/* ============================================================
   资源库 CRM · 界面美化
   现代 SaaS 风格：专业蓝/青配色 · 清晰层级 · 高密度业务界面
   仅修改样式，所有结构/类名保持不变
   ============================================================ */

:root {
    --ink: #101828;
    --muted: #667085;
    --faint: #98a2b3;
    --line: #e4e7ec;
    --line-soft: #eef0f4;
    --bg: #f4f5fb;
    --panel: #ffffff;

    --primary: #4f46e5;
    --primary-deep: #4338ca;
    --primary-mid: #6366f1;
    --primary-soft: #eef2ff;
    --violet: #8b5cf6;

    --sidebar: #0f172a;
    --sidebar-2: #1e1b4b;

    --amber: #d97706;
    --amber-soft: #fff7ed;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --blue: #2563eb;
    --blue-soft: #eff6ff;
    --purple: #7c3aed;
    --purple-soft: #f5f3ff;
    --green: #16a34a;
    --green-soft: #f0fdf4;

    --radius: 12px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -10px rgba(16, 24, 40, .10);
    --shadow-lg: 0 24px 60px -16px rgba(16, 24, 40, .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(99, 102, 241, .18); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #d0d5dd; border-radius: 999px;
    border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #98a2b3; background-clip: content-box; border: 2px solid transparent; }

.inline-form { display: inline-flex; align-items: center; margin: 0; padding: 0; }

/* ========== 整体框架 ========== */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 248px;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 170%);
    color: #dfe6ee; display: flex; flex-direction: column;
    z-index: 30;
}
.brand-block { display: flex; align-items: center; gap: 11px; padding: 22px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
    display: grid; place-items: center; font-size: 19px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary-mid), var(--violet));
    color: #fff; box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .55);
}
.brand-name { font-size: 16px; font-weight: 700; line-height: 1.25; color: #fff; }
.brand-sub { font-size: 11px; color: #9aa8bd; margin-top: 2px; }
.side-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin-bottom: 4px;
    color: #aab4c6; border-radius: var(--radius-sm); font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
    background: linear-gradient(135deg, var(--primary-mid), var(--primary-deep));
    color: #fff; font-weight: 600;
    box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6);
}
.nav-item .icon { flex: 0 0 auto; }
.sidebar-foot { padding: 14px 18px; color: #71808f; font-size: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.side-hint {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
    background: rgba(255,255,255,.07); border-radius: 999px; color: #9aa8bd; font-size: 11px;
}
.side-hint::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34d399; }

.content-wrap { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    height: 64px; background: rgba(255,255,255,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.top-title h1 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 700; }
.top-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.today-chip {
    color: var(--primary-deep); font-size: 12px; font-weight: 600;
    background: var(--primary-soft); border: 1px solid #dfe5ff;
    padding: 6px 12px; border-radius: 999px;
}
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary-mid), var(--violet));
    box-shadow: 0 3px 8px -2px rgba(99, 102, 241, .5);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13px; }
.user-meta small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.menu-btn { display: none !important; }
.icon-btn {
    width: 34px; height: 34px; min-width: 34px; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: #fff; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer;
    transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: 0 2px 8px -3px rgba(79,70,229,.35); }
.icon { vertical-align: middle; }

.main { flex: 1; position: relative; }
.main::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 250px; pointer-events: none; z-index: 0;
    background:
        radial-gradient(720px 260px at 12% -60px, rgba(99, 102, 241, .10), transparent 70%),
        radial-gradient(640px 240px at 88% -80px, rgba(139, 92, 246, .08), transparent 70%);
}
.page { max-width: 1220px; margin: 0 auto; padding: 26px 28px 60px; position: relative; z-index: 1; }
.page-center { max-width: 600px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: 0; }
.page-head-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; width: 100%; }
.page-head-inner h2 { font-size: 21px; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.back-link:hover { color: var(--primary); }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-mid), var(--primary-deep));
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, .4), 0 6px 14px -6px rgba(79, 70, 229, .55);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 2px 4px rgba(79, 70, 229, .45), 0 8px 18px -6px rgba(79, 70, 229, .6); }
.btn-amber {
    background: linear-gradient(135deg, #f59e0b, var(--amber));
    color: #fff;
    box-shadow: 0 1px 2px rgba(217, 119, 6, .4), 0 6px 14px -6px rgba(217, 119, 6, .55);
}
.btn-amber:hover { filter: brightness(1.07); box-shadow: 0 2px 4px rgba(217, 119, 6, .45), 0 8px 18px -6px rgba(217, 119, 6, .6); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: #fbfbff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-block { width: 100%; }
.btn-lg { height: 46px; font-size: 14.5px; border-radius: 12px; }
.btn-mini {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font-size: 12px; font-weight: 600;
    white-space: nowrap; cursor: pointer;
    transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: 0 2px 8px -3px rgba(79, 70, 229, .35); }
.btn-mini-primary {
    border-color: transparent; color: #fff;
    background: linear-gradient(135deg, var(--primary-mid), var(--violet));
    box-shadow: 0 1px 2px rgba(79, 70, 229, .35);
}
.btn-mini-primary:hover { color: #fff; filter: brightness(1.07); box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .6); }
.btn-mini-danger {
    border-color: transparent; color: #fff;
    background: linear-gradient(135deg, #ef4444, var(--red));
    box-shadow: 0 1px 2px rgba(220, 38, 38, .35);
}
.btn-mini-danger:hover { color: #fff; filter: brightness(1.07); box-shadow: 0 4px 12px -4px rgba(220, 38, 38, .6); }
.text-link { color: var(--primary); font-weight: 600; }
.text-link:hover { color: var(--primary-deep); }
.muted-link { color: var(--muted); }
.muted-link:hover { color: var(--primary); }
.muted { color: var(--muted); }

/* ========== KPI 指标卡 ========== */
.kpi-grid { display: grid; gap: 16px; margin-bottom: 20px; }
.kpi-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 18px; display: flex; gap: 14px; align-items: flex-start;
    box-shadow: var(--shadow); transition: box-shadow .18s ease, transform .18s ease;
}
.kpi-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.kpi-body { flex: 1; min-width: 0; }
.kpi-main-link { display: block; color: inherit; }
.kpi-main-link:hover .kpi-label { color: var(--primary); }
.kpi-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 44px;
    background: var(--blue-soft); color: var(--blue);
}
.kpi-green .kpi-icon { background: var(--green-soft); color: var(--green); }
.kpi-amber .kpi-icon { background: var(--amber-soft); color: var(--amber); }
.kpi-red .kpi-icon { background: var(--red-soft); color: var(--red); }
.kpi-purple .kpi-icon { background: var(--purple-soft); color: var(--purple); }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { font-size: 24px; font-weight: 800; line-height: 1.3; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.kpi-note { color: var(--faint); font-size: 12px; margin-top: 3px; }
.kpi-note a { color: var(--primary); font-weight: 600; }
.kpi-note a:hover { color: var(--primary-deep); }
.target-inline { margin-top: 6px; width: 100%; }
.target-inline summary {
    display: inline-flex; align-items: center; gap: 6px; min-height: 30px; color: var(--primary);
    font-weight: 600; cursor: pointer; list-style: none;
}
.target-inline summary::-webkit-details-marker { display: none; }
.target-inline summary::after {
    content: "设置"; padding: 1px 5px; border: 1px solid #dfe5ff; border-radius: 5px;
    background: var(--primary-soft); color: var(--primary); font-size: 10px;
}
.target-inline[open] summary::after { content: "收起"; }
.target-inline-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.target-inline-form .input { width: 100%; height: 42px; padding: 0 12px; font-size: 14px; }
.target-inline-form .btn { width: 100%; height: 40px; padding: 0 14px; flex: none; }
/* ========== 面板 ========== */
.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    margin-bottom: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 18px 20px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.table-panel .panel-head { border-bottom: 0; padding-bottom: 12px; }
.table-panel .table-wrap { padding: 0 0 6px; }
.danger-panel {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
}
.danger-panel .panel-head h3 { color: #b91c1c; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-aside { display: grid; grid-template-columns: 1fr 322px; gap: 20px; align-items: start; }
.content-stack, .side-stack { min-width: 0; }
.side-stack { position: sticky; top: 82px; }
.info-panel .info-list { margin: 0; padding: 6px 20px 2px; }
.info-list.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
@media (max-width: 860px) { .info-list.two-col { grid-template-columns: 1fr; } }
.info-list div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); }
.info-list div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); flex: 0 0 72px; font-size: 12px; padding-top: 1px; }
.info-list dd { margin: 0; text-align: right; font-weight: 600; word-break: break-all; font-variant-numeric: tabular-nums; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px 14px; }
.desc-text { margin: 0; padding: 0 20px 18px; color: var(--muted); line-height: 1.7; white-space: pre-wrap; }
.simple-form { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 13px; }
.simple-form .field { margin: 0; }
.approval-panel { border-color: #fde68a; }
.approval-callout {
    display: flex; align-items: flex-start; gap: 12px; margin: 18px 20px 0; padding: 14px 16px;
    border: 1px solid #fed7aa; border-radius: var(--radius-sm); background: var(--amber-soft); color: #92400e;
}
.approval-callout .icon { flex: 0 0 auto; margin-top: 1px; }
.approval-callout strong { display: block; font-size: 13px; }
.approval-callout p { margin: 3px 0 0; font-size: 12px; line-height: 1.6; }
.approval-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.approval-confirm {
    display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px;
    border: 1px solid #bbf7d0; border-radius: var(--radius-sm); background: var(--green-soft); color: #166534;
}
.approval-confirm input { margin-top: 3px; accent-color: var(--green); flex: 0 0 auto; }
.approval-reject { border-top: 1px solid var(--line-soft); background: #fffafa; }
.approval-state {
    display: flex; align-items: flex-start; gap: 13px; margin: 18px 20px 20px; padding: 16px;
    border: 1px solid #dbeafe; border-radius: var(--radius-sm); background: var(--blue-soft); color: #1e3a8a;
}
.approval-state.rejected { border-color: #fecaca; background: var(--red-soft); color: #991b1b; }
.approval-state-icon {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 42px;
    background: rgba(255,255,255,.75);
}
.approval-state strong { display: block; font-size: 14px; }
.approval-state p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.65; }
.approval-info { padding-top: 8px; }
.approval-info div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: flex-start;
    gap: 14px;
}
.approval-info dt { text-align: right; }
.approval-info dd {
    max-width: none;
    min-width: 0;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.approval-lock {
    display: flex; align-items: center; gap: 9px; margin: 0 20px 16px; padding: 12px 14px;
    border: 1px solid #dbeafe; border-radius: var(--radius-sm); background: var(--blue-soft); color: #1d4ed8; font-size: 12.5px;
}

/* ========== 待审核合同队列 ========== */
.review-queue {
    border-color: #fde68a;
}
.review-queue .panel-head {
    align-items: center;
}
.review-queue-list {
    padding: 4px 8px 10px;
}
.review-queue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 22px;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
.review-queue-row:hover {
    background: #fff8e1;
    transform: translateX(2px);
}
.review-queue-row + .review-queue-row {
    border-top: 1px dashed var(--line-soft);
}
.review-queue-main,
.review-queue-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.review-queue-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
}
.review-queue-main small,
.review-queue-meta small {
    color: var(--muted);
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.review-queue-meta {
    text-align: right;
}
.review-queue-meta b {
    color: #b45309;
    font-variant-numeric: tabular-nums;
}
.review-queue-action {
    color: var(--faint);
    display: grid;
    place-items: center;
}
.review-queue-row:hover .review-queue-action {
    color: var(--primary);
}

/* ========== 表格 ========== */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: 12px;
    border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap;
    letter-spacing: .01em;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #faf9ff; }
.th-actions { text-align: right; width: 1%; }
.table.compact td, .table.compact th { padding: 10px 14px; }
.table-link { font-weight: 700; }
.table-link:hover { color: var(--primary); }
.row-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.cell-empty { color: var(--faint); }
.row-done td { color: var(--faint); }
.td-empty { padding: 18px 0; color: var(--muted); text-align: center; }
.table.compact .table-link { font-weight: 600; }
.chip-wrap { display: flex; gap: 5px; flex-wrap: wrap; max-width: 280px; }

/* ========== 标签 / 状态 ========== */
.chip {
    display: inline-flex; align-items: center; height: 23px; padding: 0 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap;
    border: 1px solid transparent;
}
.chip-gray { background: #f2f4f7; color: #5f6c7c; border-color: #eaecf0; }
.chip-blue { background: var(--blue-soft); color: #1d4ed8; border-color: #dbeafe; }
.chip-green { background: var(--green-soft); color: #15803d; border-color: #bbf7d0; }
.chip-amber { background: var(--amber-soft); color: #b45309; border-color: #fed7aa; }
.chip-red { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.chip-purple { background: var(--purple-soft); color: #6d28d9; border-color: #e9d5ff; }
.chip-outline { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px rgba(152,162,179,.18); }
.status-pill.s-reserve::before { background: #97a3b2; }
.status-pill.s-intention::before { background: #2563c8; box-shadow: 0 0 0 3px rgba(37,99,200,.16); }
.status-pill.s-quote::before { background: #c98707; box-shadow: 0 0 0 3px rgba(201,135,7,.16); }
.status-pill.s-active::before { background: #3a9352; box-shadow: 0 0 0 3px rgba(58,147,82,.16); }
.status-pill.s-stable::before { background: #0e7c74; box-shadow: 0 0 0 3px rgba(14,124,116,.16); }
.status-pill.s-dormant::before { background: #6d5bd0; box-shadow: 0 0 0 3px rgba(109,91,208,.16); }
.status-pill.s-lost::before { background: #c03548; box-shadow: 0 0 0 3px rgba(192,53,72,.16); }
.pill-goal, .goal-pill {
    display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
    background: var(--amber-soft); border: 1px solid #fed7aa; color: #b45309; font-weight: 700; font-size: 12px;
}

/* ========== 目标 / 进度 ========== */
.goal-block { padding: 20px 20px 10px; }
.goal-value { font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.goal-value.goal-link { display: inline-block; }
.goal-value.goal-link:hover { color: var(--primary); }
.goal-label { color: var(--muted); font-size: 13px; margin: 6px 0 16px; }
.goal-arena { padding: 22px 20px 12px; }
.goal-big { font-size: 38px; font-weight: 800; line-height: 1.2; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.goal-sub { color: var(--muted); margin: 6px 0 16px; font-size: 13px; }
.progress { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin: 8px 0 6px; }
.progress.slim { height: 6px; margin: 6px 0 4px; }
.progress-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-mid), var(--violet));
    transition: width .35s ease;
}
.progress-fill.progress-teal { background: linear-gradient(90deg, #34d399, #059669); }
.progress-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tier-list { padding: 8px 20px 18px; }
.tier-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.tier-row:last-child { border-bottom: 0; }
.tier-rate { font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; }
.tier-row.reached .tier-rate { color: var(--primary); }
.tier-title { font-weight: 600; }
.tier-threshold { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.stat-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.stat-block { background: #fff; padding: 18px 20px; }
.stat-block.stat-link { display: block; color: inherit; transition: background .15s; }
.stat-block.stat-link:hover { background: var(--primary-soft); }
.stat-block.stat-link:hover .stat-label { color: var(--primary); }
.stat-num { font-size: 21px; font-weight: 800; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 5px; }

/* ========== 列表 ========== */
.mini-list, .todo-list { padding: 4px 20px 16px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-soft); }
.mini-row:last-child { border-bottom: 0; }
.mini-main, .mini-side { min-width: 0; }
.mini-title, .todo-title { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub, .todo-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.mini-side { text-align: right; }
.mini-side b { font-size: 14px; font-variant-numeric: tabular-nums; }
.mini-side > span:not(.chip) { display: block; color: var(--muted); font-size: 11px; }
.panel-count-link { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.panel-count {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 999px; background: var(--primary-soft); color: var(--primary-deep);
    font-size: 11px; line-height: 1; font-variant-numeric: tabular-nums;
}
.member-table { padding: 0 20px 10px; }
.member-table-head,
.member-row {
    display: grid;
    grid-template-columns: minmax(120px, .95fr) minmax(112px, .9fr) minmax(104px, .75fr) minmax(110px, .85fr) 72px minmax(146px, auto);
    align-items: center; gap: 16px;
}
.member-table-head {
    min-height: 38px; border-bottom: 1px solid var(--line);
    color: var(--muted); font-size: 11px; font-weight: 700;
}
.member-row { min-height: 62px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.member-row:last-child { border-bottom: 0; }
.member-person, .member-role, .member-performance, .member-account { min-width: 0; }
.member-name { font-weight: 700; }
.member-role { display: flex; align-items: center; gap: 7px; }
.member-role-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.member-role-note { color: var(--muted); font-size: 11px; white-space: nowrap; }
.member-performance {
    color: #0f766e; font-size: 13px; font-variant-numeric: tabular-nums;
}
.member-performance .row-sub { color: var(--muted); white-space: nowrap; }
.member-account {
    overflow: hidden; color: var(--muted); font-size: 12px;
    text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.member-status { display: flex; align-items: center; justify-content: flex-start; }
.member-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.member-actions .inline-form { margin: 0; }
.member-performance-filter { gap: 6px; }
.member-performance-filter .select {
    width: auto; min-width: 88px; height: 30px; padding-left: 9px; padding-right: 28px;
    background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px;
}
.member-performance-filter .btn {
    height: 30px; padding: 0 10px; font-size: 12px;
}
.todo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-soft); }
.todo-row:last-child { border-bottom: 0; }
.todo-main { flex: 1; min-width: 0; }
.todo-side { display: flex; align-items: center; gap: 8px; flex: none; }
.todo-row.done .todo-title { text-decoration: line-through; color: var(--faint); }
/* ========== 筛选 / 表单 ========== */
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 16px 18px; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 12px;
    border-radius: var(--radius-sm); background: var(--primary-soft); border: 1px solid #dfe5ff;
    color: var(--primary-deep); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.filter-chip a { color: var(--primary-deep); text-decoration: underline; }
.filter-group { position: relative; display: flex; align-items: center; }
.filter-group.grow { flex: 1; min-width: 220px; }
.filter-label { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.filter-group.grow .filter-label + .input { padding-left: 36px; }
.input {
    height: 38px; width: 100%; border: 1px solid var(--line); border-radius: 10px;
    padding: 0 12px; background: #fff; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--primary-mid); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }
.select {
    -webkit-appearance: none; appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
    background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
    background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
.filter-group .select { min-width: 130px; }
.filter-caption { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-right: 7px; white-space: nowrap; }
.row-tag {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary-deep); font-size: 11px; font-weight: 600;
}
.table-total td { background: var(--line-soft); border-top: 1px solid var(--line); font-weight: 700; }
.table-total td:first-child { border-top-left-radius: var(--radius-sm); }
.table-total td:last-child { border-top-right-radius: var(--radius-sm); }
.form-panel .panel-head { padding-bottom: 16px; }
.app-form { padding: 20px; }
.form-panel.password-panel { max-width: 620px; margin: 0 auto 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { min-width: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: #344054; margin-bottom: 7px; }
.field-full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; gap: 10px; }
.form-warning { background: var(--amber-soft); border: 1px solid #fed7aa; border-radius: var(--radius-sm); padding: 12px 14px; color: #92400e; font-size: 13px; }

/* ========== 客户搜索选择器 ========== */
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.customer-picker { position: relative; }
.customer-picker-box { position: relative; }
.customer-picker-input { padding-right: 34px; }
.customer-picker-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; line-height: 1; border: 0; border-radius: 50%;
    background: var(--line-soft); color: var(--muted); font-size: 15px; cursor: pointer;
    display: grid; place-items: center; padding: 0;
}
.customer-picker-clear:hover { background: var(--red-soft); color: var(--red); }
.customer-picker-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); overflow: hidden; max-height: 264px;
    display: none; flex-direction: column;
}
.customer-picker-dropdown:not([hidden]) { display: flex; }
.customer-picker-list { list-style: none; margin: 0; padding: 5px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.customer-picker-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.customer-picker-item:hover { background: var(--line-soft); }
.customer-picker-item.active { background: var(--primary-soft); }
.customer-picker-main { min-width: 0; }
.customer-picker-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-picker-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-picker-item .status-pill { font-size: 11.5px; flex-shrink: 0; }
.customer-picker-empty { padding: 18px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.customer-picker-status { padding: 7px 12px; text-align: center; font-size: 12px; color: var(--muted); background: var(--line-soft); border-top: 1px solid var(--line); }
.customer-picker-error { display: none; color: var(--red); font-size: 12.5px; margin-top: 6px; }
.customer-picker-error.show { display: block; }
.customer-picker.has-error .customer-picker-input { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.simple-form .field { margin-bottom: 0; }
.picker-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding: 0 18px 16px; }
.picker-form .field { margin: 0; }
.in-stack { padding: 16px 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.pay-summary { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 20px 18px; overflow: hidden; }
.pay-stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.pay-stat:last-child { border-right: 0; }
.pay-stat span { color: var(--muted); font-size: 11px; }
.pay-stat b { font-size: 18px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.pay-stat.primary { background: var(--primary-soft); }
.pay-stat.primary b { color: var(--primary-deep); }
.pay-contract { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 0 20px 18px; }
.form-panel .empty-state { border: 0; margin: 0; }

/* ========== 分段切换 ========== */
.seg-tabs {
    display: flex; gap: 4px; margin-bottom: 16px; background: var(--line-soft);
    border-radius: 10px; padding: 4px; width: max-content; max-width: 100%; overflow-x: auto;
}
.seg-tab {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px;
    color: var(--muted); font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s;
}
.seg-tab:hover { color: var(--ink); }
.seg-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(16, 24, 40, .12); font-weight: 700; }
.tab-count { font-size: 11px; background: var(--red-soft); color: var(--red); padding: 1px 6px; border-radius: 999px; font-weight: 600; }
.tab-count-green { background: var(--green-soft); color: #15803d; }
.tab-count-gray { background: #f2f4f7; color: #5f6c7c; }

/* ========== 时间线 ========== */
.timeline { padding: 12px 22px 20px; }
.timeline-item { position: relative; padding: 0 0 22px 24px; }
.timeline-item:before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child:before { bottom: calc(100% - 18px); }
.timeline-dot {
    position: absolute; left: 1px; top: 8px; width: 11px; height: 11px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-mid), var(--violet));
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.timeline-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.timeline-item p { margin: 0; color: #344054; line-height: 1.7; }

/* ========== 空状态 ========== */
.empty-state {
    padding: 38px 20px; text-align: center; border: 1.5px dashed #d7dbe6;
    border-radius: var(--radius-sm); margin: 18px 20px; background: #fbfcfe;
}
.empty-icon {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center;
    color: var(--primary); background: linear-gradient(135deg, var(--primary-soft), var(--purple-soft));
}
.empty-state h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.empty-state p { margin: 0 0 16px; color: var(--muted); }
.empty-actions { display: flex; justify-content: center; gap: 8px; }

/* ========== 附件 ========== */
.data-actions { display: flex; gap: 10px; padding: 16px 20px 20px; flex-wrap: wrap; }
.attach-upload { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 0 20px 18px; }
.attach-field { flex: 1 1 240px; min-width: 0; }
.attach-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.attach-selected span {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px;
    border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; color: var(--ink); font-size: 12px;
}
.attach-selected i { color: var(--faint); font-style: normal; font-size: 11px; }
.attach-hint { align-self: center; color: var(--faint); font-size: 11px; }
.attach-list { padding: 4px 20px 16px; }
.attach-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-soft); min-width: 0; }
.attach-row:last-child { border-bottom: 0; }
.attach-thumb {
    width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line);
    flex: none; background: #f4f6fa; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.attach-image-row:hover .attach-thumb {
    border-color: var(--primary-mid);
    box-shadow: 0 4px 12px -5px rgba(37, 99, 235, .55);
    transform: translateY(-1px);
}
.attach-icon {
    width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center;
    color: var(--primary-deep); background: var(--primary-soft); flex: none;
}
.attach-main { flex: 1; min-width: 0; }
.attach-name { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-name:hover { color: var(--primary); }
.attach-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin-top: 4px; }
.attach-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.attach-preview-popover {
    position: fixed; z-index: 120; width: max-content;
    max-width: min(560px, calc(100vw - 24px));
    padding: 10px; border: 1px solid rgba(15, 23, 42, .12); border-radius: 10px;
    background: #fff; box-shadow: 0 22px 54px -18px rgba(15, 23, 42, .42);
    opacity: 0; transform: translateY(4px) scale(.985); transform-origin: top left;
    pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.attach-preview-popover.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.attach-preview-popover img {
    display: block; width: auto; height: auto;
    max-width: min(540px, calc(100vw - 46px));
    max-height: min(68vh, 620px);
    border-radius: 6px; object-fit: contain; background: #f5f7fa;
    opacity: 0; transition: opacity .15s ease;
}
.attach-preview-popover img.is-loaded { opacity: 1; }
.attach-preview-popover:not(.is-loaded)::before {
    content: "图片预览加载中...";
    display: grid; place-items: center; min-width: 180px; min-height: 110px;
    padding: 20px; color: var(--muted); font-size: 12px;
}
.attach-preview-popover.has-error::before { content: "图片加载失败，请点击文件名查看"; }
.attach-preview-caption {
    max-width: min(540px, calc(100vw - 46px));
    padding: 8px 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--muted); font-size: 12px;
}

/* ========== 权限 ========== */
.section-title { padding: 24px 20px 4px; }
.section-title h4 { margin: 0; font-size: 14px; font-weight: 700; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 14px 20px 0; padding: 14px 16px; background: #fcfcfd; }
.perm-group legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.check-chip { cursor: pointer; }
.check-chip input { display: none; }
.check-chip span {
    display: flex; align-items: center; min-height: 34px; padding: 0 11px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: #fff; color: var(--muted); font-size: 12px;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.check-chip:hover span { border-color: #c7d2fe; }
.check-chip input:checked + span {
    border-color: var(--primary-mid); background: var(--primary-soft); color: var(--primary-deep); font-weight: 600;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .12);
}
.check-chip input:disabled + span { opacity: .55; }
.check-line { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; cursor: pointer; line-height: 1.55; }
.check-line input { margin-top: 3px; accent-color: var(--primary); }
/* ========== 柱状图 ========== */
.bar-chart { display: flex; align-items: flex-end; gap: 16px; padding: 26px 20px 14px; height: 250px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.bar-stack { display: flex; align-items: flex-end; gap: 4px; height: 170px; }
.bar { width: 14px; border-radius: 6px 6px 3px 3px; min-height: 4px; transition: filter .15s; }
.bar:hover { filter: brightness(1.1); }
.bar-income { background: linear-gradient(180deg, #fbbf24, #d97706); opacity: .9; }
.bar-amount { background: linear-gradient(180deg, #34d399, #059669); opacity: .9; }
.bar-label { color: var(--muted); font-size: 11px; }
.bar-value { color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; line-height: 1.1; max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.chart-legend { display: flex; align-items: center; gap: 18px; padding: 0 20px 18px; color: var(--muted); font-size: 11px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.dot-income { background: linear-gradient(180deg, #fbbf24, #d97706); }
.dot-amount { background: linear-gradient(180deg, #34d399, #059669); }
.tier-table { padding: 10px 20px 20px; }
.tier-table .table th, .tier-table .table td { padding-left: 0; padding-right: 14px; }
.reached-row { background: #f6fdf9; }

/* ========== 提示条 / 错误页 ========== */
.flash-banner {
    display: flex; align-items: center; min-height: 44px; padding: 11px 14px; margin-bottom: 20px;
    border-radius: 10px; font-size: 13px; font-weight: 600; border-left: 4px solid transparent;
    box-shadow: var(--shadow-sm);
}
.flash-success { background: var(--green-soft); border-color: #bbf7d0; border-left-color: #22c55e; color: #15803d; }
.flash-error { background: var(--red-soft); border-color: #fecaca; border-left-color: #ef4444; color: var(--red); }
.error-page, .error-page .empty-icon { text-align: center; }
.error-page { padding: 80px 20px; text-align: center; }
.error-page h1 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.error-page p { color: var(--muted); margin: 0 0 20px; }

/* ========== 全局弹窗 ========== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 90;
    display: grid; place-items: center; padding: 20px;
    background: rgba(2, 6, 23, .52);
    animation: modal-fade .18s ease both;
}
.modal-card {
    width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto;
    background: #fff; border: 1px solid var(--line);
    border-radius: 16px; padding: 26px;
    box-shadow: 0 28px 80px -18px rgba(2, 6, 23, .48);
    animation: modal-rise .22s ease both;
}
.modal-icon {
    width: 58px; height: 58px; border-radius: 16px;
    display: grid; place-items: center; margin-bottom: 16px;
    color: var(--green); background: var(--green-soft);
}
.contract-submitted-modal h3 {
    margin: 0 0 10px; font-size: 20px; font-weight: 800;
}
.contract-submitted-modal p {
    margin: 0; color: var(--muted); line-height: 1.7; font-size: 13px;
}
.contract-submitted-meta {
    margin: 20px 0 0; padding: 4px 0 2px;
    border-top: 1px solid var(--line-soft);
}
.contract-submitted-meta div {
    display: flex; justify-content: space-between; gap: 18px;
    padding: 9px 0; border-bottom: 1px dashed var(--line-soft);
}
.contract-submitted-meta dt {
    color: var(--muted); font-size: 12px;
}
.contract-submitted-meta dd {
    margin: 0; font-weight: 700; text-align: right;
    overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.modal-actions {
    display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ========== 登录页 ========== */
.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative;
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
    overflow: hidden;
}
.auth-body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none;
    background:
        radial-gradient(620px 460px at 12% 8%, rgba(99, 102, 241, .35), transparent 60%),
        radial-gradient(700px 520px at 92% 90%, rgba(139, 92, 246, .28), transparent 60%),
        radial-gradient(460px 360px at 78% 12%, rgba(14, 165, 233, .18), transparent 55%);
}
.auth-shell { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.auth-brand .brand-mark { width: 46px; height: 46px; font-size: 22px; box-shadow: 0 10px 24px -6px rgba(99, 102, 241, .7); }
.auth-brand .brand-name { font-size: 20px; color: #fff; }
.auth-brand .brand-sub { color: #a5b4fc; }
.auth-card {
    background: rgba(255, 255, 255, .98); border-radius: 20px; padding: 30px 28px;
    box-shadow: 0 30px 70px -18px rgba(2, 6, 23, .55);
}
.auth-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0; }
.auth-head p { margin: 8px 0 22px; color: var(--muted); font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .btn { margin-top: 6px; }
.auth-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: #a5b4fc; font-size: 11px; }

.nav-overlay { display: none; }

/* ========== 响应式 ========== */
@media (max-width: 1080px) {
    .kpi-grid.two, .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2col, .grid-aside { grid-template-columns: 1fr; }
    .side-stack { position: static; }
    .bar-chart { height: 238px; }
}

@media (min-width: 761px) and (max-width: 1080px) {
    .member-table-head,
    .member-row {
        grid-template-columns: minmax(92px, 1fr) minmax(88px, .9fr) 96px minmax(90px, .8fr) 64px minmax(132px, auto);
        gap: 10px;
    }
    .member-actions .btn-mini { padding: 0 7px; font-size: 11.5px; }
    .member-account { font-size: 11px; }
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: 0 0 44px rgba(2, 6, 23, .4);
    }
    .sidebar.open { transform: translateX(0); }
    .nav-overlay.show { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 25; }
    .content-wrap { margin-left: 0; }
    .topbar { padding: 0 12px; gap: 10px; height: 58px; }
    .menu-btn { display: inline-grid !important; }
    .today-chip, .user-meta { display: none; }
    .page { padding: 16px 14px 48px; }
    .page-head { flex-direction: column; }
    .page-head-inner { flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .kpi-grid.two, .kpi-grid.four, .kpi-grid.three { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-card { padding: 13px; gap: 10px; }
    .kpi-value { font-size: 19px; }
    .form-grid, .check-grid { grid-template-columns: 1fr; }
    .approval-grid { grid-template-columns: 1fr; }
    .review-queue-row { grid-template-columns: minmax(0, 1fr) auto; }
    .review-queue-action { display: none; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
    .filter-bar { flex-wrap: wrap; }
    .filter-group.grow { min-width: 100%; flex: 1 0 100%; }
    .filter-group .select { min-width: 0; }
    .filter-bar .btn { margin-left: auto; }
    .attach-upload { align-items: center; }
    .attach-field { flex: 1 1 100%; }
    .attach-hint { align-self: flex-end; }
    .attach-row { flex-wrap: wrap; }
    .attach-actions { margin-left: 60px; }
    .member-table { padding: 0 20px 8px; }
    .member-table-head { display: none; }
    .member-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 13px 0; }
    .member-person, .member-role, .member-performance, .member-account { grid-column: 1 / -1; }
    .member-performance { display: flex; align-items: baseline; gap: 7px; }
    .member-performance .row-sub { margin-top: 0; }
    .member-performance-filter { width: 100%; }
    .member-performance-filter .select { flex: 1 1 0; min-width: 96px; }
    .member-status { justify-content: flex-start; }
    .table-wrap { overflow-x: auto; }
    .table { min-width: 760px; }
    .pay-summary { grid-template-columns: 1fr 1fr; }
    .pay-stat:nth-child(2) { border-right: 0; }
    .pay-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .bar-chart { gap: 8px; padding: 20px 12px 10px; }
    .bar { width: 10px; }
    .seg-tabs { width: 100%; }
    .seg-tab { flex: 1; justify-content: center; padding: 0 8px; }
}

@media (max-width: 480px) {
    .kpi-grid.two, .kpi-grid.four, .kpi-grid.three { grid-template-columns: 1fr; }
    .auth-body { padding: 16px; }
    .auth-card { padding: 22px 20px; }
}
/* ========== 细节：顶栏渐变细线 ========== */
.topbar { position: sticky; overflow: visible; }
.topbar::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary-mid), var(--violet) 45%, #06b6d4 80%, #34d399);
    z-index: 1;
}

/* ========== 发布版视觉优化 ========== */
:root {
    --ink: #162033;
    --muted: #63738a;
    --faint: #94a3b8;
    --line: #dfe6ef;
    --line-soft: #edf1f6;
    --bg: #f3f6fa;
    --panel: #ffffff;

    --primary: #2563eb;
    --primary-deep: #1d4ed8;
    --primary-mid: #3b82f6;
    --primary-soft: #eff6ff;
    --violet: #0f766e;
    --purple: #0f766e;
    --purple-soft: #ecfdf5;

    --sidebar: #0b1728;
    --sidebar-2: #0b1728;

    --radius: 8px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -18px rgba(15, 23, 42, .28);
    --shadow-lg: 0 18px 44px -24px rgba(15, 23, 42, .32);
}

body {
    font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, select, textarea {
    font-family: inherit;
    letter-spacing: 0;
}

.page-head h2,
.kpi-value,
.goal-value,
.goal-big,
.stat-num,
.auth-head h1 {
    letter-spacing: 0;
}

.sidebar {
    background: var(--sidebar);
    border-right: 1px solid rgba(255, 255, 255, .06);
}
.brand-block {
    padding-top: 20px;
    padding-bottom: 17px;
}
.brand-mark {
    border-radius: 8px;
    background: var(--primary);
    box-shadow: 0 7px 18px -9px rgba(37, 99, 235, .9);
}
.brand-name { font-size: 16px; font-weight: 700; }
.brand-sub { color: #91a2b8; }
.side-nav { padding-top: 12px; }
.nav-item {
    min-height: 42px;
    color: #9eacc0;
    font-size: 13.5px;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover {
    background: rgba(255, 255, 255, .07);
    transform: translateX(1px);
}
.nav-item.active {
    background: var(--primary);
    box-shadow: 0 8px 20px -12px rgba(37, 99, 235, 1);
}
.sidebar-foot { color: #75869c; }
.side-hint { color: #93a4ba; background: rgba(255, 255, 255, .06); }

.topbar {
    background: rgba(255, 255, 255, .94);
    border-bottom-color: var(--line);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.topbar::before { display: none; }
.top-title h1 { font-size: 16px; font-weight: 700; }
.top-title p { color: var(--muted); }
.today-chip {
    color: var(--primary-deep);
    background: var(--primary-soft);
    border-color: #dbeafe;
}
.user-avatar {
    background: var(--primary);
    box-shadow: 0 5px 14px -8px rgba(37, 99, 235, .95);
}

.main::before { display: none; }
.page { padding-top: 24px; }
.page-head h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}
.page-head-inner h2 { font-size: 22px; }
.page-sub { color: var(--muted); line-height: 1.55; }
.back-link { color: var(--muted); }

.btn {
    border-radius: 8px;
    font-weight: 600;
    box-shadow: none;
}
.btn-primary {
    background: var(--primary);
    box-shadow: 0 7px 16px -12px rgba(37, 99, 235, .9);
}
.btn-primary:hover {
    background: var(--primary-deep);
    box-shadow: 0 9px 20px -13px rgba(37, 99, 235, 1);
    filter: none;
}
.btn-amber {
    background: var(--amber);
    box-shadow: 0 7px 16px -12px rgba(217, 119, 6, .9);
}
.btn-amber:hover {
    background: #b45309;
    filter: none;
}
.btn-ghost {
    background: #fff;
    border-color: var(--line);
}
.btn-ghost:hover {
    border-color: #b8c9e4;
    color: var(--primary-deep);
    background: #f8fbff;
}
.btn-mini-primary {
    background: var(--primary);
    box-shadow: none;
}
.btn-mini-primary:hover {
    background: var(--primary-deep);
    filter: none;
    box-shadow: 0 6px 16px -11px rgba(37, 99, 235, 1);
}
.btn-mini-danger {
    background: var(--red);
    box-shadow: none;
}
.btn-mini-danger:hover {
    background: #b91c1c;
    filter: none;
}

.kpi-card {
    border-radius: 8px;
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.kpi-card:hover {
    border-color: #cdd9e9;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.kpi-icon {
    border-radius: 8px;
}
.kpi-value {
    font-size: 25px;
    font-weight: 700;
}
.kpi-label { font-size: 12.5px; }
.kpi-note { color: var(--muted); }

.panel {
    border-radius: 8px;
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
}
.panel-head {
    padding: 17px 20px;
    border-bottom-color: var(--line-soft);
}
.panel-head h3 { font-size: 15.5px; font-weight: 700; }
.panel-head p { color: var(--muted); line-height: 1.55; }
.danger-panel {
    background: #fffafa;
}

.table { font-size: 13.5px; }
.table th {
    padding-top: 11px;
    padding-bottom: 11px;
    color: #53657d;
    background: #f8fafc;
    border-bottom-color: var(--line);
    letter-spacing: 0;
}
.table td {
    padding-top: 11px;
    padding-bottom: 11px;
    vertical-align: middle;
}
.table tbody tr:hover td { background: #f8fbff; }
.row-sub { color: var(--muted); }

.input {
    border-radius: 8px;
    border-color: var(--line);
    background: #fff;
}
.input:hover { border-color: #c8d4e5; }
.input:focus {
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.field label { color: #34435a; }
.filter-bar { border-radius: 8px; }
.seg-tabs { border-radius: 8px; }
.seg-tab { border-radius: 6px; }
.seg-tab.active { color: var(--primary-deep); }

.chip { font-weight: 600; }
.chip-purple {
    color: #0f766e;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.progress-fill { background: var(--primary); }
.progress-fill.progress-teal { background: #0f9f8f; }
.timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.empty-icon {
    border-radius: 8px;
    color: var(--primary);
    background: var(--primary-soft);
}
.perm-group,
.customer-picker-dropdown,
.flash-banner {
    border-radius: 8px;
}

.bar-income,
.dot-income { background: #d97706; }
.bar-amount,
.dot-amount { background: #0f9f8f; }

.modal-card,
.modal-icon,
.auth-card {
    border-radius: 8px;
}
.modal-card {
    border-color: var(--line);
    box-shadow: 0 28px 70px -30px rgba(2, 6, 23, .52);
}

.auth-body {
    background: #0b1728;
}
.auth-body::before { display: none; }
.auth-card {
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 28px 64px -24px rgba(2, 6, 23, .72);
}
.auth-brand .brand-sub { color: #93c5fd; }
.auth-foot { color: #93a4ba; }
