        :root {
            /* ===== 流金夜話 Luxury Dark 配色 ===== */
            --sidebar-width: 220px;
            --panel-width: 300px;

            /* 基底色系 */
            --bg: #050505;
            --card: rgba(20, 20, 23, 0.6);
            --surface: rgba(12, 12, 14, 0.8);
            --input: rgba(5, 5, 5, 0.6);
            --elevated: rgba(30, 30, 35, 0.8);
            --glass-border: rgba(255, 255, 255, 0.08);

            /* 相容原版 JS 的別名 */
            --color-bg: var(--bg);
            --color-card: var(--card);
            --color-surface: var(--surface);
            --color-elevated: var(--elevated);

            /* 文字色系 */
            --text: #F0F0F0;
            --text-secondary: #a1a1aa;
            --text-dim: #71717a;
            --text-muted: #888888;
            --color-text: var(--text);
            --color-text-secondary: var(--text-secondary);
            --color-text-muted: var(--text-muted);

            /* 主題色系 - 金色系 */
            --accent: #D4AF37;
            --accent-dim: #8a701e;
            --accent-soft: rgba(212, 175, 55, 0.15);
            --accent-glow: rgba(212, 175, 55, 0.15);
            --color-accent: var(--accent);
            --color-accent-dim: var(--accent-dim);
            --color-accent-soft: var(--accent-soft);

            /* 狀態色系 */
            --success: #52c41a;
            --success-soft: rgba(82, 196, 26, 0.1);
            --danger: #ff4d4f;
            --warning: #f59e0b;
            --color-success: var(--success);
            --color-success-soft: var(--success-soft);
            --color-danger: var(--danger);
            --color-warning: var(--warning);

            /* 邊框 */
            --border: rgba(255, 255, 255, 0.08);
            --border-subtle: rgba(255, 255, 255, 0.05);
            --color-border: var(--border);
            --color-border-subtle: var(--border-subtle);

            --radius: 8px;
            --radius-lg: 12px;
            --radius-xl: 16px;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: -apple-system, 'Noto Sans TC', BlinkMacSystemFont, sans-serif;
            background-color: var(--bg);
            background-image:
                radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(20, 20, 255, 0.02) 0%, transparent 50%);
            color: var(--text);
            height: 100vh;
            overflow: hidden;
            font-size: 14px;
            -webkit-font-smoothing: antialiased;
        }

        /* 全局雜訊紋理層 */
        .global-noise {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
            opacity: 0.03;
            pointer-events: none;
            z-index: 9999;
        }

        /* ===== 登入畫面 - BG-C 質感深邃風格 ===== */
        #login-screen {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            position: relative;
            overflow: hidden;
            background:
                radial-gradient(ellipse 100% 80% at 50% 0%, rgba(212, 168, 83, 0.06) 0%, transparent 50%),
                linear-gradient(180deg, #0a0a0c 0%, #08080a 100%);
        }

        .noise-overlay {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
            opacity: 0.03;
            pointer-events: none;
        }

        .spotlight {
            position: absolute;
            top: -30%;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            height: 80%;
            background: conic-gradient(from 180deg at 50% 100%,
                transparent 40%,
                rgba(212, 168, 83, 0.04) 50%,
                transparent 60%
            );
            pointer-events: none;
        }

        .bottom-fade {
            position: absolute;
            bottom: 0; left: 0; right: 0;
            height: 40%;
            background: linear-gradient(to top, rgba(8, 8, 10, 0.8), transparent);
            pointer-events: none;
        }

        .login-card {
            position: relative;
            z-index: 10;
            max-width: 380px;
            width: 100%;
            padding: 48px 40px;
            background: var(--card);
            border-radius: 24px;
            border: 1px solid rgba(255, 255, 255, 0.04);
            box-shadow:
                0 0 0 1px rgba(0, 0, 0, 0.5),
                0 25px 50px rgba(0, 0, 0, 0.5),
                0 0 80px rgba(212, 168, 83, 0.03);
        }

        .card-top-line {
            position: absolute;
            top: -1px;
            left: 20%;
            right: 20%;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.3), transparent);
        }

        .card-inner-glow {
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 150px;
            background: linear-gradient(180deg, rgba(212, 168, 83, 0.02) 0%, transparent 100%);
            border-radius: 24px 24px 0 0;
            pointer-events: none;
        }

        .login-logo-container {
            position: relative;
            text-align: center;
            margin-bottom: 28px;
        }

        .login-logo-wrapper {
            position: relative;
            display: inline-block;
        }

        .login-logo {
            width: 88px;
            height: 88px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid rgba(255, 255, 255, 0.06);
            box-shadow:
                0 4px 24px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(212, 168, 83, 0.1);
        }

        .login-logo-ring {
            position: absolute;
            top: -4px; left: -4px;
            width: 96px; height: 96px;
            border-radius: 50%;
            border: 1px solid transparent;
            border-top-color: rgba(212, 168, 83, 0.35);
            animation: spin 12s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .login-brand-title {
            position: relative;
            text-align: center;
            font-size: 26px;
            font-weight: 600;
            margin-bottom: 6px;
            letter-spacing: 0.02em;
        }

        .login-brand-subtitle {
            text-align: center;
            font-size: 11px;
            color: var(--accent);
            letter-spacing: 0.3em;
            margin-bottom: 40px;
            opacity: 0.85;
        }

        .login-form-group {
            position: relative;
            margin-bottom: 16px;
        }

        .login-input-wrapper { position: relative; }

        .login-input {
            width: 100%;
            padding: 18px 50px 18px 20px;
            font-size: 24px;
            background: var(--input);
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 14px;
            color: var(--text);
            text-align: center;
            letter-spacing: 14px;
            transition: all 0.3s ease;
            outline: none;
            -webkit-text-security: disc;
        }

        .login-input::placeholder {
            letter-spacing: 0;
            font-size: 16px;
            font-weight: 600;
            color: #71717a;
            -webkit-text-security: none;
        }

        .login-input:focus {
            border-color: rgba(212, 168, 83, 0.35);
            box-shadow:
                0 0 0 3px rgba(212, 168, 83, 0.06),
                inset 0 1px 2px rgba(0, 0, 0, 0.1);
        }

        .login-input.error {
            border-color: var(--danger);
            animation: shake 0.35s ease;
        }

        .login-input.show-password { -webkit-text-security: none; }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        .login-toggle-password {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-dim);
            cursor: pointer;
            padding: 6px;
            transition: color 0.2s;
        }

        .login-toggle-password:hover { color: var(--accent); }
        .login-toggle-password .material-icons-round { font-size: 20px; }

        .login-error-message {
            margin-top: 14px;
            padding: 12px 16px;
            background: rgba(239, 68, 68, 0.06);
            border-left: 3px solid var(--danger);
            border-radius: 0 10px 10px 0;
            display: none;
            align-items: center;
            gap: 10px;
            animation: fadeSlideIn 0.25s ease;
        }

        .login-error-message.show { display: flex; }
        .login-error-message .material-icons-round { font-size: 18px; color: var(--danger); }
        .login-error-message span { color: var(--danger); font-size: 13px; }

        @keyframes fadeSlideIn {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .login-btn-container {
            position: relative;
            width: 100%;
            height: 56px;
            margin-top: 28px;
        }

        .login-btn {
            width: 100%;
            height: 100%;
            padding: 16px;
            background: linear-gradient(135deg, var(--accent) 0%, #c49a48 100%);
            border: none;
            border-radius: 14px;
            color: #08080a;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow:
                0 2px 8px rgba(212, 168, 83, 0.2),
                0 8px 24px rgba(212, 168, 83, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .login-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow:
                0 4px 12px rgba(212, 168, 83, 0.25),
                0 12px 32px rgba(212, 168, 83, 0.2);
        }

        .login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .login-btn .material-icons-round { font-size: 18px; }

        .login-progress-container {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            background: linear-gradient(135deg, var(--accent), #c49a48);
            border-radius: 14px;
        }

        .login-progress-container.active { opacity: 1; visibility: visible; z-index: 3; }
        .login-progress-track { width: 120px; height: 3px; background: rgba(0,0,0,0.2); border-radius: 2px; overflow: hidden; }
        .login-progress-bar { height: 100%; background: #08080a; border-radius: 2px; width: 0%; transition: width 1.2s ease; }
        .login-progress-status { color: #08080a; font-size: 12px; font-weight: 600; }

        .login-footer {
            margin-top: 32px;
            text-align: center;
            font-size: 11px;
            color: var(--text-muted);
            letter-spacing: 0.02em;
        }

        @media (max-width: 480px) {
            .login-card { padding: 40px 28px; border-radius: 20px; }
            .login-logo { width: 76px; height: 76px; }
            .login-logo-ring { width: 84px; height: 84px; }
        }

        /* ===== 主畫面容器 ===== */
        #main-screen {
            display: none;
            min-height: 100vh;
        }

        #main-screen.active {
            display: flex;
        }

        /* ===== 側邊欄 ===== */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--surface);
            backdrop-filter: blur(30px);
            -webkit-backdrop-filter: blur(30px);
            border-right: 1px solid var(--glass-border);
            box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
            display: flex;
            flex-direction: column;
            position: fixed;
            height: 100vh;
            z-index: 100;
        }

        .sidebar-top {
            height: 140px;
            border-bottom: 1px solid var(--glass-border);
            padding: 16px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .datetime-section {
            display: flex;
            gap: 14px;
        }

        .sidebar-datetime-item {
            text-align: center;
            flex-shrink: 0;
            min-width: fit-content;
        }

        .sidebar-datetime-label {
            font-size: 8px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 3px;
            padding-bottom: 3px;
            border-bottom: 1px solid var(--border);
            display: inline-block;
        }

        .sidebar-datetime-item.time-item .sidebar-datetime-label {
            border-bottom-color: var(--accent);
        }

        .sidebar-datetime-value {
            font-size: 12px;
            font-weight: 600;
            color: var(--text);
            font-family: 'SF Mono', 'Monaco', monospace;
            white-space: nowrap;
        }

        .sidebar-datetime-value.time {
            color: var(--accent);
            text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .brand-logo {
            width: 42px;
            height: 42px;
            border-radius: var(--radius-lg);
            object-fit: cover;
            border: none;
        }

        .brand-text h1 {
            font-size: 14px;
            font-weight: 700;
            white-space: nowrap;
        }
        .brand-text h1 span {
            font-weight: 400;
            color: var(--text-secondary);
            margin-left: 4px;
        }

        .sidebar-nav {
            flex: 1;
            padding: 16px 10px;
            overflow-y: auto;
        }

        .nav-section { margin-bottom: 20px; }

        .nav-label {
            font-size: 10px;
            font-weight: 400;
            letter-spacing: 3px;
            text-transform: uppercase;
            padding: 14px 0;
            margin: 16px 0 8px 0;
            color: var(--text-secondary);
            background: transparent;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .nav-label::before,
        .nav-label::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--border-subtle) 20%, var(--border-subtle) 80%, transparent);
        }

        .nav-label::before { margin-right: 16px; }
        .nav-label::after { margin-left: 16px; }

        .nav-label span {
            position: relative;
            padding: 0 4px;
        }

        .nav-label span::before {
            content: '◆';
            font-size: 6px;
            color: var(--accent);
            position: absolute;
            left: -12px;
            top: 50%;
            transform: translateY(-50%);
        }

        .nav-label span::after {
            content: '◆';
            font-size: 6px;
            color: var(--accent);
            position: absolute;
            right: -12px;
            top: 50%;
            transform: translateY(-50%);
        }

        .nav-section:first-child .nav-label { margin-top: 0; }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: var(--radius);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s;
            margin-bottom: 2px;
        }

        .nav-item:hover { background: var(--elevated); color: var(--text); }
        .nav-item.active {
            background: var(--accent-soft);
            color: var(--accent);
            border: 1px solid rgba(212, 175, 55, 0.3);
            box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
        }
        .nav-item .material-icons-round { font-size: 18px; }
        .nav-item span:not(.material-icons-round) { font-size: 13px; font-weight: 500; }

        .nav-item.disabled { opacity: 0.5; cursor: not-allowed; }
        .nav-item.disabled:hover { opacity: 1; background: rgba(239, 68, 68, 0.1); color: var(--danger); }

        .disabled-inline {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 3px;
            padding: 2px 6px;
            background: transparent;
            color: transparent;
            font-size: 9px;
            font-weight: 600;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .disabled-inline .material-icons-round { font-size: 11px; }
        .nav-item.disabled:hover .disabled-inline { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

        .sidebar-footer {
            padding: 14px;
            border-top: 1px solid var(--glass-border);
        }

        .user-card {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: var(--card);
            backdrop-filter: blur(10px);
            border-radius: var(--radius);
            border: 1px solid var(--glass-border);
        }

        .user-avatar {
            width: 34px;
            height: 34px;
            background: linear-gradient(135deg, var(--success), #16a34a);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
        }

        .user-info { flex: 1; }
        .user-name { font-size: 13px; font-weight: 500; }
        .user-role { font-size: 11px; color: var(--text-secondary); }

        .logout-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            transition: color 0.15s;
        }

        .logout-btn:hover { color: var(--danger); }

        /* ===== 主區域 ===== */
        .main {
            flex: 1;
            margin-left: var(--sidebar-width);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* 頂部統計欄 */
        .stats-bar {
            height: 140px;
            background: rgba(12, 12, 14, 0.6);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--glass-border);
            padding: 14px 16px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            gap: 12px;
        }

        .stats-bar-header {
            display: flex;
            justify-content: flex-end;
            align-items: center;
        }

        .stats-bar-actions { display: flex; gap: 8px; align-items: center; }

        /* 雙圓計時器樣式 - 方案 C */
        .dual-timer {
            display: flex;
            align-items: center;
            gap: 8px;
            padding-right: 12px;
            border-right: 1px solid var(--glass-border);
            margin-right: 4px;
        }

        .timer-circle {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            cursor: default;
        }

        .timer-circle-inner {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--surface);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .timer-circle-inner .material-icons-round {
            font-size: 16px;
            transition: color 0.3s;
        }

        /* 主計時器（金色，倒數） */
        .timer-main {
            background: conic-gradient(#FFD666 100%, #333 100%);
        }
        .timer-main .material-icons-round { color: #FFD666; }
        .timer-main.warning { background: conic-gradient(#FF4D4F var(--progress), #333 var(--progress)); }
        .timer-main.warning .material-icons-round { color: #FF4D4F; }

        /* 延長按鈕（紅色，反向填充） */
        .timer-extend {
            background: conic-gradient(#FF6B6B 0%, #333 0%);
            cursor: pointer;
        }
        .timer-extend .material-icons-round { color: #666; }
        .timer-extend.ready {
            box-shadow: 0 0 12px rgba(255, 107, 107, 0.5);
        }
        .timer-extend.ready .material-icons-round { color: #FF6B6B; }
        .timer-extend.ready:hover { transform: scale(1.1); }
        .timer-extend.disabled { cursor: not-allowed; opacity: 0.7; }

        /* 中間資訊 */
        .dual-timer-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 70px;
        }
        .dual-timer-label {
            font-size: 9px;
            color: #777;
            letter-spacing: 0.3px;
        }
        .dual-timer-times {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .dual-timer-time {
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            font-size: 13px;
            font-weight: 600;
        }
        .dual-timer-time.countdown { color: #FFD666; }
        .dual-timer-time.countdown.warning { color: #FF4D4F; }
        .dual-timer-time.extend { color: #FF6B6B; }
        .dual-timer-separator {
            color: #555;
            font-size: 11px;
        }

        .btn {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 8px 14px;
            border-radius: var(--radius);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid var(--glass-border);
            background: var(--card);
            color: var(--text);
            transition: all 0.2s;
        }

        .btn:hover { background: var(--elevated); border-color: var(--accent-dim); }
        .btn .material-icons-round { font-size: 16px; }

        .btn-primary {
            background: linear-gradient(135deg, var(--success), #16a34a);
            border-color: var(--success);
            color: white;
            font-weight: 600;
            box-shadow: 0 0 20px rgba(82, 196, 26, 0.2);
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #16a34a, var(--success));
            box-shadow: 0 0 30px rgba(82, 196, 26, 0.4);
            transform: translateY(-1px);
        }

        /* ===== 日期選擇器按鈕 ===== */
        .date-picker-trigger {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius);
            color: var(--text);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .date-picker-trigger:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.15);
        }

        .date-picker-trigger .date-display {
            font-family: 'SF Mono', monospace;
            font-weight: 600;
            letter-spacing: 0.02em;
        }

        .date-picker-trigger .arrow {
            font-size: 16px;
            color: var(--text-muted);
        }

        /* ===== 日期選擇器 Modal ===== */
        .date-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3000;
        }

        .date-modal-overlay.show {
            display: flex;
            animation: modalFadeIn 0.2s ease;
        }

        @keyframes modalFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .date-modal-content {
            background: rgba(20, 20, 23, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-lg);
            padding: 24px;
            min-width: 320px;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            animation: modalSlideUp 0.25s ease;
        }

        @keyframes modalSlideUp {
            from { opacity: 0; transform: scale(0.95) translateY(10px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        .date-modal-content::before {
            content: '';
            position: absolute;
            top: 0;
            left: 20%;
            right: 20%;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
        }

        .date-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .date-panel-title {
            font-size: 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .date-panel-title::before {
            content: '';
            width: 3px;
            height: 16px;
            background: var(--accent);
            border-radius: 2px;
        }

        .date-panel-nav {
            display: flex;
            gap: 6px;
        }

        .date-panel-nav button {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(255, 255, 255, 0.03);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }

        .date-panel-nav button:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.15);
            color: var(--text);
        }

        .date-panel-nav button .material-icons-round {
            font-size: 18px;
        }

        .date-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 4px;
            text-align: center;
        }

        .date-grid .weekday-header {
            font-size: 11px;
            color: var(--text-muted);
            padding: 10px 0;
            font-weight: 500;
        }

        .date-grid .day-cell {
            padding: 10px;
            font-size: 13px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
            color: var(--text-secondary);
        }

        .date-grid .day-cell:hover {
            background: rgba(255, 255, 255, 0.08);
            color: var(--text);
        }

        .date-grid .day-cell.today {
            background: rgba(212, 175, 55, 0.15);
            color: var(--accent);
            font-weight: 600;
        }

        .date-grid .day-cell.selected {
            background: linear-gradient(135deg, var(--accent), #c49a48);
            color: #0a0a0c;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
        }

        .date-grid .day-cell.other-month {
            color: #3a3a3f;
        }

        .date-grid .day-cell.other-month:hover {
            background: rgba(255, 255, 255, 0.03);
            color: #555;
        }


        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            flex: 1;
        }

        .stat-card {
            background: var(--card);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius);
            padding: 10px 12px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            transition: all 0.2s;
        }

        .stat-card:hover { border-color: var(--accent-dim); box-shadow: 0 0 20px rgba(212, 175, 55, 0.1); }

        .stat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 6px;
        }

        .stat-label { font-size: 10px; color: var(--text-secondary); }
        .stat-value { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; font-family: 'SF Mono', 'Monaco', monospace; }
        .stat-change { font-size: 10px; color: var(--success); display: flex; align-items: center; gap: 1px; font-weight: 500; }
        .stat-change .material-icons-round { font-size: 11px; }

        /* 內容區域 */
        .content-wrapper {
            flex: 1;
            display: flex;
            flex-direction: row-reverse;
            gap: 0;
            overflow: hidden;
            min-height: 0;
        }

        /* 右側資訊面板 */
        .info-panel {
            width: 280px;
            background: rgba(12, 12, 14, 0.5);
            border-left: 1px solid var(--glass-border);
            padding: 16px;
            overflow-y: auto;
        }

        .summary-card {
            background: linear-gradient(135deg, var(--accent), #c49a48);
            border-radius: var(--radius-lg);
            padding: 18px;
            margin-bottom: 14px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 10px 40px rgba(212, 175, 55, 0.2);
        }

        .summary-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        }

        .summary-header { display: flex; justify-content: space-between; align-items: flex-start; }
        .summary-label { font-size: 11px; opacity: 0.85; color: #08080a; }
        .summary-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: #08080a; text-align: right; }

        .summary-sub {
            display: flex;
            gap: 20px;
            margin-top: 14px;
            padding-top: 14px;
            border-top: 1px solid rgba(0,0,0,0.1);
        }

        .summary-sub-item { flex: 1; }
        .summary-sub-label { font-size: 10px; opacity: 0.7; color: #08080a; }
        .summary-sub-value { font-size: 16px; font-weight: 600; color: #08080a; }

        .stats-list { display: flex; flex-direction: column; gap: 8px; }

        .stat-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            background: var(--card);
            border-radius: var(--radius);
            border: 1px solid var(--glass-border);
            transition: all 0.2s;
        }

        .stat-row:hover { border-color: var(--accent-dim); }
        .stat-row-left { display: flex; align-items: center; gap: 10px; }

        .stat-row-icon {
            width: 30px;
            height: 30px;
            background: var(--accent-glow);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent);
        }

        .stat-row-icon .material-icons-round { font-size: 15px; }
        .stat-row-label { font-size: 12px; color: var(--text-secondary); }
        .stat-row-value { font-size: 14px; font-weight: 600; }

        .history-section { margin-top: 24px; }
        .history-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }

        .history-item {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid var(--border-subtle);
            font-size: 12px;
        }

        .history-item:last-child { border-bottom: none; }
        .history-item-date { color: var(--text-secondary); }
        .history-item-amount { font-weight: 600; color: var(--success); }

        /* 左側表單區 */
        .form-area {
            flex: 1;
            padding: 20px;
            padding-bottom: 40px;
            overflow-y: auto;
            min-height: 0;
        }

        /* 表單區捲軸樣式 */
        .form-area::-webkit-scrollbar {
            width: 8px;
        }
        .form-area::-webkit-scrollbar-track {
            background: var(--bg);
            border-radius: 4px;
        }
        .form-area::-webkit-scrollbar-thumb {
            background: var(--accent-dim);
            border-radius: 4px;
        }
        .form-area::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px;
        }

        .form-card {
            background: var(--card);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: all 0.2s;
        }

        .form-card:hover { border-color: var(--accent-dim); }
        .form-card.full-width { grid-column: span 2; }

        .form-card-header {
            padding: 12px 16px;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--elevated);
        }

        .form-card-icon {
            width: 28px;
            height: 28px;
            background: var(--accent-glow);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent);
        }

        .form-card-icon .material-icons-round { font-size: 15px; }
        .form-card-title { font-size: 13px; font-weight: 600; }

        .form-card-body { padding: 14px 16px; }

        .input-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }

        .input-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

        .input-group { display: flex; flex-direction: column; gap: 6px; }
        .input-group.span-2 { grid-column: span 2; }
        .input-group.span-3 { grid-column: span 3; }

        .input-with-prefix {
            position: relative;
            display: flex;
            align-items: center;
        }

        .input-prefix {
            position: absolute;
            left: 12px;
            color: var(--accent-dim);
            font-size: 14px;
            font-weight: 600;
            font-family: 'SF Mono', 'Monaco', monospace;
            pointer-events: none;
            z-index: 1;
        }

        .input-with-prefix .input-field { padding-left: 28px; }

        .input-field.input-error {
            border-color: var(--danger) !important;
            animation: inputShake 0.4s ease;
        }

        @keyframes inputShake {
            0%, 100% { transform: translateX(0); }
            20% { transform: translateX(-4px); }
            40% { transform: translateX(4px); }
            60% { transform: translateX(-4px); }
            80% { transform: translateX(4px); }
        }

        .input-error-text {
            font-size: 10px;
            color: var(--danger);
            margin-top: 4px;
            display: none;
            align-items: center;
            gap: 4px;
        }

        .input-error-text .material-icons-round { font-size: 12px; }
        .input-group.has-error .input-error-text { display: flex; }

        .input-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            letter-spacing: 0.02em;
            padding: 2px 6px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 4px;
            display: inline-block;
        }

        .input-field {
            padding: 10px 12px;
            background: var(--input);
            border: 1px solid var(--glass-border);
            border-radius: 6px;
            color: var(--text);
            font-size: 15px;
            font-family: 'SF Mono', 'Monaco', monospace;
            font-weight: 600;
            letter-spacing: 0.02em;
            transition: all 0.2s;
            width: 100%;
            min-width: 0;
        }

        .input-field:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
            caret-color: var(--accent);
        }

        .input-field.calculated {
            background: var(--success-soft);
            border-color: transparent;
            color: var(--success);
            font-weight: 600;
            text-align: center;
        }

        .quick-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
        }

        .quick-tag {
            padding: 5px 10px;
            background: var(--elevated);
            border: 1px solid var(--border-subtle);
            border-radius: 20px;
            font-size: 11px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s;
        }

        .quick-tag:hover, .quick-tag.active {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }

        /* Modal 共用樣式 */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
        }

        .modal-overlay.show { display: flex; }

        .modal-content {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 32px;
            width: 90%;
            max-width: 450px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
            animation: modalSlideIn 0.25s ease;
        }

        @keyframes modalSlideIn {
            from { opacity: 0; transform: scale(0.95) translateY(-10px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        .modal-icon {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
        }

        .modal-icon.danger { background: rgba(239, 68, 68, 0.1); }
        .modal-icon.danger .material-icons-round { color: var(--danger); }
        .modal-icon.success { background: rgba(82, 196, 26, 0.1); }
        .modal-icon.success .material-icons-round { color: var(--success); }

        .modal-icon .material-icons-round { font-size: 28px; }

        /* 日期已結帳 Modal 樣式 */
        .date-exists-info {
            background: var(--surface);
            border-radius: 12px;
            padding: 16px;
            margin: 16px 0;
        }
        .exists-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .exists-row:last-child { border-bottom: none; }
        .exists-label {
            color: var(--text-secondary);
            font-size: 14px;
        }
        .exists-value {
            color: var(--text-primary);
            font-weight: 600;
        }
        .date-exists-hint {
            color: var(--text-secondary);
            font-size: 13px;
            text-align: center;
            margin-top: 8px;
        }

        .modal-title {
            font-size: 18px;
            font-weight: 600;
            text-align: center;
            margin-bottom: 8px;
        }

        .modal-text {
            color: var(--text-secondary);
            text-align: center;
            font-size: 14px;
            line-height: 1.6;
            margin-bottom: 20px;
        }

        /* 預覽卡片 */
        .preview-card {
            background: var(--bg);
            border-radius: var(--radius);
            padding: 16px;
            margin-bottom: 20px;
        }

        .preview-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid var(--border-subtle);
            font-size: 13px;
        }

        .preview-row:last-child { border-bottom: none; }
        .preview-label { color: var(--text-secondary); }
        .preview-value { font-weight: 600; }

        .modal-buttons { display: flex; gap: 12px; }

        .modal-btn {
            flex: 1;
            padding: 14px 20px;
            font-size: 14px;
            font-weight: 600;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .modal-btn .material-icons-round { font-size: 18px; }

        .modal-btn.cancel {
            background: var(--elevated);
            border: 1px solid var(--border);
            color: var(--text);
        }

        .modal-btn.cancel:hover { background: var(--card); border-color: var(--text-muted); }
        .modal-btn.confirm { background: var(--success); color: white; }
        .modal-btn.confirm:hover { filter: brightness(1.1); }
        .modal-btn.confirm-danger { background: var(--danger); color: white; }

        /* ===== 步驟二上傳區域樣式 ===== */
        .upload-excel-zone {
            border: 2px dashed #444;
            border-radius: 12px;
            padding: 30px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .upload-excel-zone:hover {
            border-color: #D4A574;
            background: rgba(212, 165, 116, 0.05);
        }
        .upload-excel-zone.has-file {
            border-color: #52C41A;
            background: rgba(82, 196, 26, 0.05);
        }

        /* ===== 步驟三：完成清單樣式 ===== */
        .step3-check-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .step3-check-item {
            display: flex;
            align-items: center;
            gap: 12px;
            background: #1E1E1E;
            padding: 12px 14px;
            border-radius: 10px;
        }
        .step3-check-item.pending {
            border: 1px solid #D4A574;
        }
        .step3-check-icon {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .step3-check-icon.done {
            background: #52C41A;
        }
        .step3-check-icon.pending {
            background: #D4A574;
        }
        .step3-check-icon .material-icons-round {
            font-size: 16px;
            color: #fff;
        }
        .step3-check-text {
            flex: 1;
            font-size: 13px;
            color: #E8E8E8;
        }
        .step3-check-status {
            font-size: 11px;
        }
        .step3-check-status.done {
            color: #52C41A;
        }
        .step3-check-status.pending {
            color: #D4A574;
        }

        /* ===== 提交按鈕 Loading 狀態 ===== */
        .modal-btn.confirm.loading {
            pointer-events: none;
            opacity: 0.9;
        }

        /* 脈衝光環動畫 */
        .pulse-ring {
            position: relative;
            width: 20px;
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .pulse-ring::before,
        .pulse-ring::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            border: 2px solid #fff;
            border-radius: 50%;
            animation: pulseRing 1.5s ease-out infinite;
        }
        .pulse-ring::after {
            animation-delay: 0.5s;
        }
        .pulse-ring .dot {
            width: 6px;
            height: 6px;
            background: #fff;
            border-radius: 50%;
            z-index: 1;
        }
        @keyframes pulseRing {
            0% { transform: scale(0.5); opacity: 1; }
            100% { transform: scale(1.8); opacity: 0; }
        }

        /* ===== Loading Spinner（趨勢分析按鈕用）===== */
        .loading-spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: btnSpin 0.8s linear infinite;
            margin-right: 8px;
            vertical-align: middle;
        }
        @keyframes btnSpin {
            to { transform: rotate(360deg); }
        }

        /* 趨勢分析提交按鈕 Loading 狀態 */
        #send-trend-btn.loading,
        .trend-submit-btn.loading {
            pointer-events: none;
            opacity: 0.85;
            cursor: not-allowed;
        }

        /* ===== 設定 Modal 樣式 ===== */
        .settings-modal-content {
            max-width: 420px;
            width: 90%;
            padding: 0;
        }

        .settings-modal-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
            background: var(--surface);
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        }

        .settings-modal-header > .material-icons-round {
            color: var(--accent);
            font-size: 24px;
        }

        .settings-modal-header h3 {
            flex: 1;
            font-size: 18px;
            font-weight: 600;
            color: var(--text);
        }

        .settings-close-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .settings-close-btn:hover {
            background: var(--elevated);
            color: var(--text);
        }

        .settings-modal-body {
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .settings-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .settings-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
        }

        .settings-label .material-icons-round {
            font-size: 18px;
            color: var(--accent);
        }

        .settings-input-wrapper {
            display: flex;
            align-items: center;
            background: var(--input);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow: hidden;
            transition: border-color 0.2s;
        }

        .settings-input-wrapper:focus-within {
            border-color: var(--accent);
        }

        .settings-input-prefix,
        .settings-input-suffix {
            padding: 0 12px;
            font-size: 14px;
            color: var(--text-muted);
            background: var(--surface);
        }

        .settings-input {
            flex: 1;
            background: transparent;
            border: none;
            padding: 12px;
            font-size: 16px;
            color: var(--text);
            outline: none;
        }

        .settings-input::placeholder {
            color: var(--text-dim);
        }

        .settings-select {
            width: 100%;
            background: var(--input);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 12px;
            font-size: 16px;
            color: var(--text);
            outline: none;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .settings-select:focus {
            border-color: var(--accent);
        }

        .settings-select option {
            background: var(--card);
            color: var(--text);
        }

        .settings-hint {
            font-size: 12px;
            color: var(--text-muted);
        }

        .settings-modal-footer {
            display: flex;
            gap: 12px;
            padding: 16px 24px;
            border-top: 1px solid var(--border);
            background: var(--surface);
            border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        }

        .settings-modal-footer .modal-btn {
            flex: 1;
        }

        /* ===== 頁面切換 ===== */
        .page-content {
            display: none;
            height: 100%;
        }

        .page-content.active {
            display: contents;  /* 讓子元素保持原本佈局 */
        }

        /* 報表頁面才需要自己滾動 */
        #page-report {
            overflow-y: auto;
            padding: 0;
        }

        /* 趨勢分析頁面也需要滾動 */
        #page-trend {
            overflow-y: auto;
            padding: 0;
            height: 100%;
            max-height: calc(100vh - 60px);
        }

        #page-report.active {
            display: block;
        }

        #page-trend.active {
            display: block;
        }

        /* ===== 營業報表頁面樣式 ===== */
        .report-container {
            padding: 24px;
            max-width: 800px;
            margin: 0 auto;
        }

        .report-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .report-title {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 24px;
            font-weight: 600;
            color: var(--text);
        }

        .report-title .material-icons-round {
            color: var(--accent);
            font-size: 28px;
        }

        /* 目標達成卡片 */
        .goal-card {
            background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(45, 45, 68, 0.9) 100%);
            border-radius: var(--radius-xl);
            padding: 24px;
            border: 1px solid var(--border);
        }

        .goal-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 24px;
        }

        .goal-info .goal-label {
            font-size: 14px;
            color: var(--text-muted);
            margin-bottom: 4px;
        }

        .goal-info .goal-value {
            font-size: 32px;
            font-weight: 700;
            color: var(--accent);
        }

        .goal-status {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
        }

        .goal-status.ahead {
            background: rgba(82, 196, 26, 0.15);
            color: var(--success);
        }

        .goal-status.behind {
            background: rgba(255, 77, 79, 0.15);
            color: var(--danger);
        }

        .goal-status .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: currentColor;
        }

        /* 進度條 */
        .goal-progress-container {
            margin-bottom: 24px;
        }

        .goal-progress-labels {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 8px;
        }

        .goal-progress-labels strong {
            color: var(--text);
        }

        .goal-progress-bar {
            position: relative;
            height: 10px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 5px;
            overflow: visible;
        }

        .goal-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--accent), #ffa940);
            border-radius: 5px;
            transition: width 0.5s ease;
        }

        .goal-progress-marker {
            position: absolute;
            top: -3px;
            width: 3px;
            height: 16px;
            background: var(--danger);
            border-radius: 2px;
            transition: left 0.5s ease;
        }

        /* 統計卡片 */
        .goal-stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 24px;
        }

        .goal-stat-card {
            background: rgba(30, 30, 35, 0.8);
            border-radius: var(--radius);
            padding: 16px;
            text-align: center;
        }

        .goal-stat-label {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 8px;
        }

        .goal-stat-value {
            font-size: 20px;
            font-weight: 700;
            color: var(--text);
        }

        .goal-stat-value.blue {
            color: #7EBCE6;
        }

        .goal-stat-value.red {
            color: var(--danger);
        }

        .goal-stat-value.green {
            color: var(--success);
        }

        /* 輔助資訊 */
        .goal-footer {
            display: flex;
            justify-content: center;
            gap: 32px;
            padding-top: 16px;
            border-top: 1px solid var(--border);
        }

        .goal-footer-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: var(--text-muted);
        }

        .goal-footer-item .material-icons-round {
            font-size: 16px;
        }

        .goal-footer-item strong {
            color: var(--text);
        }

        /* 報表動作按鈕 */
        .report-actions {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin-top: 24px;
        }

        @media (max-width: 768px) {
            .report-container {
                padding: 16px;
            }

            .goal-info .goal-value {
                font-size: 24px;
            }

            .goal-stats-grid {
                grid-template-columns: 1fr;
            }

            .goal-footer {
                flex-direction: column;
                gap: 12px;
                align-items: center;
            }
        }

        /* ===== 趨勢分析頁面樣式 ===== */
        .trend-container {
            padding: 24px;
            max-width: 800px;
            margin: 0 auto;
        }

        .trend-header {
            margin-bottom: 24px;
        }

        .trend-title {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 22px;
            font-weight: 600;
            color: var(--text);
        }

        .trend-title .material-icons-round {
            color: var(--accent);
            font-size: 28px;
        }

        /* 上傳卡片 */
        .upload-card {
            background: var(--card);
            border-radius: var(--radius-xl);
            border: 1px solid var(--border);
            overflow: hidden;
        }

        .upload-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 16px 20px;
            background: var(--elevated);
            border-bottom: 1px solid var(--border);
            font-weight: 600;
            color: var(--text);
        }

        .upload-card-header .material-icons-round {
            color: var(--accent);
        }

        .upload-area {
            padding: 48px 24px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px dashed transparent;
            margin: 20px;
            border-radius: var(--radius-lg);
            background: var(--surface);
        }

        .upload-area:hover {
            border-color: var(--accent);
            background: var(--accent-soft);
        }

        .upload-area.dragover {
            border-color: var(--success);
            background: var(--success-soft);
        }

        .upload-icon {
            margin-bottom: 16px;
        }

        .upload-icon .material-icons-round {
            font-size: 56px;
            color: var(--accent);
            opacity: 0.8;
        }

        .upload-text {
            font-size: 16px;
            color: var(--text);
            margin-bottom: 8px;
        }

        .upload-hint {
            font-size: 13px;
            color: var(--text-muted);
        }

        /* 預覽卡片 */
        .preview-card {
            background: #1F1F1F;
            border-radius: var(--radius-xl);
            border: 1px solid #333333;
            margin-top: 20px;
            overflow: hidden;
        }

        .preview-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 16px 20px;
            background: #1F1F1F;
            border-bottom: 1px solid #333333;
            font-weight: 600;
            color: #FAFAFA;
        }

        .preview-card-header .material-icons-round {
            color: #D4A574;
        }

        .preview-date {
            margin-left: auto;
            font-size: 13px;
            color: #888888;
            font-weight: 500;
        }

        /* 預覽內容捲軸容器 */
        .preview-scroll-container {
            max-height: 500px;
            overflow-y: auto;
            background: #141414;
        }

        .preview-scroll-container::-webkit-scrollbar {
            width: 6px;
        }

        .preview-scroll-container::-webkit-scrollbar-track {
            background: #1F1F1F;
        }

        .preview-scroll-container::-webkit-scrollbar-thumb {
            background: #444444;
            border-radius: 3px;
        }

        .preview-scroll-container::-webkit-scrollbar-thumb:hover {
            background: #555555;
        }

        /* Hero 區塊 */
        .trend-hero {
            text-align: center;
            padding: 20px;
            background: #141414;
        }

        .trend-hero-date {
            font-size: 12px;
            color: #888888;
            font-weight: 600;
            letter-spacing: 1px;
        }

        .trend-hero-label {
            font-size: 10px;
            color: #D4A574;
            letter-spacing: 2px;
            text-transform: uppercase;
            margin-top: 4px;
        }

        .trend-hero-value {
            font-size: 36px;
            font-weight: 700;
            color: #FAFAFA;
            margin-top: 4px;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        /* 統計摘要卡片 - 方案 C 極簡分隔 */
        .trend-stats-card {
            background: #1F1F1F;
            border-radius: 12px;
            padding: 14px 16px;
            margin: 0 20px 20px;
        }

        .trend-stats-grid {
            display: flex;
            margin-bottom: 12px;
        }

        .trend-stat-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .trend-stat-item:first-child {
            border-right: 1px solid #2A2A2A;
        }

        .trend-stat-label {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            font-size: 10px;
            color: #666666;
            margin-bottom: 4px;
        }

        .trend-stat-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
        }

        .trend-stat-dot.gold { background: #D4A574; }
        .trend-stat-dot.blue { background: #7EBCE6; }

        .trend-stat-value {
            font-size: 18px;
            font-weight: 700;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        .trend-stat-value.gold { color: #D4A574; }
        .trend-stat-value.blue { color: #7EBCE6; }

        /* 合併進度條 - 方案 C */
        .trend-progress-wrap {
            position: relative;
        }

        .trend-progress-labels {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
        }

        .trend-progress-labels span {
            font-size: 10px;
            font-weight: 600;
        }

        .trend-progress-labels span.gold { color: #D4A574; }
        .trend-progress-labels span.blue { color: #7EBCE6; }

        .trend-merged-bar {
            display: flex;
            height: 6px;
            background: #333333;
            border-radius: 3px;
            overflow: hidden;
        }

        .trend-merged-bar .seg {
            height: 100%;
        }

        .trend-merged-bar .seg.gold { background: #D4A574; }
        .trend-merged-bar .seg.blue { background: #7EBCE6; }

        /* Section 標題 - 奢華黑金版 */
        .section-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 0 20px;
            margin-bottom: 12px;
        }

        .section-title-box {
            background: #1F1F1F;
            border: 1px solid #D4A574;
            color: #D4A574;
            font-size: 11px;
            font-weight: 600;
            padding: 5px 14px;
            border-radius: 4px;
            letter-spacing: 2px;
        }

        .section-title-box.drink {
            border-color: #7EBCE6;
            color: #7EBCE6;
            background: rgba(26, 42, 61, 0.5);
        }

        .section-line {
            flex: 1;
            height: 1px;
            background: #333333;
        }

        /* 排行榜 - 奢華黑金版 */
        .trend-ranking {
            padding: 0 20px 20px;
        }

        .ranking-title {
            display: none;
        }

        .ranking-list {
            display: flex;
            flex-direction: column;
            background: #1F1F1F;
            border-radius: 10px;
            border: 1px solid #333333;
            overflow: hidden;
        }

        .ranking-item {
            display: flex;
            flex-direction: column;
            padding: 14px 16px;
            background: #1F1F1F;
            border-bottom: 1px solid #333333;
            gap: 0;
        }

        .ranking-item:last-child {
            border-bottom: none;
        }

        .ranking-item-main {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .ranking-badge {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            flex-shrink: 0;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        /* 圓形徽章 + 邊框設計 */
        .ranking-badge.gold {
            background: rgba(212, 165, 116, 0.12);
            color: #D4A574;
            border: 1px solid #D4A574;
        }
        .ranking-badge.silver {
            background: rgba(192, 192, 192, 0.12);
            color: #C0C0C0;
            border: 1px solid #C0C0C0;
        }
        .ranking-badge.bronze {
            background: rgba(205, 127, 50, 0.12);
            color: #CD7F32;
            border: 1px solid #CD7F32;
        }
        .ranking-badge.normal {
            background: #141414;
            color: #888888;
            border: 1px solid #333333;
        }

        .ranking-info {
            flex: 1;
            min-width: 0;
        }

        .ranking-name {
            font-size: 14px;
            font-weight: 600;
            color: #E8E8E8;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .ranking-qty {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 4px;
        }

        .ranking-qty-dot {
            display: none; /* 隱藏 dot，與 LINE 卡片一致 */
        }

        .ranking-qty-text {
            font-size: 12px;
            color: #888888;
        }

        .ranking-stats {
            display: none;
        }

        .ranking-revenue {
            text-align: right;
            flex-shrink: 0;
        }

        .ranking-revenue-value {
            font-size: 16px;
            font-weight: 700;
            color: #D4A574;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        .ranking-revenue-percent {
            font-size: 12px;
            color: #888888;
            margin-top: 2px;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        /* 進度條（靠左對齊，與 LINE 卡片一致）*/
        .ranking-bar {
            height: 4px;
            background: #333333;
            border-radius: 2px;
            margin-top: 12px;
            overflow: hidden;
        }

        .ranking-bar-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        .ranking-bar-fill.gold { background: #D4A574; }
        .ranking-bar-fill.silver { background: #C0C0C0; }
        .ranking-bar-fill.bronze { background: #CD7F32; }
        .ranking-bar-fill.normal { background: #555555; }

        /* 飲品銷售區塊 */
        .drinks-section {
            padding: 0 20px 20px;
        }

        .drinks-list {
            display: flex;
            flex-direction: column;
            background: #1F1F1F;
            border-radius: 10px;
            border: 1px solid #333333;
            overflow: hidden;
        }

        .drink-item {
            display: flex;
            flex-direction: column;
            padding: 14px 16px;
            border-bottom: 1px solid #333333;
        }

        .drink-item:last-child {
            border-bottom: none;
        }

        .drink-item-main {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .drink-badge {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #1A2A3D;
            color: #7EBCE6;
            font-size: 12px;
            font-weight: 700;
            flex-shrink: 0;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        .drink-info {
            flex: 1;
            min-width: 0;
        }

        .drink-name {
            font-size: 14px;
            color: #E8E8E8;
        }

        .drink-qty {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 4px;
        }

        .drink-qty-dot {
            display: none; /* 隱藏 dot，與 LINE 卡片一致 */
        }

        .drink-qty-text {
            font-size: 12px;
            color: #888888;
        }

        .drink-revenue {
            text-align: right;
            flex-shrink: 0;
        }

        .drink-revenue-value {
            font-size: 15px;
            font-weight: 600;
            color: #7EBCE6;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        .drink-revenue-percent {
            font-size: 12px;
            color: #888888;
            margin-top: 2px;
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        .drink-bar {
            height: 4px;
            background: #333333;
            border-radius: 2px;
            margin-top: 12px;
            overflow: hidden;
        }

        .drink-bar-fill {
            height: 100%;
            border-radius: 2px;
            background: #5BA3D9;
            transition: width 0.3s ease;
        }

        /* 動作按鈕 */
        .trend-actions {
            display: flex;
            justify-content: center;
            gap: 12px;
            padding: 20px;
            border-top: 1px solid var(--border);
        }

        .trend-footer-actions {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin-top: 24px;
        }

        .btn-secondary {
            background: var(--elevated);
            color: var(--text);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            background: var(--surface);
            border-color: var(--text-muted);
        }

        .btn-accent {
            background: linear-gradient(135deg, #D4A574 0%, #B8956A 100%);
            color: #000;
            font-weight: 600;
        }

        .btn-accent:hover {
            background: linear-gradient(135deg, #E0B585 0%, #C9A67B 100%);
            transform: translateY(-1px);
        }

        .btn-accent:disabled {
            background: #555;
            color: #888;
            cursor: not-allowed;
            transform: none;
        }

        @media (max-width: 768px) {
            .trend-container {
                padding: 16px;
            }

            .trend-stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .upload-area {
                padding: 32px 16px;
            }
        }

        /* Toast */
        .toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            padding: 14px 24px;
            border-radius: var(--radius);
            font-size: 14px;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .toast.show { opacity: 1; }
        .toast.success { background: var(--success); color: white; }
        .toast.error { background: var(--danger); color: white; }

        /* 輸入框底部錯誤提示 - 方案 C 簡潔文字 */
        .input-error-text {
            margin-top: 6px;
            padding-left: 2px;
            color: var(--danger);
            font-size: 12px;
            display: none;
            animation: fadeInError 0.2s ease;
        }
        .input-error-text.show { display: block; }
        .input-field.has-error { border-color: var(--danger); }
        @keyframes fadeInError {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* RWD - 響應式設計 */
        @media (max-width: 1400px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (max-width: 1200px) { .info-panel { display: none; } }
        @media (max-width: 1024px) {
            .form-grid { grid-template-columns: 1fr; }
            .form-card.full-width { grid-column: span 1; }
            .input-grid-3 { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 900px) {
            /* 置頂區域調整 */
            .stats-bar { padding: 10px 12px; gap: 10px; }
            .stats-bar-header { flex-wrap: wrap; justify-content: center; gap: 8px; }
            .stats-bar-actions { flex-wrap: wrap; justify-content: center; gap: 8px; }
            /* 計時器縮小 */
            .dual-timer { padding-right: 8px; margin-right: 0; }
            .timer-circle { width: 36px; height: 36px; }
            .timer-circle-inner { width: 28px; height: 28px; }
            .dual-timer-info { min-width: 60px; }
            .dual-timer-time { font-size: 12px; }
        }
        @media (max-width: 768px) {
            .sidebar { display: none; }
            .main { margin-left: 0; }
            .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
            .stat-card { padding: 12px; }
            .stat-value { font-size: 20px; }
            .input-grid, .input-grid-3 { grid-template-columns: 1fr; }
            .input-group.span-2, .input-group.span-3 { grid-column: span 1; }
            /* 表單區域 */
            .form-area { padding: 12px; }
            .form-card-body { padding: 12px; }
        }
        @media (max-width: 600px) {
            /* 置頂區域垂直排列 */
            .stats-bar-actions {
                flex-direction: column;
                align-items: stretch;
                width: 100%;
            }
            .dual-timer {
                justify-content: center;
                border-right: none;
                padding-right: 0;
                border-bottom: 1px solid var(--glass-border);
                padding-bottom: 8px;
            }
            .date-picker-trigger { justify-content: center; }
            .btn.btn-primary { width: 100%; justify-content: center; }
            /* 統計卡片 */
            .stats-grid { grid-template-columns: 1fr; }
            /* 表單卡片標題 */
            .form-card-header { padding: 10px 12px; }
            .form-card-title { font-size: 12px; }
        }
        @media (max-width: 480px) {
            /* 極小螢幕 */
            .stats-bar { padding: 8px; }
            .dual-timer-label { font-size: 8px; }
            .dual-timer-time { font-size: 11px; }
            .timer-circle { width: 32px; height: 32px; }
            .timer-circle-inner { width: 26px; height: 26px; }
            .timer-circle-inner .material-icons-round { font-size: 14px; }
            .date-picker-trigger { font-size: 12px; padding: 8px 12px; }
            .btn.btn-primary { font-size: 13px; padding: 10px 16px; }
            /* 輸入框 */
            .input-field { padding: 8px 10px; font-size: 14px; }
            .input-label { font-size: 10px; }
        }

        /* ===== 歷史查詢頁面樣式 ===== */
        .history-page-container {
            padding: 24px;
            /* 全螢幕設計，移除 max-width 限制 */
        }

        .history-page-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
        }

        .history-page-title {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .history-page-title h1 {
            font-size: 24px;
            font-weight: 600;
            color: var(--text);
        }

        .history-page-title .material-icons-round {
            font-size: 28px;
            color: var(--accent);
        }

        /* 篩選區 */
        .history-filter-section {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .history-filter-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .history-filter-label {
            font-size: 13px;
            color: var(--text-secondary);
        }

        .history-filter-select {
            padding: 10px 16px;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            color: var(--text);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            min-width: 120px;
            text-align: center;
            text-align-last: center;
        }

        .history-filter-select:hover {
            border-color: var(--accent-dim);
        }

        .history-filter-select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-soft);
        }

        .history-filter-btn {
            padding: 10px 20px;
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
            border: none;
            border-radius: var(--radius);
            color: #000;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .history-filter-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 16px var(--accent-soft);
        }

        .history-filter-btn .material-icons-round {
            font-size: 16px;
        }

        .history-reset-btn {
            padding: 10px 16px;
            background: transparent;
            border: 2px solid var(--accent);
            border-radius: var(--radius);
            color: var(--accent);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            font-size: 14px;
            font-weight: 500;
        }

        .history-reset-btn:hover:not(:disabled) {
            background: var(--accent-soft);
            box-shadow: 0 2px 8px var(--accent-soft);
        }

        .history-reset-btn:disabled {
            border-color: var(--border);
            color: var(--text-muted);
            opacity: 0.5;
            cursor: not-allowed;
        }

        .history-reset-btn .material-icons-round {
            font-size: 18px;
        }

        /* 統計摘要 */
        .history-summary-bar {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .history-summary-card {
            padding: 20px;
            background: var(--card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            text-align: center;
        }

        .history-summary-card .label {
            font-size: 12px;
            color: var(--text-dim);
            margin-bottom: 8px;
        }

        .history-summary-card .value {
            font-size: 24px;
            font-weight: 700;
            color: var(--text);
        }

        .history-summary-card .value.accent {
            color: var(--accent);
        }

        /* 表格 */
        .history-table-wrapper {
            background: var(--card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            max-height: calc(100vh - 380px); /* 扣除頭部和統計區域 */
            min-height: 300px;
        }

        .history-table-scroll {
            overflow-y: auto;
            overflow-x: auto;
            flex: 1;
        }

        /* 自訂滾動條樣式 */
        .history-table-scroll::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        .history-table-scroll::-webkit-scrollbar-track {
            background: var(--bg-subtle);
            border-radius: 4px;
        }

        .history-table-scroll::-webkit-scrollbar-thumb {
            background: var(--accent-dim);
            border-radius: 4px;
        }

        .history-table-scroll::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }

        .history-table {
            width: 100%;
            border-collapse: collapse;
        }

        .history-table thead {
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .history-table th {
            padding: 16px 12px;
            text-align: center;
            font-size: 12px;
            font-weight: 600;
            color: var(--accent);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 2px solid var(--accent-dim);
            white-space: nowrap;
            /* 不透明背景 - 防止滾動穿透 */
            background: #1a1a1a;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        /* 序號欄位樣式 */
        .history-table th.row-number,
        .history-table td.row-number {
            width: 50px;
            min-width: 50px;
            text-align: center;
            color: var(--text-dim);
            font-size: 12px;
            font-weight: 500;
        }

        .history-table td.row-number {
            font-family: 'SF Mono', Monaco, monospace;
            color: var(--accent-dim);
        }

        .history-table th.sortable {
            cursor: pointer;
            user-select: none;
            transition: background 0.2s ease;
        }

        .history-table th.sortable:hover {
            background: rgba(212, 175, 55, 0.1);
        }

        .history-table th .sort-icon {
            font-size: 14px;
            vertical-align: middle;
            margin-left: 4px;
            opacity: 0.7;
            transition: transform 0.2s ease;
        }

        .history-table th.sortable.asc .sort-icon {
            transform: rotate(180deg);
        }

        .history-table td {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-subtle);
            font-size: 14px;
            color: var(--text);
            text-align: center;
        }

        /* 結帳人欄位靠左對齊 */
        .history-table td.cashier-cell {
            text-align: left;
        }

        .history-table tbody tr {
            transition: all 0.2s ease;
        }

        .history-table tbody tr:hover {
            background: var(--accent-soft);
        }

        .history-table tbody tr:last-child td {
            border-bottom: none;
        }

        .history-table .amount {
            font-weight: 600;
            color: var(--accent);
            font-family: 'SF Mono', Monaco, monospace;
        }

        .history-table .cash {
            font-weight: 600;
            color: var(--success);
            font-family: 'SF Mono', Monaco, monospace;
        }

        .history-table .history-empty {
            padding: 60px 20px;
            color: var(--text-dim);
            font-size: 14px;
        }

        .history-view-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 6px 12px;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .history-view-btn:hover {
            background: var(--accent-soft);
            border-color: var(--accent-dim);
            color: var(--accent);
        }

        .history-view-btn .material-icons-round {
            font-size: 14px;
        }

        /* 載入中 */
        .history-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 60px 20px;
            color: var(--accent);
            font-size: 14px;
        }

        .history-loading .spinning {
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* ===== 詳細資訊 Modal ===== */
        .history-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(8px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .history-modal-overlay.active {
            display: flex;
        }

        .history-modal {
            width: 100%;
            max-width: 800px;
            max-height: 90vh;
            background: var(--surface);
            border-radius: var(--radius-xl);
            border: 1px solid var(--border);
            box-shadow:
                0 25px 50px rgba(0, 0, 0, 0.5),
                0 0 100px var(--accent-glow);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .history-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px;
            background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, transparent 100%);
            border-bottom: 1px solid var(--border);
        }

        .history-modal-title {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .history-modal-title h2 {
            font-size: 18px;
            font-weight: 600;
            color: var(--text);
        }

        .history-modal-title .date-badge {
            padding: 6px 12px;
            background: var(--accent-soft);
            border-radius: var(--radius);
            font-size: 13px;
            font-weight: 600;
            color: var(--accent);
        }

        .history-modal-close {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: 50%;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .history-modal-close:hover {
            background: rgba(255, 77, 79, 0.1);
            border-color: var(--danger);
            color: var(--danger);
        }

        .history-modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }

        /* 詳細資訊分組 */
        .history-detail-section {
            margin-bottom: 24px;
        }

        .history-detail-section:last-child {
            margin-bottom: 0;
        }

        .history-detail-section-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 600;
            color: var(--accent);
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border);
        }

        .history-detail-section-title .material-icons-round {
            font-size: 18px;
        }

        .history-detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 12px;
        }

        .history-detail-item {
            padding: 14px 16px;
            background: var(--card);
            border-radius: var(--radius);
            border: 1px solid var(--border);
        }

        .history-detail-item .label {
            font-size: 11px;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 6px;
        }

        .history-detail-item .value {
            font-size: 16px;
            font-weight: 600;
            color: var(--text);
        }

        .history-detail-item .value.accent {
            color: var(--accent);
        }

        .history-detail-item .value.success {
            color: var(--success);
        }

        .history-detail-item.highlight {
            background: var(--accent-soft);
            border-color: var(--accent-dim);
        }

        .history-detail-item.highlight .value {
            color: var(--accent);
            font-size: 20px;
        }

        /* 備註區 */
        .history-detail-note {
            padding: 16px;
            background: var(--card);
            border-radius: var(--radius);
            border: 1px solid var(--border);
            border-left: 3px solid var(--accent);
        }

        .history-detail-note .label {
            font-size: 11px;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .history-detail-note .value {
            font-size: 14px;
            color: var(--text);
            line-height: 1.6;
        }

        /* Modal 底部操作區 */
        .history-modal-footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding: 16px 24px;
            background: var(--card);
            border-top: 1px solid var(--border);
        }

        .history-modal-footer .btn-secondary {
            padding: 10px 20px;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            color: var(--text-secondary);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .history-modal-footer .btn-secondary:hover {
            background: var(--elevated);
            color: var(--text);
        }

        /* 歷史查詢頁面 RWD */
        @media (max-width: 768px) {
            .history-page-container {
                padding: 16px;
            }

            .history-page-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 16px;
            }

            .history-filter-section {
                flex-direction: column;
                align-items: stretch;
            }

            .history-filter-group {
                width: 100%;
            }

            .history-filter-select {
                flex: 1;
            }

            .history-filter-btn {
                width: 100%;
                justify-content: center;
            }

            .history-summary-bar {
                grid-template-columns: repeat(2, 1fr);
            }

            .history-table-wrapper {
                overflow-x: auto;
            }

            .history-table {
                min-width: 700px;
            }

            .history-modal {
                max-height: 95vh;
            }

            .history-modal-body {
                padding: 16px;
            }

            .history-detail-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .history-modal-footer {
                flex-direction: column;
                gap: 12px;
            }
        }
