/* ========================================
   智能病房管理系统 - 移动端H5样式
   ======================================== */

:root {
    --primary: #4F6BF6;
    --primary-light: #6C83FF;
    --primary-dark: #3A51D9;
    --primary-bg: rgba(79, 107, 246, 0.08);
    --secondary: #22D69A;
    --secondary-light: #3AEDB0;
    --danger: #FF5A65;
    --danger-light: rgba(255, 90, 101, 0.1);
    --warning: #FFB547;
    --warning-light: rgba(255, 181, 71, 0.1);
    --info: #38BDF8;
    --info-light: rgba(56, 189, 248, 0.1);
    --success: #22D69A;
    --success-light: rgba(34, 214, 154, 0.1);
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --bg-body: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ========== 登录页 ========== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #4F6BF6 40%, #38BDF8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.login-logo {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    border: 1px solid rgba(255,255,255,0.3);
}

.login-logo h1 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-logo p {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 380px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.role-item {
    text-align: center;
    padding: 1rem 0.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.role-item.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.role-item .role-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1.3rem;
}

.role-item:nth-child(1) .role-icon { background: rgba(79, 107, 246, 0.1); }
.role-item:nth-child(2) .role-icon { background: rgba(34, 214, 154, 0.1); }
.role-item:nth-child(3) .role-icon { background: rgba(255, 181, 71, 0.1); }

.role-item .role-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.role-item.active .role-name { color: var(--primary); font-weight: 600; }

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 1rem 0 2.8rem;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.3s;
    outline: none;
    color: var(--text-primary);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 107, 246, 0.1);
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-light);
}

.btn-login {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(79, 107, 246, 0.4);
    letter-spacing: 1px;
}

.btn-login:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(79, 107, 246, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    position: relative;
    z-index: 2;
}

/* ========== APP外壳布局 ========== */
.app-shell {
    min-height: 100vh;
    padding-bottom: calc(60px + var(--safe-bottom, 0px));
    background: var(--bg-body);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    padding: calc(var(--safe-top, 0px) + 0.6rem) 1rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header .header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-header .header-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.app-header .header-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--info));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 底部导航 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-bottom, 0px));
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: flex-start;
    padding-top: 6px;
    z-index: 100;
}

.tab-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.65rem;
    transition: color 0.3s;
    padding: 4px 0;
    position: relative;
}

.tab-bar a .tab-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.tab-bar a.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-bar a.active::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.tab-bar a .tab-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(calc(50% + 10px));
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 4px;
}

/* ========== 页面内容 ========== */
.page-content {
    padding: 1rem;
}

/* 概览卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 0 0 0 50px;
    opacity: 0.08;
}

.stat-card.card-blue::after { background: var(--primary); }
.stat-card.card-green::after { background: var(--secondary); }
.stat-card.card-orange::after { background: var(--warning); }
.stat-card.card-red::after { background: var(--danger); }

.stat-card .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.stat-card.card-blue .stat-icon { background: var(--primary-bg); color: var(--primary); }
.stat-card.card-green .stat-icon { background: var(--success-light); color: var(--secondary); }
.stat-card.card-orange .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.card-red .stat-icon { background: var(--danger-light); color: var(--danger); }

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card.card-blue .stat-value { color: var(--primary); }
.stat-card.card-green .stat-value { color: var(--secondary); }
.stat-card.card-orange .stat-value { color: var(--warning); }
.stat-card.card-red .stat-value { color: var(--danger); }

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 通用区块 */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.section-title h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.section-title .more-link {
    font-size: 0.75rem;
    color: var(--text-light);
    text-decoration: none;
}

/* 通用卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.75rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

/* 设备状态条 */
.device-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
}

.device-bar:last-child { border-bottom: none; }

.device-bar .device-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.device-bar .device-info {
    flex: 1;
    min-width: 0;
}

.device-bar .device-name {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.device-bar .device-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.device-bar .device-status {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    flex-shrink: 0;
}

.status-online {
    background: var(--success-light);
    color: var(--secondary);
}

.status-offline {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-light);
}

.status-warning {
    background: var(--warning-light);
    color: #D97706;
}

.status-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* 患者列表条 */
.patient-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
}

.patient-bar:last-child { border-bottom: none; }

.patient-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar-male { background: linear-gradient(135deg, #4F6BF6, #38BDF8); }
.avatar-female { background: linear-gradient(135deg, #F472B6, #FB923C); }

.patient-info { flex: 1; min-width: 0; }

.patient-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.patient-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.patient-ward {
    font-size: 0.7rem;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    flex-shrink: 0;
}

/* ========== 生命体征面板 ========== */
.vital-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.vital-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-color);
}

.vital-item .vital-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.vital-item .vital-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.vital-item .vital-unit {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 2px;
}

.vital-item.vital-hr { border-left: 3px solid var(--danger); }
.vital-item.vital-hr .vital-value { color: var(--danger); }

.vital-item.vital-spo2 { border-left: 3px solid var(--primary); }
.vital-item.vital-spo2 .vital-value { color: var(--primary); }

.vital-item.vital-temp { border-left: 3px solid var(--warning); }
.vital-item.vital-temp .vital-value { color: #D97706; }

.vital-item.vital-bp { border-left: 3px solid var(--secondary); }
.vital-item.vital-bp .vital-value { color: var(--secondary); font-size: 1.3rem; }

.vital-item.vital-rr { border-left: 3px solid var(--info); }
.vital-item.vital-rr .vital-value { color: var(--info); }

.vital-item.vital-sleep { border-left: 3px solid #A78BFA; }
.vital-item.vital-sleep .vital-value { color: #A78BFA; }

/* 雷达波动画 */
.radar-ring {
    width: 120px;
    height: 120px;
    margin: 0.5rem auto 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-ring .ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: radar-pulse 2.5s ease-out infinite;
}

.radar-ring .ring:nth-child(1) { width: 40px; height: 40px; animation-delay: 0s; }
.radar-ring .ring:nth-child(2) { width: 70px; height: 70px; animation-delay: 0.5s; }
.radar-ring .ring:nth-child(3) { width: 100px; height: 100px; animation-delay: 1s; }
.radar-ring .ring:nth-child(4) { width: 120px; height: 120px; animation-delay: 1.5s; }

.radar-ring .radar-center {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 15px rgba(79, 107, 246, 0.5);
}

@keyframes radar-pulse {
    0% { opacity: 0.8; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(1.2); }
}

/* ========== 远程查房 ========== */
.video-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #1a1a2e;
    aspect-ratio: 16/10;
    margin-bottom: 1rem;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    gap: 0.5rem;
}

.video-placeholder .cam-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.video-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: #fff;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.video-btn.btn-end {
    background: var(--danger);
    width: 52px;
    height: 52px;
}

/* 患者信息面板 */
.patient-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.patient-detail-header .patient-lg-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.patient-detail-header .patient-detail-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
}

.patient-detail-header .patient-detail-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 时间线 */
.timeline {
    padding-left: 1.5rem;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #fff;
    z-index: 1;
}

.timeline-item .timeline-time {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.timeline-item .timeline-content {
    font-size: 0.82rem;
    color: var(--text-primary);
}

/* ========== 地图定位 ========== */
.map-container {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
    position: relative;
    margin-bottom: 1rem;
}

.map-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.map-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(79, 107, 246, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 107, 246, 0.06) 1px, transparent 1px);
    background-size: 30px 30px;
}

.location-dot {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 0 6px rgba(79, 107, 246, 0.2);
    animation: loc-pulse 2s ease-in-out infinite;
}

.location-dot::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(79, 107, 246, 0.3);
    animation: loc-ring 2s ease-out infinite;
}

@keyframes loc-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes loc-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.geofence-circle {
    position: absolute;
    border: 2px dashed rgba(79, 107, 246, 0.3);
    border-radius: 50%;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.building-label {
    position: absolute;
    font-size: 0.65rem;
    color: var(--text-light);
    background: rgba(255,255,255,0.8);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ========== 告警列表 ========== */
.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
}

.alert-item:last-child { border-bottom: none; }

.alert-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.alert-dot.alert-critical { background: var(--danger); box-shadow: 0 0 8px rgba(255,90,101,0.4); }
.alert-dot.alert-warn { background: var(--warning); }
.alert-dot.alert-info { background: var(--info); }

.alert-content { flex: 1; }

.alert-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.alert-time {
    font-size: 0.65rem;
    color: var(--text-light);
}

/* ========== 医养结合 ========== */
.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.service-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.service-card:active { transform: scale(0.97); }

.service-card .svc-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 0.6rem;
}

.service-card .svc-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.service-card .svc-desc {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* 康复计划 */
.plan-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.fill-blue { background: linear-gradient(90deg, var(--primary), var(--info)); }
.progress-fill.fill-green { background: linear-gradient(90deg, var(--secondary), #86EFAC); }
.progress-fill.fill-orange { background: linear-gradient(90deg, var(--warning), #FBBF24); }

.progress-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

/* ========== 个人中心 ========== */
.profile-header {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin: -1rem -1rem 1rem;
    color: #fff;
}

.profile-header .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 0.75rem;
    border: 3px solid rgba(255,255,255,0.4);
}

.profile-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.profile-header p {
    font-size: 0.8rem;
    opacity: 0.85;
}

.menu-group {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
}

.menu-item:last-child { border-bottom: none; }

.menu-item .menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.menu-item .menu-label {
    flex: 1;
    font-size: 0.88rem;
}

.menu-item .menu-arrow {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ========== 标签/徽章 ========== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.tag-blue { background: var(--primary-bg); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--secondary); }
.tag-orange { background: var(--warning-light); color: #D97706; }
.tag-red { background: var(--danger-light); color: var(--danger); }

/* ========== 搜索框 ========== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    padding: 0 1rem;
    height: 40px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.search-bar .search-icon {
    color: var(--text-light);
    font-size: 1rem;
}

/* ========== 快捷功能网格 ========== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.25rem;
    text-decoration: none;
    color: var(--text-primary);
}

.quick-item .quick-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.quick-item .quick-name {
    font-size: 0.7rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========== 心电图动画 ========== */
.ecg-line {
    width: 100%;
    height: 60px;
    overflow: hidden;
    position: relative;
}

.ecg-line svg {
    width: 200%;
    height: 100%;
    animation: ecg-scroll 3s linear infinite;
}

@keyframes ecg-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========== 通用动画 ========== */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 床位卡片 ========== */
.bed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.bed-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    border: 1.5px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.bed-card:active { transform: scale(0.97); }

.bed-card .bed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.bed-card .bed-no {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bed-card.bed-occupied { border-color: var(--primary); }
.bed-card.bed-warning { border-color: var(--warning); }
.bed-card.bed-critical { border-color: var(--danger); }
.bed-card.bed-empty { border-color: var(--border-color); opacity: 0.6; }

.bed-card .bed-patient {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.bed-card .bed-vital {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* ========== 底部安全区域 ========== */
.bottom-space {
    height: calc(1px + var(--safe-bottom, 0px));
}

/* ========== 弹窗/操作面板 ========== */
.action-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem 1rem calc(1rem + var(--safe-bottom, 0px));
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
}

.action-sheet.show { transform: translateY(0); }

.action-sheet .sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 0 auto 1rem;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.overlay.show { opacity: 1; visibility: visible; }

/* 楼层平面图 */
.floor-plan {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    border-radius: var(--radius-lg);
    padding: 1rem;
    position: relative;
    min-height: 200px;
    margin-bottom: 1rem;
}

.floor-room {
    position: absolute;
    background: rgba(255,255,255,0.85);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.6rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.floor-room.has-alert {
    border-color: var(--danger);
    background: var(--danger-light);
}

/* 滚动容器 */
.scroll-h {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-h::-webkit-scrollbar { display: none; }

/* 页面切换标签 */
.page-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    padding: 3px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.page-tabs .tab-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.page-tabs .tab-item.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 107, 246, 0.3);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.85rem; }
