/* =====================================================
   出纳台账 · 样式
   浅色专业风：紧凑表格 + 清晰数字层级
   ===================================================== */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e5e8ed;
  --line-strong: #d3d8e0;
  --text: #171c26;
  --text-2: #4a5464;
  --muted: #7c8798;
  --primary: #2f5bda;
  --primary-dark: #2447ad;
  --primary-soft: #eef2fd;
  --in: #0c8a68;
  --in-soft: #e8f6f1;
  --out: #d33c3c;
  --out-soft: #fdeeee;
  --warn: #b7791f;
  --warn-soft: #fdf5e6;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(20, 28, 40, .06);
  --shadow: 0 4px 16px rgba(20, 28, 40, .08);
  --shadow-lg: 0 18px 48px rgba(20, 28, 40, .18);
  --mono: "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.c-in { color: var(--in); }
.c-out { color: var(--out); }
.c-muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------- 布局 */
.app {
  display: grid;
  grid-template-columns: 216px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--primary), #5b7ff0);
  color: #fff; font-weight: 700; font-size: 15px;
  display: grid; place-items: center;
  letter-spacing: .5px;
}
.brand-mark.lg { width: 46px; height: 46px; border-radius: 12px; font-size: 20px; margin: 0 auto 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 14px; }
.brand-text span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: #f5f7fa; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.sidebar-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--muted);
}
.sidebar-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--in); flex: none; }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left h1 { font-size: 17px; letter-spacing: -.2px; }
.page-sub { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.filter-group { display: flex; align-items: center; gap: 8px; }

.view { padding: 20px 24px 40px; flex: 1; }
.view-full { padding: 20px 24px 40px; }

/* ------------------------------------------------------- 控件 */
.control {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  max-width: 190px;
}
.control:hover { border-color: #b9c1cd; }
.control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 91, 218, .12); }
select.control { padding-right: 26px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%237c8798' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
input[type="date"].control { padding-right: 6px; }

.btn {
  height: 32px; padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: all .12s;
  white-space: nowrap;
}
.btn:hover { border-color: #b9c1cd; background: #fafbfc; color: var(--text); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(47, 91, 218, .28);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f1f4f8; border-color: transparent; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-danger { color: var(--out); border-color: #f0cccc; background: #fff; }
.btn-danger:hover { background: var(--out-soft); border-color: #e3a9a9; color: var(--out); }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0 4px; font-size: 12px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--out); }

/* ------------------------------------------------------- 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.card-head h3 { font-size: 13.5px; }
.card-head .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 1.55fr 1fr; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.section-head h3 { font-size: 13.5px; display: flex; align-items: baseline; gap: 6px; }
.section-head .actions { display: flex; gap: 8px; }

/* KPI */
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 25px; font-weight: 650; letter-spacing: -.6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value.sm { font-size: 20px; }
.kpi-value .unit { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-foot { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.accent-in { background: var(--in); }
.accent-out { background: var(--out); }
.accent-primary { background: var(--primary); }
.accent-net { background: linear-gradient(180deg, var(--primary), #7a9bf5); }

/* 账户行（总览「我的账户」列表模式） */
.acc-list { display: flex; flex-direction: column; gap: 8px; }
.acc-row {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s;
}
.acc-row:hover { border-color: var(--line-strong); }
.acc-row-main { flex: 1 1 auto; min-width: 0; }
.acc-row-main .acc-name { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.acc-row-main .acc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.acc-row-flow { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.acc-row-flow b { font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-row-bal {
  font-size: 15px; font-weight: 650; letter-spacing: -.3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  min-width: 116px; text-align: right;
}
.acc-row .btn-link { flex: none; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 19px; padding: 0 7px;
  border-radius: 5px;
  font-size: 10.5px; font-weight: 600;
  background: #f0f2f6; color: var(--text-2);
  white-space: nowrap;
}
.tag-bank { background: #eef2fd; color: #2f5bda; }
.tag-cash { background: #fdf5e6; color: #9a6a12; }
.tag-wechat { background: #e8f6ef; color: #12795a; }
.tag-alipay { background: #e9f2fd; color: #1a6ab8; }
.tag-in { background: var(--in-soft); color: var(--in); }
.tag-out { background: var(--out-soft); color: var(--out); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-ok { background: var(--in-soft); color: var(--in); }

/* 摘要项目库 */
.sum-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sum-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 29px; padding: 0 4px 0 9px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; font-size: 12px; max-width: 100%;
}
.sum-chip:hover { border-color: #b9c1cd; background: #fafbfc; }
.sum-chip .k { width: 6px; height: 6px; border-radius: 50%; flex: none; background: #c4cad4; }
.sum-chip.k-income .k { background: var(--in); }
.sum-chip.k-expense .k { background: var(--out); }
.sum-chip .n { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-chip .c { color: var(--muted); font-size: 11px; white-space: nowrap; }
.sum-chip button {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 12px; line-height: 1; padding: 3px 4px; border-radius: 4px;
}
.sum-chip button:hover { background: #eef1f5; color: var(--text); }
.sum-chip button.del:hover { background: var(--out-soft); color: var(--out); }

/* ------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
  background: #fafbfc;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
table.data tbody tr:hover { background: #fafbfd; }
table.data tbody tr.selected { background: var(--primary-soft); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 550; }
table.data td.amt.in { color: var(--in); }
table.data td.amt.out { color: var(--out); }
table.data td.amt.nil { color: #c4cad4; }
table.data .t-sub { color: var(--muted); font-size: 11px; }
table.data.compact tbody td { padding: 6px 10px; }
.ellip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-summary { display: flex; flex-direction: column; gap: 1px; }
.cell-summary b { font-weight: 550; }
.col-check { width: 34px; }
input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pager-btns { display: flex; align-items: center; gap: 6px; }

/* 筛选条 */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filterbar .spacer { flex: 1; }
.bulkbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--primary-soft);
  border-bottom: 1px solid #dbe4fb;
  font-size: 12px; color: var(--primary-dark);
}

/* 空状态 */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty h4 { font-size: 13.5px; color: var(--text-2); margin-bottom: 6px; }
.empty p { margin: 0 0 14px; font-size: 12.5px; }

/* ------------------------------------------------------- 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11.5px; color: var(--text-2); font-weight: 550; }
.field label .req { color: var(--out); }
.field .control { height: 34px; max-width: none; width: 100%; }
.field textarea.control { height: auto; min-height: 60px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.field .help { font-size: 11px; color: var(--muted); }
.amount-toggle { display: flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.amount-toggle button {
  flex: 1; height: 30px; border: none; background: #fff; cursor: pointer;
  font-size: 12px; color: var(--text-2); font-weight: 550;
}
.amount-toggle button.on[data-dir="out"] { background: var(--out-soft); color: var(--out); }
.amount-toggle button.on[data-dir="in"] { background: var(--in-soft); color: var(--in); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 22, 33, .38);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 20px;
  overflow-y: auto;
  animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px;
  animation: pop .16s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99) } to { opacity: 1; transform: none } }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 14.5px; }
.modal-head .close { width: 28px; height: 28px; border: none; background: none; cursor: pointer; color: var(--muted); font-size: 18px; border-radius: 6px; }
.modal-head .close:hover { background: #f1f4f8; color: var(--text); }
.modal-body { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 12px 12px; }

/* toast */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 200px; max-width: 380px;
  padding: 10px 14px;
  background: #232a36; color: #fff;
  border-radius: 8px; font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: slidein .18s ease;
  display: flex; gap: 8px; align-items: flex-start;
}
@keyframes slidein { from { opacity: 0; transform: translateX(14px) } to { opacity: 1; transform: none } }
.toast.ok { background: #10674e; }
.toast.err { background: #a72f2f; }

/* ------------------------------------------------------- 图表 */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--text-2); margin-top: 10px; }
.chart-legend .li { display: flex; align-items: center; gap: 5px; }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.chart-legend .val { color: var(--muted); }
.axis-label { font-size: 10px; fill: var(--muted); }
.grid-line { stroke: #eef1f5; stroke-width: 1; }
.bar-in { fill: var(--in); }
.bar-out { fill: #f0a6a6; }
.bar-out:hover, .bar-in:hover { opacity: .82; }

.donut-legend { display: flex; flex-direction: column; gap: 7px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.donut-legend .name { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .amt { font-variant-numeric: tabular-nums; font-weight: 550; }
.donut-legend .pct { color: var(--muted); width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- 导入 */
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  background: #fcfdfe;
  cursor: pointer;
  transition: all .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone h4 { font-size: 14px; margin-bottom: 6px; }
.dropzone p { margin: 0; font-size: 12px; color: var(--muted); }
.dropzone .hint-list { margin-top: 12px; font-size: 11.5px; color: var(--muted); line-height: 1.9; }

.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.map-grid .field label { font-size: 11px; }
.map-grid .control { height: 30px; font-size: 12px; }

.stat-row { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; }
.stat-row .s { display: flex; flex-direction: column; gap: 2px; }
.stat-row .s .k { font-size: 11px; color: var(--muted); }
.stat-row .s .v { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- 对账 */
.recon-flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.recon-step { flex: 1; min-width: 132px; padding: 13px 15px; border-right: 1px dashed var(--line); }
.recon-step:last-child { border-right: none; }
.recon-step .k { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.recon-step .v { font-size: 18px; font-weight: 650; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.recon-step.result .v { color: var(--primary); }
.recon-step.diff .v.zero { color: var(--in); }
.recon-step.diff .v.nonzero { color: var(--out); }

.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.6;
}
.banner.ok { background: var(--in-soft); color: #0a6d53; }
.banner.warn { background: var(--warn-soft); color: #8a5a10; }
.banner.err { background: var(--out-soft); color: #a32929; }
.banner .ic { font-size: 14px; line-height: 1.2; }

.progress { height: 6px; border-radius: 3px; background: #eef1f5; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); }

/* ------------------------------------------------------- 登录 */
.login-mask { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: grid; place-items: center; }
.login-box {
  width: 330px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 30px 26px; box-shadow: var(--shadow);
  text-align: center;
}
.login-box h2 { font-size: 16px; margin-bottom: 6px; }
.login-box p { margin: 0 0 18px; font-size: 12px; color: var(--muted); }
.login-box .control { width: 100%; max-width: none; height: 36px; margin-bottom: 10px; text-align: center; }
.login-err { color: var(--out); font-size: 12px; margin-top: 10px; min-height: 16px; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d8e0; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c1cd; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 响应式 */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 1fr; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  /* align-content: start 防止网格行被拉伸，避免顶部出现大片空白 */
  .app { grid-template-columns: 1fr; align-content: start; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { border-bottom: none; border-right: 1px solid var(--line); padding: 10px 14px; flex: none; }
  .brand-text { display: none; }
  .nav { flex-direction: row; padding: 6px; }
  /* 窄屏也要保留文字：只有图标的导航等于没有导航 */
  .nav-item { padding: 7px 10px; white-space: nowrap; gap: 6px; }
  .nav-item span { display: inline; font-size: 12px; }
  .sidebar-foot { display: none; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-right, .filter-group { flex-wrap: wrap; }
  .grid-4, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .acc-row { flex-wrap: wrap; }
  .acc-row-bal { min-width: 0; }
  .view { padding: 14px; }
}

/* ------------------------------------------------------- 成员与权限 */
/* viewer 只读：一切标注 data-admin-only 的写入口直接隐藏（含动态渲染的节点） */
body.role-viewer [data-admin-only] { display: none !important; }

.readonly-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 10px 14px;
  background: var(--warn-soft); border: 1px solid #f0dfae; border-radius: var(--radius);
  color: #8a6212; font-size: 12.5px;
}
.readonly-banner .ic { font-size: 15px; }
.readonly-banner b { color: #6b4a08; }

.user-box { position: relative; margin-right: 4px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px 0 12px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 999px; cursor: pointer; font-size: 12.5px;
}
.user-chip:hover { border-color: var(--primary); }
.user-chip .user-name { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-badge {
  padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
}
.role-badge.viewer { background: var(--warn-soft); color: var(--warn); }

.user-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 190px; padding: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.user-menu .um-head {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.user-menu .um-head b { font-size: 13px; }
.user-menu .um-head span { font-size: 11.5px; color: var(--muted); }
.user-menu .um-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; font-size: 12.5px;
}
.user-menu .um-item:hover { background: #f1f4f8; }
.user-menu .um-item.danger { color: var(--out); }
.user-menu .um-item.danger:hover { background: var(--out-soft); }

/* 成员管理表 */
.member-role { display: inline-flex; align-items: center; gap: 5px; }
.member-note { color: var(--muted); font-size: 12px; }
.member-self { font-size: 11px; color: var(--primary); margin-left: 6px; }
.member-scope { max-width: 250px; }
.member-scope .tag { margin: 1px 3px 1px 0; }
.tag-soft { background: #eef1f5; color: #3d4756; }

/* 成员权限：开放页面多选 */
.scope-grid { display: grid; gap: 7px; }
.scope-opt {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer;
}
.scope-opt:hover { border-color: var(--primary); background: #fafbff; }
.scope-opt input { margin-top: 2px; flex: none; }
.scope-opt b { display: block; font-size: 12.5px; font-weight: 600; }
.scope-opt span span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* 改密弹窗的显示/隐藏切换 */
.pwd-wrap { position: relative; }
.pwd-wrap .control { padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 24px; border: 0; border-radius: 5px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 0;
}
.pwd-eye:hover { background: #f1f4f8; color: var(--text-2); }
