/* ==========================================================================
   家庭银龄守护医生 · 客户端样式
   设计语言：治愈系青蓝 · 毛玻璃 · 柔和阴影 · 丝滑过渡
   适老化：大字号 / 高对比 / 大点击区域 / 减少动效干扰
   响应式：桌面端左侧导航，手机端底部标签栏
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
    /* 主色（青蓝，护眼、高对比） */
    --c-primary: #0ea5a5;
    --c-primary-deep: #0a7f8f;
    --c-primary-soft: #e3f7f6;
    --c-primary-grad: linear-gradient(135deg, #14b8c0 0%, #0a8f9c 100%);
    --c-accent: #ffb020;
    --c-accent-soft: #fff4e0;

    /* 中性色 */
    --c-bg: #eef4f8;
    --c-bg-grad: linear-gradient(160deg, #eef7f7 0%, #e8f1f6 100%);
    --c-card: #ffffff;
    --c-text: #142b33;
    --c-text-2: #5a6b75;
    --c-text-3: #8aa0ab;
    --c-line: #e5eef2;

    /* 语义色 */
    --c-success: #22c55e;
    --c-warning: #f59e0b;
    --c-danger: #ef4444;
    --c-danger-soft: #fdecec;

    /* 圆角 */
    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 24px;
    --r-xl: 30px;
    --r-full: 999px;

    /* 柔和分层阴影 */
    --shadow-sm: 0 1px 3px rgba(14, 40, 50, .06), 0 4px 12px rgba(14, 40, 50, .05);
    --shadow-md: 0 8px 24px rgba(14, 40, 50, .09), 0 2px 6px rgba(14, 40, 50, .05);
    --shadow-lg: 0 20px 50px rgba(14, 40, 50, .16), 0 6px 18px rgba(14, 40, 50, .08);
    --shadow-primary: 0 10px 24px rgba(14, 165, 165, .30);
    --glow-primary: 0 0 0 1px rgba(255, 255, 255, .35) inset, 0 14px 34px rgba(14, 165, 165, .38);

    /* 液态玻璃 */
    --glass-bg: rgba(255, 255, 255, .52);
    --glass-bg-strong: rgba(255, 255, 255, .68);
    --glass-border: rgba(255, 255, 255, .78);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .85);
    --glass-blur: blur(22px) saturate(1.55);

    /* 过渡 */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --spring: cubic-bezier(.34, 1.5, .5, 1);
    --t-fast: .18s;
    --t: .28s;
    --t-slow: .5s;

    /* 适老化大字号 */
    --fs-base: 18px;
    --fs-md: 20px;
    --fs-lg: 24px;
    --fs-xl: 30px;
    --fs-2xl: 38px;

    --tap: 52px;             /* 最小点击高度 */
    --header-h: 72px;
}

/* ---------- 2. 基础重置与排版 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "微软雅黑", "黑体", sans-serif;
    font-size: var(--fs-base);
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-bg);
    background-image: var(--c-bg-grad);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------- 沉浸光感：背景氛围光斑 ---------- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
}

.orb-a {
    width: 52vw; height: 52vw; min-width: 420px; min-height: 420px;
    top: -12%; left: -8%;
    background: radial-gradient(circle, rgba(20, 184, 192, .34), rgba(20, 184, 192, 0) 68%);
    animation: auroraA 22s ease-in-out infinite alternate;
}

.orb-b {
    width: 46vw; height: 46vw; min-width: 360px; min-height: 360px;
    bottom: -14%; right: -10%;
    background: radial-gradient(circle, rgba(255, 176, 32, .24), rgba(255, 176, 32, 0) 68%);
    animation: auroraB 28s ease-in-out infinite alternate;
}

.orb-c {
    width: 36vw; height: 36vw; min-width: 280px; min-height: 280px;
    top: 34%; left: 46%;
    background: radial-gradient(circle, rgba(96, 165, 250, .22), rgba(96, 165, 250, 0) 70%);
    animation: auroraC 25s ease-in-out infinite alternate;
}

@keyframes auroraA { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(6vw, 4vh) scale(1.15); } }
@keyframes auroraB { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(-5vw, -5vh) scale(1.2); } }
@keyframes auroraC { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(4vw, -4vh) scale(1.1); } }

/* 无障碍：清晰的焦点态 */
:focus-visible {
    outline: 3px solid var(--c-primary);
    outline-offset: 3px;
    border-radius: 8px;
}

/* ---------- 3. 登录界面 ---------- */
.login-screen {
    position: fixed;
    inset: 0;
    background: rgba(238, 247, 247, .55);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 440px;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 44px 34px;
    text-align: center;
    box-shadow: var(--glass-hi), var(--shadow-lg);
    animation: fadeUp .5s var(--ease);
}

.login-box h1 {
    font-size: 30px;
    line-height: 1.4;
    color: var(--c-text);
    margin-bottom: 8px;
    font-weight: 800;
}

.login-input {
    width: 100%;
    min-height: var(--tap);
    padding: 16px 20px;
    font-size: var(--fs-md);
    margin-bottom: 18px;
    border: 2px solid var(--c-line);
    border-radius: var(--r-md);
    background: #f8fbfc;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

.login-input:focus {
    outline: none;
    border-color: var(--c-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(14, 165, 165, .14);
}

.login-btn {
    width: 100%;
    min-height: 56px;
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: 4px;
    color: #fff;
    background: var(--c-primary-grad);
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    box-shadow: var(--glow-primary);
    transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), filter var(--t) var(--ease);
}

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(14, 165, 165, .36); }
.login-btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-md); }

/* ---------- 4. 应用外壳 ---------- */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* 顶栏（毛玻璃） */
.header {
    flex-shrink: 0;
    height: var(--header-h);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-hi);
    z-index: 100;
}

.header .header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--c-text);
}

.header-brand .logo-badge {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #fff;
    background: var(--c-primary-grad);
    border-radius: 14px;
    box-shadow: var(--glow-primary);
}

.header .header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--r-full);
    background: rgba(34, 197, 94, .10);
    color: #15803d;
    font-size: var(--fs-base);
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-green {
    background: var(--c-success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
    animation: pulseGreen 2.4s infinite;
}

.status-red { background: var(--c-danger); }

/* 主体容器 */
.main-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ---------- 5. 侧边导航 ---------- */
.nav-menu {
    flex-shrink: 0;
    width: 264px;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    box-shadow: var(--glass-hi);
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: var(--tap);
    padding: 12px 18px;
    border-radius: var(--r-md);
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--c-text-2);
    cursor: pointer;
    user-select: none;
    transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.nav-item .nav-ico {
    font-size: 24px;
    line-height: 1;
    width: 30px;
    text-align: center;
    transition: transform var(--t) var(--ease);
}

.nav-item:hover { background: rgba(14, 165, 165, .08); color: var(--c-primary-deep); transform: translateX(3px); }
.nav-item:active { transform: scale(.97); }

.nav-item.active {
    color: #fff;
    background: var(--c-primary-grad);
    box-shadow: var(--glow-primary);
}

.nav-item.active .nav-ico { transform: scale(1.08); }

/* ---------- 6. 主内容区 ---------- */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 26px 28px 40px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.content-section { display: none; }
.content-section.active {
    display: block;
    animation: fadeUp .4s var(--ease);
}

/* ---------- 7. 卡片 ---------- */
.card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, .74) 0%, rgba(255, 255, 255, .44) 100%);
    -webkit-backdrop-filter: blur(22px) saturate(1.55);
    backdrop-filter: blur(22px) saturate(1.55);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 16px rgba(14, 40, 50, .06);
    transition: transform .5s cubic-bezier(.22, 1, .36, 1),
                box-shadow .5s cubic-bezier(.22, 1, .36, 1),
                border-color .5s cubic-bezier(.22, 1, .36, 1);
    will-change: transform;
}

/* 顶部镜面高光（斜向高光带，模拟玻璃折射） */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .14) 20%, rgba(255, 255, 255, 0) 42%);
    pointer-events: none;
    z-index: 0;
}

/* 光标光斑（径向光斑实时跟随鼠标，悬浮时点亮） */
.card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 68%);
    transform: translate(calc(var(--mx, 0px) - 50%), calc(var(--my, 0px) - 50%));
    opacity: 0;
    transition: opacity .35s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
    z-index: 0;
}

.card:hover::after { opacity: 1; }

/* 内容置于高光/光斑之上 */
.card > * {
    position: relative;
    z-index: 1;
}

/* 悬浮：上浮 + 边框发光 + 深层投影 + 内发光描边 */
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(20, 184, 192, .55);
    box-shadow:
        inset 0 0 0 1px rgba(20, 184, 192, .20),
        inset 0 1px 0 rgba(255, 255, 255, .78),
        0 24px 48px rgba(14, 40, 50, .18),
        0 8px 24px rgba(14, 165, 165, .22);
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--c-text);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--c-line);
}

/* ---------- 8. 天气卡片 ---------- */
.weather-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(150deg, #eafaf9 0%, #f4fbfe 100%);
    border: 1px solid rgba(14, 165, 165, .12);
    border-radius: var(--r-lg);
    padding: 30px 24px;
    width: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.weather-icon { font-size: 74px; line-height: 1; }
.weather-city { font-size: var(--fs-lg); font-weight: 800; color: var(--c-text); margin-top: 8px; }
.weather-temp {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--c-primary-deep);
    margin: 6px 0 2px;
}
.weather-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(14, 165, 165, .2);
}
.weather-detail-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.weather-detail-label { color: var(--c-text-3); font-size: var(--fs-base); }
.weather-detail-value { color: var(--c-text); font-size: var(--fs-md); font-weight: 700; }

/* ---------- 9. 摄像头模拟区 ---------- */
.camera-sim {
    background: linear-gradient(150deg, #0f2230 0%, #122f3d 100%);
    color: #6ee7b7;
    padding: 24px;
    font-family: "SFMono-Regular", Consolas, monospace;
    border-radius: var(--r-md);
    margin-top: 20px;
    font-size: var(--fs-base);
    line-height: 1.9;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, .35);
}

/* ---------- 10. 表单 ---------- */
.form-group { margin-bottom: 22px; }

.form-group label {
    display: block;
    font-size: var(--fs-base);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--c-text);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 15px 18px;
    font-size: var(--fs-md);
    font-family: inherit;
    color: var(--c-text);
    border: 2px solid var(--c-line);
    border-radius: var(--r-md);
    background: #f8fbfc;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(14, 165, 165, .13);
}

.form-textarea { resize: vertical; min-height: 96px; }

/* ---------- 10b. 老人档案卡片视图 ---------- */
.profile-view {
    background: linear-gradient(150deg, #f6fbfc 0%, #eef7f7 100%);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    padding: 24px;
}

.pv-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--c-line);
}

.pv-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 30px;
    color: #fff;
    background: var(--c-primary-grad);
    border-radius: 18px;
    box-shadow: var(--glow-primary);
}

.pv-title { min-width: 0; }
.pv-name { font-size: var(--fs-xl); font-weight: 800; color: var(--c-text); line-height: 1.2; }
.pv-update { font-size: var(--fs-base); color: var(--c-text-3); margin-top: 4px; }

.pv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.pv-item {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pv-item.pv-wide { grid-column: 1 / -1; }
.pv-label { font-size: var(--fs-base); color: var(--c-text-3); }
.pv-value { font-size: var(--fs-md); font-weight: 700; color: var(--c-text); }

/* ---------- 11. 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 12px 28px;
    font-size: var(--fs-md);
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), filter var(--t) var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }

.btn-primary {
    position: relative;
    color: #fff;
    background: var(--c-primary-grad);
    box-shadow: var(--glow-primary);
    overflow: hidden;
}
.btn-primary:hover { box-shadow: 0 16px 36px rgba(14, 165, 165, .42); transform: translateY(-2px); }
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }

.btn-danger { color: #fff; background: var(--c-danger); box-shadow: 0 10px 22px rgba(239, 68, 68, .26); }
.btn-danger:hover { box-shadow: 0 14px 30px rgba(239, 68, 68, .34); }

/* ---------- 12. 健康数据（心电） ---------- */
.container {
    background: var(--c-card);
    border-radius: var(--r-lg);
    padding: 26px;
    text-align: center;
    border: 1px solid var(--c-line);
}

.ecg-container {
    width: 100%;
    height: 220px;
    margin-bottom: 18px;
    border-radius: var(--r-md);
    overflow: hidden;
    background: #fbfdfe;
    border: 1px solid var(--c-line);
}

#ecgCanvas { width: 100%; height: 100%; display: block; }

.heart-rate {
    font-size: 56px;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1.1;
}

.heart-rate .unit { font-size: 22px; color: var(--c-text-2); font-weight: 600; }

.status { color: var(--c-text-2); margin: 10px 0 20px; font-size: var(--fs-base); }

.error { color: var(--c-danger); margin-top: 14px; font-size: var(--fs-base); min-height: 24px; }

.big-text { font-size: var(--fs-2xl); font-weight: 800; color: var(--c-text); }

/* ---------- 13. AI 悬浮入口与聊天窗 ---------- */
.ai-float-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 64px;
    height: 64px;
    background: var(--c-primary-grad);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 28px;
    box-shadow: var(--glow-primary), var(--shadow-lg);
    cursor: pointer;
    z-index: 1000;
    transition: transform var(--t) var(--spring), box-shadow var(--t) var(--ease);
    animation: floaty 3.2s ease-in-out infinite;
}

.ai-float-btn:hover { transform: translateY(-4px) scale(1.05); }
.ai-float-btn:active { transform: scale(.94); }

.ai-chat-window {
    position: fixed;
    bottom: 104px;
    right: 28px;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: 70vh;
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    border: 1px solid var(--c-line);
}

.ai-chat-window.active {
    display: flex;
    animation: popIn .3s var(--ease);
}

.chat-header {
    flex-shrink: 0;
    background: var(--c-primary-grad);
    color: #fff;
    padding: 16px 20px;
    font-size: var(--fs-md);
    font-weight: 700;
}

.ai-chat-iframe { flex: 1; width: 100%; height: 100%; border: none; }

/* ---------- 14. 动画 ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------- 15. 响应式：手机端 ---------- */
@media (max-width: 900px) {
    :root { --header-h: 64px; }

    .header { padding: 0 16px; }
    .header-brand { font-size: var(--fs-md); }
    .header-status { padding: 8px 14px; font-size: 16px; }

    /* 主容器纵向，内容在上，导航沉底 */
    .main-container { flex-direction: column; }

    .nav-menu {
        order: 2;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        width: 100%;
        height: 72px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        gap: 4px;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .92);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border-right: none;
        border-top: 1px solid var(--c-line);
        z-index: 1000;
        overflow: visible;
    }

    .nav-item {
        flex: 1;
        flex-direction: column;
        gap: 3px;
        min-height: 0;
        height: 100%;
        padding: 6px 4px;
        border-radius: var(--r-md);
        font-size: 14px;
        justify-content: center;
    }

    .nav-item .nav-ico { font-size: 22px; width: auto; }
    .nav-item:hover { transform: none; background: rgba(14, 165, 165, .08); }

    .main-content {
        padding: 18px 16px calc(96px + env(safe-area-inset-bottom));
    }

    .card { padding: 22px 18px; border-radius: 16px; }
    .card h2 { font-size: var(--fs-md); }

    .weather-temp { font-size: 52px; }
    .weather-details { gap: 16px; }

    .ai-float-btn { bottom: 88px; right: 16px; width: 58px; height: 58px; }
    .ai-chat-window {
        bottom: 88px; right: 8px; left: 8px;
        width: auto; height: 66vh;
        max-height: none; max-width: none;
        border-radius: var(--r-lg);
    }
}

@media (max-width: 480px) {
    body { font-size: 17px; }
    .login-box { padding: 34px 22px; border-radius: var(--r-lg); }
    .login-box h1 { font-size: 26px; }
    .card h2 { flex-wrap: wrap; }
    .weather-icon { font-size: 60px; }
    .weather-temp { font-size: 46px; }
    .btn { width: 100%; }
    .btn + .btn { margin-top: 12px; }
}

/* ---------- 16. 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
