/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 简洁蓝白配色 - 适合老年人 */
    --primary-blue: #2196F3;
    --primary-gradient: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    --primary-solid: #2196F3;
    --light-blue: #E3F2FD;
    --dark-blue: #1976D2;
    --white: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray-medium: #E0E0E0;
    --gray-text: #757575;
    --text-dark: #212121;

    /* 紧急红色 - 必须醒目 */
    --danger: #D32F2F;
    --danger-gradient: linear-gradient(135deg, #D32F2F 0%, #C62828 100%);
    --danger-solid: #D32F2F;

    /* 其他功能色 */
    --warning: #F57C00;
    --warning-gradient: linear-gradient(135deg, #F57C00 0%, #EF6C00 100%);
    --success: #388E3C;
    --success-gradient: linear-gradient(135deg, #388E3C 0%, #2E7D32 100%);

    /* 统一的蓝色渐变 - 所有卡片使用相同配色 */
    --card-blue: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);

    /* 多层阴影 */
    --shadow-sm: 0 2px 8px rgba(33, 150, 243, 0.1),
                  0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(33, 150, 243, 0.15),
                  0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(33, 150, 243, 0.2),
                  0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 32px rgba(33, 150, 243, 0.25),
                  0 6px 16px rgba(0, 0, 0, 0.12);

    /* 悬浮效果阴影 */
    --hover-shadow: 0 12px 32px rgba(33, 150, 243, 0.25),
                    0 6px 16px rgba(0, 0, 0, 0.15);

    /* 紧急按钮阴影 */
    --emergency-shadow: 0 8px 24px rgba(211, 47, 47, 0.4),
                        0 4px 12px rgba(211, 47, 47, 0.3);
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: var(--light-blue);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
}

/* ==================== 顶部状态栏 ==================== */
.status-bar {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.status-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.current-time {
    font-size: 48px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.98);
    color: var(--primary-solid);
    padding: 12px 35px;
    border-radius: 16px;
    min-width: 260px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(102, 126, 234, 0.2);
    letter-spacing: 2px;
}

.current-date {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.status-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-weather {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    min-width: 150px;
}

.status-weather .weather-icon {
    font-size: 30px;
}

.weather-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    color: var(--white);
}

.status-weather .weather-text {
    font-size: 18px;
    font-weight: 700;
}

.status-weather .weather-temp {
    font-size: 20px;
    font-weight: 900;
}

.voice-settings-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 16px 28px;
    border-radius: 14px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.voice-settings-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.emergency-btn {
    background: var(--danger-gradient);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    border-radius: 14px;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--emergency-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: emergency-pulse 2s infinite;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.emergency-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(211, 47, 47, 0.5),
                    0 6px 16px rgba(211, 47, 47, 0.4);
}

.emergency-btn:active {
    transform: translateY(-1px) scale(1.02);
}

@keyframes emergency-pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(211, 47, 47, 0.4),
                    0 0 0 0 rgba(211, 47, 47, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(211, 47, 47, 0.6),
                    0 0 0 12px rgba(211, 47, 47, 0);
    }
}

/* ==================== 主容器 ==================== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 35px;
    position: relative;
    z-index: 1;
}

/* ==================== 页面切换 ==================== */
.page {
    display: none;
    animation: fade-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.active {
    display: block;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 欢迎卡片 ==================== */
.welcome-card {
    background: var(--white);
    border-radius: 28px;
    padding: 45px 50px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slide-in 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 102, 204, 0.08);
    position: relative;
    overflow: hidden;
}

/* 添加卡片光泽效果 */
.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.welcome-card:hover::before {
    left: 100%;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.welcome-info h1 {
    font-size: 46px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
    font-weight: 900;
}

.greeting {
    font-size: 28px;
    color: var(--text-dark);
    font-weight: 700;
    margin-top: 6px;
}

.companion-note {
    margin-top: 18px;
    background: rgba(33, 150, 243, 0.08);
    border-radius: 20px;
    padding: 18px 20px;
    border: 1px solid rgba(33, 150, 243, 0.15);
}

.companion-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.companion-note p {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.companion-btn {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
}

.companion-btn:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

.care-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.care-tag {
    background: var(--light-blue);
    color: var(--primary-blue);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 700;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.care-card {
    background: linear-gradient(135deg, #E3F2FD 0%, #FFFFFF 100%);
    border-radius: 24px;
    padding: 30px 35px;
    box-shadow: var(--shadow-md);
    min-width: 320px;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.care-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-blue);
    margin-bottom: 14px;
}

.care-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    color: var(--text-dark);
    font-size: 20px;
    line-height: 1.7;
    font-weight: 600;
}

.care-list li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.care-list li.medication {
    background: rgba(211, 47, 47, 0.08);
    border-radius: 12px;
    padding: 10px 12px 10px 34px;
    border: 1px solid rgba(211, 47, 47, 0.2);
    color: #B71C1C;
    font-weight: 800;
}

.care-list li.medication::before {
    content: '⏰';
    left: 10px;
    color: #B71C1C;
    font-size: 20px;
}

.care-list li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: var(--primary-blue);
    font-size: 22px;
    line-height: 1;
}

.care-btn {
    width: 100%;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
}

.care-btn:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

/* ==================== 功能卡片网格 ==================== */
.function-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.function-card {
    background: var(--white);
    border-radius: 24px;
    padding: 45px 35px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    position: relative;
    animation: scale-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
    border: 2px solid transparent;
    overflow: hidden;
}

.function-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-blue);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    border-radius: 24px;
}

/* 所有卡片使用统一的蓝色渐变 */
.function-card:nth-child(1) { animation-delay: 0.1s; }
.function-card:nth-child(2) { animation-delay: 0.2s; }
.function-card:nth-child(3) { animation-delay: 0.3s; }
.function-card:nth-child(4) { animation-delay: 0.4s; }
.function-card:nth-child(5) { animation-delay: 0.5s; }
.function-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.function-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--hover-shadow);
    border-color: rgba(33, 150, 243, 0.3);
}

.function-card:hover::before {
    opacity: 0.15;
}

.function-card:active {
    transform: translateY(-6px) scale(0.98);
}

.function-card > * {
    position: relative;
    z-index: 1;
}

.card-icon {
    font-size: 80px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 102, 204, 0.15));
    transition: all 0.4s ease;
}

.function-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(0, 102, 204, 0.3));
}

.card-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    letter-spacing: 0.5px;
}

.card-arrow {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    color: var(--gray-medium);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.function-card:hover .card-arrow {
    color: var(--primary-blue);
    transform: translateY(-50%) translateX(15px);
}

/* ==================== 页面头部 ==================== */
.page-header {
    background: var(--white);
    border-radius: 24px;
    padding: 28px 35px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 25px;
    border: 1px solid rgba(0, 102, 204, 0.08);
}

.back-btn {
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    border-radius: 14px;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.back-btn:active {
    transform: translateY(0) scale(0.98);
}

.page-header h2 {
    font-size: 38px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-weight: 900;
}

/* ==================== 控制容器 ==================== */
.control-container {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 35px;
    border: 1px solid rgba(0, 102, 204, 0.08);
}

/* ==================== 控制按钮网格 ==================== */
.control-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.control-btn {
    background: var(--white);
    border: 3px solid var(--gray-medium);
    padding: 35px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.control-btn:hover::before {
    transform: scaleX(1);
}

.control-btn:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px) scale(1.03);
    box-shadow: var(--shadow-lg);
}

.control-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
}

.control-btn.active::before {
    display: none;
}

.control-btn.active .device-icon,
.control-btn.active .device-name,
.control-btn.active .device-status {
    color: var(--white);
}

.device-icon {
    font-size: 60px;
    filter: drop-shadow(0 2px 5px rgba(0, 102, 204, 0.2));
    transition: all 0.4s ease;
}

.control-btn:hover .device-icon {
    transform: scale(1.1);
}

.device-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.device-status {
    font-size: 22px;
    color: var(--gray-text);
    font-weight: 600;
}

/* ==================== 温度控制卡片 ==================== */
.temp-control-card {
    background: var(--white);
    border-radius: 28px;
    padding: 70px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid rgba(0, 102, 204, 0.08);
    position: relative;
    overflow: hidden;
}

.temp-control-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 102, 204, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: temp-bg-scroll 30s linear infinite;
}

@keyframes temp-bg-scroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.temp-info {
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.temp-label {
    font-size: 28px;
    color: var(--gray-text);
    margin-bottom: 25px;
    font-weight: 600;
    letter-spacing: 1px;
}

.temp-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 15px;
}

.temp-value {
    font-size: 110px;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0, 102, 204, 0.2));
}

.temp-unit {
    font-size: 52px;
    color: var(--gray-text);
    font-weight: 700;
}

.temp-controls {
    display: flex;
    justify-content: center;
    gap: 50px;
    position: relative;
    z-index: 1;
}

.temp-adjust-btn {
    width: 200px;
    height: 200px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.temp-adjust-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.temp-adjust-btn:active::before {
    width: 300px;
    height: 300px;
}

.temp-down {
    background: linear-gradient(135deg, #64B5F6 0%, #42A5F5 100%);
}

.temp-up {
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
}

.temp-adjust-btn:hover {
    transform: translateY(-8px) scale(1.08);
    box-shadow: var(--shadow-xl);
}

.temp-adjust-btn:active {
    transform: translateY(-4px) scale(1.02);
}

.temp-adjust-btn .btn-icon {
    font-size: 64px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

.temp-adjust-btn .btn-text {
    font-size: 28px;
    font-weight: 900;
    color: var(--white);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

/* ==================== 场景按钮网格 ==================== */
.scene-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.scene-btn {
    background: var(--white);
    border: 3px solid var(--gray-medium);
    padding: 45px 35px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.scene-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-blue);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    border-radius: 24px;
}

.scene-btn:hover {
    border-color: var(--primary-blue);
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--hover-shadow);
}

.scene-btn:hover::before {
    opacity: 0.1;
}

.scene-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: var(--shadow-xl);
    transform: scale(1.03);
}

.scene-btn.active .scene-icon,
.scene-btn.active .scene-name {
    color: var(--white);
}

.scene-btn > * {
    position: relative;
    z-index: 1;
}

.scene-icon {
    font-size: 72px;
    filter: drop-shadow(0 3px 6px rgba(0, 102, 204, 0.15));
    transition: all 0.4s ease;
}

.scene-btn:hover .scene-icon {
    transform: scale(1.15) rotate(5deg);
}

.scene-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

/* ==================== 安全监控列表 ==================== */
.security-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.security-item {
    background: var(--white);
    border-radius: 20px;
    padding: 35px;
    display: flex;
    align-items: center;
    gap: 28px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.security-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(8px);
    border-color: rgba(0, 102, 204, 0.15);
}

.security-icon {
    font-size: 60px;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-blue);
    border-radius: 18px;
    filter: drop-shadow(0 4px 8px rgba(33, 150, 243, 0.3));
    flex-shrink: 0;
}

.security-info {
    flex: 1;
}

.security-name {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.security-status {
    font-size: 22px;
    color: var(--gray-text);
    font-weight: 600;
}

.security-badge {
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.safe-badge {
    background: var(--success-gradient);
    color: var(--white);
}

.warning-badge {
    background: var(--warning-gradient);
    color: var(--white);
    animation: warning-blink 2s infinite;
}

@keyframes warning-blink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

/* ==================== 健康数据网格 ==================== */
.health-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.health-card {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.health-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-blue);
    border-radius: 24px 24px 0 0;
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.health-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 102, 204, 0.15);
}

.health-card:hover::before {
    transform: scaleX(1);
}

.health-icon {
    font-size: 56px;
    margin-bottom: 18px;
    filter: drop-shadow(0 3px 6px rgba(0, 102, 204, 0.15));
}

.health-value {
    font-size: 52px;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 5px rgba(0, 102, 204, 0.1));
}

.health-label {
    font-size: 22px;
    color: var(--gray-text);
    margin-bottom: 12px;
    font-weight: 600;
}

.health-status {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: 800;
    background: var(--success-gradient);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(0, 204, 102, 0.3);
}

.health-card.warning .health-value {
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.health-card.warning .health-status {
    background: var(--warning-gradient);
    box-shadow: 0 3px 10px rgba(255, 165, 0, 0.3);
}

/* ==================== 语音指示器 ==================== */
.voice-indicator {
    position: fixed;
    top: 120px;
    right: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 22px;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(0, 102, 204, 0.15);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.voice-indicator:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.voice-indicator.speaking {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.voice-indicator.speaking .voice-wave span {
    animation: voice-wave 0.6s ease-in-out infinite;
}

.voice-wave {
    display: flex;
    gap: 5px;
    align-items: center;
    height: 28px;
}

.voice-wave span {
    width: 6px;
    background: var(--primary-gradient);
    border-radius: 4px;
    height: 14px;
    box-shadow: 0 2px 5px rgba(0, 102, 204, 0.3);
}

.voice-wave span:nth-child(1) { animation-delay: 0s; }
.voice-wave span:nth-child(2) { animation-delay: 0.12s; }
.voice-wave span:nth-child(3) { animation-delay: 0.24s; }
.voice-wave span:nth-child(4) { animation-delay: 0.36s; }
.voice-wave span:nth-child(5) { animation-delay: 0.48s; }

@keyframes voice-wave {
    0%, 100% {
        height: 14px;
    }
    50% {
        height: 28px;
    }
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--primary-gradient);
    color: var(--white);
    padding: 24px 50px;
    border-radius: 20px;
    font-size: 28px;
    font-weight: 800;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: modal-fade-in 0.3s ease;
}

.modal.show {
    display: flex;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modal-slide-in 0.4s ease;
}

@keyframes modal-slide-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 30px;
    border-bottom: 2px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 32px;
    color: var(--primary-blue);
    margin: 0;
}

.modal-close {
    background: var(--gray-light);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--gray-medium);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.setting-group {
    margin-bottom: 30px;
}

.setting-group label {
    display: block;
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: bold;
}

.voice-select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--gray-medium);
    border-radius: 12px;
    font-size: 22px;
    color: var(--text-dark);
    background: var(--white);
    cursor: pointer;
}

.voice-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-light);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

.slider-value {
    min-width: 60px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-blue);
    text-align: center;
}

.test-voice-btn {
    width: 100%;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.test-voice-btn:hover {
    background: var(--dark-blue);
    transform: scale(1.02);
}

.modal-footer {
    padding: 30px;
    border-top: 2px solid var(--gray-light);
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.cancel-btn {
    background: var(--gray-light);
    color: var(--text-dark);
}

.cancel-btn:hover {
    background: var(--gray-medium);
}

.confirm-btn {
    background: var(--primary-blue);
    color: var(--white);
}

.confirm-btn:hover {
    background: var(--dark-blue);
    transform: scale(1.05);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .function-grid,
    .control-grid,
    .scene-grid,
    .health-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .status-bar {
        padding: 16px 20px;
        flex-wrap: wrap;
        row-gap: 12px;
    }

    .logo {
        font-size: 26px;
    }

    .status-left {
        flex: 1 1 auto;
    }

    .status-right {
        order: 2;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 10px;
    }

    .current-time {
        font-size: 36px;
        min-width: 200px;
        padding: 8px 20px;
    }

    .current-date {
        font-size: 16px;
    }

    .status-weather {
        padding: 8px 10px;
        gap: 8px;
    }

    .status-weather .weather-icon {
        font-size: 24px;
    }

    .status-weather .weather-text {
        font-size: 16px;
    }

    .status-weather .weather-temp {
        font-size: 18px;
    }

    .voice-settings-btn {
        font-size: 18px;
        padding: 10px 16px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .emergency-btn {
        font-size: 20px;
        padding: 10px 18px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .main-container {
        padding: 24px;
    }

    .welcome-card {
        padding: 32px 36px;
    }

    .welcome-info h1 {
        font-size: 38px;
    }

    .greeting {
        font-size: 22px;
    }

    .companion-title {
        font-size: 18px;
    }

    .companion-note p {
        font-size: 18px;
    }

    .companion-btn {
        font-size: 16px;
    }

    .care-tag {
        font-size: 16px;
        padding: 8px 12px;
    }

    .care-card {
        padding: 24px;
        min-width: 260px;
    }

    .care-title {
        font-size: 20px;
    }

    .care-list {
        font-size: 18px;
    }

    .care-btn {
        font-size: 18px;
    }

    .function-card {
        padding: 32px 24px;
    }

    .card-icon {
        font-size: 64px;
    }

    .card-title {
        font-size: 26px;
    }

    .card-arrow {
        right: 20px;
        font-size: 28px;
    }

    .page-header {
        padding: 22px 28px;
    }

    .back-btn {
        font-size: 20px;
        padding: 12px 24px;
    }

    .page-header h2 {
        font-size: 30px;
    }

    .control-btn {
        padding: 28px;
    }

    .device-icon {
        font-size: 48px;
    }

    .device-name {
        font-size: 22px;
    }

    .device-status {
        font-size: 18px;
    }

    .temp-control-card {
        padding: 50px;
    }

    .temp-value {
        font-size: 90px;
    }

    .temp-unit {
        font-size: 40px;
    }

    .temp-adjust-btn {
        width: 160px;
        height: 160px;
    }

    .temp-adjust-btn .btn-text {
        font-size: 22px;
    }

    .scene-btn {
        padding: 32px 24px;
    }

    .scene-icon {
        font-size: 56px;
    }

    .scene-name {
        font-size: 22px;
    }

    .security-item {
        padding: 28px;
        gap: 20px;
    }

    .security-icon {
        width: 70px;
        height: 70px;
        font-size: 48px;
    }

    .security-name {
        font-size: 24px;
    }

    .security-status {
        font-size: 18px;
    }

    .security-badge {
        font-size: 18px;
        padding: 8px 20px;
    }

    .health-card {
        padding: 28px;
    }

    .health-icon {
        font-size: 44px;
    }

    .health-value {
        font-size: 40px;
    }

    .health-label {
        font-size: 18px;
    }

    .health-status {
        font-size: 16px;
    }

    .voice-indicator {
        top: 90px;
        right: 20px;
        padding: 14px 20px;
        font-size: 18px;
    }

    .toast {
        font-size: 22px;
        padding: 18px 32px;
    }
}

@media (max-width: 768px) {
    .status-bar {
        flex-wrap: wrap;
        padding: 15px 20px;
    }

    .current-time {
        font-size: 36px;
        min-width: 200px;
    }

    .function-grid,
    .control-grid,
    .scene-grid,
    .health-grid {
        grid-template-columns: 1fr;
    }

    .welcome-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .temp-control-card {
        padding: 40px 30px;
    }

    .temp-value {
        font-size: 72px;
    }

    .temp-adjust-btn {
        width: 140px;
        height: 140px;
    }
}
