/* Bettermi 全局样式（2026-09-10 从 base.html 内联抽出 → 可缓存） */

        :root {
            --primary: #4ECDC4;
            --primary-light: #5DBDD9;
            --primary-dark: #3A8BA6;
            --gold: #FFD700;
            --gold-soft: #C9A94E;  /* 2026-08-20 低调哑光金 */
            --exp: #FF6B6B;
            --bg: #0F0F1A;
            --card: #1A1A2E;
            --card2: #16213E;
            --text: #FFFFFF;
            --text2: #FFFFFF;
            --border: #2A2A4A;
            --success: #4ECDC4;
            --warning: #FFD93D;
            --danger: #BC3F48;
            --accent2: #4AACCA;
            --accent3: #4F65CE;
            --avatar: #6C63FF;
            --radius: 16px;
            --radius-sm: 12px;
            --radius-xs: 8px;
            --shadow: 0 4px 20px rgba(0,0,0,0.3);
            --safe-bottom: env(safe-area-inset-bottom, 0px);
            --nav-height: 90px;
        }

        /* 🟡 全局标准：右上角返回/Home 按钮 = 黑字黄底立体（2026-08-29 拍板，蓝图 V13）
           2026-09-12 升级「样品 A · 深雕金厚底 Blade」（Mr Koh 拍板）
           ⚠️ 定义位置刻意放在 .btn-3d 家族**之后**（文件下半部），
              否则 .btn-3d 的 border/padding 简写会盖掉厚底边 → 3D 效果失效。
           用法：<a href="/dashboard" class="btn-3d btn-3d-yellow">← 首页</a>（靠最右方） */
        * { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            min-height: -webkit-fill-available;
            padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
            -webkit-font-smoothing: antialiased;
        }
        /* 📱 App模式全站顶部安全区（2026-09-04 拍板）：加桌到主屏幕(standalone)后页面从屏幕最顶开始，
           无 .header 的页面第一行(标题+右上角按钮)会顶进状态栏/刘海区域导致难点。
           此规则只在 App 模式下生效：①普通浏览器模式零改动 ②有 .header 的页面自带避让不受影响
           ③env() 自动适配：无刘海机型报 0 → 不留空白。
           （2026-09-08 批1补丁：原规则依赖 :has()，iOS<15.4 老系统不支持会整条失效 = 39 个无 .header
            页面漏避让。新增 JS 兜底 class body.app-mode-no-header（见文件尾部脚本）：老系统同样生效；
            新系统两条规则同值覆盖不叠加；桌面/Android/浏览器模式/带 .header 页面 → 不触发零影响。） */
        @media (display-mode: standalone) {
            body:not(:has(.header)) {
                padding-top: max(12px, env(safe-area-inset-top));
            }
            /* JS 兜底（2026-09-08）：仅 App 模式 + 页面无 .header 时才由脚本加此 class */
            body.app-mode-no-header {
                padding-top: max(12px, env(safe-area-inset-top));
            }
        }
        /* ===== Bottom Nav: Single scrollable row ===== */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--card);
            border-top: 1px solid var(--border);
            z-index: 100;
            padding-bottom: calc(2px + var(--safe-bottom));
        }
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1px;
            flex: 0 0 auto;
            min-width: 64px;
            min-height: 54px;
            padding: 2px 6px;
            border-radius: 6px;
            text-decoration: none;
            color: var(--text2);
            transition: background 0.15s;
        }
        .nav-item:active { background: rgba(255,255,255,0.04); }
        .nav-item.active {
            color: var(--primary);
            background: rgba(78,205,196,0.08);
        }

        /* 大字模式 — 全面提升为手机可用 */

        /* 字体大小模式 */
        body.large-text .card-title { font-size: 18px; }
        body.large-text .stat-label { font-size: 15px; }
        body.large-text .step-name { font-size: 21px; font-weight: 700; }
        body.large-text .step-points { font-size: 16px; }
        body.large-text .rank-name { font-size: 18px; }
        body.large-text .rank-score { font-size: 20px; }

        body.large-text .quick-log-btn .ql-icon { font-size: 36px; }
        body.large-text .quick-log-btn .ql-name { font-size: 18px; }
        body.large-text .quick-log-btn .ql-points { font-size: 16px; }
        body.large-text .form-label { font-size: 18px; }
        body.large-text .btn { font-size: 18px; min-height: 56px; }
        body.large-text .btn-3d { font-size: 17px; min-height: 54px; }
        body.large-text .btn-3d-sm { font-size: 14px; min-height: 42px; }
        body.large-text .header-title { font-size: 24px; }
        body.large-text .score-big { font-size: 56px; }
        body.large-text .card { padding: 22px; }
        body.large-text input, body.large-text select, body.large-text textarea { font-size: 18px; padding: 18px 20px; }
        body.large-text .topic-chip { font-size: 15px; padding: 8px 14px; }
        body.large-text .rank-item { min-height: 60px; }
        body.large-text .step-item { min-height: 80px; }
        body.large-text .step-icon { width: 56px; height: 56px; font-size: 30px; }
        body.large-text .stat-value { font-size: 26px; }
        body.large-text .flash { font-size: 16px; padding: 14px 18px; }
        body.large-text .card-title { letter-spacing: 1.5px; }
        /* End Nav */
        ::-webkit-scrollbar { width: 4px; }
        ::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

        /* ===== Header ===== */
        .header {
            background: linear-gradient(135deg, var(--primary-dark), var(--primary));
            padding: 12px 16px;
            padding-top: max(12px, env(safe-area-inset-top));
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 20px rgba(108,99,255,0.3);
            min-height: 52px;
            overflow: hidden;
        }
        .header-title {
            font-size: 22px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
            /* 2026-09-18：长标题不能把右侧按钮挤扁 —— 标题可缩（省略号），右侧按钮不缩 */
            flex-shrink: 1;
            min-width: 0;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        .header > .btn-3d, .header > a.btn-3d { flex-shrink: 0; }
        .header-title > span { flex-shrink: 0; }
        .header-title span { font-size: 15px; }
        .header-user { 
            display: flex; 
            align-items: center; 
            gap: 4px; 
            flex-shrink: 0;
            max-width: 55%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .header-user::-webkit-scrollbar { display: none; }
        .header-user .avatar {
            width: 28px; height: 28px;
            border-radius: 50%;
            background: rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 600;
            flex-shrink: 0;
        }

        /* ===== Flash ===== */
        .flash {
            padding: 12px 16px;
            margin: 10px 12px;
            border-radius: var(--radius-sm);
            font-size: 15px;
            display: flex;
            align-items: center;
            gap: 8px;
            animation: slideDown 0.3s ease;
        }
        .flash.success { background: rgba(78,205,196,0.15); color: var(--success); border: 1px solid rgba(78,205,196,0.3); }
        .flash.danger { background: rgba(255,107,107,0.15); color: var(--danger); border: 1px solid rgba(255,107,107,0.3); }
        .flash.warning { background: rgba(255,165,0,0.15); color: #FF9500; border: 1px solid rgba(255,165,0,0.3); }
        @keyframes slideDown { from { transform: translateY(-20px); opacity:0; } to { transform: translateY(0); opacity:1; } }

        /* ===== Container ===== */
        .container { max-width: 600px; margin: 0 auto; padding: 12px; }

        /* ===== Cards ===== */
        .card {
            background: var(--card);
            border-radius: var(--radius);
            padding: 16px;
            margin-bottom: 12px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }
        .card-title {
            font-size: 15px;
            color: var(--text2);
            margin-bottom: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        /* 金色胶囊卡片标题（2026-08-31 拍板：与 Order 卡片统一；联系人页全卡使用）
           用法：<span class="card-title-gold">📋 标题 <span class="ctg-cnt">(N)</span></span> */
        .card-title-gold {
            display: inline-flex; align-items: center; gap: 8px;
            border: 2px solid #FFD700; background: rgba(255,215,0,0.08);
            border-radius: 12px; padding: 8px 16px;
            font-size: 17px; font-weight: 800; color: #FFD700;
            margin-bottom: 11px; line-height: 1.4;
        }
        .card-title-gold .ctg-cnt { color: #fff; font-size: 14px; font-weight: 800; }

        /* 🔮 生命密码 · 标题行（标题在左、生日+年龄胶囊在右）
           2026-10-09 拍板【设计 3】：凡是画出来的生命密码图，标题右边都挂「该人士的生日 + 年龄」。
           年龄 = 今年 − 出生年（不看月日），橙色；无完整年份 → 不显示（capsule 整体不渲染）。 */
        .lc-head { display:flex; align-items:center; justify-content:space-between;
                   gap:10px; flex-wrap:wrap; row-gap:8px; margin-bottom:11px; }
        .lc-head > .card-title-gold { margin-bottom:0; }
        .lc-agechip { display:inline-flex; align-items:center; gap:7px;
                      background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.14);
                      border-radius:999px; padding:6px 12px; font-size:15px; color:var(--text2);
                      white-space:nowrap; }
        /* 🎂 2026-10-15（用户：生日日期 ①字小 ②灰色 → 看不到）：
           字→17px 加粗；色→纯白（写死灰 #B9BFD6 违反「严禁灰色字体」铁律，改走白） */
        .lc-agechip .lc-ac-date { color:var(--text); font-size:17px; font-weight:700; }
        .lc-agechip .lc-ac-age { color:#FF8C00; font-weight:800; }
        .lc-agechip:empty { display:none; }

        /* 🔮 生命密码 · 卡下方「81组 / 缺数」两颗查阅按钮（2026-10-09 拍板：图上不带文字，资料另开一页查） */
        .lc-ref-row { display:flex; gap:10px; margin-top:10px; }
        .lc-ref-btn { flex:1; min-height:46px; border-radius:12px; text-decoration:none;
                      display:flex; align-items:center; justify-content:center; gap:7px;
                      font-size:15px; font-weight:800; color:#fff;
                      background:linear-gradient(180deg,#232338,#1a1a2c);
                      border:1px solid rgba(255,255,255,.18); box-shadow:0 4px 0 rgba(0,0,0,.45); }
        .lc-ref-btn.gold { background:linear-gradient(180deg,#FFD700,#FFA500); color:#000; border-color:#FFD700; }
        .lc-ref-btn:active { transform:translateY(1px); }
        /* 🔎 资料页：常驻右上角返回钮（深底金字 + 金边 —— 2026-10-09 用户拍板方案 C）
           ⚠️ position:fixed —— 页面很长，滑到哪里右上角都有返回钮，永不被滑掉。 */
        .lc-ref-back { position:fixed; top:calc(10px + env(safe-area-inset-top)); right:12px; z-index:2000;
                       display:inline-flex; align-items:center; gap:6px; min-height:44px;
                       padding:9px 16px; border-radius:999px; text-decoration:none;
                       background:rgba(12,12,20,.94); color:#FFD700; border:2px solid #FFD700;
                       font-size:15px; font-weight:900; letter-spacing:.3px;
                       box-shadow:0 6px 22px rgba(0,0,0,.7); }
        .lc-ref-back:active { transform:scale(.97); }

        /* ===== Score ===== */

        .score-big {
            font-size: 48px;
            font-weight: 800;
            background: linear-gradient(135deg, var(--gold), #FFA500);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .score-label { font-size: 15px; color: var(--text2); }

        /* ===== Stats Grid ===== */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }
        .stat-item {
            background: var(--card2);
            border-radius: var(--radius-sm);
            padding: 14px 8px;
            text-align: center;
        }
        .stat-value { font-size: 24px; font-weight: 700; }
        .stat-label { font-size: 14px; color: var(--text2); margin-top: 4px; }

        /* ===== Steps ===== */
        .step-list { display: flex; flex-direction: column; gap: 8px; }
        .step-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 12px;
            background: var(--card2);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
            min-height: 72px;
            -webkit-tap-highlight-color: rgba(108,99,255,0.2);
        }
        .step-item:active { transform: scale(0.98); background: rgba(108,99,255,0.08); }
        .step-icon {
            width: 52px; height: 52px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            flex-shrink: 0;
        }
        .step-info { flex: 1; min-width: 0; }
        .step-name { font-size: 17px; font-weight: 600; color: white; }
        .step-points { font-size: 15px; color: var(--text2); }
        .step-status { font-size: 20px; flex-shrink: 0; }
        .step-progress-bar {
            width: 100%; height: 4px;
            background: var(--border);
            border-radius: 2px;
            margin-top: 6px;
            overflow: hidden;
        }
        .step-progress-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

        /* ===== Leaderboard ===== */
        .rank-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
            min-height: 52px;
        }
        .rank-item:last-child { border-bottom: none; }
        .rank-num {
            width: 30px; height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 700;
            flex-shrink: 0;
        }
        .rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
        .rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
        .rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
        .rank-other { background: var(--card2); color: var(--text2); }
        .rank-name { flex: 1; font-size: 16px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .rank-score { font-size: 18px; font-weight: 700; color: var(--gold); white-space: nowrap; }
        .rank-badge {
            font-size: 14px; padding: 2px 8px; border-radius: 20px;
            background: var(--primary); color: white; white-space: nowrap;
        }
        .is-me { background: rgba(108,99,255,0.1); border-radius: var(--radius-xs); margin: 0 -4px; padding: 10px 4px; }

        /* ===== Buttons ===== */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 14px 24px;
            border-radius: var(--radius-sm);
            border: none;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
            min-height: 48px;
            -webkit-tap-highlight-color: rgba(108,99,255,0.2);
        }
        .btn:active { transform: scale(0.97); }
        .btn-primary { background: var(--primary); color: #000; }
        .btn-success { background: var(--success); color: #000; }
        .btn-create {
            background: var(--success);
            color: #000;
            font-weight: 600;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-height: 44px;
            padding: 10px 18px;
            border-radius: 12px;
            font-size: 15px;
            cursor: pointer;
            border: none;
            -webkit-tap-highlight-color: rgba(78,205,196,0.3);
        }
        .btn-create .plus-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #3A1F7A;
            color: #fff;
            font-weight: 700;
            font-size: 15px;
            line-height: 1;
        }
        .btn-create:active {
            opacity: 0.85;
            transform: scale(0.97);
        }
        .btn-outline {
            background: transparent;
            border: 2px solid var(--border);
            color: var(--text);
        }
        .btn-outline:active { border-color: var(--success); color: var(--success); }
        .btn-danger { background: var(--danger); color: #fff; }
        .btn-block { width: 100%; }
        .btn-sm { padding: 10px 16px; font-size: 14px; min-height: 40px; }

        /* ===== Premium 3D Button System ===== */
        /* Performance: static gradients, no animations */
        .btn-3d {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px 20px;
            font-size: 14px;
            font-weight: 700;
            text-decoration: none;
            border-radius: var(--radius-xs);
            cursor: pointer;
            user-select: none;
            min-height: 42px;
            position: relative;
            overflow: hidden;
            border: 1.5px solid rgba(255,255,255,0.2);
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
            transition: all 0.15s ease;
        }
        /* 🎨 2026-10-15（用户报障：生命密码「关系圈/合图清单」黑底上看不到）：
           写在 <a> 上的 .btn-3d 原本没写 color → 落到浏览器默认链接蓝 rgb(0,0,238) → 深底上看不见。
           只给 **a.btn-3d** 兜底白色（<button> 不碰：它们有浏览器默认浅底，白字反而会变看不见）。 */
        a.btn-3d { color: var(--text); }
        .btn-3d-primary {
            background: linear-gradient(180deg, #4ECDC4 0%, #3DBDB5 100%);
            color: #000;
            border-bottom: 5px solid #2A9E97;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.12),
                0 6px 20px rgba(78,205,196,0.3), 0 3px 8px rgba(0,0,0,0.15);
        }
        .btn-3d-primary:hover {
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.12),
                0 8px 28px rgba(78,205,196,0.45), 0 4px 12px rgba(0,0,0,0.2);
        }
        .btn-3d-primary:active {
            transform: translateY(3px);
            border-bottom-width: 2px;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 3px 6px rgba(0,0,0,0.15),
                0 1px 4px rgba(78,205,196,0.15);
        }
        .btn-3d-gold {
            background: linear-gradient(180deg, #C9A94E 0%, #B08D3A 100%);
            color: #1A1505;
            border-bottom: 5px solid #8F7330;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -2px 0 rgba(0,0,0,0.08),
                0 4px 14px rgba(201,169,78,0.18), 0 3px 8px rgba(0,0,0,0.15);
        }
        .btn-3d-gold:hover {
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -2px 0 rgba(0,0,0,0.08),
                0 6px 20px rgba(201,169,78,0.26), 0 4px 12px rgba(0,0,0,0.2);
        }
        .btn-3d-gold:active {
            transform: translateY(3px);
            border-bottom-width: 2px;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 3px 6px rgba(0,0,0,0.15),
                0 1px 4px rgba(201,169,78,0.12);
        }
        .btn-3d-purple {
            background: linear-gradient(180deg, #6C63FF 0%, #5A52E0 100%);
            color: #fff;
            border-bottom: 5px solid #3D35B0;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.12),
                0 6px 20px rgba(108,92,231,0.3), 0 3px 8px rgba(0,0,0,0.15);
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        .btn-3d-purple:hover {
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.12),
                0 8px 28px rgba(108,92,231,0.45), 0 4px 12px rgba(0,0,0,0.2);
        }
        .btn-3d-purple:active {
            transform: translateY(3px);
            border-bottom-width: 2px;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 3px 6px rgba(0,0,0,0.15),
                0 1px 4px rgba(108,92,231,0.15);
        }
        .btn-3d-danger {
            background: linear-gradient(180deg, #BC3F48 0%, #A8323A 100%);
            color: #fff;
            border-bottom: 5px solid #8A252D;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -2px 0 rgba(0,0,0,0.12),
                0 6px 20px rgba(188,63,72,0.3), 0 3px 8px rgba(0,0,0,0.15);
        }
        .btn-3d-danger:hover {
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -2px 0 rgba(0,0,0,0.12),
                0 8px 28px rgba(188,63,72,0.45), 0 4px 12px rgba(0,0,0,0.2);
        }
        .btn-3d-danger:active {
            transform: translateY(3px);
            border-bottom-width: 2px;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 3px 6px rgba(0,0,0,0.15),
                0 1px 4px rgba(188,63,72,0.15);
        }
        .btn-3d-ghost {
            background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
            color: var(--text);
            border: 1px solid rgba(255,255,255,0.1);
            border-bottom: 3px solid rgba(255,255,255,0.12);
            box-shadow: 0 3px 10px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.08);
            text-shadow: none;
        }
        .btn-3d-ghost:hover {
            box-shadow: 0 5px 16px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.1);
        }
        .btn-3d-ghost:active {
            transform: translateY(2px);
            border-bottom-width: 1px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        }
        .btn-3d-sm {
            padding: 6px 12px;
            font-size: 14px;
            min-height: 32px;
            border-bottom-width: 3px;
            border-radius: 8px;
        }
        .btn-3d-sm:active { border-bottom-width: 1px; }
        .btn-3d-block { width: 100%; }

        /* ═══ 🟡 全站标准：右上角返回/首页 3D 金按钮（样品 A · 深雕金厚底 Blade）═══
           2026-09-12 Mr Koh 拍板。四大设计要点：
             ① 四层金光渐变 + 6px 厚底边 → 明显立体
             ② 按下**不改底边宽度**（只 translateY）→ 零重排，头部不会抖
             ③ transition 只列 transform/box-shadow（不用 all）→ 少无谓重算
             ④ touch-action:manipulation → 手机去掉双击缩放等待，点按更跟手
           放在 .btn-3d 家族之后，保证能盖掉 .btn-3d 的 border/padding 简写。 */
        .btn-3d.btn-3d-yellow {
            display:inline-flex; align-items:center; justify-content:center; gap:6px;
            padding:9px 18px; font-size:16px; font-weight:800; text-decoration:none;
            border-radius:12px; cursor:pointer; min-height:44px; position:relative;
            background:linear-gradient(180deg,#FFF0A8 0%,#FFD700 38%,#F2C200 70%,#D9A800 100%);
            color:#241C02;
            border:none; border-bottom:6px solid #A07C00;
            text-shadow:0 1px 0 rgba(255,255,255,0.55);
            box-shadow:inset 0 2px 0 rgba(255,255,255,0.85), inset 0 -3px 0 rgba(160,124,0,0.35),
                0 8px 18px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,215,0,0.28);
            -webkit-tap-highlight-color:transparent;
            touch-action:manipulation;
            transition:transform .12s ease, box-shadow .12s ease;
        }
        .btn-3d.btn-3d-yellow:hover {
            transform:translateY(-1px);
            box-shadow:inset 0 2px 0 rgba(255,255,255,0.85), inset 0 -3px 0 rgba(160,124,0,0.35),
                0 12px 26px rgba(0,0,0,0.38), 0 0 16px rgba(255,215,0,0.45), 0 0 0 1px rgba(255,215,0,0.5);
        }
        .btn-3d.btn-3d-yellow:active {
            transform:translateY(4px);
            box-shadow:inset 0 3px 8px rgba(140,105,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
        }
        /* 单独用（不带 .btn-3d）也要好看 */
        .btn-3d-yellow {
            display:inline-flex; align-items:center; justify-content:center; gap:6px;
            padding:9px 18px; font-size:16px; font-weight:800; text-decoration:none;
            border-radius:12px; cursor:pointer; min-height:44px; position:relative;
            background:linear-gradient(180deg,#FFF0A8 0%,#FFD700 38%,#F2C200 70%,#D9A800 100%);
            color:#241C02;
            border:none; border-bottom:6px solid #A07C00;
            text-shadow:0 1px 0 rgba(255,255,255,0.55);
            box-shadow:inset 0 2px 0 rgba(255,255,255,0.85), inset 0 -3px 0 rgba(160,124,0,0.35),
                0 8px 18px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,215,0,0.28);
            -webkit-tap-highlight-color:transparent;
            touch-action:manipulation;
            transition:transform .12s ease, box-shadow .12s ease;
        }
        .btn-3d-yellow:hover { transform:translateY(-1px);
            box-shadow:inset 0 2px 0 rgba(255,255,255,0.85), inset 0 -3px 0 rgba(160,124,0,0.35),
                0 12px 26px rgba(0,0,0,0.38), 0 0 16px rgba(255,215,0,0.45), 0 0 0 1px rgba(255,215,0,0.5); }
        .btn-3d-yellow:active { transform:translateY(4px);
            box-shadow:inset 0 3px 8px rgba(140,105,0,0.45), 0 2px 6px rgba(0,0,0,0.3); }
        /* 次要款（青绿 3D）· 同样零重排 */
        .btn-3d-yellow.is-teal {
            background:linear-gradient(180deg,#6FE3DB 0%,#4ECDC4 38%,#3DBDB5 72%,#2A9E97 100%);
            border-bottom-color:#1F7A74; color:#04211F;
            text-shadow:0 1px 0 rgba(255,255,255,0.45);
            box-shadow:inset 0 2px 0 rgba(255,255,255,0.7), inset 0 -3px 0 rgba(31,122,116,0.35),
                0 8px 18px rgba(0,0,0,0.3), 0 0 0 1px rgba(78,205,196,0.35);
        }

        /* ===== 登录页按钮（2026-09-01 拍板 V3，蓝图「登录页单页合一设计基准」）===== */
        /* 登录按钮：深青玻璃金属框（iOS 玻璃质感：金属边框 + 渐变 + 顶部椭圆高光） */
        .login-glass-deep {
            display:flex; align-items:center; justify-content:center; gap:6px; width:100%;
            padding:15px 20px; font-size:17px; font-weight:800; cursor:pointer; border-radius:14px;
            border:2px solid #B8CCCC; color:#EAFEFC; position:relative; overflow:hidden;
            text-shadow:0 1px 2px rgba(0,0,0,0.25); min-height:50px;
            background:linear-gradient(180deg, #3FA8A0 0%, #2A8B84 50%, #1F6E68 100%);
            box-shadow:0 6px 18px rgba(42,139,132,0.35), inset 0 2px 3px rgba(255,255,255,0.35), inset 0 -3px 6px rgba(0,0,0,0.2);
            transition:all 0.15s ease;
        }
        .login-glass-deep::before {
            content:''; position:absolute; top:5px; left:12%; right:12%; height:38%; border-radius:50%;
            background:linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.0));
            pointer-events:none;
        }
        .login-glass-deep:active { transform:translateY(2px); box-shadow:0 3px 10px rgba(42,139,132,0.25), inset 0 2px 3px rgba(255,255,255,0.2); }

        /* 创建按钮：哑金实底立体（3D 厚底边） */
        .btn-reg-matte {
            display:flex; align-items:center; justify-content:center; gap:6px; width:100%; margin-top:12px;
            text-decoration:none; font-size:15px; font-weight:800; min-height:48px; border-radius:13px;
            background:linear-gradient(180deg,#E8C766 0%,#C9A94E 55%,#A98A38 100%); color:#1A1405;
            border:1.5px solid rgba(255,255,255,0.35); border-bottom:5px solid #7A5F22;
            box-shadow:inset 0 1px 0 rgba(255,255,255,0.5), 0 5px 18px rgba(201,169,78,0.3);
            transition:all 0.15s ease;
        }
        .btn-reg-matte:active { transform:translateY(3px); border-bottom-width:2px; }
        /* ===== End Premium 3D Buttons ===== */

        /* ===== 按钮1号设计（2026-08-30 拍板：稳重大气玻璃卡，重要按钮用这套）=====
           用法：<a class="btn1 btn1-gold" href="..."> 主按钮（重要）
                 <a class="btn1 btn1-teal" href="..."> 次按钮
           图标章：<span class="btn1-icon btn1-icon-gold">📞</span>  /  <span class="btn1-icon btn1-icon-teal">✅</span>
           文字：<span class="btn1-text"><span class="btn1-title">标题</span><span class="btn1-sub">副标题</span></span>
           箭头：<span class="btn1-arrow">›</span>
           完整示例 = 首页第二卡（dashboard.html）Contact+To Do 并排 */
        .btn1 {
            flex: 1;
            min-width: 0;  /* 2026-08-30 修复：防 nowrap 副标题把按钮撑爆（To Do 右边过界） */
            display: flex;
            align-items: center;
            gap: 11px;
            padding: 16px 14px;
            text-decoration: none;
            border-radius: 16px;
            background: linear-gradient(180deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.015) 100%);
            border: 1px solid rgba(255,255,255,0.12);
            box-shadow: 0 4px 14px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
            transition: all 0.15s ease;
        }
        .btn1:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
        /* 主按钮：低调哑光金描边（#C9A94E，2026-08-20 拍板哑光金） */
        .btn1-gold {
            border: 1.5px solid rgba(201,169,78,0.55);
            background: linear-gradient(180deg, rgba(201,169,78,0.10) 0%, rgba(201,169,78,0.02) 100%);
            box-shadow: 0 4px 16px rgba(201,169,78,0.12), 0 4px 14px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
        }
        /* 次按钮：青色微光 */
        .btn1-teal {
            border: 1px solid rgba(255,255,255,0.12);
        }
        .btn1-teal .btn1-arrow { color: rgba(78,205,196,0.9); }
        .btn1-icon {
            width: 42px;
            height: 42px;
            border-radius: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            flex-shrink: 0;
        }
        .btn1-icon-gold {
            background: linear-gradient(180deg, #C9A94E 0%, #A98A38 100%);
            border: 1px solid rgba(255,255,255,0.22);
            box-shadow: 0 2px 6px rgba(201,169,78,0.25);
        }
        .btn1-icon-teal {
            background: rgba(78,205,196,0.14);
            border: 1px solid rgba(78,205,196,0.35);
        }
        .btn1-text { flex: 1; min-width: 0; }
        .btn1-title { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; color: #FFFFFF; letter-spacing: 0.3px; }
        .btn1-sub { display: block; font-size: 14px; color: rgba(255,255,255,0.62); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .btn1-gold .btn1-sub { color: rgba(255,255,255,0.68); }
        .btn1-arrow { font-size: 22px; font-weight: 400; color: rgba(255,255,255,0.55); }
        .btn1-gold .btn1-arrow { color: #C9A94E; }
        /* ===== End 按钮1号设计 ===== */

        /* ===== Forms ===== */
        input, select, textarea {
            width: 100%;
            padding: 14px 16px;
            background: var(--card2);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text);
            font-size: 16px;  /* iOS auto-zoom prevention */
            outline: none;
            transition: border-color 0.2s;
        }
        /* Remove native styling only on text-based inputs; keep select, time, date native pickers on iOS */
        input[type="text"], input[type="email"], input[type="password"],
        input[type="search"], input[type="tel"], input[type="url"],
        input[type="number"], textarea {
            -webkit-appearance: none;
            appearance: none;
        }
        input:focus, select:focus, textarea:focus { border-color: var(--primary); }
        input::placeholder, textarea::placeholder { color: var(--text2); }  /* 版本A：占位符对比度下限 ≥#9AA3B8（textarea 原来漏了 → 回退浏览器默认 ~#757575，低于下限）*/
        textarea { font-family: inherit; resize: vertical; min-height: 80px; }
        select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23A0A0B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
        .form-group { margin-bottom: 14px; }
        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: var(--text2);
            margin-bottom: 6px;
        }
        /* 2026-08-21：地址区块 label 放大到 17px */
        .addr-label {
            font-size: 17px;
            color: var(--text);
        }

        /* ===== Quick Log ===== */
        .quick-log-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 14px;
        }
        .quick-log-btn {
            padding: 16px 12px;
            border-radius: var(--radius-sm);
            border: none !important;
            outline: none;
            background: var(--card2);
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            min-height: 80px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            -webkit-tap-highlight-color: rgba(108,99,255,0.2);
        }
        .quick-log-btn:active { transform: scale(0.95); background: var(--card); }
        .quick-log-btn label { border: none !important; }
        .quick-log-btn .ql-icon { font-size: 32px; }
        .quick-log-btn .ql-name { font-size: 15px; font-weight: 600; color: white; }
        .quick-log-btn .ql-points { font-size: 14px; color: var(--gold); }

        /* ===== Streak ===== */
        .streak-fire { font-size: 32px; }

        /* ===== Tab Bar ===== */
        .tab-bar {
            display: flex;
            background: var(--card2);
            border-radius: var(--radius-sm);
            padding: 4px;
            margin-bottom: 14px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .tab-item {
            flex: 1;
            text-align: center;
            padding: 10px 8px;
            font-size: 14px;
            font-weight: 600;
            border-radius: var(--radius-xs);
            cursor: pointer;
            color: var(--text2);
            white-space: nowrap;
            transition: all 0.2s;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }
        .tab-item.active { background: var(--primary); color: white; }

        /* ===== Slider ===== */
        input[type="range"] {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 6px;
            background: var(--border);
            border-radius: 3px;
            outline: none;
            padding: 0;
        }
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            border: 3px solid var(--card);
            box-shadow: 0 2px 8px rgba(108,99,255,0.4);
        }

        /* ===== Tags ===== */
        .tag {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 600;
        }

        /* ===== Mobile Only ===== */
        .mobile-hide { display: none; }

        /* ===== Responsive ===== */
        @media (max-width: 480px) {
            .container { padding: 10px; }
            .card { padding: 14px; margin-bottom: 10px; }
            .stats-grid { gap: 8px; }
            .stat-item { padding: 12px 6px; }
            .stat-value { font-size: 20px; }
            .quick-log-grid { gap: 8px; }
            .quick-log-btn { padding: 14px 10px; min-height: 72px; }
            .header { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
            .header-title { font-size: 16px; }
            .score-big { font-size: 36px; }
        }

        /* Touch-friendly extra spacing on very small screens */
        @media (max-width: 360px) {
            .container { padding: 8px; }
            .card { padding: 12px; border-radius: var(--radius-sm); }
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
        }

        /* Fix for notch phones in landscape */
        @media (orientation: landscape) and (max-height: 450px) {
            .header { padding: 6px 12px; min-height: 40px; }
            .header-title { font-size: 15px; }
            body { padding-bottom: calc(100px + var(--safe-bottom) + 4px); }
        }
        /* ⏰ 时间显示 — 全局统一大小，方便阅读 */
        .time-lg { font-size:16px; font-weight:600; line-height:1.4; }
        .time-md { font-size:14px; font-weight:500; }
    

.scroll-5 {
    max-height: 275px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-right: 4px;
}


.action-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text2);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
    flex-shrink: 0;
}
.action-more-btn:active {
    background: rgba(255,255,255,0.08);
    transform: scale(0.92);
}
.action-sheet-item {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: none;
    background: var(--card2);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    transition: background 0.1s;
}
.action-sheet-item:active {
    background: rgba(255,255,255,0.06);
}
.action-sheet-item-delete {
    color: var(--danger);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 通用返回按钮 */
.back-btn {
    display:inline-flex;
    align-items:center;
    gap:4px;
    padding:6px 14px;
    border-radius:20px;
    background:rgba(255,255,255,0.15);
    color:#fff !important;
    font-size:14px;
    font-weight:600;
    text-decoration:none !important;
    white-space:nowrap;
    transition:background .2s;
    min-height:36px;
}
.back-btn:hover,
.back-btn:active {
    background:rgba(255,255,255,0.3);
}
.back-btn:focus-visible {
    outline:2px solid var(--primary);
    outline-offset:2px;
}

/* 🖱️ 「整卡可点」按压反馈 + 键盘焦点（2026-09-20 点击盲区 P4）
 * 整卡可点保留 <div>（版式零风险），但要有按压反馈与可见焦点圈；
 * 键盘触发逻辑在 static/js/tap_click.js。
 * ⚠️ 只用 opacity / outline —— 不碰盒模型 → 版式零位移。 */
.sq-tap {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sq-tap:active {
    opacity: 0.72;
}
.sq-tap:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== 桌面宽度收口（2026-09-27 Mr Koh：电脑上很多页宽度没控制，直接拉满屏幕）=====
   背景：移动优先设计，页面靠 .container{max-width:600px} 控宽；但没套 .container 的页面
   （首页 /dashboard、/appliances、/accounts、/notes、/tree/view…）在电脑上直接铺满屏幕。
   做法：只在 ≥768px（平板/电脑）把「应用壳」收成固定宽度并居中，等于把桌面当手机壳看；
   手机（<768px）行为一字不变。宽度想调只改 --sq-shell-w 一个变量。 */
:root { --sq-shell-w: 680px; }

@media (min-width: 768px) {
    /* html 单独给底色 → 壳外是更深的背景，形成一条可见的应用边界 */
    html { background: #07070d; }
    body {
        max-width: var(--sq-shell-w);
        margin-left: auto;
        margin-right: auto;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    }
    /* 底部固定导航同样收进壳内（fixed 元素不受 body 宽度约束，要单独夹） */
    .bottom-nav {
        max-width: var(--sq-shell-w);
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }
    /* 桌面固定底栏类名不统一，凡是「贴底固定」都收口（只夹宽度，不动定位） */
    body > [style*="position:fixed"][style*="bottom"],
    body > [style*="position: fixed"][style*="bottom"] {
        max-width: var(--sq-shell-w);
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }
}
/* ══════════════════════════════════════════════════════════════════
   全站「输入框 / 搜索框」统一（2026-10-05 Mr Koh 拍板 · 版本 A）
   输入框 = 蓝 #4F65CE；搜索框 = 品牌青 #4ECDC4（+微光）
   ⚠️ 刻意「只改颜色、不改尺寸」：用 outline 画彩色环（outline 不影响布局）
      → 满足点击盲区 P3「版式零位移」门禁，不会让页面高度变化
   用法：输入加 class="sq-in"；搜索框加 class="sq-search"
        （要 🔍 前缀：<span class="sq-search-wrap"><span class="sq-ico">🔍</span><input class="sq-search"></span>）
   ── 2026-10-06 P1 定案（Mr Koh 15:38 拍板 A）──
       · 输入框：蓝 #4F65CE 边框 + 焦点蓝光环（#6b7ee0 + rgba(79,101,206,.35)）
       · 【不采用】旧「焦点青光环」于输入框（青只留给搜索框 .sq-search）
       · 保留不冲突项：占位符对比度 ≥ #9AA3B8（页面自造的更暗占位符一律改掉；
         全局 input::placeholder=var(--text2)=#FFFFFF 已高于下限，无需再动）
   ══════════════════════════════════════════════════════════════════ */
.sq-in { border-color: #4F65CE !important; outline: 2px solid #4F65CE; outline-offset: -2px; }
.sq-in:focus { border-color: #6b7ee0 !important; outline-color: #6b7ee0; box-shadow: 0 0 0 3px rgba(79,101,206,.35); }
.sq-search { border-color: var(--primary) !important; outline: 2px solid var(--primary); outline-offset: -2px;
  box-shadow: 0 0 0 3px rgba(78,205,196,.16); }
.sq-search:focus { border-color: #71e6de !important; outline-color: #71e6de; box-shadow: 0 0 0 4px rgba(78,205,196,.30); }
.sq-search-wrap { position: relative; }
.sq-search-wrap > .sq-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 16px; opacity: .9; pointer-events: none; z-index: 1; }
/* ══════════════════════════════════════════════════════════════════
   🔍 金色描边「显眼动作」按钮 = .sq-btn-gold（2026-10-16 拍板：家庭成员「✚ 添加」要与地址「放大」同款）
   单一来源 = 本类；用法：<button class="sq-btn-gold" style="…只留尺寸/定位…>
   规格：白字 + 亮金描边 var(--gold) + 深底 rgba(15,15,26,.75) + 金色柔光 + 胶囊圆角
   ⚠️ 本类只定「视觉外壳」（颜色/边框/阴影/圆角/字重/排列）；**尺寸与定位留给实例内联** → 版式零位移
   ══════════════════════════════════════════════════════════════════ */
.sq-btn-gold {
  display: inline-flex; align-items: center; gap: 4px;
  color: #fff; font-weight: 700;
  background: rgba(15,15,26,.75);
  border: 2px solid var(--gold);
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(255,215,0,.55);
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sq-btn-gold:active { transform: translateY(1px); }
.sq-btn-gold:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
