/* ===== 全局重置 & 配色 ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
            background: #f5f0eb;
            color: #3d322c;
            padding: 12px;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: flex-start;
        }
        .app-container {
            max-width: 480px;
            width: 100%;
            margin: 0 auto;
        }

        /* ===== 通用卡片 ===== */
        .card {
            background: #ffffff;
            border-radius: 20px;
            padding: 18px 16px 20px;
            box-shadow: 0 4px 16px rgba(60, 45, 40, 0.08);
            margin-bottom: 16px;
            border: 1px solid #ede8e2;
        }
        .card-title {
            font-size: 17px;
            font-weight: 600;
            color: #4a3a32;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 14px;
        }
        .card-title span {
            font-weight: 400;
            font-size: 13px;
            color: #b5aeaa;
        }

        /* ===== 认证页 ===== */
        .auth-page {
            padding-top: 20px;
        }
        .auth-page h1 {
            font-weight: 600;
            font-size: 26px;
            color: #4a3a32;
            margin-top: 4px;
        }
        .auth-error {
            background: #fee9e7;
            color: #c0392b;
            padding: 8px 14px;
            border-radius: 12px;
            font-size: 14px;
            display: none;
            margin-bottom: 12px;
        }
        .auth-error.show {
            display: block;
        }
        .hidden {
            display: none !important;
        }

        .form-group {
            margin-bottom: 14px;
        }
        .form-group label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            color: #5a4a42;
            margin-bottom: 4px;
        }
        .form-group input,
        .form-group select {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid #ddd6cf;
            border-radius: 12px;
            font-size: 15px;
            background: #fcfaf8;
            transition: 0.2s;
            color: #3d322c;
        }
        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #b8a69a;
            box-shadow: 0 0 0 3px rgba(139, 122, 107, 0.15);
        }
        .form-group input::placeholder {
            color: #ccc3bb;
        }

        .flex-row {
            display: flex;
            gap: 10px;
            align-items: center;
        }
        .flex-row input {
            flex: 1;
        }

        .captcha-img {
            border-radius: 10px;
            background: #f0ebe6;
            cursor: pointer;
            border: 1px solid #ddd6cf;
            min-width: 100px;
            height: 44px;
            object-fit: contain;
        }

        .btn-primary {
            background: #8b7a6b;
            color: #fff;
            border: none;
            padding: 12px 20px;
            border-radius: 14px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: 0.2s;
        }
        .btn-primary:hover {
            background: #7a6a5c;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(139, 122, 107, 0.3);
        }
        .btn-primary:active {
            transform: scale(0.97);
        }

        .btn-secondary {
            background: #f0ebe6;
            color: #5a4a42;
            border: 1px solid #ddd6cf;
            padding: 8px 16px;
            border-radius: 12px;
            font-size: 14px;
            cursor: pointer;
            transition: 0.2s;
        }
        .btn-secondary:hover {
            background: #e5ddd6;
        }

        .btn-logout {
            background: none;
            border: none;
            font-size: 22px;
            cursor: pointer;
            color: #b5aeaa;
            padding: 4px 8px;
            border-radius: 10px;
            transition: 0.2s;
        }
        .btn-logout:hover {
            background: #f0ebe6;
            color: #8b7a6b;
        }

        .tab-btn {
            padding: 8px 0;
            border-radius: 10px;
            border: none;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: 0.2s;
            background: #f0ebe6;
            color: #5a4a42;
        }
        .tab-btn:hover {
            background: #e5ddd6;
        }

        .auth-switch {
            text-align: center;
            font-size: 13px;
            color: #b5aeaa;
            margin-top: 14px;
            padding-top: 12px;
            border-top: 1px solid #ede8e2;
        }

        /* ===== 主界面 ===== */
        .app-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 4px 16px 4px;
        }
        .app-brand {
            font-size: 20px;
            font-weight: 600;
            color: #4a3a32;
            letter-spacing: 0.5px;
        }
        .user-badge {
            background: #f0ebe6;
            padding: 4px 14px 4px 12px;
            border-radius: 30px;
            font-size: 14px;
            color: #5a4a42;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* ===== 今日修行（第四板块） ===== */
        .record-input .row {
            display: flex;
            gap: 8px;
            margin-bottom: 10px;
            flex-wrap: wrap;
        }
        .record-input .row select,
        .record-input .row input {
            flex: 1;
            min-width: 60px;
            padding: 10px 12px;
            border: 1px solid #ddd6cf;
            border-radius: 12px;
            font-size: 15px;
            background: #fcfaf8;
            color: #3d322c;
        }
        .record-input .row select:focus,
        .record-input .row input:focus {
            outline: none;
            border-color: #b8a69a;
            box-shadow: 0 0 0 3px rgba(139, 122, 107, 0.12);
        }
        .record-input .row input[type="number"] {
            max-width: 100px;
        }
        .record-input .row input[type="text"] {
            flex: 2;
        }

        #recordFeedback {
            margin-top: 10px;
            font-size: 14px;
            padding: 8px 14px;
            border-radius: 12px;
            display: none;
        }
        #recordFeedback.success {
            display: block;
            background: #e8f5e9;
            color: #2e7d32;
        }
        #recordFeedback.error {
            display: block;
            background: #fee9e7;
            color: #c0392b;
        }

        /* ===== 今日修行记录（第三板块） ===== */
        .today-card {
            background: #fcfaf8;
            border-radius: 16px;
            padding: 14px 16px;
            border: 1px solid #ede8e2;
        }
        .today-date {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 15px;
            font-weight: 500;
            color: #5a4a42;
            margin-bottom: 8px;
        }
        .badge-today {
            background: #8b7a6b;
            color: #fff;
            font-size: 11px;
            padding: 2px 12px;
            border-radius: 30px;
            font-weight: 500;
        }
        .today-content {
            font-size: 16px;
            color: #3d322c;
            padding: 8px 0 4px 0;
            line-height: 1.6;
            min-height: 40px;
        }
        .today-content .empty-hint {
            color: #ccc3bb;
            font-size: 15px;
        }
        .today-actions {
            display: flex;
            gap: 10px;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #ede8e2;
        }
        .btn-copy {
            background: #f0ebe6;
            border: none;
            padding: 8px 18px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 500;
            color: #5a4a42;
            cursor: pointer;
            transition: 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .btn-copy:hover {
            background: #e5ddd6;
        }

        .copy-toast {
            font-size: 13px;
            padding: 6px 14px;
            border-radius: 10px;
            display: none;
            margin-top: 8px;
        }
        .copy-toast.show {
            display: inline-block;
        }
        .copy-toast.success {
            background: #e8f5e9;
            color: #2e7d32;
        }
        .copy-toast.error {
            background: #fee9e7;
            color: #c0392b;
        }

        /* ===== 统计板块 ===== */
        .summary-controls {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        .summary-controls label {
            font-size: 14px;
            color: #5a4a42;
        }
        .summary-controls select {
            padding: 6px 12px;
            border: 1px solid #ddd6cf;
            border-radius: 10px;
            font-size: 14px;
            background: #fcfaf8;
            color: #3d322c;
        }
        .summary-controls select:focus {
            outline: none;
            border-color: #b8a69a;
        }
        .summary-controls .btn-secondary {
            padding: 6px 16px;
            font-size: 13px;
        }

        .summary-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #f0ebe6;
            font-size: 15px;
        }
        .summary-item:last-child {
            border-bottom: none;
        }
        .summary-item .cat {
            color: #5a4a42;
        }
        .summary-item .total {
            font-weight: 600;
            color: #4a3a32;
        }

        .history-empty {
            color: #ccc3bb;
            font-size: 15px;
            text-align: center;
            padding: 20px 0 8px 0;
        }

        /* ===== 全局统计（第一板块） ===== */
        .global-stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px 12px;
            padding: 4px 0;
        }
        .global-stats-grid .stat-item {
            display: flex;
            justify-content: space-between;
            padding: 6px 0;
            border-bottom: 1px solid #f5f0eb;
            font-size: 14px;
        }
        .global-stats-grid .stat-item .cat {
            color: #5a4a42;
        }
        .global-stats-grid .stat-item .total {
            font-weight: 600;
            color: #4a3a32;
        }
        .global-stats-grid .stat-empty {
            grid-column: 1 / -1;
            color: #ccc3bb;
            text-align: center;
            padding: 16px 0;
        }

        /* ===== 响应式 ===== */
        @media (max-width: 420px) {
            .record-input .row {
                gap: 6px;
            }
            .record-input .row select,
            .record-input .row input {
                font-size: 14px;
                padding: 8px 10px;
            }
            .record-input .row input[type="number"] {
                max-width: 80px;
            }
            .card {
                padding: 14px 12px 16px;
            }
            .app-brand {
                font-size: 18px;
            }
            .global-stats-grid {
                gap: 4px 8px;
            }
            .global-stats-grid .stat-item {
                font-size: 13px;
            }
        }
