/* ============================================================
   蓝筑财务 · 家装公司财务系统 v2.1（收支凭证照片）
   黑蓝主题 · 深色财务工作台
   ============================================================ */
:root {
    --blue-950: #03060d;
    --blue-900: #050a14;
    --blue-800: #081226;
    --blue-700: #0d2142;
    --blue-600: #1f5cff;
    --blue-500: #3d7bff;
    --blue-300: #8fb4ff;
    --blue-100: #172c4f;
    --blue-50: #0f1c33;
    --ink: #e9f0ff;
    --ink-2: #c2cfe6;
    --muted: #8b9cba;
    --faint: #647691;
    --line: #1b2a43;
    --line-2: #131f33;
    --bg: #04070d;
    --white: #0a1220;
    --panel: #0e1a2d;
    --green: #2dd4a0;
    --green-bg: #07271f;
    --red: #ff6b7a;
    --red-bg: #2a0f16;
    --amber: #f6c453;
    --amber-bg: #2a210d;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(1100px 600px at 8% -12%, rgba(31, 92, 255, .16), transparent 62%),
        radial-gradient(900px 520px at 100% 0%, rgba(13, 40, 92, .35), transparent 60%),
        linear-gradient(180deg, #04070d 0%, #05090f 50%, #04070d 100%);
    background-attachment: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-300); text-decoration: none; }
a:hover { color: #cfe0ff; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); letter-spacing: .2px; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }

.ico { flex: 0 0 auto; vertical-align: -3px; }
.text-red { color: var(--red); }

/* ---------- 整体布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex: 0 0 240px;
    background:
        radial-gradient(500px 260px at 0% 0%, rgba(31, 92, 255, .18), transparent 70%),
        linear-gradient(180deg, #03060d 0%, #071022 52%, #050a14 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    border-right: 1px solid rgba(90, 130, 200, .14);
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3d7bff, #0b3dc9);
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 10px 24px rgba(31, 92, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 17px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { display: block; font-size: 11px; color: rgba(190, 210, 240, .55); letter-spacing: .6px; margin-top: 1px; }

.nav { flex: 1; padding: 4px 12px 18px; overflow-y: auto; }
.nav-group {
    padding: 18px 10px 8px;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 1.8px;
    color: rgba(150, 175, 215, .48);
    text-transform: uppercase;
}
.nav-group:first-child { padding-top: 10px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: rgba(210, 224, 248, .74);
    font-size: 14px;
    transition: background .16s, color .16s, border-color .16s;
    position: relative;
    border: 1px solid transparent;
}

.nav-link .ico { color: rgba(160, 185, 225, .58); }
.nav-link:hover { background: rgba(80, 130, 220, .10); color: #fff; }
.nav-link.active {
    background: linear-gradient(90deg, rgba(31, 92, 255, .26), rgba(31, 92, 255, .06));
    border-color: rgba(80, 135, 255, .32);
    color: #fff;
    font-weight: 600;
}
.nav-link.active .ico { color: #9cc0ff; }
.nav-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: #4d88ff;
    box-shadow: 0 0 12px rgba(77, 136, 255, .8);
}

.sidebar-foot {
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(110, 150, 220, .12);
}
.company-name {
    font-size: 12px;
    color: rgba(205, 220, 245, .62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.version { font-size: 11px; color: rgba(150, 175, 215, .38); margin-top: 3px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 28px;
    background: rgba(5, 9, 16, .84);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}

.menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink-2);
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 19px; line-height: 1.3; }
.topbar-title p { font-size: 12px; color: var(--faint); margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(14, 26, 45, .7);
    color: var(--ink);
}
.user-chip:hover { border-color: rgba(93, 139, 255, .45); color: var(--ink); }
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, #17356e, #0e1f42);
    color: #a8c7ff;
    display: grid;
    place-items: center;
    font-weight: 700;
    border: 1px solid rgba(93, 139, 255, .24);
}
.user-meta b { display: block; font-size: 13px; line-height: 1.3; }
.user-meta small { display: block; font-size: 11px; color: var(--faint); line-height: 1.3; }

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px solid transparent;
}
.icon-btn:hover { background: var(--red-bg); color: var(--red); }

.content { padding: 22px 28px 48px; width: 100%; max-width: 1580px; margin: 0 auto; }

.sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(1, 4, 10, .72);
    z-index: 35;
}

/* ---------- 通用组件 ---------- */
.card {
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(16, 28, 48, .7) 0%, rgba(9, 17, 30, .92) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(120, 160, 230, .06);
    padding: 20px;
}

.card + .card { margin-top: 18px; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 2px 0 14px;
}
.section-head h2 { font-size: 17px; }
.section-head p { font-size: 12px; color: var(--faint); margin-top: 3px; }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

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

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.w-full { width: 100%; }

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    border: 1px solid;
}
.flash-success { background: rgba(13, 58, 45, .55); border-color: rgba(45, 212, 160, .28); color: #7de9c5; }
.flash-error { background: rgba(74, 18, 30, .55); border-color: rgba(255, 107, 122, .3); color: #ffb1b9; }
.flash .flash-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: .55;
}
.flash .flash-close:hover { opacity: 1; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background .16s, border-color .16s, box-shadow .16s, transform .05s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, #2c6bff 0%, #144bd6 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(31, 92, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover { background: linear-gradient(135deg, #417dff 0%, #1b55e6 100%); color: #fff; }
.btn-ghost { background: rgba(16, 28, 48, .72); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: rgba(93, 139, 255, .5); color: #cfe0ff; background: rgba(31, 92, 255, .10); }
.btn-soft { background: rgba(31, 92, 255, .12); color: #a8c7ff; border-color: rgba(80, 130, 230, .22); }
.btn-soft:hover { background: rgba(31, 92, 255, .2); color: #d9e6ff; }
.btn-danger { background: rgba(255, 107, 122, .12); color: #ffa3ac; border-color: rgba(255, 107, 122, .28); }
.btn-danger:hover { background: rgba(255, 107, 122, .2); color: #ffd0d4; }
.btn-link { background: none; border: 0; color: var(--blue-300); padding: 0 4px; height: auto; font-weight: 500; }
.btn-link:hover { color: #d9e6ff; text-decoration: underline; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn-sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(16, 28, 48, .6);
    color: var(--muted);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}
.icon-btn-sm:hover { color: #cfe0ff; border-color: rgba(93, 139, 255, .4); background: rgba(31, 92, 255, .12); }
.icon-btn-sm.danger:hover { color: var(--red); border-color: rgba(255, 107, 122, .35); background: var(--red-bg); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .2px; }
.field > label .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input[type=tel], input[type=search], select, textarea {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #22344f;
    border-radius: var(--radius-sm);
    background: #0a1526;
    color: var(--ink);
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa6c8' stroke-width='2'%3E%3Cpath d='m5 8 7 7 7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
input:focus, select:focus, textarea:focus {
    border-color: rgba(77, 136, 255, .7);
    background: #0b1830;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}
input::placeholder, textarea::placeholder { color: #52637f; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue-500); }
input[type=date]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-grid .field { min-width: 0; }
.form-grid textarea { height: 42px; min-height: 42px; padding: 0 12px; resize: vertical; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .span-2 { grid-column: span 2; }

.form-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 24px 0 14px;
    padding-left: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--blue-300);
    border-left: 3px solid var(--blue-500);
    line-height: 1.2;
}
.form-section-title:first-child { margin-top: 0; }

.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(14, 26, 45, .6);
    font-size: 13px;
    cursor: pointer;
    color: var(--ink-2);
}
.check-item:hover { border-color: rgba(93, 139, 255, .42); background: rgba(31, 92, 255, .08); }
.check-item input { margin: 0; }

/* ---------- 快捷记账 ---------- */
.quick-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(700px 220px at 100% 0%, rgba(31, 92, 255, .18), transparent 65%),
        linear-gradient(135deg, #0b1830 0%, #0a1322 60%, #08111f 100%);
    border: 1px solid rgba(70, 115, 200, .32);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(120, 160, 230, .10);
}
.quick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.quick-title { display: flex; align-items: center; gap: 10px; }
.quick-title h2 { font-size: 18px; }
.quick-title .dot {
    width: 36px; height: 36px; border-radius: 11px;
    background: linear-gradient(145deg, #3d7bff, #0b3dc9); color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 8px 18px rgba(31, 92, 255, .32);
}
.quick-title p { font-size: 12px; color: var(--muted); margin-top: 1px; }

.seg {
    display: inline-flex;
    background: rgba(8, 16, 30, .8);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.seg-item { position: relative; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 34px;
    padding: 0 14px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: background .16s, color .16s;
}
.seg-item span:hover { color: #cfe0ff; }
.seg-item input:checked + span { background: linear-gradient(135deg, #2c6bff, #144bd6); color: #fff; box-shadow: 0 4px 12px rgba(31, 92, 255, .3); }
.seg-item.seg-expense input:checked + span { background: linear-gradient(135deg, #ff6b7a, #d63b51); box-shadow: 0 4px 12px rgba(255, 107, 122, .25); }

.amount-group { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.amount-wrap { position: relative; width: 100%; min-width: 0; }
.amount-wrap .currency {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 700;
    color: var(--blue-300);
    z-index: 1;
}
.amount-wrap input {
    height: 42px;
    padding-left: 34px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .3px;
    border-radius: var(--radius-sm);
    border-color: #22344f;
    background: #0a1526;
    font-variant-numeric: tabular-nums;
}
.amount-wrap input:focus { border-color: rgba(77, 136, 255, .75); box-shadow: 0 0 0 4px rgba(59, 130, 246, .14); }

.quick-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.quick-actions .btn-primary { height: 46px; padding: 0 26px; font-size: 15px; }
.quick-tip { font-size: 12px; color: var(--faint); }

/* ---------- KPI ---------- */
.kpi {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
}
.kpi::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(93, 139, 255, .45), transparent);
}
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.kpi-value {
    font-size: 25px;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: -.3px;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.kpi-value.green { color: var(--green); }
.kpi-value.red { color: var(--red); }
.kpi-value.blue { color: var(--blue-300); }
.kpi-meta { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.kpi-icon {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(31, 92, 255, .12);
    color: #8fb4ff;
    display: grid;
    place-items: center;
    border: 1px solid rgba(93, 139, 255, .18);
}

/* ---------- 表格 ---------- */
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 13, 24, .65); }
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data th {
    padding: 12px 14px;
    background: #0c1830;
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    color: #9fb2d1;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    letter-spacing: .3px;
}
table.data td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
    font-size: 13.5px;
    color: var(--ink-2);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: rgba(31, 92, 255, .06); }
table.data tfoot td { background: #0b1729; border-top: 1px solid var(--line); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* 平板宽度下压缩表格留白，保证收支流水 7 列完整展示 */
@media (max-width: 1180px) and (min-width: 901px) {
    table.data { min-width: 660px; }
    table.data th,
    table.data td { padding-left: 9px; padding-right: 9px; }
    table.data th { font-size: 12px; }
    table.data td { font-size: 12.6px; }
    table.data .num { font-size: 12.5px; }
}
table.data .amount-inc { color: var(--green); }
table.data .amount-exp { color: var(--red); }
table.data .sub { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
table.data .strong { font-weight: 600; color: var(--ink); }

/* ---------- 标签 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-green { background: rgba(45, 212, 160, .1); color: #64e3bb; border-color: rgba(45, 212, 160, .2); }
.badge-red { background: rgba(255, 107, 122, .1); color: #ff9aa5; border-color: rgba(255, 107, 122, .2); }
.badge-blue { background: rgba(31, 92, 255, .12); color: #9cc0ff; border-color: rgba(80, 130, 230, .24); }
.badge-gray { background: rgba(120, 140, 170, .12); color: #94a6c2; border-color: rgba(120, 140, 170, .16); }
.badge-dark { background: rgba(70, 95, 135, .2); color: #b8c8e2; border-color: rgba(120, 150, 200, .16); }
.badge-amber { background: rgba(246, 196, 83, .1); color: #f6c453; border-color: rgba(246, 196, 83, .2); }

/* ---------- 图表 ---------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 10px 4px 0; }
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 8px; }
.chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 138px; }
.chart-bar { width: 14px; border-radius: 5px 5px 2px 2px; min-height: 3px; transition: height .3s; }
.bar-inc { background: linear-gradient(180deg, #8fb4ff, #2c6bff); box-shadow: 0 0 14px rgba(60, 110, 255, .2); }
.bar-exp { background: linear-gradient(180deg, #ff9aa5, #e0475e); box-shadow: 0 0 14px rgba(255, 80, 100, .14); }
.chart-label { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.legend-inc { background: var(--blue-500); }
.legend-exp { background: #ef475d; }

.hbar-list { display: flex; flex-direction: column; gap: 13px; }
.hbar-row { display: grid; grid-template-columns: 132px 1fr 96px; align-items: center; gap: 10px; }
.hbar-row-wide { grid-template-columns: 240px 1fr 110px; }
.hbar-name { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 9px; background: #101f36; border-radius: 99px; overflow: hidden; border: 1px solid rgba(80, 120, 190, .1); }
.hbar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8fb4ff, #2c6bff); }
.hbar-fill.red { background: linear-gradient(90deg, #ff9aa5, #e0475e); }
.hbar-value { font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.progress { height: 8px; background: #101f36; border-radius: 99px; overflow: hidden; border: 1px solid rgba(80, 120, 190, .1); }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4d88ff, #1f5cff); box-shadow: 0 0 12px rgba(60, 110, 255, .35); }
.progress > span.warn { background: linear-gradient(90deg, #f6c453, #d99a1a); box-shadow: 0 0 12px rgba(246, 196, 83, .25); }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-bottom: 7px; }

/* ---------- Tabs / 筛选 ---------- */
.tabs { display: inline-flex; gap: 4px; background: rgba(8, 16, 30, .7); padding: 5px; border-radius: 12px; border: 1px solid var(--line); }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    color: #93a6c4;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: color .16s, background .16s;
}
.tab:hover { color: #cfe0ff; background: rgba(31, 92, 255, .08); }
.tab.active { background: linear-gradient(135deg, rgba(44, 107, 255, .28), rgba(20, 75, 214, .14)); color: #d9e6ff; box-shadow: inset 0 0 0 1px rgba(93, 139, 255, .28); }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: rgba(120, 160, 230, .14); color: #a8c7ff; font-size: 11px; }

.filters { padding: 16px 20px; }
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    align-items: end;
}
.filter-grid > .field, .filter-grid > .field.search-wide { min-width: 0; }
.filter-grid > .filter-actions { margin-left: 0; justify-content: flex-end; align-self: end; }
.filter-actions { display: flex; gap: 8px; align-items: end; }
.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 16px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    margin-bottom: 16px;
    box-shadow: none;
}
.summary-item {
    min-width: 0;
    padding: 13px 16px;
    background: linear-gradient(90deg, rgba(15, 29, 52, .85) 0%, rgba(9, 18, 33, .85) 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 12.5px;
    color: var(--muted);
    box-shadow: inset 0 1px 0 rgba(120, 160, 230, .06);
}
.summary-item b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; margin-top: 2px; color: var(--ink); white-space: nowrap; }
.summary-item.summary-action { display: flex; align-items: center; justify-content: flex-end; }
.summary-strip.summary-single { grid-template-columns: 1fr; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 0; flex-wrap: wrap; }
.page-numbers { display: flex; gap: 5px; flex-wrap: wrap; }
.page-num {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-size: 12.5px;
    color: var(--ink-2);
    background: rgba(14, 26, 45, .6);
}
.page-num:hover { border-color: rgba(93, 139, 255, .45); color: #cfe0ff; }
.page-num.active { background: linear-gradient(135deg, #2c6bff, #144bd6); border-color: rgba(93, 139, 255, .4); color: #fff; }
.page-num.disabled { opacity: .4; pointer-events: none; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 44px 20px; }
.empty-icon {
    width: 58px; height: 58px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: rgba(31, 92, 255, .12);
    color: #8fb4ff;
    display: grid;
    place-items: center;
    border: 1px solid rgba(93, 139, 255, .18);
}
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

/* ---------- 项目卡片 / 详情 ---------- */
.project-name { font-weight: 600; color: var(--ink); }
.project-name:hover { color: #cfe0ff; }
.link-strong { font-weight: 600; color: var(--ink); }
.link-strong:hover { color: #cfe0ff; }

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h2 { font-size: 21px; }
.detail-meta { font-size: 12.5px; color: var(--faint); margin-top: 6px; }

.mini-stat-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.mini-stat { min-width: 120px; }
.mini-stat label { font-size: 11.5px; color: var(--faint); display: block; letter-spacing: .3px; }
.mini-stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-stat b.green { color: var(--green); }
.mini-stat b.red { color: var(--red); }
.mini-stat b.blue { color: var(--blue-300); }

.info-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.info-item label { display: block; font-size: 11.5px; color: var(--faint); margin-bottom: 2px; }
.info-item span { font-size: 13.5px; color: var(--ink-2); }

.note-box {
    background: rgba(10, 21, 39, .7);
    border: 1px dashed rgba(93, 139, 255, .28);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.8;
}

.project-hero {
    background:
        radial-gradient(600px 200px at 0% 0%, rgba(31, 92, 255, .12), transparent 65%),
        linear-gradient(180deg, rgba(16, 28, 48, .72) 0%, rgba(9, 17, 30, .94) 100%);
}
.project-tabs { margin: 16px 0; }
.budget-hero {
    background:
        radial-gradient(520px 200px at 100% 0%, rgba(45, 212, 160, .08), transparent 65%),
        linear-gradient(180deg, rgba(14, 26, 45, .8) 0%, rgba(9, 17, 30, .94) 100%);
    margin-bottom: 16px;
}

/* ---------- 项目附件 / 图片 ---------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.media-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(10, 20, 37, .8);
    transition: border-color .16s, transform .16s;
}
.media-card:hover { border-color: rgba(93, 139, 255, .38); transform: translateY(-1px); }
.media-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #060b14;
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.media-card:hover .media-thumb img { transform: scale(1.04); }
.media-zoom {
    position: absolute;
    inset: auto 8px 8px auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 7px;
    background: rgba(3, 8, 18, .72);
    color: #cfe0ff;
    font-size: 11.5px;
    opacity: 0;
    transition: opacity .16s;
    border: 1px solid rgba(120, 160, 230, .25);
}
.media-card:hover .media-zoom { opacity: 1; }
.media-meta { padding: 9px 11px; border-top: 1px solid var(--line-2); }
.media-name { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-sub { font-size: 11px; color: var(--faint); margin-top: 2px; }
.media-del {
    position: absolute;
    top: 8px; right: 8px;
    margin: 0;
    opacity: 0;
    transition: opacity .16s;
}
.media-del button {
    width: 28px; height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 122, .35);
    background: rgba(22, 8, 13, .8);
    color: #ffa3ac;
    display: grid; place-items: center;
    cursor: pointer;
}
.media-card:hover .media-del { opacity: 1; }

.upload-box {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 14px;
    background: rgba(8, 16, 30, .55);
}
.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px 16px;
    border: 1px dashed rgba(93, 139, 255, .38);
    border-radius: 12px;
    background: rgba(31, 92, 255, .05);
    cursor: pointer;
    color: #bcd3f5;
    text-align: center;
    transition: border-color .16s, background .16s;
}
.upload-drop:hover { border-color: rgba(93, 139, 255, .7); background: rgba(31, 92, 255, .1); }
.upload-drop strong { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.upload-drop span { font-size: 11.5px; color: var(--faint); }
.upload-drop .ico { color: #8fb4ff; }
.upload-drop input[type=file] { display: none; }
.upload-drop.is-disabled { cursor: not-allowed; opacity: .6; border-color: var(--line); background: rgba(120, 140, 170, .06); }
.upload-drop.is-disabled:hover { border-color: var(--line); background: rgba(120, 140, 170, .06); }
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.upload-preview figure {
    position: relative;
    margin: 0;
    aspect-ratio: 1;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #060b14;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-preview figcaption {
    position: absolute; inset: auto 0 0 0;
    padding: 2px 5px;
    font-size: 10px;
    background: rgba(3, 8, 18, .72);
    color: #b7c8e4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: rgba(1, 4, 10, .92);
    backdrop-filter: blur(6px);
}
.lightbox.show { display: flex; }
.lightbox img {
    max-width: min(1100px, 92vw);
    max-height: 82vh;
    border-radius: 10px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
    border: 1px solid rgba(120, 160, 230, .22);
}
.lightbox-close {
    position: absolute;
    top: 18px; right: 22px;
    width: 42px; height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(120, 160, 230, .3);
    background: rgba(14, 26, 45, .8);
    color: #dce8ff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.lightbox-close:hover { border-color: rgba(93, 139, 255, .6); }
.lightbox-caption {
    position: absolute;
    bottom: 16px;
    left: 0; right: 0;
    text-align: center;
    font-size: 12.5px;
    color: #9fb2d1;
    padding: 0 20px;
}

/* ---------- 收支凭证照片 ---------- */
.voucher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(93, 139, 255, .32);
    background: rgba(31, 92, 255, .1);
    color: var(--blue-300);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background .16s, border-color .16s, color .16s;
}
.voucher-btn:hover { background: rgba(31, 92, 255, .22); border-color: rgba(93, 139, 255, .62); color: #dce8ff; }
.voucher-btn .ico { color: inherit; }
.mdata-voucher {
    height: 22px;
    padding: 0 8px;
    margin: 0;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    gap: 3px;
}
.voucher-cell { white-space: nowrap; }

.voucher-existing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
    margin: 2px 0 10px;
}
.voucher-existing-item {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(8, 16, 30, .55);
}
.voucher-existing-item .thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #060b14;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
    overflow: hidden;
}
.voucher-existing-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.voucher-existing-item .vex-meta { padding: 6px 8px; border-top: 1px solid var(--line-2); }
.vex-name { display: block; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vex-sub { display: block; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.vex-del {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    border-radius: 7px;
    border: 1px solid rgba(255, 107, 122, .35);
    background: rgba(22, 8, 13, .82);
    color: #ffa3ac;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: .55;
    transition: opacity .16s;
}
.voucher-existing-item:hover .vex-del { opacity: 1; }
.voucher-upload-box { padding: 0; border: 0; background: transparent; }

.voucher-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(1, 4, 10, .9);
    backdrop-filter: blur(6px);
}
.voucher-modal.show { display: flex; }
.voucher-dialog {
    width: min(980px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.voucher-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}
.voucher-head h3 { font-size: 16px; }
.voucher-head p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.voucher-close {
    width: 32px; height: 32px;
    flex: 0 0 32px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.voucher-close:hover { color: var(--ink); border-color: rgba(93, 139, 255, .5); }
.voucher-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    min-height: 0;
    flex: 1;
}
.voucher-stage {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background:
        radial-gradient(420px 220px at 50% 40%, rgba(31, 92, 255, .10), transparent 70%),
        #03070f;
}
.voucher-stage img {
    max-width: 100%;
    max-height: min(60vh, 600px);
    object-fit: contain;
    border-radius: 8px;
    display: block;
    cursor: zoom-in;
}
.voucher-stage-tip {
    position: absolute;
    right: 14px; bottom: 12px;
    padding: 3px 8px;
    border-radius: 7px;
    background: rgba(3, 8, 18, .72);
    border: 1px solid rgba(120, 160, 230, .22);
    color: #9fb2d1;
    font-size: 11px;
}
.voucher-info {
    border-left: 1px solid var(--line);
    padding: 16px 18px;
    overflow-y: auto;
}
.voucher-info h4 {
    font-size: 11.5px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 12px;
}
.voucher-info dl {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 9px 10px;
    margin: 0 0 18px;
    font-size: 12.5px;
}
.voucher-info dt { color: var(--faint); }
.voucher-info dd { margin: 0; color: var(--ink-2); word-break: break-all; }
.voucher-info .btn { width: 100%; justify-content: center; }
.voucher-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    overflow-x: auto;
}
.voucher-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 54px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #060b14;
    cursor: pointer;
    opacity: .62;
    transition: opacity .16s, border-color .16s, box-shadow .16s;
}
.voucher-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.voucher-thumb:hover { opacity: 1; }
.voucher-thumb.active { opacity: 1; border-color: rgba(93, 139, 255, .78); box-shadow: 0 0 0 2px rgba(31, 92, 255, .22); }

@media (max-width: 640px) {
    .voucher-modal { padding: 10px; }
    .voucher-dialog { width: 100%; max-height: 94vh; }
    .voucher-body { grid-template-columns: 1fr; overflow-y: auto; }
    .voucher-stage { min-height: 190px; padding: 10px; }
    .voucher-stage img { max-height: 38vh; }
    .voucher-info { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
    .voucher-existing { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .vex-del { opacity: 1; }
}

/* ---------- 自动保存 ---------- */
.autosave-status { font-size: 11.5px; color: var(--faint); min-height: 18px; }
.autosave-status.ok { color: var(--green); }
.autosave-status.err { color: var(--red); }
.draft-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 12px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: rgba(31, 92, 255, .08);
    border: 1px solid rgba(93, 139, 255, .26);
    font-size: 12.5px;
    color: #bcd3f5;
}
.draft-bar .draft-actions { margin-left: auto; display: flex; gap: 7px; }
.draft-bar button {
    height: 28px; padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(93, 139, 255, .35);
    background: rgba(31, 92, 255, .16);
    color: #d9e6ff;
    font-size: 12px;
    cursor: pointer;
}
.draft-bar button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.autosave-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(8, 20, 38, .96);
    border: 1px solid rgba(93, 139, 255, .3);
    color: #cfe0ff;
    font-size: 12.5px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .5);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}
.autosave-toast.show { opacity: 1; transform: translateY(0); }
.autosave-toast.err { border-color: rgba(255, 107, 122, .4); color: #ffb1b9; }

/* ---------- 基础资料行 ---------- */
.cat-row { background: rgba(14, 26, 45, .5); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.cat-row[data-status="0"] { opacity: .55; }
.cat-name { font-size: 13px; color: var(--ink-2); }
.cat-row[data-status="0"] .cat-name { color: var(--faint); text-decoration: line-through; }

/* 基础资料：统一间距与分组卡片 */
.base-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.base-tip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--faint);
    font-size: 12px;
}
.base-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.base-stat {
    min-width: 0;
    padding: 15px 18px;
    background: linear-gradient(180deg, rgba(16, 28, 48, .72), rgba(9, 17, 30, .9));
    border: 1px solid var(--line);
    border-radius: 12px;
}
.base-stat span { display: block; color: var(--muted); font-size: 12px; }
.base-stat b { display: block; margin-top: 5px; font-size: 22px; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.base-stat b small { font-size: 11px; font-weight: 400; color: var(--faint); margin-left: 2px; }
.base-stat b.green { color: var(--green); }
.base-stat b.blue { color: var(--blue-300); }
.base-stat b.red { color: var(--red); }
.base-layout { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.base-form-card, .base-directory { min-height: 0; }
.base-form-card .section-head, .base-directory .section-head { margin-top: 0; }
.base-form-card .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.base-form-card .form-grid .field { min-width: 0; }
.cat-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
.cat-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 13px;
    background: rgba(8, 17, 31, .5);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.cat-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(95, 135, 200, .12);
}
.cat-block-head p { margin: 6px 0 0; color: var(--faint); font-size: 11px; line-height: 1.45; }
.cat-block-head b {
    flex: 0 0 auto;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: rgba(120, 160, 230, .1);
    color: #a8c7ff;
    font-size: 12px;
}
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-list .cat-row { min-height: 37px; }
.cat-actions { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; }
.cat-actions form { display: inline-flex; }
.cat-empty { color: var(--faint); font-size: 12.5px; padding: 10px 0; }
.account-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.account-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(8, 17, 31, .5);
}
.account-main, .account-balance { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-title b { display: block; font-size: 13.5px; color: var(--ink); }
.account-icon {
    width: 34px; height: 34px; flex: 0 0 34px;
    display: grid; place-items: center; border-radius: 9px;
    color: #9cc0ff; background: rgba(47, 107, 255, .14);
    border: 1px solid rgba(93, 139, 255, .2);
}
.account-tags { display: flex; gap: 5px; margin-top: 4px; }
.account-actions { display: flex; align-items: center; gap: 1px; }
.account-actions form { display: inline-flex; }
.account-balance { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(95, 135, 200, .12); align-items: flex-end; }
.account-balance span { display: block; color: var(--faint); font-size: 11px; }
.account-balance b { display: block; margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; }
.account-flow { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 12px; color: var(--faint); font-size: 11px; }

/* ---------- 角色权限矩阵 ---------- */
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(10, 20, 37, .6); }
.perm-group h4 { font-size: 13px; color: var(--blue-300); margin-bottom: 10px; }
.perm-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.perm-check {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 9px; background: rgba(14, 26, 45, .55);
    border: 1px solid var(--line); font-size: 12.5px; cursor: pointer;
    color: var(--ink-2);
}
.perm-check:hover { border-color: rgba(93, 139, 255, .42); }

.role-card { display: flex; flex-direction: column; gap: 10px; }
.role-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-card-name { font-weight: 600; font-size: 15px; }
.role-perm-count { font-size: 12px; color: var(--faint); }

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(900px 500px at 8% 0%, rgba(31, 92, 255, .30), transparent 68%),
        radial-gradient(800px 500px at 100% 100%, rgba(12, 38, 90, .55), transparent 70%),
        linear-gradient(135deg, #03060d 0%, #060d1b 55%, #04070d 100%);
}
.login-card {
    width: 100%;
    max-width: 940px;
    background: linear-gradient(155deg, #0a1424 0%, #070f1d 100%);
    border: 1px solid rgba(90, 130, 200, .22);
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    box-shadow: 0 40px 110px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(120, 160, 230, .1);
}
.login-visual {
    position: relative;
    padding: 48px 44px;
    color: #fff;
    background:
        radial-gradient(520px 300px at 20% 20%, rgba(31, 92, 255, .35), transparent 70%),
        linear-gradient(155deg, #0b1d3a 0%, #071226 55%, #040a14 100%);
    overflow: hidden;
    border-right: 1px solid rgba(90, 130, 200, .16);
}
.login-visual::after {
    content: "";
    position: absolute;
    width: 340px; height: 340px;
    right: -130px; bottom: -130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(60, 120, 255, .28), transparent 68%);
    border: 1px solid rgba(120, 160, 230, .14);
}
.login-visual .brand { padding: 0 0 30px; }
.login-visual .brand-mark { background: rgba(255, 255, 255, .12); box-shadow: none; border: 1px solid rgba(255, 255, 255, .18); }
.login-visual .brand-text strong { font-size: 18px; }
.login-visual .brand-text span { color: rgba(200, 218, 245, .58); }
.login-headline { font-size: 30px; line-height: 1.35; letter-spacing: .5px; margin-bottom: 12px; }
.login-sub { color: rgba(200, 218, 245, .66); font-size: 13px; line-height: 1.9; max-width: 340px; }
.login-features { margin-top: 32px; display: flex; flex-direction: column; gap: 13px; position: relative; z-index: 2; }
.login-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(215, 230, 255, .82); }
.login-feature .tick {
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(31, 92, 255, .2);
    border: 1px solid rgba(93, 139, 255, .3);
    display: grid; place-items: center; flex: 0 0 22px;
    color: #a8c7ff;
}
.login-foot { margin-top: 36px; font-size: 11.5px; color: rgba(180, 200, 230, .38); position: relative; z-index: 2; }

.login-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }
.login-form p { font-size: 13px; color: var(--faint); margin-bottom: 26px; }
.login-fields { display: flex; flex-direction: column; gap: 16px; }
.login-fields .field label { font-size: 13px; }
.login-fields input { height: 46px; }
.login-btn { height: 48px; font-size: 15px; margin-top: 4px; }
.login-error {
    background: rgba(74, 18, 30, .55);
    border: 1px solid rgba(255, 107, 122, .28);
    color: #ffb1b9;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12.5px;
    margin-bottom: 14px;
}
.login-copyright { text-align: center; margin-top: 26px; font-size: 11.5px; color: var(--faint); }

/* ---------- 安装向导 ---------- */
.install-page { min-height: 100vh; background: var(--bg); padding: 36px 20px 60px; }
.install-wrap { max-width: 860px; margin: 0 auto; }
.install-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.install-brand .brand-mark { width: 44px; height: 44px; }
.install-brand strong { display: block; font-size: 19px; }
.install-brand span { font-size: 12px; color: var(--faint); }
.install-card { background: linear-gradient(180deg, #0b1526, #08111e); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.install-steps { display: flex; border-bottom: 1px solid var(--line); background: #0a1527; }
.install-step {
    flex: 1;
    padding: 15px 16px;
    font-size: 12.5px;
    color: var(--faint);
    display: flex;
    align-items: center;
    gap: 8px;
}
.install-step .step-no {
    width: 24px; height: 24px; border-radius: 50%;
    background: #12233d; color: #8b9cba;
    display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 24px;
    border: 1px solid var(--line);
}
.install-step.active { color: #cfe0ff; font-weight: 600; background: rgba(31, 92, 255, .08); }
.install-step.active .step-no { background: linear-gradient(135deg, #2c6bff, #144bd6); color: #fff; }
.install-step.done { color: var(--green); }
.install-step.done .step-no { background: var(--green-bg); color: var(--green); border-color: rgba(45, 212, 160, .2); }
.install-body { padding: 28px 32px 32px; }
.install-body h2 { font-size: 20px; margin-bottom: 6px; }
.install-desc { color: var(--faint); font-size: 13px; margin-bottom: 22px; }
.install-body .form-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.install-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.check-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.check-row:last-child { border-bottom: 0; }
.check-row span:first-child { color: var(--ink-2); }
.check-ok { color: var(--green); font-weight: 600; }
.check-fail { color: var(--red); font-weight: 600; }
.install-tip {
    background: rgba(31, 92, 255, .07);
    border: 1px solid rgba(93, 139, 255, .22);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12.5px;
    color: #a9c1e4;
    margin-top: 16px;
}
.install-alert { background: rgba(74, 18, 30, .55); border: 1px solid rgba(255, 107, 122, .28); color: #ffb1b9; border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; }
.done-panel { text-align: center; padding: 20px 0 8px; }
.done-icon { width: 66px; height: 66px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid rgba(45, 212, 160, .2); }
.done-panel h2 { margin-bottom: 8px; }
.done-panel p { color: var(--muted); font-size: 13px; }
.account-box { background: rgba(10, 21, 39, .7); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 20px auto 0; max-width: 380px; text-align: left; font-size: 13px; }
.account-box .row { display: flex; justify-content: space-between; padding: 4px 0; }
.account-box b { color: var(--blue-300); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid, .form-grid.cols-3, .form-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .base-form-card .form-grid, .cat-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar-entry { display: none; }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 24px 0 60px rgba(0, 0, 0, .55);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-mask.show { display: block; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 12px 16px; }
    .content { padding: 16px; }
    .login-card { grid-template-columns: 1fr; max-width: 480px; }
    .login-visual { padding: 30px 28px; border-right: 0; border-bottom: 1px solid rgba(90, 130, 200, .16); }
    .login-features, .login-foot { display: none; }
    .login-headline { font-size: 22px; margin-bottom: 6px; }
    .login-sub { display: none; }
    .login-form { padding: 30px 28px; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-2.ratio { grid-template-columns: 1fr; }
    .base-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .base-form-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .account-list { grid-template-columns: 1fr; }
    .topbar-title p { display: none; }
    .user-meta { display: none; }
}

@media (max-width: 640px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .base-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .base-tip { padding: 0 2px; line-height: 1.5; }
    .base-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .base-stat { padding: 12px 14px; }
    .base-stat b { font-size: 19px; }
    .base-form-card .form-grid, .cat-board, .form-grid, .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-5 { grid-template-columns: 1fr; }
    .form-grid .span-2, .form-grid .full { grid-column: auto; }
    .account-main { align-items: flex-start; }
    .account-balance { align-items: flex-start; flex-direction: column; }
    .account-flow { justify-content: flex-start; }
    .quick-card { padding: 16px; }
    .quick-head { flex-direction: column; align-items: flex-start; }
    .amount-wrap { min-width: 100%; }
    .kpi-value { font-size: 22px; }
    .section-head { flex-direction: column; align-items: flex-start; }
    .install-body { padding: 20px; }
    .install-steps { flex-direction: column; }
    .install-step { padding: 10px 16px; border-bottom: 1px solid var(--line); }
    .btn { padding: 0 12px; }
    .tabs { width: 100%; overflow-x: auto; }
    .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lightbox { padding: 20px 12px; }
}
@media (max-width: 640px) {
    .hbar-row { grid-template-columns: 96px 1fr 84px; }
    .hbar-row-wide { grid-template-columns: 130px 1fr 90px; }
}
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }

/* ---------- 统一入口：项目收支二级导航 ---------- */
.page-subnav {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    margin: 0 0 20px;
    background: rgba(8, 16, 30, .7);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.subnav-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: .18s;
}
.subnav-item:hover { color: var(--ink); background: rgba(80, 130, 220, .10); }
.subnav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    box-shadow: 0 6px 18px rgba(31, 92, 255, .3);
}

/* ---------- 顶栏统一“记一笔”入口 ---------- */
.quick-create { position: relative; }
.quick-create-btn { gap: 4px; }
.quick-create-btn .chev { font-size: 10px; opacity: .75; margin-left: 2px; }
.quick-create-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 232px;
    padding: 8px;
    background: #0b1627;
    border: 1px solid #234064;
    border-radius: 14px;
    box-shadow: 0 22px 50px rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: .18s;
    z-index: 40;
}
.quick-create.open .quick-create-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.quick-create-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
}
.quick-create-menu a:hover { background: rgba(47, 107, 255, .14); }
.quick-create-menu a .ico { color: var(--blue-300); flex: none; }
.quick-create-menu a b { display: block; font-size: 13px; }
.quick-create-menu a small { display: block; color: var(--faint); font-size: 11px; margin-top: 3px; }

/* ---------- 手机端底部导航 ---------- */
.mobile-bar { display: none; }
.mobile-sheet { display: none; }

@media (max-width: 900px) {
    .sidebar, .sidebar-mask, .menu-btn { display: none !important; }
    .topbar { padding: 11px 14px; gap: 10px; }
    .topbar-title h1 { font-size: 17px; }
    .topbar-title p { display: none; }
    .topbar-right { gap: 7px; }
    .quick-create, .topbar-entry { display: none !important; }
    .user-chip { padding: 3px; background: transparent; border-color: transparent; }
    .user-meta { display: none; }
    .icon-btn { width: 34px; height: 34px; }
    .content { padding: 14px 14px 98px; }
    .app-shell { padding-bottom: 0; background: transparent; }

    .mobile-bar {
        display: flex;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 90;
        padding: 8px 8px 6px;
        background: rgba(6, 13, 24, .92);
        border: 1px solid #1e3656;
        border-radius: 18px;
        box-shadow: 0 18px 50px rgba(0, 0, 0, .65);
        backdrop-filter: blur(18px);
        justify-content: space-around;
        align-items: flex-end;
    }
    .mbar-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 5px 2px 3px;
        border: 0;
        background: transparent;
        color: #7690b3;
        font-size: 10.5px;
        text-decoration: none;
        cursor: pointer;
        border-radius: 10px;
    }
    .mbar-link .ico { color: currentColor; }
    .mbar-link.active { color: #9cc4ff; }
    .mbar-link.active .ico { filter: drop-shadow(0 0 8px rgba(76, 140, 255, .55)); }
    .mbar-add {
        flex: 0 0 62px;
        width: 62px;
        height: 62px;
        margin: -22px 2px 0;
        border: 4px solid #07101d;
        border-radius: 50%;
        background: linear-gradient(145deg, #3d7bff, #1f5cff);
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        box-shadow: 0 10px 28px rgba(31, 92, 255, .55);
        cursor: pointer;
    }
    .mbar-add span { font-size: 9px; margin-top: -2px; letter-spacing: .5px; }
    .mbar-add .ico { width: 22px; height: 22px; }

    .mobile-sheet {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 120;
        pointer-events: none;
        visibility: hidden;
    }
    .mobile-sheet.show { pointer-events: auto; visibility: visible; }
    .sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(1, 5, 12, .7);
        opacity: 0;
        transition: .22s;
        backdrop-filter: blur(2px);
    }
    .mobile-sheet.show .sheet-backdrop { opacity: 1; }
    .sheet-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 9px 18px calc(22px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, #0d1a2c, #08111e);
        border-radius: 22px 22px 0 0;
        border-top: 1px solid #24446b;
        box-shadow: 0 -24px 60px rgba(0, 0, 0, .55);
        transform: translateY(105%);
        transition: transform .24s ease;
        max-height: 82vh;
        overflow-y: auto;
    }
    .mobile-sheet.show .sheet-panel { transform: translateY(0); }
    .sheet-handle { width: 42px; height: 4px; border-radius: 4px; background: #2a4669; margin: 0 auto 14px; }
    .sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
    .sheet-head b { font-size: 17px; display: block; }
    .sheet-head small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 4px; }
    .sheet-close {
        flex: none; width: 32px; height: 32px; border-radius: 50%;
        border: 1px solid #24446b; background: #0c1a2d; color: #9cb8dd;
        font-size: 20px; line-height: 1; cursor: pointer;
    }
    .record-choices { display: grid; gap: 10px; }
    .record-choice {
        display: flex; align-items: center; gap: 13px;
        padding: 14px; background: rgba(16, 33, 56, .8);
        border: 1px solid #1e3656; border-radius: 14px;
        color: var(--ink); text-decoration: none;
    }
    .record-choice:active { transform: scale(.985); }
    .record-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
    .record-ico.blue { background: rgba(47, 107, 255, .16); color: #8eb8ff; }
    .record-ico.green { background: rgba(30, 180, 120, .14); color: #57d5a3; }
    .record-choice b { display: block; font-size: 14px; }
    .record-choice small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 3px; }
    .record-arrow { margin-left: auto; color: #5b7ba3; }
    .sheet-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .sheet-nav-item {
        display: flex; align-items: center; gap: 10px;
        padding: 12px; border-radius: 11px; border: 1px solid #1a304d;
        background: rgba(13, 28, 48, .65); color: #c9dbf5; text-decoration: none; font-size: 13px;
    }
    .sheet-nav-item.active { border-color: #2f6bff; background: rgba(47, 107, 255, .14); color: #fff; }
    .sheet-nav-ico { color: #7fa6d9; display: inline-flex; }
    .sheet-account { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #1a304d; }
    .sheet-account a {
        flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        height: 42px; border-radius: 11px; border: 1px solid #24446b; color: #9fbce0;
        text-decoration: none; font-size: 12.5px;
    }
    .sheet-account a.danger { color: #ff9b9b; border-color: #4a2a36; }
}

@media (max-width: 640px) {
    .page-subnav { display: flex; width: 100%; }
    .subnav-item { flex: 1; justify-content: center; padding: 9px 10px; }
    .card { border-radius: 13px; }
    .card[style*="padding:24px"] { padding: 17px !important; }
    .filters { padding: 14px; }
    .filter-grid { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
    .filter-grid > .field, .filter-grid > .field.search-wide { flex: 0 0 auto; width: 100%; }
    .filter-grid > .filter-actions { margin-left: 0; width: 100%; }
    .filter-grid > .filter-actions .btn { flex: 1; justify-content: center; }
    .page-head, .section-head { gap: 10px; }
    .page-head .actions, .section-actions { width: 100%; }
    .page-head .actions .btn, .section-actions .btn { flex: 1; justify-content: center; }
    .table-wrap { border-radius: 10px; }
    .table-wrap table { min-width: 660px; }
    .project-tabs { width: 100%; overflow-x: auto; }
    .project-tabs a { white-space: nowrap; }
    .topbar-title h1 { font-size: 16.5px; }
    .flash { font-size: 12.5px; }
    .kpi-grid, .grid-4, .grid-3 { gap: 10px; }
    .summary-row, .summary-strip { overflow: visible; }
    .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; }
    .summary-strip.summary-single { grid-template-columns: 1fr; }
    .project-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; }
    .project-tabs .tab { justify-content: center; min-width: 0; }
    .mdata-title { display: block; }
    .mdata-title > a, .mdata-title > span { display: block; overflow-wrap: anywhere; }
    .mdata-title b { display: block; margin-top: 5px; font-size: 18px; }
    .mdata-tags span { overflow-wrap: anywhere; }
}

/* ---------- 手机端筛选折叠 ---------- */
.filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 38px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--blue-300);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.filter-toggle .chev { margin-left: auto; color: var(--faint); font-size: 11px; }
@media (max-width: 640px) {
    .filter-toggle { display: flex; }
    .filters.mobile-closed { padding: 11px 14px; }
    .filters.mobile-closed form { display: none; }
    .filters.mobile-closed .filter-toggle { height: 30px; }
}

/* ---------- 手机端列表卡片（表格替代） ---------- */
.mdata-list { display: none; }
.mdata-card {
    padding: 14px;
    border: 1px solid #1a304d;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(15, 31, 54, .9), rgba(9, 20, 36, .9));
}
.mdata-card + .mdata-card { margin-top: 10px; }
.mdata-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mdata-date { font-size: 12px; color: #91a9c9; line-height: 1.5; }
.mdata-date small { display: block; color: #5e7899; font-size: 10.5px; margin-top: 2px; }
.mdata-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 9px; }
.mdata-title a { color: #dceaff; font-size: 14px; font-weight: 700; text-decoration: none; line-height: 1.45; }
.mdata-title b { flex: none; font-size: 16px; letter-spacing: .2px; }
.mdata-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mdata-tags span {
    padding: 3px 8px; border-radius: 999px; background: rgba(47, 107, 255, .1);
    border: 1px solid rgba(47, 107, 255, .18); color: #9db9df; font-size: 10.5px;
}
.mdata-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #16283f; color: #617c9e; font-size: 11px; }
.mdata-actions { display: flex; align-items: center; gap: 12px; }
.mdata-actions a, .mdata-actions button {
    display: inline-flex; align-items: center; gap: 3px; border: 0; background: transparent;
    color: #8db4e8; font-size: 11.5px; padding: 2px; cursor: pointer;
}
.mdata-actions button { color: #e18a8a; }
.mdata-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #16283f; }
.mdata-stats div { min-width: 0; }
.mdata-stats small { display: block; color: #647f9f; font-size: 10.5px; }
.mdata-stats b { display: block; margin-top: 3px; font-size: 13px; white-space: nowrap; }
@media (max-width: 640px) {
    .txn-table, .project-table, .company-table { display: none !important; }
    .mdata-list { display: block; }
    .mdata-card { padding: 13px; }
    .mdata-title b { font-size: 15px; }
}
@media (max-width: 640px) {
    .project-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-top: 4px; }
    .project-actions .btn { justify-content: center; }
    .project-hero .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .mobile-bar { padding-bottom: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
    .mbar-link { padding-bottom: 6px; }
    .content { padding-bottom: 110px; }
}

/* ============================================================
   浅色主题：白色主调，由右上角按钮或系统偏好初始化
   ============================================================ */
/* light theme (manual, no OS dependency) */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="light"] {
        --blue-950: #eff4fb;
        --blue-900: #f5f8fd;
        --blue-800: #ffffff;
        --blue-700: #e7effa;
        --blue-600: #1f5cff;
        --blue-500: #2f6bff;
        --blue-300: #1d4ed8;
        --blue-100: #dce9ff;
        --blue-50: #edf4ff;
        --ink: #142033;
        --ink-2: #33445c;
        --muted: #5f7189;
        --faint: #8292a8;
        --line: #dbe4f0;
        --line-2: #e9eff7;
        --bg: #f4f7fb;
        --white: #ffffff;
        --panel: #ffffff;
        --green: #0f9f6e;
        --green-bg: #e7f7f1;
        --red: #d9364f;
        --red-bg: #fdecef;
        --amber: #a96f12;
        --amber-bg: #fff4db;
        --shadow: 0 8px 22px rgba(30, 56, 96, .08);
        --shadow-lg: 0 20px 60px rgba(30, 56, 96, .14);
    }
:where(html[data-theme="light"]) body {
        background:
            radial-gradient(900px 480px at 6% -12%, rgba(47, 107, 255, .10), transparent 62%),
            radial-gradient(760px 460px at 100% 0%, rgba(47, 107, 255, .05), transparent 60%),
            #f4f7fb;
    }
:where(html[data-theme="light"]) a { color: #1d4ed8; }
:where(html[data-theme="light"]) a:hover { color: #0b3dc9; }
:where(html[data-theme="light"]) .sidebar {
        background: #ffffff;
        border-right: 1px solid #dbe4f0;
        box-shadow: 8px 0 30px rgba(30, 56, 96, .04);
    }
:where(html[data-theme="light"]) .brand-text strong,
:where(html[data-theme="light"]) .company-name { color: #142033; }
:where(html[data-theme="light"]) .brand-text span,
:where(html[data-theme="light"]) .version { color: #7b8ca3; }
:where(html[data-theme="light"]) .nav-group { color: #93a2b7; }
:where(html[data-theme="light"]) .nav-link { color: #4a5c75; }
:where(html[data-theme="light"]) .nav-link .ico { color: #7f93ad; }
:where(html[data-theme="light"]) .nav-link:hover { background: #eef4ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .nav-link.active {
        background: linear-gradient(90deg, #e6efff, #f3f7ff);
        border-color: #c9dcff;
        color: #1746b3;
    }
:where(html[data-theme="light"]) .nav-link.active .ico { color: #1f5cff; }
:where(html[data-theme="light"]) .sidebar-foot { border-top-color: #e3ebf5; }
:where(html[data-theme="light"]) .topbar { background: rgba(255, 255, 255, .9); border-bottom-color: #dbe4f0; }
:where(html[data-theme="light"]) .topbar-title h1 { color: #142033; }
:where(html[data-theme="light"]) .topbar-title p { color: #8292a8; }
:where(html[data-theme="light"]) .user-chip,
:where(html[data-theme="light"]) .menu-btn { background: #ffffff; border-color: #dbe4f0; color: #33445c; }
:where(html[data-theme="light"]) .avatar { background: #e9f1ff; color: #1d4ed8; border-color: #cddffb; }
:where(html[data-theme="light"]) .user-meta small { color: #8292a8; }
:where(html[data-theme="light"]) .quick-create-menu { background: #ffffff; border-color: #d6e2f1; box-shadow: 0 18px 42px rgba(30, 56, 96, .18); }
:where(html[data-theme="light"]) .quick-create-menu a:hover { background: #edf4ff; }
:where(html[data-theme="light"]) .quick-create-menu a b { color: #142033; }
:where(html[data-theme="light"]) .sidebar-mask { background: rgba(20, 34, 54, .35); }
:where(html[data-theme="light"]) .card,
:where(html[data-theme="light"]) .kpi,
:where(html[data-theme="light"]) .summary-item,
:where(html[data-theme="light"]) .base-stat,
:where(html[data-theme="light"]) .cat-block,
:where(html[data-theme="light"]) .account-item {
        background: #ffffff;
        border-color: #dbe4f0;
        box-shadow: 0 6px 18px rgba(30, 56, 96, .05);
    }
:where(html[data-theme="light"]) .card { background: #ffffff; }
:where(html[data-theme="light"]) .summary-strip { background: transparent; border-color: transparent; box-shadow: none; }
:where(html[data-theme="light"]) .filters,
:where(html[data-theme="light"]) .filters.mobile-closed { background: #ffffff; }
:where(html[data-theme="light"]) .section-head p,
:where(html[data-theme="light"]) .faint,
:where(html[data-theme="light"]) .cat-block-head p,
:where(html[data-theme="light"]) .account-balance span { color: #8292a8; }
:where(html[data-theme="light"]) .base-stat span { color: #5f7189; }
:where(html[data-theme="light"]) .base-stat b { color: #142033; }
:where(html[data-theme="light"]) .btn-primary { background: linear-gradient(135deg, #2f6bff, #1746d6); color: #fff; }
:where(html[data-theme="light"]) .btn-primary:hover { background: linear-gradient(135deg, #3d7bff, #1f5cff); }
:where(html[data-theme="light"]) .btn-ghost { background: #ffffff; border-color: #d5e0ee; color: #4a5c75; }
:where(html[data-theme="light"]) .btn-ghost:hover { background: #edf4ff; border-color: #a9c8ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .btn-soft { background: #edf4ff; color: #1d4ed8; border-color: #c9dcff; }
:where(html[data-theme="light"]) .btn-danger { background: #fdecef; color: #c62942; border-color: #f4c6cf; }
:where(html[data-theme="light"]) .btn-link { color: #1d4ed8; }
:where(html[data-theme="light"]) .icon-btn-sm { background: #f4f8fd; border-color: #e0e8f3; color: #6b7e96; }
:where(html[data-theme="light"]) .icon-btn-sm:hover { background: #edf4ff; border-color: #a9c8ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .icon-btn-sm.danger:hover { background: #fdecef; border-color: #f0bdca; color: #d9364f; }
:where(html[data-theme="light"]) input[type=text],
:where(html[data-theme="light"]) input[type=password],
:where(html[data-theme="light"]) input[type=number],
:where(html[data-theme="light"]) input[type=date],
:where(html[data-theme="light"]) input[type=month],
:where(html[data-theme="light"]) input[type=tel],
:where(html[data-theme="light"]) input[type=search],
:where(html[data-theme="light"]) select,
:where(html[data-theme="light"]) textarea {
        background-color: #ffffff;
        border-color: #d6e1ef;
        color: #142033;
    }
:where(html[data-theme="light"]) input:focus,
:where(html[data-theme="light"]) select:focus,
:where(html[data-theme="light"]) textarea:focus { background-color: #ffffff; border-color: #7fa9ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
:where(html[data-theme="light"]) input::placeholder,
:where(html[data-theme="light"]) textarea::placeholder { color: #9aa9bd; }
:where(html[data-theme="light"]) select { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f7189' stroke-width='2'%3E%3Cpath d='m5 8 7 7 7-7'/%3E%3C/svg%3E"); }
:where(html[data-theme="light"]) input[type=date]::-webkit-calendar-picker-indicator,
:where(html[data-theme="light"]) input[type=month]::-webkit-calendar-picker-indicator { filter: none; }
:where(html[data-theme="light"]) .tabs { background: #eef3fa; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .tab { color: #647691; }
:where(html[data-theme="light"]) .tab:hover { color: #1d4ed8; background: #e3edff; }
:where(html[data-theme="light"]) .tab.active { background: #ffffff; color: #1d4ed8; box-shadow: 0 2px 8px rgba(30, 56, 96, .1), inset 0 0 0 1px #c9dcff; }
:where(html[data-theme="light"]) .tab-count { background: #e6efff; color: #1d4ed8; }
:where(html[data-theme="light"]) .seg { background: #eef3fa; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .seg-item span { color: #647691; }
:where(html[data-theme="light"]) .seg-item input:checked + span { color: #ffffff; }
:where(html[data-theme="light"]) .page-subnav { background: #ffffff; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .subnav-item { color: #5f7189; }
:where(html[data-theme="light"]) .subnav-item:hover { background: #edf4ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .subnav-item.active { color: #ffffff; }
:where(html[data-theme="light"]) .table-wrap { background: #ffffff; border-color: #dbe4f0; }
:where(html[data-theme="light"]) table.data th { background: #f3f7fc; color: #5f7189; border-bottom-color: #dbe4f0; }
:where(html[data-theme="light"]) table.data td { color: #33445c; border-bottom-color: #e9eff7; }
:where(html[data-theme="light"]) table.data tbody tr:hover td { background: #f4f8ff; }
:where(html[data-theme="light"]) table.data tfoot td { background: #f3f7fc; border-top-color: #dbe4f0; }
:where(html[data-theme="light"]) .data .sub { color: #8292a8; }
:where(html[data-theme="light"]) .badge-green { background: #e7f7f1; color: #0b8a5e; border-color: #bfe9d9; }
:where(html[data-theme="light"]) .badge-red { background: #fdecef; color: #c62942; border-color: #f4c6cf; }
:where(html[data-theme="light"]) .badge-blue { background: #eaf1ff; color: #1d4ed8; border-color: #c9dcff; }
:where(html[data-theme="light"]) .badge-gray { background: #f0f3f8; color: #647691; border-color: #dde5ef; }
:where(html[data-theme="light"]) .badge-dark { background: #e8edf5; color: #33445c; border-color: #d3deec; }
:where(html[data-theme="light"]) .badge-amber { background: #fff4db; color: #99620b; border-color: #f2dca9; }
:where(html[data-theme="light"]) .cat-row,
:where(html[data-theme="light"]) .perm-check,
:where(html[data-theme="light"]) .perm-group { background: #f8fbfe; border-color: #e3ebf5; }
:where(html[data-theme="light"]) .cat-row[data-status="0"] { opacity: .6; }
:where(html[data-theme="light"]) .account-icon { background: #edf4ff; border-color: #d2e2ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .account-balance { border-top-color: #e7edf5; }
:where(html[data-theme="light"]) .cat-block-head { border-bottom-color: #e7edf5; }
:where(html[data-theme="light"]) .cat-block-head b { background: #edf4ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .base-tip { color: #8292a8; }
:where(html[data-theme="light"]) .summary-item { color: #5f7189; }
:where(html[data-theme="light"]) .summary-item b { color: #142033; }
:where(html[data-theme="light"]) .progress,
:where(html[data-theme="light"]) .hbar-track { background: #e8eff8; border-color: #dce6f2; }
:where(html[data-theme="light"]) .chart-grid line,
:where(html[data-theme="light"]) .chart-axis { border-color: #e3ebf5; }
:where(html[data-theme="light"]) .draft-bar { background: #ffffff; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .autosave-toast { background: #ffffff; border-color: #c9dcff; color: #1d4ed8; box-shadow: 0 14px 32px rgba(30, 56, 96, .16); }
:where(html[data-theme="light"]) .flash-success { background: #e7f7f1; border-color: #bfe9d9; color: #0b8a5e; }
:where(html[data-theme="light"]) .flash-error { background: #fdecef; border-color: #f4c6cf; color: #c62942; }
:where(html[data-theme="light"]) .login-page { background: radial-gradient(900px 500px at 8% 0%, rgba(47, 107, 255, .12), transparent 68%), #f4f7fb; }
:where(html[data-theme="light"]) .login-card { background: #ffffff; border-color: #dbe4f0; box-shadow: 0 30px 80px rgba(30, 56, 96, .14); }
:where(html[data-theme="light"]) .login-visual {
        color: #142033;
        background: radial-gradient(520px 300px at 20% 20%, rgba(47, 107, 255, .16), transparent 70%), linear-gradient(155deg, #eef5ff 0%, #e4efff 60%, #f4f8ff 100%);
        border-right-color: #dbe4f0;
    }
:where(html[data-theme="light"]) .login-visual::after { border-color: #cddffb; background: radial-gradient(circle, rgba(47, 107, 255, .12), transparent 68%); }
:where(html[data-theme="light"]) .login-visual .brand-mark { background: linear-gradient(145deg, #3d7bff, #0b3dc9); border-color: transparent; color: #fff; }
:where(html[data-theme="light"]) .login-visual .brand-text strong { color: #142033; }
:where(html[data-theme="light"]) .login-visual .brand-text span,
:where(html[data-theme="light"]) .login-sub,
:where(html[data-theme="light"]) .login-feature,
:where(html[data-theme="light"]) .login-foot { color: #5f7189; }
:where(html[data-theme="light"]) .login-feature .tick { background: #e6efff; border-color: #c9dcff; color: #1d4ed8; }
:where(html[data-theme="light"]) .login-form h2 { color: #142033; }
:where(html[data-theme="light"]) .login-error { background: #fdecef; border-color: #f4c6cf; color: #c62942; }
:where(html[data-theme="light"]) .login-page .login-card { color: #142033; }
:where(html[data-theme="light"]) .install-page,
:where(html[data-theme="light"]) .install-card,
:where(html[data-theme="light"]) .install-body { background: #ffffff; color: #142033; }
:where(html[data-theme="light"]) .install-steps,
:where(html[data-theme="light"]) .install-step { border-color: #dbe4f0; }
:where(html[data-theme="light"]) .install-tip { background: #f6f9fe; border-color: #dbe4f0; color: #5f7189; }
:where(html[data-theme="light"]) .mobile-bar { background: rgba(255, 255, 255, .94); border-color: #dbe4f0; box-shadow: 0 16px 40px rgba(30, 56, 96, .16); }
:where(html[data-theme="light"]) .mbar-link { color: #7b8ca3; }
:where(html[data-theme="light"]) .mbar-link.active { color: #1d4ed8; }
:where(html[data-theme="light"]) .mobile-sheet .sheet-backdrop { background: rgba(20, 34, 54, .35); }
:where(html[data-theme="light"]) .sheet-panel { background: #ffffff; border-color: #dbe4f0; box-shadow: 0 -22px 60px rgba(30, 56, 96, .2); }
:where(html[data-theme="light"]) .sheet-handle { background: #d6e1ef; }
:where(html[data-theme="light"]) .sheet-head b { color: #142033; }
:where(html[data-theme="light"]) .sheet-head small { color: #8292a8; }
:where(html[data-theme="light"]) .sheet-close { background: #f1f5fb; color: #5f7189; }
:where(html[data-theme="light"]) .record-choice,
:where(html[data-theme="light"]) .sheet-nav-item { background: #f7fafd; border-color: #e0e8f3; color: #33445c; }
:where(html[data-theme="light"]) .record-choice:hover,
:where(html[data-theme="light"]) .sheet-nav-item:hover { background: #edf4ff; border-color: #c9dcff; }
:where(html[data-theme="light"]) .sheet-nav-item.active { background: #edf4ff; border-color: #a9c8ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .sheet-account a { background: #ffffff; border-color: #dbe4f0; color: #4a5c75; }
:where(html[data-theme="light"]) .sheet-account a.danger { color: #c62942; border-color: #f4c6cf; }
:where(html[data-theme="light"]) .filter-toggle { background: #ffffff; border-color: #dbe4f0; color: #4a5c75; }

/* 浅色主题下的重点业务面板补丁 */
/* light theme (manual, no OS dependency) */
:where(html[data-theme="light"]) .quick-card {
        background:
            radial-gradient(700px 220px at 100% 0%, rgba(31, 92, 255, .09), transparent 65%),
            linear-gradient(135deg, #ffffff 0%, #fbfdff 100%);
        border-color: #cfdff3;
        box-shadow: 0 14px 36px rgba(30, 56, 96, .08), inset 0 1px 0 #ffffff;
    }
:where(html[data-theme="light"]) .quick-title h2 { color: #142033; }
:where(html[data-theme="light"]) .project-hero {
        background: radial-gradient(600px 200px at 0% 0%, rgba(31, 92, 255, .08), transparent 65%), #ffffff;
        border-color: #dbe4f0;
    }
:where(html[data-theme="light"]) .budget-hero {
        background: radial-gradient(520px 200px at 100% 0%, rgba(15, 159, 110, .07), transparent 65%), #ffffff;
        border-color: #dbe4f0;
    }
:where(html[data-theme="light"]) .note-box { background: #f7fafd; border-color: #bcd2f5; color: #33445c; }
:where(html[data-theme="light"]) .media-card { background: #ffffff; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .media-card .media-name,
:where(html[data-theme="light"]) .media-name { color: #33445c; }
:where(html[data-theme="light"]) .upload-drop { background: #f8fbfe; border-color: #c9dcff; }
:where(html[data-theme="light"]) .upload-drop:hover { background: #edf4ff; border-color: #8fb4ff; }
:where(html[data-theme="light"]) .voucher-btn { background: #eaf1ff; border-color: #c9dcff; color: #1d4ed8; }
:where(html[data-theme="light"]) .voucher-btn:hover { background: #dfeaff; border-color: #8fb4ff; color: #144bd6; }
:where(html[data-theme="light"]) .voucher-existing-item { background: #ffffff; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .vex-del { background: #fdecef; color: #c62942; border-color: #f4c6cf; }
:where(html[data-theme="light"]) .voucher-stage { background: radial-gradient(420px 220px at 50% 40%, rgba(31, 92, 255, .07), transparent 70%), #f6f9fd; }
:where(html[data-theme="light"]) .voucher-stage-tip { background: #ffffff; color: #5f7189; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .voucher-thumb { background: #f6f9fd; border-color: #dbe4f0; }
:where(html[data-theme="light"]) .project-name:hover,
:where(html[data-theme="light"]) .link-strong:hover { color: #1d4ed8; }
:where(html[data-theme="light"]) .empty-icon { background: #edf4ff; border-color: #d2e2ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .draft-bar button.ghost { color: #5f7189; }
:where(html[data-theme="light"]) .chart-tip,
:where(html[data-theme="light"]) .chart-empty { color: #8292a8; }
:where(html[data-theme="light"]) .project-status-tabs { background: #ffffff; }

/* light theme (manual, no OS dependency) */
:where(html[data-theme="light"]) .mbar-add { border-color: #ffffff; box-shadow: 0 10px 26px rgba(31, 92, 255, .35); }
:where(html[data-theme="light"]) .mobile-bar { border-color: #dbe4f0; }

/* light theme (manual, no OS dependency) */
:where(html[data-theme="light"]) .mdata-card {
        background: #ffffff;
        border-color: #dbe4f0;
        box-shadow: 0 6px 16px rgba(30, 56, 96, .05);
    }
:where(html[data-theme="light"]) .mdata-date { color: #5f7189; }
:where(html[data-theme="light"]) .mdata-date small { color: #8292a8; }
:where(html[data-theme="light"]) .mdata-title a { color: #142033; }
:where(html[data-theme="light"]) .mdata-tags span { background: #edf4ff; border-color: #d2e2ff; color: #1d4ed8; }
:where(html[data-theme="light"]) .mdata-foot,
:where(html[data-theme="light"]) .mdata-stats { border-top-color: #e7edf5; color: #5f7189; }
:where(html[data-theme="light"]) .mdata-actions a { color: #1d4ed8; }
:where(html[data-theme="light"]) .mdata-actions button { color: #c62942; }
:where(html[data-theme="light"]) .mdata-stats small { color: #8292a8; }
:where(html[data-theme="light"]) .mdata-stats b { color: #142033; }


/* 大面积白色主调 */
/* light theme (manual, no OS dependency) */
:where(html[data-theme="light"]) body { background: #ffffff; }
:where(html[data-theme="light"]) .app-shell,
:where(html[data-theme="light"]) .content { background: #ffffff; }
:where(html[data-theme="light"]) .quick-card { background: #ffffff; }
:where(html[data-theme="light"]) .login-page { background: #ffffff; }
:where(html[data-theme="light"]) .amount-wrap input { background: #ffffff; border-color: #d6e1ef; color: #142033; }
:where(html[data-theme="light"]) .amount-wrap input:focus { background: #ffffff; }
:where(html[data-theme="light"]) .summary-item { background: #ffffff; }
:where(html[data-theme="light"]) .mdata-card { background: #ffffff; }


/* 手机端统一列表卡片：所有字段完整换行显示 */
@media (max-width: 640px) {
    .mdata-title { display: block; }
    .mdata-title > a, .mdata-title > span { display: block; overflow-wrap: anywhere; }
    .mdata-title b { display: block; margin-top: 6px; font-size: 18px; }
    .mdata-tags span { overflow-wrap: anywhere; }
    .mdata-foot { flex-wrap: wrap; }
    .mdata-stats { gap: 10px; }
    .mdata-stats b { white-space: normal; overflow-wrap: anywhere; }
}

/* light theme (manual, no OS dependency) */
:where(html[data-theme="light"]) .check-item { background: #ffffff; border-color: #dbe4f0; color: #33445c; }
:where(html[data-theme="light"]) .check-item:hover { background: #edf4ff; border-color: #b9d2ff; }


/* ============================================================
   v1.6 统一排版规范
   基础间距、表单高度、目录与手机卡片规则
   ============================================================ */
:root {
    --card-pad: 18px;
    --gap-card: 16px;
    --gap-field: 16px;
    --gap-cat: 16px;
    --cat-pad: 14px;
    --cat-item-gap: 8px;
    --cat-row-h: 40px;
}


/* 所有卡片统一内边距与卡片间距 */
.card, .kpi, .quick-card, .summary-item, .base-stat {
    padding: var(--card-pad);
}
.card + .card { margin-top: var(--gap-card); }
.grid, .grid-2, .grid-3, .grid-4, .filter-grid, .summary-strip, .form-grid {
    gap: var(--gap-field);
}
.summary-strip { padding: 0; }
.card > .flex-between { gap: 12px; }
.card h2 { line-height: 1.4; }

/* 表单框统一高度、统一间距 */
.form-grid .field, .filter-grid .field { min-width: 0; }
.form-grid input:not([type=hidden]):not([type=checkbox]):not([type=radio]),
.form-grid select,
.form-grid textarea,
.filter-grid input:not([type=hidden]),
.filter-grid select,
.filter-grid textarea {
    width: 100%;
    height: 42px;
    min-height: 42px;
    box-sizing: border-box;
}
.form-grid textarea { resize: vertical; }
.form-grid .field label { min-height: 18px; display: flex; align-items: center; }

/* 目录统一：四组科目与资金账户同间距、同内边距、同行高 */
.cat-board { gap: var(--gap-cat); }
.cat-block { padding: var(--cat-pad); border-radius: 12px; }
.cat-block-head {
    padding-bottom: 12px;
    margin-bottom: 12px;
    min-height: 46px;
    box-sizing: border-box;
}
.cat-block-head p { margin-top: 4px; }
.cat-list { gap: var(--cat-item-gap); flex: 1; }
.cat-list .cat-row { min-height: var(--cat-row-h); }
.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    box-sizing: border-box;
}
.cat-row > div:first-child { min-width: 0; flex: 1; }
.cat-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cat-actions { min-width: 54px; justify-content: flex-end; }
.cat-empty { margin: 0; min-height: var(--cat-row-h); display: flex; align-items: center; }

.account-list { gap: var(--gap-cat); }
.account-item {
    padding: var(--cat-pad);
    min-height: 98px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

/* 宽表在桌面端压缩列宽，避免右侧被截断 */
table.data.table-wide { min-width: 0; }
table.data.table-wide th, table.data.table-wide td { padding: 10px 8px; font-size: 12.5px; }
table.data.table-wide .sub { font-size: 10.5px; }

/* 手机：所有列表按收支流水卡片展示，不截断、不横向滚动 */
.mobile-table-hide { display: block; }
.mdata-list { display: none; flex-direction: column; gap: var(--gap-card); }
.mdata-card { padding: 15px 16px; border-radius: 12px; }
.mdata-card + .mdata-card { margin-top: 0; }
.mdata-title { gap: 10px; }
.mdata-tags span { max-width: 100%; overflow-wrap: anywhere; }
.mdata-stats span { display: block; color: #6b7e96; font-size: 10.5px; line-height: 1.4; }
.mdata-stats b { margin-top: 4px; font-size: 13px; line-height: 1.35; }
.mdata-stats.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mdata-total { background: #f8fbff; border-color: #cddff5; }
.mdata-actions { flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
    .mobile-table-hide { display: none !important; }
    .mdata-list { display: flex; }
    .mdata-card { padding: 14px 15px; }
    .mdata-title { display: block; }
    .mdata-title > a, .mdata-title > span:not(.badge) { display: block; }
    .mdata-title .badge { display: inline-flex; width: auto; margin-top: 6px; }
    .mdata-title b { display: block; margin-top: 7px; font-size: 18px; white-space: normal; }
    .summary-strip > .summary-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .mdata-stats { gap: 10px 12px; }
    .mdata-stats b { white-space: normal; overflow-wrap: anywhere; }
    .card, .kpi, .summary-item, .base-stat { padding: 14px; }
    .card + .card { margin-top: 14px; }
    .grid, .grid-2, .grid-3, .grid-4, .filter-grid, .summary-strip, .form-grid { gap: 12px; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-toolbar > .flex { width: 100%; }
    .stats-toolbar .btn { flex: 1; justify-content: center; }
    .cat-board, .cat-list, .account-list { gap: 12px; }
    .cat-block, .account-item { padding: 12px; }
    .cat-row { min-height: 42px; }
    .btn { min-height: 40px; }
}

/* ============================================================
   v1.7 财务工作台主题
   深色菜单栏 · 内容区自适应黑白 · 竖向极简目录
   ============================================================ */
:root {
    --nav-bg: #0b1526;
    --nav-line: #1c2a40;
    --nav-text: #a9b8cc;
    --nav-muted: #64748b;
    --accent: #2563eb;
}

/* light theme (manual, no OS dependency) */
html[data-theme="light"] {
        --bg: #ffffff;
        --panel: #ffffff;
        --panel-soft: #f8fafc;
        --topbar: #ffffff;
        --field: #ffffff;
        --table-head: #f8fafc;
        --hover: #f5f8fc;
        --ink: #0f172a;
        --ink-2: #334155;
        --muted: #667085;
        --faint: #98a2b3;
        --line: #e4e9f1;
        --line-2: #edf1f6;
        --shadow: 0 1px 2px rgba(16, 24, 40, .04);
        --radius: 10px;
        --radius-sm: 8px;
    }
html[data-theme="light"] { color-scheme: light; }
:where(html[data-theme="light"]) body { background: #ffffff; }
/* dark theme (manual, no OS dependency) */
html[data-theme="dark"] {
        --bg: #070b12;
        --panel: #101826;
        --panel-soft: #0c1420;
        --topbar: #0b1220;
        --field: #0c1420;
        --table-head: #0d1624;
        --hover: #132033;
        --ink: #e6edf7;
        --ink-2: #b6c3d6;
        --muted: #8494ab;
        --faint: #5f7189;
        --line: #1f2b3d;
        --line-2: #172131;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        --radius: 10px;
        --radius-sm: 8px;
    }
html[data-theme="dark"] { color-scheme: dark; }
:where(html[data-theme="dark"]) body { background: #070b12; }

body {
    background: var(--bg);
    color: var(--ink);
    background-image: none;
}
.app-shell {
    background: linear-gradient(to right, var(--nav-bg) 0, var(--nav-bg) 239px, var(--nav-line) 239px, var(--nav-line) 240px, transparent 240px);
}
.content { background: transparent; }
.content { padding: 20px 28px 44px; }

/* 深色菜单栏：两种主题下都保持深色 */
.sidebar {
    background: var(--nav-bg) !important;
    border-right: 1px solid var(--nav-line);
    box-shadow: none;
}
.sidebar .brand { padding: 22px 18px 18px; }
.sidebar .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 8px;
    background: var(--accent);
    box-shadow: none;
    font-size: 18px;
}
.sidebar .brand-text strong { color: #f8fafc; font-size: 16px; letter-spacing: .2px; }
.sidebar .brand-text span { color: #7d8fa8; font-size: 10.5px; letter-spacing: .4px; }
.sidebar .nav { padding: 2px 10px 16px; }
.sidebar .nav-group {
    padding: 16px 10px 6px;
    color: var(--nav-muted);
    font-size: 10.5px;
    letter-spacing: .6px;
}
.sidebar .nav-link {
    min-height: 40px;
    padding: 9px 12px 9px 13px;
    margin-bottom: 1px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 5px;
    color: var(--nav-text);
    font-size: 13.5px;
    font-weight: 400;
}
.sidebar .nav-link .ico { color: #7f93ad; }
.sidebar .nav-link:hover { background: #111f33; color: #ffffff; }
.sidebar .nav-link.active {
    background: #122238;
    border-color: transparent;
    border-left-color: #3b82f6;
    color: #ffffff;
    font-weight: 500;
}
.sidebar .nav-link.active .ico { color: #93b4ff; }
.sidebar .nav-link.active::before { display: none; }
.sidebar .sidebar-foot { border-top: 1px solid var(--nav-line); padding: 14px 18px 16px; }
.sidebar .company-name { color: #8ea0b8; }
.sidebar .version { color: #5f7189; }

/* 顶栏随主题变化，内容区保持留白 */
.topbar {
    background: var(--topbar);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: none;
    padding: 12px 28px;
}
.topbar-title h1 { font-size: 20px; font-weight: 650; color: var(--ink); }
.topbar-title p { font-size: 11.5px; color: var(--faint); }
.user-chip, .menu-btn { background: var(--panel); border-color: var(--line); color: var(--ink-2); box-shadow: none; }

/* 卡片：白/黑自适应，减阴影、减圆角、统一边框 */
.card, .kpi, .summary-item, .base-stat, .cat-block, .account-item, .mdata-card, .quick-card,
.project-hero, .budget-hero, .filters, .filters.mobile-closed {
    background: var(--panel);
    background-image: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card { padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card h2, .section-head h2 { font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.section-head { margin-bottom: 14px; }
.summary-strip {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

/* 表单：统一 42px、细边框、无发光 */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month],
input[type=tel], input[type=search], select, textarea {
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    box-shadow: none;
}
input:focus, select:focus, textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}
.btn {
    background-image: none;
    border-radius: 7px;
    box-shadow: none;
    font-weight: 500;
}
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-soft); border-color: #cbd5e1; color: var(--ink); }
.badge { height: 22px; border-radius: 5px; font-weight: 500; font-size: 11.5px; }
.kpi-icon { background: rgba(37, 99, 235, .10); border: 1px solid rgba(37, 99, 235, .16); color: #3b82f6; }
.kpi-icon-red { background: rgba(220, 38, 38, .10); border-color: rgba(220, 38, 38, .16); color: #ef4444; }

/* 表格：财务系统式紧凑表头与细分隔线 */
table.data th {
    background: var(--table-head);
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    letter-spacing: .2px;
}
table.data td { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
table.data tfoot td { background: var(--panel-soft); border-top: 1px solid var(--line); }
table.data tbody tr:hover td { background: var(--hover); }
.table-wrap { background: var(--panel); border-color: var(--line); }

/* 基础资料与资金账户：改为完整竖向单列 */
.cat-board {
    grid-template-columns: 1fr;
    gap: 14px;
}
.cat-block { padding: 0; overflow: hidden; }
.cat-block-head {
    padding: 14px 16px;
    margin: 0;
    min-height: 0;
    border-bottom: 1px solid var(--line);
}
.cat-block-head p { margin-top: 3px; font-size: 11.5px; }
.cat-list { gap: 0; }
.cat-list .cat-row { min-height: 50px; }
.cat-row {
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    border-radius: 0;
    background: transparent;
}
.cat-row:last-child { border-bottom: 0; }
.cat-row:hover { background: var(--hover); }
.cat-name { font-size: 13.5px; }
.cat-actions { min-width: 62px; }
.account-list { grid-template-columns: 1fr; gap: 14px; }
.account-item { padding: 16px 18px; min-height: 0; }

/* 手机端：深色菜单栏、竖向功能目录、卡片间距统一 */
.mobile-bar {
    background: var(--nav-bg) !important;
    border-color: var(--nav-line) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    backdrop-filter: none;
}
.mbar-link { color: #8ea2bd; }
.mbar-link.active { color: #ffffff; }
.mbar-add { border-color: var(--nav-bg); }
.sheet-nav {
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.sheet-nav-item {
    padding: 13px 16px;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    border-radius: 0;
    background: transparent;
}
.sheet-nav-item:last-child { border-bottom: 0; }
.sheet-nav-item.active { background: var(--panel-soft); border-color: var(--line-2); }

@media (max-width: 640px) {
    .cat-block, .account-item { padding: 0; }
    .cat-row { padding: 12px 14px; }
    .card { padding: 16px; }
    .topbar { padding: 10px 14px; }
    .content { padding: 12px 12px 96px; }
}


/* 用户权限：表单窄栏 + 账号列表宽栏，避免表格右侧被裁切 */
.users-layout { grid-template-columns: 360px minmax(0, 1fr); }
@media (max-width: 1100px) {
    .users-layout { grid-template-columns: 1fr; }
}


/* 项目列表：固定列宽，名称与客户合并到首列，避免右侧操作被裁切 */
.table-projects { table-layout: fixed; width: 100%; }
.table-projects td, .table-projects th { padding-left: 10px; padding-right: 10px; }
.table-projects .table-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.table-projects .table-stack .sub { margin-top: 0; }
.table-projects .table-actions { text-align: right; }
@media (max-width: 900px) { .table-projects { table-layout: auto; } }


/* 项目收支桌面表：合并同类信息，紧凑行高，避免九列挤压换行 */
.table-txn { table-layout: fixed; width: 100%; min-width: 760px; }
.table-txn td, .table-txn th { padding-left: 10px; padding-right: 10px; }
.table-txn .cell-main { display: block; font-size: 12.5px; }
.table-txn .table-actions { text-align: right; }
@media (max-width: 900px) { .table-txn { table-layout: auto; } }


/* 半宽卡片内的小表：定宽列，禁止横向滚动 */
table.data.table-compact { min-width: 0; table-layout: fixed; }
table.data.table-compact th, table.data.table-compact td { padding: 9px 8px; font-size: 12.5px; }
/* 账号列表：定宽列，最近登录与操作不再被裁切 */
table.data.table-users { table-layout: fixed; min-width: 0; }
table.data.table-users th, table.data.table-users td { padding: 10px 8px; font-size: 12.5px; }
.table-users .nowrap { white-space: normal; }


/* 项目汇总：合并客户/负责人与状态/工期，8 列完整显示 */
table.data.table-summary { table-layout: fixed; width: 100%; min-width: 0; }


/* 两栏卡片高度对齐，保持版式统一 */
.grid-2.ratio { align-items: stretch; }


/* 栅格中相邻卡片只使用 grid gap，不再叠加额外上边距 */
.grid > .card + .card,
.grid-2 > .card + .card,
.grid-3 > .card + .card,
.grid-4 > .card + .card { margin-top: 0; }


/* 手机端不使用桌面侧栏底色带 */
@media (max-width: 900px) {
    .app-shell { background: transparent !important; }
}

/* ============================================================
   v1.8 · 统一留白 / 手动主题 / 极简目录
   ============================================================ */
:root { --section-gap: 16px; }

/* 上下模块统一 16px，消除 0 / 14 / 20 / 30 混用 */
.filters, .filters.mobile-closed { margin-bottom: var(--section-gap); }
.summary-strip { margin-bottom: var(--section-gap); }
.project-tabs { margin: 0; }
.page-subnav { margin: 0 0 var(--section-gap); }
.content > .flex-between { margin-bottom: var(--section-gap) !important; }
.content > .summary-strip + .card, .content > .filters + .card { margin-top: 0; }
.card + .card { margin-top: var(--section-gap); }
.section-head { margin-bottom: var(--section-gap); }

/* 筛选区：字段等宽等距，按钮与输入框同高 */
.filter-grid { gap: 16px; }
.filter-actions { gap: 10px; }
.filter-actions .btn, .filter-grid .btn { height: 42px; min-width: 88px; justify-content: center; }
.filter-actions .btn-sm, .filter-grid .btn-sm { height: 42px; font-size: 13px; }
.filter-grid .field > label { display: flex; align-items: center; min-height: 22px; margin-bottom: 4px; }
.filter-grid .field { display: flex; flex-direction: column; justify-content: flex-end; }

/* 收支流水：桌面端一行 6 个等距盒子，避免按钮单独掉到第二行 */
@media (min-width: 1101px) {
    .txn-filter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) 176px; }
}

/* 顶栏主题切换 */
.theme-toggle { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); }
.theme-toggle:hover { background: var(--hover); color: var(--ink); border-color: #b9c8dc; }
.theme-ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
html[data-theme="light"] .theme-ico-dark,
html[data-theme="dark"] .theme-ico-light { display: none; }

/* 科目目录：横向分组选择 */
.cat-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; }
.cat-switch-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--panel); color: var(--ink-2); box-shadow: none;
    transition: border-color .16s, background .16s, color .16s;
}
.cat-switch-item:hover { border-color: #c7d4e4; background: var(--hover); color: var(--ink); }
.cat-switch-item.active { border-color: #2563eb; background: #eff6ff; color: #174ea6; box-shadow: inset 0 0 0 1px #2563eb; }
html[data-theme="dark"] .cat-switch-item.active { background: #0e2340; border-color: #3b82f6; color: #dbeafe; box-shadow: inset 0 0 0 1px #3b82f6; }
.cat-switch-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-switch-meta { flex: 0 0 auto; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.cat-switch-meta b { font-size: 15px; color: var(--ink); margin-right: 2px; font-variant-numeric: tabular-nums; }
.cat-switch-item.active .cat-switch-meta, .cat-switch-item.active .cat-switch-meta b { color: #174ea6; }
html[data-theme="dark"] .cat-switch-item.active .cat-switch-meta, html[data-theme="dark"] .cat-switch-item.active .cat-switch-meta b { color: #bfdbfe; }
.cat-board-single { grid-template-columns: 1fr; }

/* 卡片式列表在手机上统一呼吸感 */
@media (max-width: 900px) {
    .cat-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .filter-grid { gap: 12px; }
    .cat-switch-item { padding: 11px 12px; }
    .mdata-card { border-radius: 10px; }
    .mdata-list { gap: 12px; }
    .theme-toggle { width: 34px; height: 34px; }
}

/* 收支筛选：日期合并为一个范围盒，桌面两行等距不留半行 */
.txn-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.txn-filter-grid .field-range { grid-column: span 3; }
.txn-filter-grid .filter-actions { grid-column: span 1; justify-self: stretch; }
.date-range { display: flex; align-items: center; gap: 10px; min-width: 0; }
.date-range input { min-width: 0; }
.date-sep { flex: 0 0 auto; color: var(--faint); font-size: 12px; }

/* 基础资料：卡片之间不再叠加 flex gap */
.base-layout { gap: 0; }

/* 手机列表：去掉外层大卡片，只保留一张张流水卡，间距统一 12 */
@media (max-width: 900px) {
    .card:has(> .mdata-list) {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0 !important;
    }
    .txn-filter-grid { display: grid; grid-template-columns: 1fr; }
    .txn-filter-grid .field-range, .txn-filter-grid .filter-actions { grid-column: auto; }
    .txn-filter-grid .filter-actions { justify-self: stretch; }
    .date-range { gap: 8px; }
}
@media (min-width: 901px) {
    .txn-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 统计分析：汇总条按数量等分，7 项不再落单 */
@media (min-width: 1160px) {
    .summary-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
    .summary-7 .summary-item { padding: 12px; }
    .summary-7 .summary-item b { font-size: 16px; }
    .summary-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}
@media (min-width: 901px) and (max-width: 1159px) {
    .stats-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}

/* 手机端奇数汇总项：改为一条横向指标行，避免全宽大卡片显得突兀 */
@media (max-width: 900px) {
    .summary-strip > .summary-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 62px;
        padding: 14px 16px;
    }
    .summary-strip > .summary-item:last-child:nth-child(odd) b { margin-top: 0; font-size: 19px; }
}

/* ============================================================
   v2.0 · 凭证审核中心 / CSV 批量导入
   ============================================================ */
.brand-mark.brand-mark-sm { font-size: 15px; letter-spacing: .5px; }
.brand-mark.brand-mark-xs { font-size: 12px; letter-spacing: 0; line-height: 1.1; text-align: center; }
.sidebar .brand-mark.brand-mark-sm { font-size: 14px; }
.sidebar .brand-mark.brand-mark-xs { font-size: 11px; }
.install-brand .brand-mark.brand-mark-sm { font-size: 16px; }
.install-brand .brand-mark.brand-mark-xs { font-size: 13px; }

.security-fab-wrap { position: fixed; right: 26px; bottom: 24px; z-index: 30; }
.security-fab {
    position: relative; width: 46px; height: 46px; padding: 0; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--ink-2);
    box-shadow: 0 8px 24px rgba(16, 24, 40, .14); cursor: pointer;
    transition: border-color .16s, color .16s, transform .16s;
}
.security-fab:hover { color: #2563eb; border-color: #93b4f8; transform: translateY(-1px); }
.security-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel); }
.security-dot.ok { background: #0f9f6e; }
.security-dot.warn { background: #f59e0b; }
.security-pop {
    position: absolute; right: 0; bottom: 58px; width: 330px; max-width: calc(100vw - 32px);
    padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 18px 48px rgba(16, 24, 40, .18);
}
.security-pop[hidden] { display: none !important; }
.security-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.security-pop-head > div { display: flex; align-items: center; gap: 8px; }
.security-pop-head b { font-size: 14px; }
.security-pop-close { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 6px; }
.security-pop-close:hover { background: var(--hover); color: var(--ink); }
.security-pop p { margin: 10px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.security-pop-hint { color: var(--faint) !important; font-size: 11.5px !important; }
@media (max-width: 900px) {
    .security-fab-wrap { right: 14px; bottom: 94px; }
    .security-fab { width: 42px; height: 42px; }
    .security-pop { bottom: 54px; padding: 14px 16px; }
}

.merged-section-head {
    margin: 28px 0 14px;
    padding: 0 2px;
    align-items: flex-end;
}
.merged-section-head h2 { font-size: 18px; letter-spacing: -.2px; }
.merged-section-head p { margin-top: 3px; }
@media (max-width: 900px) {
    .merged-section-head { margin: 24px 0 12px; align-items: flex-start; }
    .merged-section-head h2 { font-size: 17px; }
}

.project-info-list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 18px; }
.project-jump .faint { font-size: 12px; }
@media (max-width: 1180px) {
    .project-info-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .project-info-list { grid-template-columns: repeat(1, minmax(0, 1fr)); row-gap: 14px; }
}
@media (max-width: 560px) {
    .project-info-list { display: block; }
    .project-info-list .info-item {
        display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
        padding: 9px 0; border-bottom: 1px solid var(--line-2);
    }
    .project-info-list .info-item:last-child { border-bottom: 0; padding-bottom: 0; }
    .project-info-list .info-item label { margin: 0; flex: 0 0 auto; }
    .project-info-list .info-item span { text-align: right; word-break: break-word; }
}

/* ============================================================
   v2.0 · 凭证审核与批量导入
   ============================================================ */
.btn-xs { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; gap: 4px; }
.danger-text { color: #dc2626 !important; }
:where(html[data-theme="dark"]) .danger-text { color: #ff9aa5 !important; }
.subnav-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
    padding: 0 5px; margin-left: 3px; border-radius: 9px; background: #fff3dc; color: #9a620b; font-size: 10.5px; font-weight: 700;
}
.approval-summary { margin-bottom: var(--gap-card); }
.approval-note { font-size: 12.5px !important; color: var(--muted) !important; font-weight: 500 !important; }
.approval-card { padding: 14px 16px; }
.approval-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.approval-actions form { margin: 0; }
.approval-mfoot { align-items: center; }
@media (max-width: 640px) {
    .approval-table { display: none !important; }
    .approval-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .approval-card { padding: 12px; }
    .approval-actions { gap: 6px; }
    .approval-actions .btn-xs { height: 32px; padding: 0 12px; }
}

/* ============================================================
   v2.0 · 审核状态、审核中心、CSV 导入
   ============================================================ */
.status-switch {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin: 0 0 var(--gap-card); padding: 4px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--panel); width: fit-content;
}
.status-label { padding: 0 8px 0 4px; font-size: 11.5px; color: var(--muted); }
.status-switch a {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 6px;
    font-size: 12px; color: var(--muted); text-decoration: none;
}
.status-switch a.active { background: rgba(47, 107, 255, .14); color: var(--blue-300); font-weight: 600; }
.status-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px;
    padding: 0 4px; border-radius: 8px; background: #fff1d6; color: #9a620b; font-size: 10px; font-weight: 700;
}
.mdata-badges { display: inline-flex; align-items: center; gap: 5px; }
.reject-note {
    margin-top: 10px; padding: 8px 10px; border-radius: 7px; background: #fff1f2; border: 1px solid #f4c6cf;
    color: #b4233a; font-size: 11.5px; line-height: 1.55;
}
:where(html[data-theme="dark"]) .reject-note { background: rgba(255, 107, 122, .08); border-color: rgba(255, 107, 122, .2); color: #ff9aa5; }
.review-banner {
    display: flex; align-items: center; gap: 14px; margin-bottom: var(--gap-card);
    padding: 14px 16px; border: 1px solid #f2dca9; border-radius: 10px; background: #fff8e9; color: #6b4c0c;
}
.review-banner .review-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; background: #ffefc7; color: #9a620b; }
.review-banner b { display: block; font-size: 13.5px; }
.review-banner p { margin: 2px 0 0; font-size: 11.5px; color: #876c34; }
.review-banner .btn { margin-left: auto; flex: none; }
.review-banner-warn { border-color: #f4c6cf; background: #fff5f6; color: #8d1f31; }
.review-banner-warn .review-ico { background: #ffe2e6; color: #c62942; }
.review-banner-warn p { color: #93616a; }
:where(html[data-theme="dark"]) .review-banner { background: rgba(246, 196, 83, .08); border-color: rgba(246, 196, 83, .24); color: #f6d18a; }
:where(html[data-theme="dark"]) .review-banner .review-ico { background: rgba(246, 196, 83, .14); color: #f6c453; }
:where(html[data-theme="dark"]) .review-banner p { color: #bba47a; }
:where(html[data-theme="dark"]) .review-banner-warn { background: rgba(255, 107, 122, .08); border-color: rgba(255, 107, 122, .24); color: #ffb3bd; }
:where(html[data-theme="dark"]) .review-banner-warn p { color: #c9939b; }

.import-layout { align-items: start; }
.import-main, .import-guide { padding: 24px; }
.import-drop { min-height: 210px; }
.import-file { margin-top: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.import-note {
    margin-top: 16px; padding: 10px 12px; border-radius: 8px; background: var(--line-2);
    color: var(--ink-2); font-size: 12px; line-height: 1.65;
}
.import-rules { display: grid; gap: 0; }
.import-rules > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.import-rules > div:last-child { border-bottom: 0; }
.import-rules b { font-size: 12.5px; }
.import-rules span { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.import-example { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.import-example > b { display: block; margin-bottom: 8px; font-size: 12.5px; }
.example-row { margin-top: 8px; }
.example-row span { display: block; color: var(--muted); font-size: 11px; }
.example-row code {
    display: block; margin-top: 3px; padding: 7px 9px; border-radius: 6px; background: var(--line-2);
    color: var(--ink-2); font-size: 10.5px; line-height: 1.6; word-break: break-all; white-space: normal;
}
@media (max-width: 900px) {
    .status-switch { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .status-switch a { flex: none; }
    .review-banner { align-items: flex-start; flex-wrap: wrap; }
    .review-banner .btn { margin-left: 48px; }
    .import-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .import-main, .import-guide { padding: 16px; }
    .import-rules > div { grid-template-columns: 98px minmax(0, 1fr); gap: 9px; }
}

.nav-badge {
    margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #f59e0b; color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}

.approval-table td.nowrap { white-space: nowrap; }
.example-row code {
    white-space: normal; word-break: normal; overflow-wrap: normal;
    font-size: 11px; line-height: 1.75;
}
.import-checks {
    margin-top: 14px; padding: 14px 16px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--white);
}
.import-checks > b { display: block; margin-bottom: 9px; font-size: 12.5px; color: var(--ink); }
.import-checks > div {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 5px 0; color: var(--muted); font-size: 12px; line-height: 1.55;
}
.import-checks > div span {
    flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(31,92,255,.10); color: var(--blue-600); font-size: 10px; font-weight: 700;
}

.approval-self-note { color: var(--faint); font-size: 11.5px; white-space: nowrap; }

/* ---------- 通用删除确认弹窗（替代浏览器原生 confirm） ---------- */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(1, 4, 10, .55);
    backdrop-filter: blur(3px);
}
.confirm-modal.show { display: flex; }
.confirm-dialog {
    width: min(420px, 92vw);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 22px 22px 18px;
}
.confirm-dialog .confirm-title { font-size: 16px; margin-bottom: 10px; }
.confirm-dialog .confirm-text { color: var(--muted); font-size: 13px; line-height: 1.7; }
.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
:where(html[data-theme="light"]) .confirm-modal { background: rgba(20, 34, 54, .45); }
