        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
            background: #0a0e17;
            background-image:
                radial-gradient(ellipse 80% 50% at 50% 0%, rgba(44, 83, 100, 0.35) 0%, transparent 70%),
                radial-gradient(ellipse 60% 40% at 80% 100%, rgba(240, 194, 127, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse 60% 40% at 20% 80%, rgba(252, 92, 125, 0.04) 0%, transparent 60%);
            background-attachment: fixed;
            color: #e0e0e0;
            min-height: 100vh;
        }

        /* ========== Header ========== */
        .header {
            background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
            padding: 40px 24px 28px;
            position: relative;
            overflow: hidden;
        }
        .header::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: radial-gradient(ellipse at 30% 40%, rgba(240,194,127,0.1) 0%, transparent 55%),
                        radial-gradient(ellipse at 80% 60%, rgba(252,92,125,0.06) 0%, transparent 50%);
        }
        .header-mountains {
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            width: 100%;
            pointer-events: none;
            opacity: 0.15;
        }
        .header-inner {
            max-width: 1400px;
            margin: 0 auto;
            position: relative;
            z-index: 2;
        }
        .header-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 16px;
        }
        .header-left h1 {
            font-size: 32px;
            font-weight: 900;
            background: linear-gradient(135deg, #f0c27f, #fc5c7d, #f0c27f);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 6px;
            letter-spacing: 1px;
        }
        .header-left p { font-size: 13px; color: rgba(255,255,255,0.35); letter-spacing: 0.5px; }
        .tab-bar {
            display: flex;
            gap: 4px;
            margin-top: 18px;
            padding: 4px;
            background: rgba(255,255,255,0.05);
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.06);
            width: fit-content;
        }
        .tab-btn {
            padding: 8px 20px;
            border: none;
            background: transparent;
            color: #888;
            font-size: 13px;
            font-weight: 600;
            border-radius: 9px;
            cursor: pointer;
            transition: all 0.25s;
            font-family: inherit;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .tab-btn:hover { color: #ccc; }
        .tab-btn.active {
            background: linear-gradient(135deg, rgba(240,194,127,0.2), rgba(252,92,125,0.2));
            color: #f0c27f;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        }

        /* 账号 / 退出入口（Header 右上角，所有页面可见） */
        .header-user {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 999px;
            cursor: pointer;
            transition: all 0.25s;
            align-self: flex-start;
        }
        .header-user:hover {
            background: rgba(255,255,255,0.1);
            border-color: rgba(240,194,127,0.35);
        }
        .header-user .hu-avatar { font-size: 16px; line-height: 1; }
        .header-user .hu-name {
            font-size: 13px;
            color: #81c784;
            font-weight: 600;
            max-width: 160px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .header-user .hu-chev { font-size: 14px; color: rgba(255,255,255,0.4); }

        /* 统计卡片 */
        .header-stats {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        /* 默认隐藏所有统计卡片，避免页面加载瞬间所有卡片同时显示（FOUC）。
           仅当 html 元素有 data-tab 属性且等于 data-show-tab 时才显示。
           JS 切 tab 时同步更新 html[data-tab]。 */
        .h-stat { display: none; }
        html[data-tab="home"] .h-stat[data-show-tab="home"],
        html[data-tab="gear"] .h-stat[data-show-tab="gear"],
        html[data-tab="expense"] .h-stat[data-show-tab="expense"] {
            text-align: center;
            padding: 10px 18px;
            background: rgba(255,255,255,0.04);
            border-radius: 14px;
            border: 1px solid rgba(255,255,255,0.06);
            min-width: 76px;
            backdrop-filter: blur(10px);
            transition: all 0.3s;
        }
        .h-stat:hover {
            background: rgba(255,255,255,0.07);
            border-color: rgba(240,194,127,0.15);
            transform: translateY(-2px);
        }
        .h-stat .stat-icon { font-size: 14px; margin-bottom: 2px; }
        .h-stat .num {
            font-size: 22px;
            font-weight: 800;
            color: #f0c27f;
            line-height: 1.1;
        }
        .h-stat .lbl {
            font-size: 10px;
            color: #888;
            margin-top: 3px;
            letter-spacing: 0.5px;
        }

        /* ========== PWA 全屏模式适配 ========== */
        @media (display-mode: standalone) {
            .header {
                padding-top: max(40px, env(safe-area-inset-top));
            }
            .toolbar {
                padding-bottom: max(8px, env(safe-area-inset-bottom));
            }
            body {
                padding-bottom: env(safe-area-inset-bottom);
            }
        }
        html { height: 100%; }
        html.pwa-standalone body {
            user-select: none;
            -webkit-user-select: none;
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
        }
        html.pwa-standalone input,
        html.pwa-standalone textarea {
            user-select: text;
            -webkit-user-select: text;
        /* ========== 首次使用引导 ========== */
        .first-use-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.8);
            z-index: 99998;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .first-use-card {
            background: linear-gradient(135deg, #0f2027, #2c5364);
            color: #fff;
            border-radius: 16px;
            padding: 28px 24px;
            max-width: 360px;
            width: 100%;
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
            border: 1px solid rgba(240,194,127,0.3);
        }
        .first-use-emoji {
            text-align: center;
            font-size: 48px;
            margin-bottom: 12px;
        }
        .first-use-title {
            color: #f0c27f;
            margin: 0 0 12px;
            font-size: 20px;
            text-align: center;
        }
        .first-use-desc {
            margin: 0 0 16px;
            line-height: 1.6;
            color: rgba(255,255,255,0.85);
            font-size: 14px;
        }
        .first-use-btn-new {
            width: 100%;
            padding: 14px;
            margin-bottom: 10px;
            background: linear-gradient(135deg, #f0c27f, #fc5c7d);
            color: #0a0e17;
            border: none;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
        }
        .first-use-btn-pick {
            width: 100%;
            padding: 14px;
            margin-bottom: 10px;
            background: rgba(255,255,255,0.1);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 10px;
            font-size: 14px;
            cursor: pointer;
        }
        .first-use-btn-later {
            width: 100%;
            padding: 10px;
            background: none;
            color: rgba(255,255,255,0.5);
            border: none;
            font-size: 13px;
            cursor: pointer;
        }

        /* ========== PWA 安装条 ========== */
        .pwa-install-bar {
            position: fixed;
            bottom: 0; left: 0; right: 0;
            background: linear-gradient(135deg, #0f2027, #2c5364);
            color: #f0c27f;
            padding: 14px 16px;
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 99999;
            font-size: 14px;
            box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
            border-top: 1px solid rgba(240,194,127,0.3);
            padding-bottom: max(14px, env(safe-area-inset-bottom));
        }
        .pwa-install-bar .install-emoji { font-size: 28px; }
        .pwa-install-bar .install-text {
            flex: 1;
            line-height: 1.4;
        }
        .pwa-install-bar .install-text small {
            font-size: 12px;
            color: rgba(255,255,255,0.6);
        }
        .pwa-install-btn {
            background: linear-gradient(135deg, #f0c27f, #fc5c7d);
            color: #0a0e17;
            border: none;
            border-radius: 10px;
            padding: 12px 20px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            min-height: 44px;
        }
        .pwa-dismiss-btn {
            background: none;
            border: none;
            color: rgba(255,255,255,0.4);
            font-size: 22px;
            cursor: pointer;
            padding: 8px;
            min-width: 44px;
            min-height: 44px;
        }

        /* ========== iOS 安装提示 ========== */
        .ios-install-hint {
            position: fixed;
            bottom: 0; left: 0; right: 0;
            background: linear-gradient(135deg, #0f2027, #2c5364);
            color: #fff;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 99999;
            font-size: 13px;
            box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
        }
        .ios-install-hint .hint-emoji { font-size: 24px; }
        .ios-install-hint .hint-text {
            flex: 1;
            line-height: 1.5;
        }
        .ios-install-hint .hint-text .share-icon {
            font-size: 18px;
        }
        .ios-install-hint .hint-dismiss {
            background: none;
            border: none;
            color: rgba(255,255,255,0.4);
            font-size: 20px;
            cursor: pointer;
            padding: 4px;
        }

        /* 下拉刷新提示 */
        .pull-to-refresh {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 0;
            overflow: hidden;
            background: linear-gradient(180deg, rgba(240,194,127,0.12), transparent);
            display: flex;
            align-items: flex-end;
            justify-content: center;
            padding-bottom: 8px;
            z-index: 100;
            pointer-events: none;
            transition: height 0.2s ease;
            color: #f0c27f;
            font-size: 12px;
            letter-spacing: 1px;
        }
        .pull-to-refresh.show {
            height: 56px;
        }
        .pull-to-refresh .ptr-icon {
            display: inline-block;
            font-size: 18px;
            margin-right: 6px;
            animation: ptrSpin 1.2s linear infinite;
        }
        @keyframes ptrSpin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* ========== 全局可访问性 ========== */
        /* sr-only：屏幕阅读器可读但视觉隐藏（用于给盲人补充上下文） */
        .sr-only {
            position: absolute;
            width: 1px; height: 1px;
            padding: 0; margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* 清晰的键盘焦点环 */
        /* 仅键盘聚焦时显示，避免鼠标点击也出现焦点圈（影响视觉） */
        :focus-visible {
            outline: 2px solid #f0c27f;
            outline-offset: 2px;
        }
        /* input/select/textarea 自带焦点环与 :focus-visible 同时显示会重复，统一去掉浏览器默认 */
        input:focus-visible,
        select:focus-visible,
        textarea:focus-visible,
        button:focus-visible {
            outline: 2px solid #f0c27f;
            outline-offset: 1px;
        }

