        /* ========== CSS变量系统 ========== */
        :root {
            /* 主导色 - 70% */
            --bg-primary: #0f0f23;
            --bg-secondary: #1a1a3e;
            --bg-tertiary: #0d1b2a;
            --text-primary: #fafafa;
            --text-secondary: #a1a1a1;
            --text-muted: #6b7280;
            
            /* 功能色 - 20% */
            --success: #10b981;
            --success-light: rgba(16, 185, 129, 0.15);
            --warning: #f59e0b;
            --warning-light: rgba(245, 158, 11, 0.15);
            --danger: #ef4444;
            --danger-light: rgba(239, 68, 68, 0.15);
            --info: #3b82f6;
            --info-light: rgba(59, 130, 246, 0.15);
            
            /* 强调色 - 10% */
            --accent: #ff6b35;
            --accent-hover: #ff8555;
            --accent-light: rgba(255, 107, 53, 0.15);
            
            /* 品牌渐变 */
            --brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
            
            /* 间距系统 */
            --spacing-xs: 4px;
            --spacing-sm: 8px;
            --spacing-md: 16px;
            --spacing-lg: 24px;
            --spacing-xl: 32px;
            
            /* 圆角 */
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 16px;
            --radius-xl: 20px;
            
            /* 阴影 */
            --shadow-sm: 0 2px 8px rgba(0,0,0,0.15);
            --shadow-md: 0 4px 15px rgba(0,0,0,0.2);
            --shadow-lg: 0 8px 40px rgba(0,0,0,0.3);
            
            /* 过渡 */
            --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Plus Jakarta Sans', -apple-system, 'PingFang SC', sans-serif; background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%); min-height: 100vh; color: var(--text-primary); }
        #app { min-height: 100vh; }
        [v-cloak] { display: none; }

        /* 管理端登录：黑曜石与香槟金的工业商务视觉 */
        .admin-auth-loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 17px; background: #090c11; color: rgba(235,230,218,.58); }
        .admin-auth-loading img { width: 58px; height: 58px; padding: 7px; object-fit: contain; border: 1px solid rgba(210,187,142,.3); border-radius: 10px; background: #f3f0e9; box-shadow: 0 22px 60px rgba(0,0,0,.42); }
        .admin-auth-loading p { margin: 0; font-size: 11px; letter-spacing: .16em; }
        .admin-auth-spinner { width: 24px; height: 24px; border: 1px solid rgba(210,187,142,.18); border-top-color: #cfb986; border-radius: 50%; animation: admin-spin .85s linear infinite; }
        @keyframes admin-spin { to { transform: rotate(360deg); } }
        .admin-login-screen { position: relative; isolation: isolate; min-height: 100vh; overflow: hidden; background: #080b0f; color: #f2eee5; }
        .admin-login-screen::before { content: ''; position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at 74% 43%, rgba(196,164,105,.09), transparent 24%), radial-gradient(circle at 15% 18%, rgba(63,86,111,.13), transparent 28%), linear-gradient(115deg, #0b0f15 0%, #07090c 62%, #0d1014 100%); }
        .admin-login-screen::after { content: ''; position: absolute; z-index: -1; inset: 0; opacity: .32; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 74px 74px; mask-image: linear-gradient(90deg, #000, transparent 68%); }
        .admin-login-atmosphere { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
        .admin-login-atmosphere span { position: absolute; display: block; border: 1px solid rgba(214,193,151,.09); transform: rotate(45deg); }
        .admin-login-atmosphere span:nth-child(1) { top: -330px; right: 8%; width: 720px; height: 720px; }
        .admin-login-atmosphere span:nth-child(2) { right: -220px; bottom: -380px; width: 680px; height: 680px; border-color: rgba(214,193,151,.06); }
        .admin-login-atmosphere span:nth-child(3) { left: 46%; top: 22%; width: 1px; height: 56%; border: 0; background: linear-gradient(transparent, rgba(214,193,151,.14), transparent); transform: none; }
        .admin-login-frame { width: min(1540px, 100%); min-height: 100vh; margin: 0 auto; padding: 38px clamp(30px, 5vw, 82px) 28px; display: flex; flex-direction: column; }
        .admin-login-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
        .admin-login-brand { display: flex; align-items: center; gap: 14px; }
        .admin-brand-mark { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid rgba(221,207,179,.28); border-radius: 9px; background: #ece8df; box-shadow: inset 0 0 0 4px rgba(11,14,18,.05), 0 15px 40px rgba(0,0,0,.28); }
        .admin-brand-mark img { width: 40px; height: 40px; object-fit: contain; }
        .admin-login-brand > div strong, .admin-login-brand > div span { display: block; }
        .admin-login-brand strong { color: #f0ece3; font-size: 16px; font-weight: 650; letter-spacing: .08em; }
        .admin-login-brand div > span { margin-top: 5px; color: rgba(226,218,201,.38); font-size: 9px; font-weight: 700; letter-spacing: .2em; }
        .admin-login-status { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 999px; background: rgba(255,255,255,.025); color: rgba(236,231,218,.5); font-size: 10px; letter-spacing: .08em; }
        .admin-login-status i { width: 6px; height: 6px; border-radius: 50%; background: #62ae86; box-shadow: 0 0 0 4px rgba(98,174,134,.09); }
        .admin-login-content { flex: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(410px, .88fr); align-items: center; gap: clamp(56px, 8vw, 138px); padding: 54px 0 46px; }
        .admin-login-hero { align-self: center; max-width: 760px; }
        .admin-login-index { display: flex; align-items: center; gap: 15px; margin-bottom: 38px; color: #bba879; font-size: 10px; font-weight: 750; letter-spacing: .2em; }
        .admin-login-index::before { content: ''; width: 42px; height: 1px; background: #bba879; }
        .admin-login-hero h1 { margin: 0; color: #f1eee7; font-size: clamp(54px, 5.35vw, 82px); font-weight: 360; line-height: 1.18; letter-spacing: -.055em; }
        .admin-login-hero h1 em { color: #cdb98a; font-style: normal; font-weight: 420; }
        .admin-login-hero > p { max-width: 590px; margin: 30px 0 0; color: rgba(229,223,211,.48); font-size: 15px; line-height: 2; letter-spacing: .025em; }
        .admin-login-capabilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 680px; margin-top: clamp(62px, 9vh, 108px); border-top: 1px solid rgba(255,255,255,.08); }
        .admin-login-capabilities div { position: relative; padding: 22px 22px 0 0; }
        .admin-login-capabilities div + div { padding-left: 24px; border-left: 1px solid rgba(255,255,255,.07); }
        .admin-login-capabilities strong, .admin-login-capabilities span { display: block; }
        .admin-login-capabilities strong { color: rgba(205,185,138,.62); font-size: 9px; letter-spacing: .16em; }
        .admin-login-capabilities span { margin-top: 9px; color: rgba(239,235,225,.62); font-size: 12px; }
        .admin-login-panel { display: flex; align-items: center; justify-content: flex-end; padding: 0; }
        .admin-login-card { position: relative; width: min(460px, 100%); padding: 46px 44px 40px; overflow: hidden; border: 1px solid rgba(232,221,198,.14); border-radius: 18px; background: linear-gradient(145deg, rgba(29,32,37,.9), rgba(15,18,22,.82)); box-shadow: 0 38px 100px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.04); backdrop-filter: blur(28px); }
        .admin-login-card::before { content: ''; position: absolute; top: 0; left: 44px; right: 44px; height: 1px; background: linear-gradient(90deg, transparent, rgba(214,193,151,.75), transparent); }
        .admin-login-card-top { min-height: 38px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
        .admin-login-eyebrow { display: block; padding-top: 6px; color: rgba(205,185,138,.58); font-size: 8px; font-weight: 800; letter-spacing: .2em; }
        .admin-login-seal { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(205,185,138,.27); border-radius: 50%; color: #cdb98a; font-family: Georgia, serif; font-size: 11px; letter-spacing: .08em; }
        .admin-login-card h2 { margin: 20px 0 0; color: #f2eee6; font-size: 30px; font-weight: 520; letter-spacing: -.035em; }
        .admin-login-card > p { margin: 11px 0 34px; color: rgba(230,224,212,.38); font-size: 12px; line-height: 1.7; }
        .admin-login-card > label, .admin-login-label-row label { display: block; color: rgba(237,231,218,.62); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
        .admin-login-card > label { margin: 0 0 9px; }
        .admin-login-label-row { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 9px; }
        .admin-login-field { display: flex; align-items: center; min-height: 54px; padding: 0 16px; border: 1px solid rgba(235,226,207,.11); border-radius: 9px; background: rgba(4,6,9,.42); transition: border-color .2s, background .2s, box-shadow .2s; }
        .admin-login-field:focus-within { border-color: rgba(205,185,138,.68); background: rgba(9,10,13,.72); box-shadow: 0 0 0 3px rgba(205,185,138,.08); }
        .admin-login-field input { min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; color: #f0ece3; font-size: 14px; letter-spacing: .02em; }
        .admin-login-field input::placeholder { color: rgba(222,215,201,.2); }
        .admin-password-toggle { padding: 0; border: 0; background: transparent; color: rgba(205,185,138,.68); font-size: 10px; font-weight: 600; letter-spacing: .03em; }
        .admin-password-toggle:hover { color: #d6c59c; }
        .admin-login-error { margin-top: 16px; padding: 11px 13px; border: 1px solid rgba(218,103,112,.3); border-radius: 8px; background: rgba(127,35,45,.13); color: #e5a0a6; font-size: 12px; line-height: 1.55; }
        .admin-login-submit { width: 100%; min-height: 54px; margin-top: 26px; padding: 0 19px; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgba(246,235,211,.18); border-radius: 9px; background: linear-gradient(105deg, #d8c59a, #bda36c); color: #121416; font-size: 13px; font-weight: 750; letter-spacing: .06em; box-shadow: 0 15px 34px rgba(0,0,0,.22); transition: transform .2s, filter .2s, box-shadow .2s; }
        .admin-login-submit b { font-size: 16px; font-weight: 400; }
        .admin-login-submit:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 19px 40px rgba(0,0,0,.3); }
        .admin-login-submit:disabled { cursor: not-allowed; opacity: .58; }
        .admin-login-note { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; color: rgba(226,219,205,.28); font-size: 9px; letter-spacing: .07em; }
        .admin-login-note i { width: 2px; height: 2px; border-radius: 50%; background: rgba(205,185,138,.45); }
        .admin-login-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.055); color: rgba(225,218,203,.25); font-size: 9px; letter-spacing: .09em; }
        .admin-app-shell { min-height: 100vh; }
        .admin-session-summary { display: flex; align-items: center; gap: 9px; margin-left: auto; padding-left: 12px; }
        .admin-session-summary span { max-width: 110px; overflow: hidden; color: rgba(255,255,255,.62); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
        .admin-session-summary button { padding: 7px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.78); font-size: 12px; }
        .admin-session-summary button:hover { background: rgba(255,255,255,.12); color: #fff; }

        @media (max-width: 1080px) {
            .admin-login-frame { padding-inline: 34px; }
            .admin-login-content { grid-template-columns: minmax(0, 1fr) minmax(390px, .9fr); gap: 48px; }
            .admin-login-hero h1 { font-size: 52px; }
            .admin-login-capabilities { margin-top: 58px; }
            .admin-session-summary { display: none; }
        }
        @media (max-width: 820px) {
            .admin-login-frame { padding: 26px 22px 22px; }
            .admin-login-content { display: block; padding: 48px 0 34px; }
            .admin-login-hero { max-width: none; }
            .admin-login-index { margin-bottom: 22px; }
            .admin-login-hero h1 { font-size: clamp(40px, 9.5vw, 58px); }
            .admin-login-hero > p { max-width: 560px; margin-top: 20px; font-size: 13px; line-height: 1.8; }
            .admin-login-capabilities { margin-top: 38px; }
            .admin-login-panel { justify-content: stretch; margin-top: 48px; }
            .admin-login-card { width: 100%; }
        }
        @media (max-width: 560px) {
            .admin-login-frame { padding: 22px 16px 18px; }
            .admin-login-brand strong { font-size: 14px; }
            .admin-login-brand div > span { font-size: 8px; letter-spacing: .13em; }
            .admin-brand-mark { width: 44px; height: 44px; }
            .admin-brand-mark img { width: 35px; height: 35px; }
            .admin-login-status { display: none; }
            .admin-login-content { padding-top: 42px; }
            .admin-login-index { font-size: 8px; letter-spacing: .14em; }
            .admin-login-hero h1 { font-size: 39px; line-height: 1.23; }
            .admin-login-capabilities { grid-template-columns: 1fr; margin-top: 32px; }
            .admin-login-capabilities div { padding: 13px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
            .admin-login-capabilities div + div { padding-left: 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.06); }
            .admin-login-capabilities span { margin-top: 0; }
            .admin-login-panel { margin-top: 34px; }
            .admin-login-card { padding: 34px 22px 30px; border-radius: 14px; }
            .admin-login-card::before { left: 22px; right: 22px; }
            .admin-login-card h2 { font-size: 26px; }
            .admin-login-footer { display: block; line-height: 1.8; }
            .admin-login-footer span { display: block; }
        }
        
        /* 数字和代码用 JetBrains Mono */
        .stat-value, .material-code, .number, .money, [style*="text-align:right"] { font-family: 'JetBrains Mono', monospace; }

        /* 导航栏 */
        .navbar { background: rgba(15,15,35,0.8); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255,255,255,0.08); padding: 0 30px; height: 64px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 30px rgba(0,0,0,0.3); }
        .logo { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
        .logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 4px 15px rgba(102,126,234,0.4); }
        .nav-menu { display: flex; gap: 6px; }
        .nav-item { padding: 10px 18px; border-radius: 8px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-size: 14px; color: rgba(255,255,255,0.6); font-weight: 500; }
        .nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; transform: translateY(-1px); }
        .nav-item.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; box-shadow: 0 4px 15px rgba(102,126,234,0.3); }

        /* 主容器 */
        .main-container { max-width: 1400px; margin: 0 auto; padding: 30px 24px; }

        /* 卡片 */
        .card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 28px; margin-bottom: 24px; backdrop-filter: blur(10px); transition: all 0.3s; }
        .card:hover { border-color: rgba(255,255,255,0.12); box-shadow: 0 8px 40px rgba(0,0,0,0.2); }
        .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
        .card-title { font-size: 20px; font-weight: 700; background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

        /* 按钮 */
        .btn { padding: 12px 24px; border-radius: 10px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.3px; }
        .btn:hover { transform: translateY(-2px); }
        .btn:active { transform: translateY(0); }
        .btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; box-shadow: 0 4px 15px rgba(102,126,234,0.4); }
        .btn-primary:hover { box-shadow: 0 6px 25px rgba(102,126,234,0.5); }
        .btn-secondary { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
        .btn-secondary:hover { background: rgba(255,255,255,0.15); }
        .btn-success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); color: #fff; box-shadow: 0 4px 15px rgba(56,239,125,0.3); }
        .btn-warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: #fff; box-shadow: 0 4px 15px rgba(245,87,108,0.3); }
        .btn-info { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: #fff; box-shadow: 0 4px 15px rgba(79,172,254,0.3); }
        .btn-danger { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%); color: #fff; box-shadow: 0 4px 15px rgba(238,90,90,0.3); }
        .btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 8px; }

        /* 表单 */
        .form-group { margin-bottom: 18px; }
        .form-label { display: block; font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px; font-weight: 500; }
        .form-input, .form-select { width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: #fff; font-size: 14px; transition: all 0.3s; }
        .form-input:focus, .form-select:focus { outline: none; border-color: #667eea; background: rgba(102,126,234,0.1); box-shadow: 0 0 0 3px rgba(102,126,234,0.25), 0 4px 12px rgba(102,126,234,0.15); }
        .form-input::placeholder { color: rgba(255,255,255,0.3); }
        .form-select option { background: #1a1a3e; color: #fff; }
        .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }

        /* 表格 */
        .table { width: 100%; border-collapse: collapse; }
        .table th { background: rgba(102,126,234,0.15); padding: 16px 12px; text-align: left; font-weight: 600; font-size: 13px; color: rgba(255,255,255,0.9); border-bottom: 1px solid rgba(255,255,255,0.1); }
        .table td { padding: 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); transition: all 0.2s ease; }
        .table tbody tr { transition: all 0.2s; }
        .table tbody tr:hover { background: rgba(102,126,234,0.08); }
        .table tbody tr:hover td { color: #fff; }
        
        /* 统计卡片 */
        .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
        .stat-card { background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 20px; position: relative; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; }
        .stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
        .stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #667eea, #764ba2); }
        .stat-label { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
        .stat-value { font-size: 28px; font-weight: 800; color: #fff; }

        /* 模态框 */
        .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); display: flex; align-items: flex-start; justify-content: center; z-index: 2000; backdrop-filter: blur(8px); padding: 50px 20px 30px; overflow-y: auto; }
        .modal { background: linear-gradient(180deg, #1a1a3e 0%, #0f0f23 100%); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 0; width: 90%; max-width: 600px; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,0.5); }
        .modal-lg { max-width: 950px; }
        .modal-xl { max-width: 1150px; }
        .modal-body { padding: 20px; }
        .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
        .modal-title { font-size: 18px; font-weight: 700; }
        .modal-close { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; transition: all 0.3s; }
        .modal-close:hover { background: rgba(245,87,108,0.3); transform: rotate(90deg); }
        .material-group-container { max-height: 500px; overflow-y: auto; padding-right: 8px; }
        .material-group-container::-webkit-scrollbar { width: 6px; }
        .material-group-container::-webkit-scrollbar-thumb { background: rgba(102,126,234,0.3); border-radius: 3px; }
        .material-group-container::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
        .material-group { margin-bottom: 18px; }
        .material-group-title { font-size: 14px; font-weight: 700; color: #4facfe; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 8px; }
        .material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
        .material-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 12px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
        .material-card:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
        .material-card.selected { border-color: #667eea; background: rgba(102,126,234,0.15); box-shadow: 0 0 0 2px rgba(102,126,234,0.3); }
        .material-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
        .material-code { font-size: 13px; font-weight: 700; color: #4facfe; font-family: monospace; }
        .material-weight { font-size: 10px; color: rgba(255,255,255,0.4); }
        .material-name { font-size: 11px; color: rgba(255,255,255,0.7); margin-bottom: 3px; }
        .material-info { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 8px; }
        .pack-badge { background: rgba(79,172,254,0.3); color: #4facfe; padding: 3px 8px; border-radius: 6px; cursor: pointer; font-weight: 500; }
        .pack-badge:hover { background: rgba(79,172,254,0.5); }
        .pack-count { font-size: 11px; color: #f093fb; min-width: 40px; text-align: center; font-weight: 600; }
        .pack-btn { flex: 1; height: 24px; border: none; border-radius: 6px; background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; font-size: 10px; transition: all 0.2s; }
        .pack-btn:hover { background: rgba(255,255,255,0.2); }
        .pack-btn.primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
        .material-price { font-size: 11px; color: #38ef7d; margin-bottom: 8px; font-weight: 500; }
        .material-actions { display: flex; gap: 6px; align-items: center; }
        .material-actions input { width: 70px; padding: 6px 8px; text-align: center; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; color: #fff; font-size: 13px; }
        .material-actions input:focus { outline: none; border-color: #667eea; }
        .qty-btn { width: 44px; height: 44px; border: none; border-radius: 8px; background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; font-size: 14px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
        .qty-btn:hover { background: rgba(255,255,255,0.2); }
        .qty-btn.primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); box-shadow: 0 2px 10px rgba(102,126,234,0.3); }
        .material-item { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 14px; }
        .material-item.selected { border-color: #667eea; background: rgba(102,126,234,0.15); }
        .material-qty { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
        .material-qty input { width: 100px; padding: 8px 12px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; color: #fff; text-align: center; font-size: 14px; }
        .settlement-print { background: #fff; color: #333; padding: 30px; border-radius: 12px; }
        .settlement-print h2 { text-align: center; margin-bottom: 24px; font-size: 22px; color: #1a1a2e; }
        .settlement-print .info-row { display: flex; margin: 8px 0; font-size: 14px; }
        .settlement-print .info-label { width: 90px; color: #666; font-weight: 500; }
        .settlement-print table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 13px; }
        .settlement-print th, .settlement-print td { border: 1px solid #ddd; padding: 10px; text-align: left; }
        .settlement-print th { background: #f8f9fa; font-weight: 600; }
        .settlement-print .total-row { font-weight: bold; background: #f8f9fa; }
        .settlement-summary { margin-top: 24px; padding: 20px; background: rgba(255,255,255,0.05); border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
        .settlement-summary .row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
        .settlement-summary .row:last-child { border-bottom: none; font-weight: 700; font-size: 16px; color: #4facfe; }
        .toast { position: fixed; top: 80px; right: 24px; background: var(--success-gradient); padding: 14px 24px; border-radius: 12px; z-index: 3000; animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 8px 30px rgba(56,239,125,0.4); font-weight: 500; }
        .toast.error { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%); box-shadow: 0 8px 30px rgba(238,90,90,0.4); }
        @keyframes toastIn { from { transform: translateX(100%) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
        
        /* ========== 焦点状态 (Accessibility) ========== */
        .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
        .nav-item:focus-visible { background: rgba(255,255,255,0.15); box-shadow: 0 0 0 3px var(--accent-light); }
        .form-input:focus-visible, .form-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
        .material-card:focus-visible, .stat-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
        .modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
        
        /* ========== 状态设计 ========== */
        /* Loading Skeleton */
        .skeleton { animation: skeleton-pulse 1.5s ease-in-out infinite; }
        .skeleton-card { background: rgba(255,255,255,0.05); border-radius: var(--radius-lg); height: 120px; margin-bottom: var(--spacing-md); }
        .skeleton-row { background: rgba(255,255,255,0.05); border-radius: var(--radius-sm); height: 40px; margin-bottom: var(--spacing-sm); }
        @keyframes skeleton-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 0.3; } }
        
        /* Empty State */
        .empty-state { text-align: center; padding: var(--spacing-xl); color: var(--text-secondary); }
        .empty-icon { font-size: 48px; margin-bottom: var(--spacing-md); opacity: 0.5; }
        .empty-text { font-size: 16px; margin-bottom: var(--spacing-lg); }
        
        /* Error State */
        .error-state { text-align: center; padding: var(--spacing-xl); background: var(--danger-light); border: 1px solid var(--danger); border-radius: var(--radius-lg); }
        .error-icon { font-size: 48px; margin-bottom: var(--spacing-md); }
        .error-text { color: var(--danger); font-size: 14px; margin-bottom: var(--spacing-md); }
        
        /* Loading State */
        .loading-spinner { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        
        /* ========== 数字动画 ========== */
        .stat-value {
            animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
            animation-delay: calc(var(--index, 0) * 0.15s);
            opacity: 0;
        }
        @keyframes fadeInUp {
            from { transform: translateY(30px); opacity: 0; }
            50% { opacity: 0.5; }
            to { transform: translateY(0); opacity: 1; }
        }
        
        /* 数字递增动画样式 */
        .count-up {
            display: inline-block;
            transition: transform 0.3s;
        }
        .count-up.pulse {
            animation: pulseOnce 0.3s ease-out;
        }
        @keyframes pulseOnce {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); color: var(--accent); }
            100% { transform: scale(1); }
        }
        
        /* ========== 柱状图增强 ========== */
        .chart-bar { 
            width: 100%;
            min-width: 20px;
            background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
            border-radius: 4px 4px 0 0;
            transition: all var(--transition-fast);
            cursor: pointer;
            position: relative;
        }
        .chart-bar:hover {
            filter: brightness(1.2);
            box-shadow: 0 0 20px rgba(102,126,234,0.4);
        }
        .chart-bar-tooltip {
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.9);
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            white-space: nowrap;
            opacity: 0;
            transition: opacity var(--transition-fast);
            pointer-events: none;
        }
        .chart-bar:hover .chart-bar-tooltip { opacity: 1; }
        
        /* 移动端适配 - 第一次优化 */
        @media (max-width: 768px) {
            /* 导航栏优化 */
            .navbar { padding: 0 12px; height: 54px; }
            .logo { font-size: 14px; }
            .logo-icon { width: 30px; height: 30px; font-size: 14px; }
            .nav-menu { display: none; }
            .logo img { height: 24px !important; }
            
            /* 移动端汉堡菜单 */
            .mobile-menu-btn { display: flex !important; flex-direction: column; gap: 4px; cursor: pointer; padding: 8px; }
            .mobile-menu-btn span { width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }
            
            /* 移动端菜单面板 */
            .mobile-menu { position: fixed; top: 54px; left: 0; right: 0; background: rgba(15,15,35,0.98); backdrop-filter: blur(20px); padding: 8px; z-index: 999; border-bottom: 1px solid rgba(255,255,255,0.1); max-height: calc(100vh - 54px); overflow-y: auto; }
            .mobile-menu .nav-item { padding: 10px 14px; font-size: 14px; border-radius: 8px; margin-bottom: 4px; }
            
            /* 主容器优化 */
            .main-container { padding: 12px 10px; }
            
            /* 卡片优化 */
            .card { padding: 14px 10px; margin-bottom: 12px; border-radius: 12px; }
            .card-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
            .card-title { font-size: 15px; }
            
            /* 按钮优化 - 增大触摸区域 */
            .btn { padding: 10px 16px; font-size: 14px; border-radius: 8px; min-height: 44px; }
            .btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
            
            /* 统计卡片优化 */
            .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
            .stat-card { padding: 10px; border-radius: 10px; }
            .stat-value { font-size: 20px; }
            .stat-label { font-size: 10px; }
            
            /* 表格优化 - 横向滚动 */
            .table { font-size: 11px; min-width: 600px; }
            .table th, .table td { padding: 8px 6px; }
            .card:has(.table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
            
            /* 模态框优化 */
            .modal-overlay { padding: 10px !important; align-items: flex-start !important; }
            .modal { width: 96%; max-height: 90vh; border-radius: 16px; }
            .modal-lg, .modal-xl { max-width: 96%; max-height: 90vh; }
            .modal-title { font-size: 15px; }
            .modal-header { padding: 14px 16px; }
            .modal-body { padding: 14px; }
            
            /* 表单优化 - 增大输入框 */
            .form-row { grid-template-columns: 1fr; gap: 10px; }
            .form-input, .form-select { padding: 12px 14px; font-size: 16px; border-radius: 8px; min-height: 48px; }
            .form-label { font-size: 13px; margin-bottom: 4px; }
            
            /* Toast优化 */
            .toast { left: 10px; right: 10px; top: auto; bottom: 70px; text-align: center; font-size: 13px; padding: 10px 16px; border-radius: 10px; }
            
            /* 材料选择卡片优化 - 改为单列 */
            .material-grid { grid-template-columns: 1fr; gap: 10px; }
            .material-card { padding: 12px; border-radius: 12px; }
            .material-code { font-size: 14px; }
            .material-name { font-size: 12px; }
            .material-actions input { width: 60px; font-size: 16px; padding: 8px 10px; min-height: 44px; }
            .qty-btn { width: 48px; height: 48px; font-size: 16px; }
            
            /* 项目卡片优化 */
            .project-card { padding: 10px; margin-bottom: 10px; }
            
            /* 租赁/归还卡片优化 */
            [style*="border-left:3px solid"] { padding: 6px 8px !important; }
            [style*="border-left:3px solid"] strong { font-size: 12px !important; }
            [style*="border-left:3px solid"] span { font-size: 10px !important; }
            
            /* 数据卡片优化 - 4列改2列 */
            [style*="display:grid;grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
            [style*="display:grid;grid-template-columns:repeat(4"] > div { padding: 8px !important; }
            [style*="font-size:24px"] { font-size: 18px !important; }
            [style*="font-size:28px"] { font-size: 22px !important; }
            
            /* 价格表卡片 */
            [style*="grid-template-columns:repeat(auto-fill,minmax(300px"] { grid-template-columns: 1fr !important; }
            
            /* 筛选下拉框 */
            [style*="position:absolute"][style*="z-index:100"] { position: fixed !important; left: 10px !important; right: 10px !important; top: auto !important; bottom: 10px !important; max-width: none !important; z-index: 3000 !important; }
            
            /* 表格滚动提示 */
            .card:has(.table)::after { content: '← 左右滑动查看更多 →'; display: block; text-align: center; font-size: 10px; color: rgba(255,255,255,0.4); padding: 6px 0; }
            
            /* 卡片头部筛选区域 */
            [style*="display:flex;gap:12px;align-items:center"] { flex-wrap: wrap !important; }
        }
        
        /* 超小屏幕优化（<375px） */
        @media (max-width: 374px) {
            .logo span { display: none; }
            .stats-grid { grid-template-columns: 1fr; }
            .stat-value { font-size: 18px; }
            .btn { padding: 6px 12px; font-size: 12px; }
            .modal-title { font-size: 14px; }
            [style*="grid-template-columns:repeat(auto-fill,minmax(150px"] { grid-template-columns: repeat(2, 1fr) !important; }
            [style*="font-size:18px"] { font-size: 14px !important; }
        }
        
        /* 隐藏移动端菜单按钮（PC端） */
        @media (min-width: 769px) {
            .mobile-menu-btn { display: none !important; }
            .mobile-menu { display: none !important; }
        }
        
        /* 移动端菜单面板样式 */
        .mobile-menu { position: fixed; top: 54px; left: 0; right: 0; background: rgba(15,15,35,0.98); backdrop-filter: blur(20px); padding: 10px; z-index: 999; border-bottom: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
        
        /* 触摸优化 */
        @media (hover: none) and (pointer: coarse) {
            .btn { min-height: 44px; }
            .nav-item { min-height: 44px; display: flex; align-items: center; }
            .form-input, .form-select { min-height: 48px; font-size: 16px; }
            .material-card { min-height: 60px; }
            .qty-btn { min-width: 44px; min-height: 44px; }
            input[type="number"] { min-height: 44px; font-size: 16px; }
        }
        
        .upload-area { border: 2px dashed rgba(102,126,234,0.4); border-radius: 12px; padding: 40px; text-align: center; margin: 20px 0; cursor: pointer; transition: all 0.3s; background: rgba(102,126,234,0.05); }
        .upload-area:hover { border-color: #667eea; background: rgba(102,126,234,0.1); transform: scale(1.01); }
        .upload-area input { display: none; }
        .import-result { margin-top: 20px; padding: 20px; background: rgba(255,255,255,0.05); border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
        .import-result .error { color: #f5576c; font-size: 12px; margin-top: 6px; padding: 4px 0; }
        .import-result .success { color: #38ef7d; font-size: 13px; margin-top: 6px; padding: 4px 0; }
        .btn-group { display: flex; gap: 10px; flex-wrap: wrap; }


        /* ========== v3.2 专业业务后台视觉系统 ========== */
        :root {
            --surface-page: #f4f7fb;
            --surface-card: #ffffff;
            --surface-soft: #f8fafc;
            --border-ui: #dce4ef;
            --text-strong: #172033;
            --text-body: #334155;
            --text-soft: #64748b;
            --brand: #4f46e5;
            --brand-hover: #4338ca;
            --sidebar: #111827;
            --sidebar-soft: #1f2937;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
            background: var(--surface-page);
            color: var(--text-body);
        }
        .stat-value, .material-code, .number, .money, [style*="text-align:right"] {
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
            font-variant-numeric: tabular-nums;
        }

        .navbar {
            position: fixed;
            inset: 0 auto 0 0;
            width: 252px;
            height: 100vh;
            padding: 22px 14px;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            gap: 18px;
            background: var(--sidebar);
            border-right: 1px solid rgba(255,255,255,.08);
            border-bottom: 0;
            box-shadow: 8px 0 30px rgba(15,23,42,.12);
            z-index: 1000;
        }
        .logo { min-height: 48px; padding: 0 8px 16px; border-bottom: 1px solid rgba(255,255,255,.09); color: #fff; font-size: 15px; line-height: 1.35; letter-spacing: 0; }
        .logo img { width: 38px; height: 38px !important; object-fit: contain; margin-right: 0 !important; border-radius: 9px; }
        .nav-menu { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding-right: 2px; }
        .nav-group-label { margin: 14px 10px 5px; color: #8290a7; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
        .nav-group-label:first-child { margin-top: 0; }
        .nav-item {
            width: 100%; min-height: 42px; padding: 9px 12px; display: flex; align-items: center; gap: 11px;
            border: 1px solid transparent; background: transparent; color: #c7d0df; border-radius: 9px;
            font: inherit; font-size: 14px; font-weight: 500; text-align: left; box-shadow: none;
        }
        .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; transform: none; }
        .nav-item.active { background: #4f46e5; color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,.28); }
        .nav-item.nav-stock { background: rgba(16,185,129,.12); color: #6ee7b7; border-color: rgba(16,185,129,.18); }
        .nav-icon { width: 22px; display: inline-flex; justify-content: center; font-size: 17px; line-height: 1; }
        .mobile-menu-btn { display: none !important; border: 0; background: transparent; }

        .main-container { max-width: none; margin: 0 0 0 252px; padding: 30px 34px 44px; }
        .page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 0 0 22px; }
        .page-heading h1 { margin: 3px 0 5px; color: var(--text-strong); font-size: 28px; line-height: 1.25; letter-spacing: -.02em; }
        .page-heading p { color: var(--text-soft); font-size: 14px; }
        .page-eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
        .quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

        .card { background: var(--surface-card); border: 1px solid var(--border-ui); border-radius: 14px; box-shadow: 0 3px 14px rgba(15,23,42,.055); backdrop-filter: none; }
        .card:hover { border-color: #cbd5e1; box-shadow: 0 8px 26px rgba(15,23,42,.075); }
        .card-title { color: var(--text-strong); background: none; -webkit-background-clip: initial; -webkit-text-fill-color: currentColor; }
        .stat-card { background: #fff; border: 1px solid var(--border-ui); box-shadow: 0 3px 12px rgba(15,23,42,.05); }
        .stat-card::before { background: var(--brand); }
        .stat-card:hover { box-shadow: 0 8px 22px rgba(15,23,42,.08); }
        .stat-label { color: var(--text-soft); }
        .stat-value { color: var(--text-strong); }

        .btn { border: 1px solid transparent; box-shadow: none; letter-spacing: 0; }
        .btn:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(15,23,42,.12); }
        .btn-primary { background: var(--brand); color: #fff; box-shadow: none; }
        .btn-primary:hover { background: var(--brand-hover); box-shadow: 0 5px 14px rgba(79,70,229,.22); }
        .btn-secondary { background: #fff; color: #475569; border-color: #cbd5e1; }
        .btn-secondary:hover { background: #f8fafc; }
        .btn-success { background: #059669; color: #fff; box-shadow: none; }
        .btn-warning { background: #d97706; color: #fff; box-shadow: none; }
        .btn-info { background: #0284c7; color: #fff; box-shadow: none; }
        .btn-danger { background: #dc2626; color: #fff; box-shadow: none; }
        .btn-sm { min-height: 32px; padding: 6px 11px; font-size: 12px; }

        .form-label { color: #475569; font-weight: 600; }
        .form-input, .form-select { background: #fff; border-color: #cbd5e1; color: var(--text-strong); }
        .form-input::placeholder { color: #94a3b8; }
        .form-input:focus, .form-select:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.13); }
        .form-select option { background: #fff; color: var(--text-strong); }

        .card:has(.table) { overflow-x: auto; scrollbar-color: #cbd5e1 transparent; }
        .table { color: var(--text-body); font-size: 13px; }
        .table th { position: sticky; top: 0; z-index: 2; background: #f1f5f9; color: #475569; border-bottom-color: #dbe3ee; white-space: nowrap; }
        .table td { color: #334155; border-bottom-color: #e9eef5; vertical-align: middle; }
        .table tbody tr:hover { background: #f8fafc; }
        .table tbody tr:hover td { color: var(--text-strong); }
        .table td[style*="text-align:right"], .table th[style*="text-align:right"] { text-align: right !important; }
        .tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
        .tag-blue { background: #e0e7ff; color: #4338ca; }
        .tag-green { background: #d1fae5; color: #047857; }
        .tag-red { background: #fee2e2; color: #b91c1c; }
        .tag-gray { background: #e2e8f0; color: #475569; }

        .modal-overlay { background: rgba(15,23,42,.64); backdrop-filter: blur(4px); padding-top: 34px; }
        .modal { max-height: calc(100vh - 68px); overflow-y: auto; background: #fff; color: var(--text-body); border-color: #dbe3ee; border-radius: 16px; box-shadow: 0 28px 80px rgba(15,23,42,.28); }
        .modal-header { position: sticky; top: 0; z-index: 8; background: rgba(255,255,255,.97); color: var(--text-strong); border-bottom-color: #e2e8f0; }
        .modal-close { flex: 0 0 auto; border: 0; background: #eef2f7; color: #475569; font: inherit; font-size: 20px; }
        .modal-close:hover { background: #fee2e2; color: #b91c1c; }
        .modal-actions { position: sticky; bottom: 0; z-index: 7; margin-left: -1px; margin-right: -1px; padding: 14px 20px !important; background: rgba(255,255,255,.97); border-top: 1px solid #e2e8f0 !important; }
        .material-group-container { scrollbar-color: #cbd5e1 transparent; }
        .material-group-title { color: #0369a1; border-bottom-color: #e2e8f0; }
        .material-card, .material-item { background: #f8fafc; border-color: #dbe3ee; }
        .material-card:hover { background: #fff; box-shadow: 0 5px 16px rgba(15,23,42,.09); }
        .material-card.selected, .material-item.selected { background: #eef2ff; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(79,70,229,.12); }
        .material-name, .material-info, .material-weight { color: #64748b; }
        .material-actions input, .material-qty input { background: #fff; border-color: #cbd5e1; color: var(--text-strong); }
        .qty-btn, .pack-btn { background: #e2e8f0; color: #334155; }
        .qty-btn.primary, .pack-btn.primary { background: var(--brand); color: #fff; box-shadow: none; }
        .settlement-summary { background: #f8fafc; border-color: #dbe3ee; }
        .settlement-summary .row { border-bottom-color: #e2e8f0; }
        .upload-area { background: #eef2ff; border-color: #a5b4fc; color: #475569; }
        .import-result { background: #f8fafc; border-color: #dbe3ee; }
        .toast { color: #fff; }
        .empty-state { color: var(--text-soft); }
        .error-state { background: #fef2f2; }

        .main-container [style*="background:rgba(255,255,255,0.05)"],
        .main-container [style*="background: rgba(255,255,255,0.05)"] { background: #f8fafc !important; }
        .main-container [style*="background:rgba(255,255,255,0.03)"] { background: #fff !important; }
        .main-container [style*="border:1px solid rgba(255,255,255,0.1)"] { border-color: #dbe3ee !important; }
        .main-container [style*="color:rgba(255,255,255,0.6)"] { color: #64748b !important; }
        .main-container [style*="color:rgba(255,255,255,0.7)"] { color: #475569 !important; }

        @media (max-width: 1100px) {
            .navbar { position: sticky; inset: auto; top: 0; width: 100%; height: 58px; padding: 0 14px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
            .navbar .logo { min-height: auto; padding: 0; border: 0; font-size: 14px; }
            .navbar .logo img { width: 30px; height: 30px !important; }
            .nav-menu { display: none; }
            .mobile-menu-btn { width: 42px; height: 42px; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; border-radius: 9px; }
            .mobile-menu-btn span { width: 21px; height: 2px; background: #fff; border-radius: 2px; }
            .mobile-menu { display: block !important; top: 58px; max-height: calc(100vh - 58px); padding: 10px 12px 18px; background: #111827; overflow-y: auto; }
            .mobile-menu .nav-group-label { margin-top: 12px; }
            .mobile-menu .nav-item { color: #d5dbe6; }
            .main-container { margin-left: 0; padding: 22px 18px 34px; }
            .page-heading { align-items: flex-start; }
        }

        @media (max-width: 768px) {
            .main-container { padding: 16px 10px 28px; }
            .page-heading { flex-direction: column; gap: 14px; margin-bottom: 16px; }
            .page-heading h1 { font-size: 23px; }
            .quick-actions { width: 100%; justify-content: stretch; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
            .quick-actions .btn { justify-content: center; padding: 9px 7px; font-size: 12px; }
            .card { border-radius: 11px; }
            .card-header { flex-direction: row; align-items: center; }
            .table { min-width: 720px; font-size: 12px; }
            .table th, .table td { padding: 10px 8px; }
            .modal-overlay { padding: 8px !important; }
            .modal { width: 100%; max-height: calc(100vh - 16px); border-radius: 13px; }
            .modal-actions { flex-wrap: wrap; }
            .modal-actions .btn { flex: 1; justify-content: center; }
        }

        /* Light-theme overrides for legacy inline form and summary styles. */
        .main-container input[style*="color:#fff"],
        .main-container select[style*="color:#fff"],
        .main-container option[style*="color:#fff"] { color: var(--text-strong) !important; background: #fff !important; border-color: #cbd5e1 !important; }
        .main-container div[style*="color:#fff"],
        .main-container strong[style*="color:#fff"] { color: var(--text-strong) !important; }
        .modal-header[style*="gradient"] { color: #fff; }
        .modal-header[style*="gradient"] .modal-close { color: #fff !important; background: rgba(255,255,255,.16); }

        @media (max-width: 1100px) {
            [style*="grid-template-columns:repeat(5"],
            [style*="grid-template-columns:repeat(6"] { grid-template-columns: repeat(3, 1fr) !important; }
        }
        @media (max-width: 768px) {
            .btn { min-height: 42px; padding: 9px 14px; }
            .btn-sm { min-height: 36px; padding: 7px 11px; font-size: 12px; }
            [style*="grid-template-columns:repeat(5"],
            [style*="grid-template-columns:repeat(6"] { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
        }
        @media (max-width: 374px) {
            [style*="grid-template-columns:repeat(5"],
            [style*="grid-template-columns:repeat(6"] { grid-template-columns: 1fr !important; }
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
        }



        /* ========== v3.2.1 高对比度与弹窗一致性修复 ========== */
        :root {
            --text-strong: #111827;
            --text-body: #1f2937;
            --text-soft: #475569;
            --text-muted: #64748b;
            --surface-page: #eef2f7;
            --surface-card: #ffffff;
            --surface-soft: #f8fafc;
            --border-ui: #cbd5e1;
        }

        body, .main-container, .card, .modal, .project-detail-panel { color: var(--text-body); }
        .card, .modal, .project-detail-panel { background: #fff !important; border-color: #cbd5e1 !important; }
        .card-title, .modal-title, .page-heading h1 { color: #111827 !important; }
        .stat-label, .form-label, .empty-state, .modal p { color: #475569; }
        .form-input::placeholder { color: #64748b; opacity: 1; }

        /* Convert all legacy semi-transparent white text on light surfaces. */
        .main-container [style*="color:rgba(255,255,255"],
        .modal [style*="color:rgba(255,255,255"],
        .project-detail-panel [style*="color:rgba(255,255,255"] { color: #475569 !important; }
        .main-container div[style*="color:#fff"],
        .main-container span[style*="color:#fff"],
        .main-container strong[style*="color:#fff"],
        .modal div[style*="color:#fff"],
        .modal span[style*="color:#fff"],
        .modal strong[style*="color:#fff"],
        .project-detail-panel div[style*="color:#fff"],
        .project-detail-panel span[style*="color:#fff"],
        .project-detail-panel strong[style*="color:#fff"] { color: #111827 !important; }

        /* Legacy dark form fields now use a consistent accessible light treatment. */
        .main-container input:not([type="checkbox"]):not([type="radio"]),
        .main-container select,
        .main-container textarea,
        .modal input:not([type="checkbox"]):not([type="radio"]),
        .modal select,
        .modal textarea,
        .project-detail-panel input,
        .project-detail-panel select {
            background: #fff !important; color: #111827 !important; border-color: #94a3b8 !important;
        }
        .main-container input:focus, .main-container select:focus, .main-container textarea:focus,
        .modal input:focus, .modal select:focus, .modal textarea:focus {
            border-color: #4f46e5 !important; box-shadow: 0 0 0 3px rgba(79,70,229,.16) !important;
        }
        .main-container option, .modal option { background: #fff !important; color: #111827 !important; }

        /* Replace pale legacy accent text with readable semantic colors. */
        .main-container [style*="color:#38ef7d"], .modal [style*="color:#38ef7d"], .project-detail-panel [style*="color:#38ef7d"],
        .main-container [style*="color:#2ecc71"], .modal [style*="color:#2ecc71"], .project-detail-panel [style*="color:#2ecc71"] { color: #047857 !important; }
        .main-container [style*="color:#4facfe"], .modal [style*="color:#4facfe"], .project-detail-panel [style*="color:#4facfe"],
        .main-container [style*="color:#3498db"], .modal [style*="color:#3498db"], .project-detail-panel [style*="color:#3498db"] { color: #075985 !important; }
        .main-container [style*="color:#f39c12"], .modal [style*="color:#f39c12"], .project-detail-panel [style*="color:#f39c12"] { color: #92400e !important; }
        .main-container [style*="color:#f093fb"], .modal [style*="color:#f093fb"], .project-detail-panel [style*="color:#f093fb"],
        .main-container [style*="color:#9b59b6"], .modal [style*="color:#9b59b6"] { color: #7e22ce !important; }
        .main-container [style*="color:#f5576c"], .modal [style*="color:#f5576c"], .project-detail-panel [style*="color:#f5576c"],
        .main-container [style*="color:#e74c3c"], .modal [style*="color:#e74c3c"], .project-detail-panel [style*="color:#e74c3c"] { color: #b91c1c !important; }

        /* Legacy white-glass panels become visibly separated light panels. */
        .main-container [style*="background:rgba(255,255,255,0.02)"],
        .main-container [style*="background:rgba(255,255,255,0.03)"],
        .main-container [style*="background:rgba(255,255,255,0.05)"],
        .main-container [style*="background:rgba(255,255,255,0.1)"],
        .modal [style*="background:rgba(255,255,255,0.02)"],
        .modal [style*="background:rgba(255,255,255,0.03)"],
        .modal [style*="background:rgba(255,255,255,0.05)"],
        .modal [style*="background:rgba(255,255,255,0.1)"],
        .project-detail-panel [style*="background:rgba(255,255,255,0.05)"],
        .project-detail-panel [style*="background:rgba(255,255,255,0.1)"],
        .main-container [style*="linear-gradient(135deg, rgba(255,255,255,0.1)"] {
            background: #f8fafc !important; border-color: #cbd5e1 !important;
        }
        .modal [style*="background:#2a2a4a"],
        .project-detail-panel [style*="background:#2a2a4a"] { background: #fff !important; border-color: #cbd5e1 !important; }

        .modal [style*="border-bottom:1px solid rgba(255,255,255"],
        .modal [style*="border-top:1px solid rgba(255,255,255"],
        .project-detail-panel [style*="border-bottom:1px solid rgba(255,255,255"],
        .project-detail-panel [style*="border-top:1px solid rgba(255,255,255"] { border-color: #dbe3ee !important; }

        /* Standard and custom dialog headers. */
        .modal-header { background: #fff !important; color: #111827 !important; border-bottom: 1px solid #dbe3ee !important; }
        .modal-header[style*="gradient"], .project-detail-header {
            background: #3730a3 !important; color: #fff !important; border-bottom-color: #312e81 !important;
        }
        .modal-header[style*="gradient"] .modal-title,
        .project-detail-header h3 { color: #fff !important; }
        .modal-header[style*="gradient"] .modal-close,
        .project-detail-header [style*="color:#fff"] { color: #fff !important; background: rgba(255,255,255,.16) !important; }
        .modal-close { color: #334155 !important; background: #e2e8f0 !important; }
        .modal-close:hover { color: #991b1b !important; background: #fee2e2 !important; }

        .project-detail-overlay { background: rgba(15,23,42,.68) !important; }
        .project-detail-panel { box-shadow: 0 28px 80px rgba(15,23,42,.3) !important; }
        .project-detail-body { background: #fff; }
        .project-detail-body > div:first-child > div { background: #f8fafc !important; border: 1px solid #dbe3ee; }
        .project-detail-panel .table th { background: #eef2ff !important; }

        .modal-actions, .modal-actions-split, .stock-modal-footer {
            background: #f8fafc !important; color: #334155 !important; border-top: 1px solid #dbe3ee !important;
        }
        .modal-actions-split { position: sticky; bottom: 0; z-index: 7; }
        .stock-modal-footer [style*="color:rgba(255,255,255"] { color: #475569 !important; }
        .modal .btn[style*="color:#f5576c"] { background: #fee2e2 !important; color: #991b1b !important; border-color: #fecaca !important; }

        /* Purposefully colored KPI cards retain high-contrast white text. */
        .gradient-kpi { box-shadow: 0 8px 20px rgba(15,23,42,.14); }
        .gradient-kpi:nth-child(1) { background: #4338ca !important; }
        .gradient-kpi:nth-child(2) { background: #047857 !important; }
        .gradient-kpi:nth-child(3) { background: #0369a1 !important; }
        .gradient-kpi:nth-child(4) { background: #be123c !important; }
        .gradient-kpi:nth-child(5) { background: #b45309 !important; }
        .gradient-kpi *, .gradient-kpi .stat-value { color: #fff !important; }

        .table th { color: #334155 !important; background: #e9eef5; }
        .table td { color: #1f2937; }
        .table tfoot td { font-weight: 700; }
        .tag-blue { background: #e0e7ff; color: #3730a3; }
        .tag-green { background: #d1fae5; color: #065f46; }
        .tag-red { background: #fee2e2; color: #991b1b; }
        .tag-orange { background: #ffedd5; color: #9a3412; }
        .tag-gray { background: #e2e8f0; color: #334155; }
        .btn:disabled { opacity: .58; cursor: not-allowed; box-shadow: none; transform: none; }

        @media (max-width: 768px) {
            .stock-modal-footer, .modal-actions-split { flex-direction: column; align-items: stretch !important; gap: 10px; }
            .stock-modal-footer > div, .modal-actions-split > div { flex-wrap: wrap; }
        }



        /* ========== v3.2.2 单色业务界面：中性灰白 + 单一靛蓝 ========== */
        :root {
            --brand: #4338ca;
            --brand-hover: #3730a3;
            --text-strong: #0f172a;
            --text-body: #1e293b;
            --text-soft: #334155;
            --text-muted: #475569;
            --surface-page: #f1f5f9;
            --surface-card: #ffffff;
            --surface-soft: #f8fafc;
            --border-ui: #cbd5e1;
            --danger: #b91c1c;
        }

        body { background: #f1f5f9; color: #1e293b; }
        .main-container, .card, .modal, .project-detail-panel { color: #1e293b; }
        .card, .modal, .project-detail-panel { background: #fff !important; border: 1px solid #cbd5e1 !important; box-shadow: 0 2px 8px rgba(15,23,42,.06); }
        .card:hover { border-color: #94a3b8; box-shadow: 0 4px 12px rgba(15,23,42,.08); }
        .card-title, .modal-title, .page-heading h1 { color: #0f172a !important; }
        .page-eyebrow { color: #4338ca; }
        .stat-label, .form-label, .empty-state, .modal p { color: #334155 !important; }
        .form-input::placeholder { color: #475569 !important; }

        /* Navigation uses only neutral slate and the single brand color. */
        .navbar { background: #172033; }
        .nav-item { color: #d8dee9; }
        .nav-item.active { background: #4338ca; box-shadow: none; }
        .nav-item.nav-stock { background: rgba(255,255,255,.06); color: #d8dee9; border-color: rgba(255,255,255,.1); }
        .nav-item.nav-stock:hover { background: rgba(255,255,255,.1); color: #fff; }

        /* Normal actions are brand or neutral; red is reserved for destructive actions. */
        .btn-primary, .btn-success { background: #4338ca !important; color: #fff !important; border-color: #4338ca !important; }
        .btn-primary:hover, .btn-success:hover { background: #3730a3 !important; }
        .btn-info, .btn-warning { background: #475569 !important; color: #fff !important; border-color: #475569 !important; }
        .btn-info:hover, .btn-warning:hover { background: #334155 !important; }
        .btn-secondary { background: #fff !important; color: #1e293b !important; border-color: #94a3b8 !important; }
        .btn-secondary:hover { background: #f1f5f9 !important; }
        .btn-danger, .modal .btn[style*="color:#f5576c"] { background: #b91c1c !important; color: #fff !important; border-color: #b91c1c !important; }
        .btn-danger:hover { background: #991b1b !important; }
        .btn[style*="gradient"] { background: #475569 !important; color: #fff !important; border-color: #475569 !important; }

        /* All data text defaults to strong neutral; only negative/danger stays red. */
        .stat-card .stat-value, .settlement-summary .row:last-child { color: #0f172a !important; }
        .main-container [style*="color:#38ef7d"], .modal [style*="color:#38ef7d"], .project-detail-panel [style*="color:#38ef7d"],
        .main-container [style*="color:#2ecc71"], .modal [style*="color:#2ecc71"], .project-detail-panel [style*="color:#2ecc71"],
        .main-container [style*="color:#27ae60"], .modal [style*="color:#27ae60"], .project-detail-panel [style*="color:#27ae60"],
        .main-container [style*="color:#4facfe"], .modal [style*="color:#4facfe"], .project-detail-panel [style*="color:#4facfe"],
        .main-container [style*="color:#3498db"], .modal [style*="color:#3498db"], .project-detail-panel [style*="color:#3498db"],
        .main-container [style*="color:#f39c12"], .modal [style*="color:#f39c12"], .project-detail-panel [style*="color:#f39c12"],
        .main-container [style*="color:#f093fb"], .modal [style*="color:#f093fb"], .project-detail-panel [style*="color:#f093fb"],
        .main-container [style*="color:#9b59b6"], .modal [style*="color:#9b59b6"], .project-detail-panel [style*="color:#9b59b6"],
        .main-container [style*="color:#075985"], .modal [style*="color:#075985"],
        .main-container [style*="color:#047857"], .modal [style*="color:#047857"],
        .main-container [style*="color:#92400e"], .modal [style*="color:#92400e"] { color: #334155 !important; }
        .main-container [style*="color:#f5576c"], .modal [style*="color:#f5576c"],
        .main-container [style*="color:#e74c3c"], .modal [style*="color:#e74c3c"],
        .main-container [style*="color:#b91c1c"], .modal [style*="color:#b91c1c"] { color: #b91c1c !important; }

        /* Replace decorative color blocks and gradients with neutral surfaces. */
        .main-container div[style*="background:linear-gradient"]:not(.project-detail-header),
        .modal tr[style*="linear-gradient"],
        .project-detail-panel div[style*="background:linear-gradient"]:not(.project-detail-header) { background: #f8fafc !important; }
        .main-container [style*="background:rgba(52,152,219"],
        .main-container [style*="background:rgba(39,174,96"],
        .main-container [style*="background:rgba(46,204,113"],
        .main-container [style*="background:rgba(243,156,18"],
        .main-container [style*="background:rgba(102,126,234"],
        .modal [style*="background:rgba(52,152,219"],
        .modal [style*="background:rgba(39,174,96"],
        .modal [style*="background:rgba(46,204,113"],
        .modal [style*="background:rgba(155,89,182"],
        .modal [style*="background:rgba(102,126,234"] { background: #f8fafc !important; }

        /* KPI and summary cards are white with structure, not five competing colors. */
        .main-container .gradient-kpi {
            background: #fff !important; border: 1px solid #cbd5e1; border-top: 3px solid #4338ca;
            box-shadow: none; text-align: left !important;
        }
        .main-container .gradient-kpi *, .main-container .gradient-kpi .stat-value { color: #0f172a !important; }
        .main-container .gradient-kpi > div:first-child { color: #334155 !important; }
        .stat-card::before { background: #4338ca; }
        .chart-bar { background: #4338ca !important; }
        .chart-bar:hover { box-shadow: 0 0 0 3px rgba(67,56,202,.14); }

        /* Status chips are mostly neutral; danger remains visibly red. */
        .tag, .tag-blue, .tag-green, .tag-orange, .tag-gray {
            background: #e2e8f0 !important; color: #1e293b !important; border: 1px solid #cbd5e1;
        }
        .tag-red { background: #fee2e2 !important; color: #991b1b !important; border-color: #fecaca; }
        .pack-badge { background: #e0e7ff; color: #3730a3; }
        .pack-count, .material-price, .material-code { color: #334155 !important; }

        /* Tables and forms separate content through borders and spacing. */
        .table th { background: #e2e8f0 !important; color: #0f172a !important; border-bottom-color: #94a3b8; }
        .table td { background: #fff; color: #1e293b; border-bottom-color: #dbe3ee; }
        .table tbody tr:hover, .table tbody tr:hover td { background: #f1f5f9 !important; color: #0f172a; }
        .table tfoot td { background: #f1f5f9 !important; color: #0f172a; }
        .form-input, .form-select, .modal input, .modal select, .modal textarea {
            background: #fff !important; color: #0f172a !important; border-color: #94a3b8 !important;
        }

        /* Dialogs use one brand header and neutral bodies/footers. */
        .modal-header[style*="gradient"], .project-detail-header { background: #4338ca !important; border-bottom-color: #3730a3 !important; }
        .modal-header[style*="gradient"] .modal-title, .project-detail-header h3 { color: #fff !important; }
        .modal-actions, .modal-actions-split, .stock-modal-footer { background: #f1f5f9 !important; color: #1e293b !important; }
        .inventory-row, .inventory-row td { background: #fff !important; }
        .inventory-row:hover, .inventory-row:hover td { background: #f8fafc !important; }
        .status-qty-badge { background: #e2e8f0 !important; color: #1e293b !important; border: 1px solid #cbd5e1; }

        .toast { background: #334155 !important; color: #fff !important; box-shadow: 0 8px 24px rgba(15,23,42,.2); }
        .toast.error { background: #b91c1c !important; }
        .upload-area { background: #f8fafc; border-color: #94a3b8; color: #334155; }
        .error-state { background: #fef2f2; border-color: #fecaca; }


        /* Specificity guard: KPI cards stay white even when legacy inline gradients are present. */
        .main-container div.gradient-kpi[style*="background:linear-gradient"] {
            background: #fff !important;
        }



        /* ========== v3.2.3 字体颜色规范：浅底黑字，深底白字 ========== */
        :root {
            --font-on-light: #111827;
            --font-on-dark: #ffffff;
            --font-placeholder: #475569;
        }

        /* Default: every light content surface uses the same near-black text. */
        .main-container,
        .main-container :where(h1,h2,h3,h4,h5,h6,p,div,span,strong,small,label,li,a,td,th),
        .modal,
        .modal :where(h1,h2,h3,h4,h5,h6,p,div,span,strong,small,label,li,a,td,th),
        .project-detail-panel,
        .project-detail-panel :where(h1,h2,h3,h4,h5,h6,p,div,span,strong,small,label,li,a,td,th) {
            color: var(--font-on-light) !important;
        }

        .main-container input,
        .main-container select,
        .main-container textarea,
        .modal input,
        .modal select,
        .modal textarea,
        .project-detail-panel input,
        .project-detail-panel select,
        .project-detail-panel textarea,
        .main-container option,
        .modal option {
            color: var(--font-on-light) !important;
        }
        .main-container input::placeholder,
        .main-container textarea::placeholder,
        .modal input::placeholder,
        .modal textarea::placeholder { color: var(--font-placeholder) !important; opacity: 1; }

        /* Light controls and badges also use black text. */
        .main-container button,
        .modal button,
        .project-detail-panel button,
        .tag, .tag-blue, .tag-green, .tag-orange, .tag-gray, .tag-red,
        .pack-badge, .pack-count, .material-code, .material-price,
        .qty-btn, .pack-btn, .status-qty-badge,
        .btn-secondary, .modal-close {
            color: var(--font-on-light) !important;
        }

        /* Dark surfaces are the only places where white text is allowed. */
        .navbar, .navbar *,
        .mobile-menu, .mobile-menu *,
        .modal-header[style*="gradient"], .modal-header[style*="gradient"] *,
        .project-detail-header, .project-detail-header *,
        .chart-bar-tooltip, .chart-bar-tooltip *,
        .toast, .toast * {
            color: var(--font-on-dark) !important;
        }

        /* Filled action controls remain readable on dark fills. */
        .main-container .btn-primary, .main-container .btn-primary *,
        .main-container .btn-success, .main-container .btn-success *,
        .main-container .btn-info, .main-container .btn-info *,
        .main-container .btn-warning, .main-container .btn-warning *,
        .main-container .btn-danger, .main-container .btn-danger *,
        .modal .btn-primary, .modal .btn-primary *,
        .modal .btn-success, .modal .btn-success *,
        .modal .btn-info, .modal .btn-info *,
        .modal .btn-warning, .modal .btn-warning *,
        .modal .btn-danger, .modal .btn-danger *,
        .project-detail-panel .btn-primary, .project-detail-panel .btn-primary *,
        .project-detail-panel .btn-danger, .project-detail-panel .btn-danger *,
        .qty-btn.primary, .qty-btn.primary *,
        .pack-btn.primary, .pack-btn.primary *,
        .btn[style*="gradient"], .btn[style*="gradient"] * {
            color: var(--font-on-dark) !important;
        }

        /* Secondary and close controls have light backgrounds, so they stay black. */
        .main-container .btn-secondary, .main-container .btn-secondary *,
        .modal .btn-secondary, .modal .btn-secondary *,
        .project-detail-panel .btn-secondary, .project-detail-panel .btn-secondary *,
        .modal .modal-close {
            color: var(--font-on-light) !important;
        }
        .modal-header[style*="gradient"] .modal-close { color: var(--font-on-dark) !important; }

        /* Remove remaining semantic font colors; structure and labels carry meaning. */
        .stat-value, .stat-label, .table td, .table th, .table tfoot td,
        .settlement-summary .row, .settlement-summary .row *,
        .gradient-kpi, .gradient-kpi *,
        .material-name, .material-info, .material-weight,
        .empty-state, .error-state, .error-text,
        [class*="tag-"] {
            color: var(--font-on-light) !important;
        }

        /* ========== v3.3 layout polish ========== */
        :root {
            --layout-sidebar: 252px;
            --layout-max: 1680px;
            --space-card: 22px;
            --radius-card: 12px;
            --radius-control: 8px;
            --shadow-card: 0 1px 3px rgba(15,23,42,.07), 0 8px 22px rgba(15,23,42,.035);
        }

        html { background: #f1f5f9; scrollbar-gutter: stable; }
        body { line-height: 1.5; text-rendering: optimizeLegibility; }
        button, input, select, textarea { font: inherit; }
        button, .nav-item, .modal-close { -webkit-tap-highlight-color: transparent; }
        ::selection { background: #e0e7ff; color: #111827; }

        .navbar {
            width: var(--layout-sidebar);
            padding: 20px 13px 24px;
            gap: 15px;
            box-shadow: 5px 0 18px rgba(15,23,42,.10);
        }
        .logo { padding: 0 9px 15px; }
        .nav-menu {
            gap: 4px;
            padding: 1px 4px 10px 1px;
            scrollbar-width: thin;
            scrollbar-color: #475569 transparent;
        }
        .nav-item {
            position: relative;
            min-height: 43px;
            padding: 9px 12px;
            border-radius: 8px;
            line-height: 1.25;
        }
        .nav-item.active {
            background: #4338ca;
            box-shadow: inset 3px 0 0 #ffffff;
        }
        .nav-item:hover { transform: none; }
        .nav-icon { width: 21px; }
        .nav-group-label { margin: 16px 11px 6px; }

        .main-container {
            width: calc(100% - var(--layout-sidebar));
            max-width: var(--layout-max);
            margin: 0 0 0 var(--layout-sidebar);
            padding: 32px clamp(24px, 2.5vw, 42px) 52px;
        }
        .page-heading {
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 18px;
            border-bottom: 1px solid #cbd5e1;
        }
        .page-heading h1 { margin-top: 2px; font-size: clamp(24px, 2vw, 30px); }
        .page-heading p { max-width: 720px; line-height: 1.65; }
        .page-eyebrow { margin-bottom: 2px; }
        .quick-actions { gap: 8px; }

        .card {
            padding: var(--space-card);
            margin-bottom: 18px;
            border-radius: var(--radius-card);
            box-shadow: var(--shadow-card);
        }
        .card:hover {
            border-color: #cbd5e1;
            box-shadow: var(--shadow-card);
        }
        .card-header {
            min-height: 42px;
            gap: 16px;
            margin-bottom: 18px;
            padding-bottom: 14px;
            border-bottom: 1px solid #e2e8f0;
        }
        .card-title { font-size: 18px; line-height: 1.35; }
        .btn-group { gap: 8px; }

        .btn {
            min-height: 38px;
            padding: 8px 16px;
            gap: 7px;
            border-radius: var(--radius-control);
            line-height: 1.2;
            justify-content: center;
        }
        .btn:hover { transform: none; box-shadow: none; }
        .btn:active { transform: translateY(1px); }
        .btn-sm { min-height: 32px; padding: 6px 11px; }
        .btn:focus-visible,
        .nav-item:focus-visible,
        .modal-close:focus-visible,
        .qty-btn:focus-visible,
        .pack-btn:focus-visible {
            outline: 3px solid rgba(67,56,202,.22);
            outline-offset: 2px;
        }
        .btn-secondary { border-color: #94a3b8 !important; }
        .btn:disabled { filter: grayscale(.2); opacity: .52; }

        .form-group { margin-bottom: 16px; }
        .form-label { margin-bottom: 6px; font-size: 13px; line-height: 1.35; }
        .form-row { gap: 16px; }
        .form-input, .form-select,
        .main-container input:not([type="checkbox"]):not([type="radio"]),
        .main-container select, .main-container textarea,
        .modal input:not([type="checkbox"]):not([type="radio"]),
        .modal select, .modal textarea {
            min-height: 42px;
            padding: 9px 12px;
            border-radius: var(--radius-control);
            line-height: 1.4;
        }
        .main-container textarea, .modal textarea { min-height: 94px; resize: vertical; }
        input[type="checkbox"], input[type="radio"] { accent-color: #4338ca; }
        input[type="number"] { font-variant-numeric: tabular-nums; }

        .card:has(.table), .modal:has(.table) {
            scrollbar-width: thin;
            scrollbar-color: #94a3b8 transparent;
        }
        .table {
            border-collapse: separate;
            border-spacing: 0;
            font-size: 13px;
            line-height: 1.4;
        }
        .table th {
            height: 43px;
            padding: 10px 12px;
            font-size: 12px;
            letter-spacing: .01em;
            border-top: 1px solid #cbd5e1;
        }
        .table th:first-child { border-left: 1px solid #cbd5e1; border-top-left-radius: 7px; }
        .table th:last-child { border-right: 1px solid #cbd5e1; border-top-right-radius: 7px; }
        .table td { padding: 11px 12px; }
        .table tbody tr:nth-child(even) td { background: #fbfcfe; }
        .table tbody tr:hover td { background: #f1f5f9 !important; }
        .table td .btn + .btn { margin-left: 5px; }
        .table tfoot td { border-top: 1px solid #cbd5e1; }
        .table :where(.number,.money,[style*="text-align:right"]) { white-space: nowrap; }

        .stats-grid {
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 18px;
        }
        .stat-card, .main-container .gradient-kpi {
            min-height: 108px;
            padding: 17px 18px !important;
            border-radius: 10px;
        }
        .stat-card:hover, .material-card:hover { transform: none; }
        .stat-label { margin-bottom: 7px; line-height: 1.35; }
        .stat-value { font-size: clamp(23px, 2vw, 29px); line-height: 1.15; }

        .tag, [class*="tag-"], .status-qty-badge {
            min-height: 24px;
            padding: 3px 8px;
            border-radius: 999px;
            line-height: 1.25;
        }

        .modal-overlay { padding: 28px 20px; overscroll-behavior: contain; }
        .modal {
            max-height: calc(100dvh - 56px);
            border-radius: 14px;
            overscroll-behavior: contain;
            scrollbar-width: thin;
            scrollbar-color: #94a3b8 transparent;
        }
        .modal-header { min-height: 64px; padding: 15px 22px; }
        .modal-title { font-size: 18px; line-height: 1.35; }
        .modal-close { width: 34px; height: 34px; border-radius: 8px; }
        .modal-close:hover { transform: none; }
        .modal-body { padding: 20px 22px 22px; }
        .modal-actions, .modal-actions-split, .stock-modal-footer {
            gap: 9px;
            padding: 13px 22px !important;
            box-shadow: 0 -5px 14px rgba(15,23,42,.04);
        }
        .material-group-container { max-height: min(52vh, 560px); padding-right: 7px; }
        .material-group { margin-bottom: 16px; }
        .material-group-title { margin-bottom: 9px; padding-bottom: 7px; }
        .material-grid { gap: 9px; }
        .material-card, .material-item { border-radius: 9px; }
        .material-card:hover { box-shadow: 0 2px 8px rgba(15,23,42,.07); }
        .upload-area { padding: 30px 22px; border-radius: 10px; }
        .upload-area:hover { transform: none; }

        .project-detail-panel { border-radius: 14px !important; overflow: hidden; }
        .project-detail-header { padding: 16px 22px !important; }
        .project-detail-body { padding: 20px 22px 24px !important; }

        .empty-state { padding: 42px 20px; }
        .empty-icon { margin-bottom: 10px; opacity: .45; }
        .toast {
            top: 22px;
            right: 22px;
            max-width: min(420px, calc(100vw - 32px));
            padding: 12px 18px;
            border-radius: 9px;
        }

        @media (max-width: 1100px) {
            .navbar { width: 100%; padding: 0 14px; gap: 10px; }
            .main-container {
                width: 100%;
                max-width: none;
                margin-left: 0;
                padding: 24px 20px 40px;
            }
            .page-heading { align-items: flex-start; }
        }

        @media (max-width: 768px) {
            html { scrollbar-gutter: auto; }
            .main-container { padding: 15px 10px 30px; }
            .page-heading {
                gap: 13px;
                margin-bottom: 15px;
                padding: 3px 4px 14px;
            }
            .page-heading h1 { font-size: 23px; }
            .quick-actions {
                width: 100%;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 7px;
            }
            .quick-actions .btn { min-width: 0; min-height: 42px; }

            .card {
                padding: 16px 12px;
                margin-bottom: 12px;
                border-radius: 10px;
            }
            .card-header {
                min-height: 0;
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                margin-bottom: 14px;
                padding-bottom: 11px;
            }
            .card-header > :not(.card-title) { max-width: 100%; }
            .card-title { font-size: 16px; }
            .btn-group { width: 100%; }
            .btn-group .btn { flex: 1 1 auto; }

            .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
            .stat-card, .main-container .gradient-kpi {
                min-height: 92px;
                padding: 13px 12px !important;
            }
            .stat-value { font-size: 21px; }

            .table { min-width: 680px; font-size: 12px; }
            .table th { height: 40px; padding: 8px; }
            .table td { padding: 9px 8px; }
            .card:has(.table)::after { color: #475569; padding: 9px 0 0; }

            .form-row { grid-template-columns: 1fr; gap: 10px; }
            .form-input, .form-select,
            .main-container input:not([type="checkbox"]):not([type="radio"]),
            .main-container select, .main-container textarea,
            .modal input:not([type="checkbox"]):not([type="radio"]),
            .modal select, .modal textarea {
                min-height: 46px;
                font-size: 16px;
            }

            .modal-overlay { padding: 6px !important; }
            .modal, .modal-lg, .modal-xl {
                width: 100%;
                max-width: 100%;
                max-height: calc(100dvh - 12px);
                border-radius: 11px;
            }
            .modal-header { min-height: 56px; padding: 12px 14px; }
            .modal-body { padding: 14px; }
            .modal-actions, .modal-actions-split, .stock-modal-footer {
                align-items: stretch !important;
                padding: 11px 14px !important;
            }
            .modal-actions, .modal-actions-split { flex-direction: column; }
            .modal-actions > *, .modal-actions-split > * { width: 100%; }
            .modal-actions .btn, .modal-actions-split .btn { width: 100%; }
            .material-group-container { max-height: 54vh; }
            .project-detail-header { padding: 13px 14px !important; }
            .project-detail-body { padding: 14px !important; }
            .toast { left: 10px; right: 10px; top: auto; bottom: 12px; max-width: none; }
        }

        @media (max-width: 420px) {
            .quick-actions { grid-template-columns: 1fr; }
            .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .logo span {
                max-width: 210px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
        }

        @media print {
            body { background: #fff !important; color: #000 !important; }
            .navbar, .mobile-menu, .mobile-menu-btn, .quick-actions,
            .btn, .toast, .card:has(.table)::after { display: none !important; }
            .main-container {
                width: 100% !important;
                max-width: none !important;
                margin: 0 !important;
                padding: 0 !important;
            }
            .page-heading { margin-bottom: 12px; padding-bottom: 10px; }
            .card, .stat-card, .project-detail-panel {
                break-inside: avoid;
                border-color: #999 !important;
                box-shadow: none !important;
            }
            .table th { position: static; background: #eee !important; }
            .table th, .table td { color: #000 !important; border-color: #999 !important; }
        }

/* ========== v3.4 canonical UI layer ========== */
:root {
    --ui-ink: #111827;
    --ui-muted: #475569;
    --ui-line: #cbd5e1;
    --ui-line-soft: #e2e8f0;
    --ui-panel: #ffffff;
    --ui-panel-soft: #f8fafc;
    --ui-accent: #4338ca;
}

/* 盘扣提料 */
.pickup-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.pickup-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, .65fr) minmax(220px, 1.25fr);
    gap: 12px;
    margin-bottom: 16px;
}

.pickup-filters .form-group { margin-bottom: 0; }
.table-subtext, .card-note { margin-top: 3px; color: #64748b; font-size: 11px; }
.empty-cell { padding: 34px !important; text-align: center; color: #94a3b8 !important; }

.pickup-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.pickup-detail-grid > div {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.pickup-detail-grid span { display: block; color: #64748b; font-size: 11px; }
.pickup-detail-grid strong { display: block; margin-top: 6px; color: #0f172a; font-size: 13px; }
.pickup-notes { display: grid; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f8fafc; color: #475569; font-size: 13px; }
.compact-number { width: 110px; margin-left: auto; text-align: right; }

.project-check-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 220px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #f8fafc;
}

.project-check-list label { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; color: #334155; cursor: pointer; }
.project-check-list label:hover { background: #eef2ff; }
.access-code-box { display: grid; gap: 5px; margin: 14px 0; padding: 16px; border: 1px solid #a7f3d0; border-radius: 12px; background: #ecfdf5; color: #065f46; }
.access-code-box strong { font: 800 28px/1.2 "JetBrains Mono", monospace; letter-spacing: .14em; }
.access-code-box small { color: #047857; }

@media (max-width: 900px) {
    .pickup-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pickup-filters, .pickup-detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .pickup-filters, .pickup-detail-grid, .project-check-list { grid-template-columns: 1fr; }
}

/* Keep business screens steady and reduce decorative motion. */
.stat-value,
.main-container [style*="animation: fadeInUp"],
.main-container [style*="animation:fadeInUp"] {
    animation: none !important;
    opacity: 1 !important;
}
.card,
.stat-card,
.material-card,
.btn,
.nav-item {
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

/* One monochrome SVG icon system for desktop and mobile navigation. */
.nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    font-size: 0 !important;
    color: inherit;
}
.nav-icon::before {
    content: "";
    display: block;
    width: 19px;
    height: 19px;
    background: currentColor;
    -webkit-mask: var(--nav-svg) center / contain no-repeat;
    mask: var(--nav-svg) center / contain no-repeat;
}
.nav-menu .nav-item:nth-of-type(1),
.mobile-menu .nav-item:nth-of-type(1) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(2),
.mobile-menu .nav-item:nth-of-type(2) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 7.5h7l2 2h9v10.5H3z'/%3E%3Cpath d='M3 7.5V5h7l2 2h9v2.5'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(3),
.mobile-menu .nav-item:nth-of-type(3) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19h8'/%3E%3Cpath d='M13 5h6v6'/%3E%3Cpath d='M10 14L19 5'/%3E%3Crect x='3' y='10' width='7' height='7' rx='1'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(4),
.mobile-menu .nav-item:nth-of-type(4) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 5h-8'/%3E%3Cpath d='M11 19H5v-6'/%3E%3Cpath d='M14 10l-9 9'/%3E%3Crect x='14' y='7' width='7' height='7' rx='1'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(5),
.mobile-menu .nav-item:nth-of-type(5) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 8l8-4 8 4-8 4z'/%3E%3Cpath d='M4 8v8l8 4 8-4V8'/%3E%3Cpath d='M12 12v8'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(6),
.mobile-menu .nav-item:nth-of-type(6) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 3h9l4 4v14H6z'/%3E%3Cpath d='M15 3v5h4M9 12h6M9 16h6'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(7),
.mobile-menu .nav-item:nth-of-type(7) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='13' rx='2'/%3E%3Cpath d='M3 10h18M8 15h3'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(8),
.mobile-menu .nav-item:nth-of-type(8) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 3v4M17 3v4M3 10h18M7 14h3M14 14h3M7 18h3'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(9),
.mobile-menu .nav-item:nth-of-type(9) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3Ccircle cx='18' cy='18' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
}
.nav-menu .nav-item:nth-of-type(10),
.mobile-menu .nav-item:nth-of-type(10) {
    --nav-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M7 10l5 5 5-5M4 19h16'/%3E%3C/g%3E%3C/svg%3E");
}

/* Compact icons for the three dashboard actions. */
.quick-actions .btn::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background: currentColor;
    -webkit-mask: var(--quick-svg) center / contain no-repeat;
    mask: var(--quick-svg) center / contain no-repeat;
}
.quick-actions .btn:nth-child(1) {
    --quick-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.quick-actions .btn:nth-child(2) {
    --quick-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.quick-actions .btn:nth-child(3) {
    --quick-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='6' width='18' height='13' rx='2'/%3E%3Cpath d='M3 10h18M8 15h3'/%3E%3C/g%3E%3C/svg%3E");
}

/* Dashboard summary cards use one neutral hierarchy. */
.page-heading + div[style*="grid-template-columns:repeat(4"] {
    gap: 12px !important;
    margin-bottom: 18px !important;
}
.page-heading + div[style*="grid-template-columns:repeat(4"] > div {
    min-height: 104px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 18px !important;
    text-align: left !important;
    background: var(--ui-panel) !important;
    border: 1px solid var(--ui-line) !important;
    border-top: 3px solid var(--ui-accent) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
.page-heading + div[style*="grid-template-columns:repeat(4"] > div > div {
    margin-left: 0 !important;
    color: var(--ui-ink) !important;
}

/* Tables with an action column keep it visible during horizontal scrolling. */
.table:has(tbody td:last-child button) th:last-child,
.table:has(tbody td:last-child .btn) th:last-child {
    position: sticky;
    right: 0;
    z-index: 5;
    min-width: 124px;
    background: #e2e8f0 !important;
    box-shadow: -1px 0 0 var(--ui-line), -8px 0 12px rgba(15,23,42,.035);
}
.table:has(tbody td:last-child button) td:last-child,
.table:has(tbody td:last-child .btn) td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background: var(--ui-panel) !important;
    box-shadow: -1px 0 0 var(--ui-line-soft), -8px 0 12px rgba(15,23,42,.025);
}
.table:has(tbody td:last-child button) tbody tr:nth-child(even) td:last-child,
.table:has(tbody td:last-child .btn) tbody tr:nth-child(even) td:last-child {
    background: #fbfcfe !important;
}
.table:has(tbody td:last-child button) tbody tr:hover td:last-child,
.table:has(tbody td:last-child .btn) tbody tr:hover td:last-child {
    background: #f1f5f9 !important;
}
.table td:last-child .btn {
    white-space: nowrap;
}
.table td,
.table th {
    font-variant-numeric: tabular-nums;
}
.table td[style*="text-align:right"],
.table th[style*="text-align:right"],
.table .number,
.table .money {
    text-align: right !important;
}

/* Clear horizontal scrolling and consistent empty states. */
.card:has(> .table),
.card:has(.table) {
    position: relative;
}
.empty-state,
.error-state {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .nav-icon { width: 21px; height: 21px; flex-basis: 21px; }
    .page-heading + div[style*="grid-template-columns:repeat(4"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    .page-heading + div[style*="grid-template-columns:repeat(4"] > div {
        min-height: 92px;
        padding: 13px 12px !important;
    }
    .table:has(tbody td:last-child button) th:last-child,
    .table:has(tbody td:last-child .btn) th:last-child {
        min-width: 112px;
    }
}

@media print {
    .nav-icon::before,
    .quick-actions .btn::before {
        display: none !important;
    }
    .table th:last-child,
    .table td:last-child {
        position: static !important;
        box-shadow: none !important;
    }
}

/* ========== v3.5 responsive and interaction polish ========== */
html,
body,
#app {
    max-width: 100%;
    overflow-x: clip;
}

.logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex: 0 0 34px;
}

.logo span {
    line-height: 1.35;
}

.dashboard-kpis,
.dashboard-summary {
    min-width: 0;
}

.dashboard-kpis > div,
.dashboard-summary > div {
    min-width: 0;
    background: var(--ui-panel) !important;
    border-color: var(--ui-line) !important;
}

.dashboard-kpis .stat-value,
.dashboard-summary > div > div:last-child {
    color: var(--ui-ink) !important;
    font-family: inherit !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-summary > div > div:last-child {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(16px, 1.45vw, 20px) !important;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.project-actions .btn {
    padding: 5px 10px !important;
    font-size: 12px !important;
}

.project-more-btn::after {
    content: "⌄";
    margin-left: 6px;
    color: var(--ui-muted);
}

.project-action-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4499;
    background: transparent;
}

.project-action-popover {
    position: fixed;
    z-index: 4500;
    width: 176px;
    padding: 7px;
    border: 1px solid var(--ui-line);
    border-radius: 11px;
    background: var(--ui-panel);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .22);
}

.project-action-title {
    overflow: hidden;
    margin: 0 4px 5px;
    padding: 7px 5px 9px;
    border-bottom: 1px solid var(--ui-line-soft);
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-action-popover button {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ui-ink);
    text-align: left;
    cursor: pointer;
}

.project-action-popover button:hover,
.project-action-popover button:focus-visible {
    background: var(--ui-panel-soft);
    outline: none;
}

.project-action-popover button.danger {
    color: #b42318;
}

.confirm-overlay {
    z-index: 5000 !important;
    align-items: center !important;
}

.confirm-modal {
    width: min(430px, calc(100vw - 24px));
}

.confirm-message {
    margin: 0;
    color: var(--ui-ink);
    line-height: 1.7;
    white-space: pre-line;
}

.mobile-menu-backdrop {
    display: none;
}

.mobile-menu-header {
    display: none;
}

@media (max-width: 768px) {
    body:has(.mobile-menu) {
        overflow: hidden;
    }

    .main-container,
    .main-container > div,
    .card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-kpis,
    .dashboard-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .dashboard-kpis > div,
    .dashboard-summary > div {
        min-height: 86px !important;
        padding: 12px 10px !important;
    }

    .dashboard-kpis > div > div,
    .dashboard-summary > div > div {
        white-space: normal;
        word-break: keep-all;
    }

    .dashboard-kpis .stat-value,
    .dashboard-summary > div > div:last-child {
        max-width: 100%;
        font-size: clamp(18px, 5.5vw, 24px) !important;
        white-space: nowrap;
    }

    .dashboard-search {
        flex-direction: column;
        align-items: stretch !important;
    }

    .dashboard-search > * {
        width: 100% !important;
        min-width: 0 !important;
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 58px 0 0;
        z-index: 998;
        display: block;
        background: rgba(15, 23, 42, .55);
        backdrop-filter: blur(2px);
    }

    .mobile-menu {
        inset: 58px auto 0 0 !important;
        width: min(86vw, 340px) !important;
        max-height: none !important;
        border-right: 1px solid rgba(255, 255, 255, .12);
        border-bottom: 0 !important;
        box-shadow: 14px 0 32px rgba(15, 23, 42, .25) !important;
        overscroll-behavior: contain;
    }

    .mobile-menu-header {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        margin: -2px -2px 8px;
        padding: 4px 8px 8px;
        background: #111827;
        color: #fff;
    }

    .mobile-menu-header button {
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 8px;
        background: rgba(255, 255, 255, .1);
        color: #fff;
        font-size: 24px;
        cursor: pointer;
    }

    .modal-body {
        padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    }

    .confirm-modal .modal-body {
        padding-bottom: 18px !important;
    }

    .project-actions {
        gap: 5px;
    }

    .project-action-backdrop {
        background: rgba(15, 23, 42, .38);
        backdrop-filter: blur(1px);
    }

    .project-action-popover {
        inset: auto 10px calc(10px + env(safe-area-inset-bottom)) 10px !important;
        width: auto;
        border-radius: 14px;
        box-shadow: 0 18px 50px rgba(15, 23, 42, .3);
    }

    .project-action-popover button {
        min-height: 44px;
        font-size: 15px;
    }
}

.admin-login-footer .icp-link {
    color: rgba(225,218,203,.58);
    text-decoration: none;
}
.admin-login-footer .icp-link:hover {
    color: rgba(225,218,203,.9);
    text-decoration: underline;
}
