/* 集团内部账务管理系统 — 设计系统（无构建，原生 CSS） */

:root {
  --bg: #f3f6fb;
  --bg-soft: #f9fbfe;
  --panel: #ffffff;
  --line: #e6ebf3;
  --line-soft: #eef2f8;
  --ink: #0f1b2d;
  --ink-2: #3f4d63;
  --muted: #768097;
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --brand-soft: #eef4ff;
  --good: #0f9d6b;
  --good-soft: #e9faf2;
  --bad: #e0483a;
  --bad-soft: #fef0ee;
  --warn: #d9870a;
  --warn-soft: #fff8eb;
  --sidebar: #111c30;
  --sidebar-hover: #1e2b44;
  --sidebar-ink: #c2cde0;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 28, 48, 0.04), 0 2px 10px rgba(16, 28, 48, 0.045);
  --shadow-lift: 0 6px 22px rgba(37, 99, 235, 0.13);
  --font: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.62; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14.5px; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #1e3a8a 0%, #0f172a 55%, #020617 100%);
}
.login-card {
  width: 380px; background: var(--panel); border-radius: 16px; padding: 36px 32px; box-shadow: 0 24px 64px rgba(2, 6, 23, 0.45);
}
.login-card .brand-mark { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.login-card .brand-sub { color: var(--muted); margin: 6px 0 24px; font-size: 13px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.login-error { color: var(--bad); font-size: 13px; min-height: 20px; margin-top: 10px; }
.login-hint { color: var(--muted); font-size: 12px; margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }

/* ---------- 布局壳 ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-ink); padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { color: #fff; font-weight: 700; font-size: 17px; padding: 4px 12px 2px; letter-spacing: 0.5px; }
.sidebar .brand small { display: block; color: #64748b; font-weight: 400; font-size: 11px; margin-top: 2px; }
.sidebar nav { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 8px; color: var(--sidebar-ink);
  text-decoration: none; font-size: 14.5px; border: none; background: transparent; cursor: pointer; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.nav-item .nav-ico { width: 20px; text-align: center; font-size: 16px; }
.nav-item .nav-count {
  margin-left: auto; background: rgba(255, 255, 255, 0.16); border-radius: 999px; font-size: 11.5px; padding: 0 7px; line-height: 18px;
}
.nav-item.active .nav-count { background: rgba(255, 255, 255, 0.28); }
.nav-group { color: #5b6b82; font-size: 12px; padding: 16px 12px 5px; letter-spacing: 1px; font-weight: 600; }
.nav-l1 .nav-ico { font-size: 17px; }
/* 一级（账套首页 / 集团治理）：隐藏左侧账套模块栏，正文铺满——进入账套后才出现左栏（金蝶式两级空间） */
.shell.no-sidebar { grid-template-columns: 1fr; }
.shell.no-sidebar .sidebar { display: none; }
#appShell.no-sidebar ~ .ai-fab { display: none !important; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.topbar .top-meta { color: var(--muted); font-size: 12.5px; }
.topbar .top-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.top-nav-link { color: var(--brand); cursor: pointer; font-size: 13px; text-decoration: none; padding: 4px 2px; }
.top-nav-link:hover { text-decoration: underline; }
/* topbar 用户区（从原侧栏移上来，浅色横排） */
.topbar .user-box { display: flex; align-items: center; gap: 10px; border: none; padding: 0; font-size: 12.5px; }
.topbar .user-box .user-name { color: var(--ink); font-weight: 600; font-size: 13px; }
.topbar .user-box .user-role { color: var(--muted); }
.topbar .user-box button {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12.5px;
}
.topbar .user-box button:hover { border-color: var(--brand); color: var(--brand-deep); }
.page { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- 通用组件 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
}
.card .card-head h3 { font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.card .card-head .head-sub { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-left: 8px; }
.card .card-body { padding: 18px 20px; }
.card .card-body.tight { padding: 0; }
.card .card-body.empty, .empty { color: var(--muted); text-align: center; padding: 30px 16px; font-size: 13.5px; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1200px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: .85; }
.kpi.tone-good::before { background: var(--good); } .kpi.tone-bad::before { background: var(--bad); }
.kpi .kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .kpi-value { font-size: 23px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: .3px; color: var(--ink); }
.kpi .kpi-foot { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi.tone-good .kpi-value { color: var(--good); }
.kpi.tone-bad .kpi-value { color: var(--bad); }
.kpi.tone-brand .kpi-value { color: var(--brand-deep); }

.todo-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.todo-chip {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-size: 13px; box-shadow: var(--shadow);
}
.todo-chip b { font-size: 15px; }
.todo-chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.todo-chip.urgent { border-color: #fecaca; background: var(--bad-soft); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; color: var(--ink-2); font-weight: 600; font-size: 12.5px; padding: 11px 16px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--bg-soft); letter-spacing: .2px;
}
table.data td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink); }
table.data tbody tr:nth-child(even) td { background: #fbfcfe; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--brand-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: .2px; }
.num.pos { color: var(--good); font-weight: 600; }
.num.neg { color: var(--bad); font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.badge {
  display: inline-block; border-radius: 999px; font-size: 11.5px; padding: 1px 9px; font-weight: 600; white-space: nowrap;
  background: #f1f5f9; color: #475569;
}
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.brand { background: var(--brand-soft); color: var(--brand-deep); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  border-radius: var(--radius-sm); padding: 8px 15px; font-size: 13.5px; cursor: pointer; font-weight: 500; transition: all .12s ease;
}
.btn:hover { border-color: #c3cfe0; background: var(--bg-soft); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(37,99,235,.25); }
.btn.primary:hover { background: var(--brand-deep); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.btn.danger { background: var(--bad-soft); border-color: #fecaca; color: var(--bad); }
.btn.danger:hover { background: #fee2e2; }
.btn.good { background: var(--good-soft); border-color: #a7f3d0; color: var(--good); }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.tiny { padding: 2px 8px; font-size: 12px; border-radius: 5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* 工资表 / 可编辑表格 */
.report-table input.cell-num { width: 92px; text-align: right; font-variant-numeric: tabular-nums; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 13px; }
.report-table input.cell-num:focus { border-color: var(--brand); outline: none; }
.report-table tr.group-row td { background: var(--bg-soft); font-weight: 600; color: var(--ink-2); }
.report-table td.row-actions { white-space: nowrap; text-align: center; }
.report-table td.row-actions .btn { margin: 0 2px; }

.empty { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 13px; }

/* ---------- 做账中心流水线 ---------- */
.pipeline { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1280px) { .pipeline { grid-template-columns: 1fr; } }
.lane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lane .lane-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center;
}
.lane .lane-head h3 { font-size: 13.5px; }
.lane .lane-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }
.work-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fcfdff; }
.work-card .wc-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.work-card .wc-title { font-weight: 600; font-size: 13.5px; }
.work-card .wc-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.work-card .wc-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.work-card .wc-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.entry-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.entry-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 6px; border-bottom: 1px dashed var(--line); }
.entry-table td { padding: 4px 6px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.warning-list { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--warn); }
.confidence-bar { height: 5px; border-radius: 4px; background: #e2e8f0; margin-top: 8px; overflow: hidden; }
.confidence-bar i { display: block; height: 100%; background: var(--brand); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 6px; }
.tab {
  border: none; background: transparent; padding: 11px 16px; font-size: 13.5px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; font-weight: 500;
}
.tab.active { color: var(--brand-deep); border-bottom-color: var(--brand); font-weight: 700; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; background: #fff; font-size: 13.5px; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
.field input:hover, .field select:hover { border-color: #c3cfe0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13); }
.field textarea { min-height: 72px; resize: vertical; }

/* ---------- 弹窗 / Toast ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.5); display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px; z-index: 50; overflow-y: auto;
}
.modal {
  background: var(--panel); border-radius: 14px; width: 560px; max-width: 100%; box-shadow: 0 24px 64px rgba(2, 6, 23, 0.35);
}
.modal.wide { width: 760px; }
.modal .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .modal-head h3 { font-size: 15px; }
.modal .modal-close { border: none; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal .modal-body { padding: 18px 20px; }
.modal .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

#toastRoot { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: #0f172a; color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 13px; box-shadow: 0 8px 24px rgba(2, 6, 23, 0.4);
  animation: toast-in 0.18s ease-out;
}
.toast.error { background: var(--bad); }
.toast.success { background: var(--good); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- AI 页 ---------- */
.ai-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.ai-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex: none; }
.ai-dot.live { background: var(--good); }
.chat-box { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; }
.chat-msg { max-width: 86%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.chat-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: #f1f5f9; border-bottom-left-radius: 4px; }
.chat-msg .chat-meta { font-size: 11px; opacity: 0.65; margin-top: 6px; }
.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.finding { border-left: 3px solid var(--line); padding: 10px 14px; background: #fcfdff; border-radius: 0 8px 8px 0; }
.finding.high { border-left-color: var(--bad); }
.finding.medium { border-left-color: var(--warn); }
.finding.low { border-left-color: var(--good); }
.finding .f-title { font-weight: 600; font-size: 13.5px; }
.finding .f-detail { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.finding .f-suggestion { font-size: 12.5px; margin-top: 4px; color: var(--brand-deep); }

/* ---------- 提案 / Token ---------- */
.proposal { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.proposal .p-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.proposal .p-title { font-weight: 600; }
.proposal pre {
  background: #0f172a; color: #cbd5e1; padding: 12px; border-radius: 8px; font-size: 11.5px; overflow-x: auto; margin-top: 10px;
  font-family: var(--mono); max-height: 260px;
}
.token-once {
  background: var(--warn-soft); border: 1px dashed var(--warn); padding: 12px 14px; border-radius: 10px; font-family: var(--mono);
  font-size: 12.5px; word-break: break-all; margin-top: 10px;
}
.code-block {
  background: #0f172a; color: #cbd5e1; padding: 14px; border-radius: 10px; font-family: var(--mono); font-size: 12px;
  overflow-x: auto; line-height: 1.7;
}

/* ---------- 危险区 ---------- */
.danger-zone { border: 1px solid #fecaca; background: var(--bad-soft); border-radius: var(--radius); padding: 16px 18px; }
.danger-zone h4 { color: var(--bad); font-size: 13.5px; margin-bottom: 6px; }
.danger-zone p { font-size: 12.5px; color: #7f1d1d; margin-bottom: 10px; }

/* ---------- 账套多选（用户管辖账套） ---------- */
.check-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 220px; overflow: auto; padding: 6px 2px; }
.check-item { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; font-size: 13px; white-space: nowrap; }

/* ---------- 账套首页（公司方块化，参考精斗云） ---------- */
.acct-home { padding: 4px 2px; }
.acct-home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.acct-home-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.acct-home-ai { background: var(--brand-soft); color: var(--brand-deep); border: 1px solid #dbe5ff; border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.acct-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 168px; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.acct-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(37,99,235,.14); border-color: #c7d6ff; }
.acct-card.off { opacity: .55; }
.acct-card-top { padding: 16px 18px 10px; flex: 1; }
.acct-name { font-size: 16px; font-weight: 700; color: var(--brand-deep); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-id { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-bottom: 10px; }
.acct-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.acct-tag { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
.acct-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--brand-soft); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); font-size: 13px; color: var(--muted); }
.acct-card-foot b { color: var(--ink); }
.acct-card-new { align-items: center; justify-content: center; cursor: pointer; border-style: dashed; border-color: #c7d6ff; background: linear-gradient(180deg, #fafcff, #f4f8ff); }
.acct-card-new:hover { border-color: var(--brand); }
.acct-new-plus { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 30px; line-height: 56px; text-align: center; margin-bottom: 10px; }
.acct-new-label { color: var(--brand-deep); font-weight: 600; }
.btn.sm { padding: 4px 12px; font-size: 13px; }
/* 集团横幅 + 境内/境外分组 */
.group-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; border-radius: var(--radius); padding: 18px 24px; margin-bottom: 14px; box-shadow: 0 6px 22px rgba(37,99,235,.18); }
.group-banner-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.group-banner .muted { color: rgba(255,255,255,.82) !important; }
.group-banner .muted b { color: #fff; }
.group-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.group-stat { text-align: center; }
.group-stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
.group-stat span { font-size: 12px; color: rgba(255,255,255,.85); }
.group-note { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 9px 14px; margin-bottom: 16px; }
.acct-section { margin-bottom: 20px; }
.acct-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-left: 2px; border-left: 3px solid var(--brand); padding-left: 10px; }
.acct-section-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.acct-focus { margin-top: 8px; }
.acct-tag.tag-cur { background: var(--brand-soft); color: var(--brand-deep); border-color: #dbe5ff; font-weight: 600; }
@media (max-width: 480px) { .acct-grid { grid-template-columns: 1fr; } }

/* ---------- 账套工作台：常用功能宫格 + 顶栏账套芯片（精斗云风格） ---------- */
.acct-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--brand-soft); color: var(--brand-deep); border: 1px solid #d7e3ff; border-radius: 999px; padding: 5px 14px; font-size: 13.5px; font-weight: 500; margin-right: 10px; }
.acct-chip b { color: var(--ink); }
.acct-chip a { color: var(--brand); cursor: pointer; text-decoration: none; border-left: 1px solid #c7d6ff; padding-left: 8px; margin-left: 2px; }
.acct-chip a:hover { text-decoration: underline; }
.quick-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.quick-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.quick-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--ink); transition: transform .1s ease, border-color .1s ease, background .1s ease; }
.quick-cell:hover { transform: translateY(-2px); border-color: var(--brand); background: var(--brand-soft); }
.quick-cell .quick-ico { width: 38px; height: 38px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.quick-cell.primary .quick-ico { background: var(--brand); border-color: var(--brand); }
.quick-cell.ai .quick-ico { background: linear-gradient(135deg,#7c3aed,#2563eb); border: none; }
.quick-cell.ai { color: var(--brand-deep); }
@media (max-width: 480px) { .quick-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 报表（精斗云风格：行次表 / 资产负债双栏 / 余额表四段） ---------- */
.report-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.report-table th, .report-table td { border: 1px solid var(--line); padding: 9px 12px; }
.report-table thead th { background: var(--bg-soft); font-weight: 600; color: var(--ink-2); text-align: center; letter-spacing: .2px; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.report-table tbody tr:hover td { background: #f6f9ff; }
.report-table tfoot td { background: #f4f7fc; font-weight: 600; }
.report-table .neg { color: var(--bad); }
.report-table .pos { color: var(--good); }
.bs-table td:nth-child(2), .bs-table td:nth-child(4) { width: 16%; }

/* ---------- 模块汇总 + 全局 AI 悬浮助手 ---------- */
.module-sum { font-size: 14px; margin-bottom: 10px; padding: 8px 12px; background: var(--brand-soft); border-radius: 8px; display: inline-block; }
.module-sum b { font-size: 17px; color: var(--brand-deep); }
.module-sum b.neg { color: var(--bad); }
.ai-fab { display: none; position: fixed; right: 22px; bottom: 22px; z-index: 50; align-items: center; gap: 8px; padding: 12px 18px; border: none; border-radius: 999px; background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(37, 99, 235, .35); }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(37, 99, 235, .45); }
#appShell:not(.hidden) ~ .ai-fab { display: inline-flex; }

/* ---------- 账套财务指标卡片（精斗云风格） ---------- */
.metric-head { font-weight: 700; font-size: 15px; margin: 4px 0 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.metric-label { font-weight: 600; color: #334155; }
.metric-period { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 1px 8px; }
.metric-big { font-size: 26px; font-weight: 700; color: var(--ink); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.metric-big.pos { color: var(--good); } .metric-big.neg { color: var(--bad); }
.metric-line { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 2px 0; }
.metric-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.metric-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
.metric-sub b.pos { color: var(--good); } .metric-sub b.neg { color: var(--bad); }
.metric-ratios { display: flex; gap: 12px; margin-top: 10px; }
.metric-ratios > div { flex: 1; text-align: center; background: var(--bg); border-radius: 8px; padding: 8px 4px; font-size: 12px; color: var(--muted); }
.metric-ratios b { display: block; font-size: 17px; color: var(--brand-deep); margin-top: 2px; }
.trend { font-size: 12px; font-weight: 600; }
.trend.up { color: var(--good); } .trend.down { color: var(--bad); } .trend.muted { color: var(--muted); }

/* ---------- 财务指标切换 + 行业对标 + 资产卡片 ---------- */
.metric-head { display: flex; align-items: center; gap: 10px; }
.seg { border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 5px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.bench-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.bench-name { font-weight: 600; margin-bottom: 2px; }
.bench-val { font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.bench-bar { position: relative; height: 6px; background: linear-gradient(90deg,#fde68a,#86efac,#fde68a); border-radius: 4px; }
.bench-bar span { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-deep); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transform: translateX(-50%); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.asset-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.asset-card h4 { font-size: 15px; margin-bottom: 8px; color: var(--brand-deep); }
.asset-card .metric-line { padding: 3px 0; }
.aichip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.aichip { border: 1px solid #c7d6ff; background: var(--brand-soft); color: var(--brand-deep); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.aichip:hover { background: var(--brand); color: #fff; }

/* ---------- 精斗云式两级左侧导航（一级模块 + 二级子菜单） ---------- */
.nav-l1 { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 16px; background: transparent; border: none; color: var(--sidebar-ink); cursor: pointer; font-size: 15.5px; font-weight: 600; text-align: left; border-radius: 8px; }
.nav-l1:hover { background: var(--sidebar-hover); color: #fff; }
.nav-l1.has-active { color: #fff; }
.nav-l1 .nav-l1-label { flex: 1; }
.nav-l1 .nav-caret { font-size: 11px; opacity: .7; }
.nav-l1.open { color: #fff; }
.nav-subs { display: flex; flex-direction: column; padding: 2px 0 6px; }
.nav-subs.hidden { display: none; }
.nav-sub { width: 100%; text-align: left; padding: 9px 16px 9px 44px; background: transparent; border: none; color: #aab6c8; cursor: pointer; font-size: 14.5px; border-radius: 8px; transition: background .12s, color .12s; }
.nav-sub:hover { background: var(--sidebar-hover); color: #fff; }
.nav-sub.active { background: var(--brand); color: #fff; border-radius: 8px; font-weight: 600; box-shadow: 0 2px 8px rgba(37,99,235,.35); }

/* 二级菜单子组标题（精斗云 日常业务/基础资料 等分组） */
.nav-subgroup { padding: 9px 14px 4px 26px; font-size: 12px; color: #6b7a90; letter-spacing: .5px; font-weight: 600; }
.nav-subgroup:first-child { padding-top: 4px; }

/* ---------- 金蝶记账凭证 录凭证 (last-mile 复刻) ---------- */
.vsheet { padding: 0; }
.vs-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vs-tpl { max-width: 220px; }
.vs-head { display: flex; align-items: center; gap: 22px; padding: 14px 16px 8px; position: relative; flex-wrap: wrap; }
.vs-field { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.vs-field select, .vs-field input { font-size: 13px; }
.vs-title { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 4px; }
.vs-title small { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.vsheet-grid { width: 100%; border-collapse: collapse; margin: 6px 0 0; }
.vsheet-grid th, .vsheet-grid td { border: 1px solid #d7deea; padding: 0; }
.vsheet-grid thead th { background: #f1f5fb; font-weight: 600; color: #334155; text-align: center; padding: 6px 4px; font-size: 13px; }
.vsheet-grid .vs-no { width: 36px; }
.vsheet-grid .vs-proj-h, .vsheet-grid .vs-proj { width: 130px; }
.vsheet-grid td.vs-no { text-align: center; color: var(--muted); font-size: 12px; }
.vsheet-grid input.vs-text, .vsheet-grid select.vs-proj { width: 100%; border: none; padding: 9px 8px; background: transparent; font-size: 13px; outline: none; }
.vsheet-grid input.vs-text:focus { background: #f0f6ff; }
.amt-head { width: 232px; padding: 0 !important; }
.amt-head .digit-labels, .amt-cell { width: 232px; }
.digit-labels { display: flex; }
.digit-labels span { flex: 1; text-align: center; font-size: 10px; color: #94a3b8; border-left: 1px solid #e2e8f0; padding: 2px 0; }
.digit-labels span:first-child { border-left: none; }
.amt-cell { padding: 0 !important; background-image: repeating-linear-gradient(to right, transparent, transparent 20.1px, #eef2f8 20.1px, #eef2f8 21.1px); background-position: right; }
.amt-cell .amt-input { width: 100%; border: none; background: transparent; text-align: right; font-family: var(--mono); font-size: 14px; letter-spacing: 7px; padding: 9px 6px 9px 2px; outline: none; -moz-appearance: textfield; }
.amt-cell .amt-input::-webkit-outer-spin-button, .amt-cell .amt-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.amt-cell .amt-input:focus { background: #f0f6ff; }
.amt-total { display: block; text-align: right; font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: 7px; padding: 9px 6px; }
.vs-total td { background: #fafbfe; font-weight: 700; }
.vs-total td:first-child { text-align: center; }
.vs-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }

/* 查凭证（金蝶内联分录表） */
.vq-table td, .vq-table th { vertical-align: middle; }
.vq-table tbody td { border: 1px solid var(--line); padding: 6px 10px; }
.vq-table .vq-reversed td { color: var(--muted); text-decoration: line-through; text-decoration-color: #cbd5e1; }
.vq-table .vq-reversed .btn-row .btn { text-decoration: none; }

/* 凭证汇总表（精斗云 1:1：汇总日期条 + 过滤面板 + 科目级次上卷表） */
.vs-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.vs-input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; outline: none; }
.vs-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.vs-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; background: #fff; font-size: 13px; }
.vs-pill b { color: var(--muted); font-weight: 600; }
.vs-month { border: none; outline: none; font-size: 13px; padding: 2px 0; }
.vs-num { width: 92px; }
.vs-filter { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fcfdff; }
.vs-frow { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.vsum-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.vsum-field > span { color: var(--muted); min-width: 56px; }
.vs-fbtns { justify-content: flex-end; margin-top: 12px; gap: 10px; }
.vs-table tbody tr:hover { background: var(--brand-soft); }
.vs-code { color: var(--brand); cursor: pointer; font-family: var(--mono); text-decoration: none; }
.vs-code:hover { text-decoration: underline; }
.seg-group { display: inline-flex; gap: 0; }
.seg-group .btn { border-radius: 0; }
.seg-group .btn:first-child { border-radius: 8px 0 0 8px; }
.seg-group .btn:last-child { border-radius: 0 8px 8px 0; border-left: none; }
