/* ========== 科目手输 + 选择器 ========== */
.code-input { font-family: inherit; }
.code-input.code-error { border-color: #ef4444; background: #fef2f2; }
.code-hint { font-size: 11px; line-height: 1.3; }
.acct-wrap { position: relative; }
.acct-suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 500; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  padding: 4px; max-height: 260px; overflow-y: auto;
}
.sg-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: 7px; cursor: pointer; transition: background .12s;
}
.sg-item:hover { background: #eff6ff; }
.amt-input { font-variant-numeric: tabular-nums; font-family: Consolas, monospace; }

.pk-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.pk-box {
  background: #fff; border-radius: 14px; max-width: 1000px; width: 100%;
  max-height: 82vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.25); overflow: hidden;
}
.pk-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.pk-title { font-weight: 600; font-size: 15px; }
.pk-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; padding: 14px 18px 18px; overflow-y: auto;
}
.pk-col { background: #f8fafc; border-radius: 10px; padding: 8px; border: 1px solid #e2e8f0; }
.pk-col-title {
  font-size: 13px; font-weight: 700; padding: 4px 6px 8px;
  display: flex; align-items: center; gap: 6px;
}
.pk-资产 { color: #2563eb; }
.pk-负债 { color: #dc2626; }
.pk-权益 { color: #9333ea; }
.pk-成本 { color: #d97706; }
.pk-收入 { color: #059669; }
.pk-费用 { color: #ea580c; }
.pk-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 8px; cursor: pointer; background: #fff;
  border: 1px solid transparent; transition: all .12s;
}
.pk-item:hover { border-color: var(--primary, #2563eb); background: #eff6ff; }
.pk-code { font-family: Consolas, monospace; font-weight: 600; color: #334155; }
.pk-name { flex: 1; font-size: 13px; color: #475569; }
.pk-dir {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #f1f5f9; color: #64748b;
}

/* ========== 标准记账凭证（查看/打印） ========== */
.voucher-row[data-view-voucher] { cursor: pointer; }
.voucher-row[data-view-voucher]:hover { box-shadow: 0 2px 10px rgba(37, 99, 235, .1); }
.voucher-modal-card { max-width: 780px; width: 100%; }

.voucher-doc {
  font-family: "SimSun", "Songti SC", serif;
  background: #fff; padding: 26px 28px;
  border: 1px solid #cbd5e1; border-radius: 8px;
}
.vd-top { display: flex; justify-content: space-between; font-size: 13px; color: #475569; }
.vd-unit {
  text-align: center; font-size: 15px; font-weight: 600;
  margin: 12px 0 2px; letter-spacing: 2px;
  min-height: 20px;
}
.vd-title {
  text-align: center; font-size: 24px; font-weight: 700;
  letter-spacing: 14px; margin: 16px 0 6px; text-indent: 14px;
}
.vd-date { text-align: right; font-size: 13px; margin-bottom: 10px; }
.vd-table { width: 100%; border-collapse: collapse; }
.vd-table th, .vd-table td {
  border: 1px solid #334155; padding: 9px 10px; font-size: 14px;
  vertical-align: middle;
}
.vd-table th { background: #f1f5f9; text-align: center; font-weight: 600; }
.vd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.vd-summary { color: #334155; }
.vd-code { color: #94a3b8; font-size: 11px; margin-left: 8px; font-family: Consolas, monospace; }
.vd-total td { font-weight: 700; background: #f8fafc; }
.vd-words { margin-top: 12px; font-size: 14px; letter-spacing: 1px; }
.vd-blank { display: inline-block; width: 42px; border-bottom: 1px solid #64748b; }
.vd-sign {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  margin-top: 28px; font-size: 13px; color: #334155; gap: 8px;
}
.vd-sign i { display: inline-block; width: 60px; border-bottom: 1px solid #94a3b8; }

/* 打印时只输出凭证主体 */
@media print {
  body * { visibility: hidden; }
  .voucher-doc, .voucher-doc * { visibility: visible; }
  .voucher-doc {
    position: absolute; left: 0; top: 0; width: 100%;
    border: none; padding: 0;
  }
}

/* ========== 全局变量与重置 ========== */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.18);

  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.18s ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* 禁止页面级横向溢出（表格横滑由 .table-wrap 内部处理），
   避免手机上撑大初始包含块导致 fixed 元素尺寸异常 */
body { overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }

/* ========== 布局 ========== */
.app {
  display: grid;
  /* minmax(0, 1fr) 避免内容 min-content 撑爆轨道（否则手机上会横向溢出、整页被缩小） */
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.brand-title { color: #fff; font-size: 15px; font-weight: 600; }
.brand-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.brand-course { font-size: 10.5px; color: #7dd3fc; margin-top: 2px; letter-spacing: .3px; }
/* 归属小印：朱红方形「湘」，呼应水墨主题 */
.brand-seal, .login-seal {
  position: absolute;
  right: -6px; bottom: -6px;
  width: 18px; height: 18px;
  border-radius: 4px;
  background: linear-gradient(160deg, #c2412e, #a83224);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-6deg);
  box-shadow: 0 2px 6px rgba(168, 50, 36, .45);
  font-family: "KaiTi", "STKaiti", serif;
}
.brand-logo { position: relative; }
.login-logo { position: relative; }
.login-seal { right: -4px; bottom: -4px; width: 26px; height: 26px; font-size: 15px; }
.sidebar-credit {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.5;
  color: rgba(148, 163, 184, .75);
  text-align: center;
  letter-spacing: .3px;
}
/* ========== 案例库（难度选择） ========== */
.case-lib { display: flex; flex-direction: column; gap: 10px; }
.case-lib-item {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--panel-2);
}
.case-lib-item.on { border-color: var(--primary); background: var(--primary-soft); }
.cli-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cli-level {
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 999px; padding: 2px 9px; flex-shrink: 0;
}
.case-lib-item.on .cli-level { background: linear-gradient(135deg, #2563eb, #4f46e5); }
.cli-name { font-size: 14px; font-weight: 600; color: var(--text); }
.cli-meta { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.cli-note { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.cli-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 9px;
}
.cli-progress { font-size: 11.5px; color: var(--muted); }

/* ========== 会计要素判断练习 ========== */
.eq-panel { border-left: 4px solid #2563eb; }
.eq-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin: 10px 0 14px;
}
.eq-progress { font-size: 12.5px; color: var(--text-2); }
.eq-list { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; }
.eq-item {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2);
}
.eq-item.ok { border-color: #6ee7b7; background: #f0fdf4; }
.eq-item.bad { border-color: #fca5a5; background: #fef2f2; }
.eq-main { flex: 1; min-width: 0; }
.eq-text { font-size: 13.5px; line-height: 1.65; color: var(--text); margin: 3px 0 10px; }
.eq-label { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.eq-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.eq-chip {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-family: inherit; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; transition: var(--transition);
}
.eq-chip:hover { border-color: var(--primary); color: var(--primary); }
.eq-chip.on {
  background: var(--primary); border-color: var(--primary);
  color: #fff; font-weight: 600;
}
.eq-dirs { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.eq-dir-row { display: flex; align-items: center; gap: 10px; }
.eq-dir-name { font-size: 12.5px; color: var(--text-2); min-width: 76px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn {
  padding: 5px 12px; border: none; background: #fff;
  font-family: inherit; font-size: 12px; color: var(--text-2); cursor: pointer;
  border-right: 1px solid var(--border);
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--primary-soft); color: var(--primary); }
.seg-btn.on { background: var(--primary); color: #fff; font-weight: 600; }
.eq-result { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eq-score { font-size: 12px; font-weight: 600; color: var(--text-2); }
.eq-issues {
  flex-basis: 100%;
  font-size: 12px; color: #991b1b;
  background: #fee2e2; border-radius: 6px; padding: 6px 10px; line-height: 1.6;
}
.eq-summary {
  margin-top: 12px; padding: 10px 14px;
  background: var(--panel-2); border: 1px dashed var(--border);
  border-radius: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.7;
}
@media (max-width: 960px) {
  .eq-list { max-height: none; }
  .eq-chip { padding: 8px 14px; }
  .seg-btn { padding: 8px 14px; }
  .eq-dir-name { min-width: 62px; }
}

/* ========== 课堂案例面板 ========== */
.case-panel { border-left: 4px solid #c2412e; }
.case-progress { display: flex; gap: 6px; flex-wrap: wrap; }
.case-bar {
  height: 6px; border-radius: 999px; background: var(--panel-2);
  overflow: hidden; margin: 10px 0 14px;
}
.case-bar-in { height: 100%; background: linear-gradient(90deg, #2563eb, #10b981); transition: width .3s; }
.case-list { display: flex; flex-direction: column; gap: 10px; max-height: 620px; overflow-y: auto; }
.case-item {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2);
}
.case-item.ok { border-color: #6ee7b7; background: #f0fdf4; }
.case-item.diff { border-color: #fca5a5; background: #fef2f2; }
.case-total, .eq-total { text-align: right; flex-shrink: 0; }
.case-total-num, .eq-total-num { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.case-total-num span, .eq-total-num span { font-size: 13px; font-weight: 600; color: var(--muted); }
.case-total-label, .eq-total-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.case-score { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-2); }
.case-per { font-size: 11.5px; color: var(--muted); align-self: center; }
.case-no {
  flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.case-item.ok .case-no { background: #059669; }
.case-item.diff .case-no { background: #dc2626; }
.case-main { flex: 1; min-width: 0; }
.case-date { font-size: 11.5px; color: var(--muted); }
.case-text { font-size: 13.5px; line-height: 1.65; margin: 3px 0 8px; color: var(--text); }
.case-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-answer {
  margin-top: 10px; padding: 10px 12px;
  background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 8px;
  font-size: 12.5px; line-height: 1.7;
}
.case-hint { margin-top: 6px; color: #92400e; }
.case-diff {
  margin-top: 8px; font-size: 12px; color: #991b1b;
  background: #fee2e2; border-radius: 6px; padding: 6px 10px;
}

/* ========== 单位信息 / 会计期间 ========== */
.company-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 16px;
}
.period-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.period-form .field { margin-bottom: 0; min-width: 200px; }

/* 登录页：已有账本列表（一人一账本，可切换） */
.login-students {
  margin-top: 14px;
  text-align: left;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
}
.login-students-title {
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.login-students-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
}
.student-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  text-align: left;
}
.student-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.student-chip.active { border-color: var(--primary); background: var(--primary-soft); }
.student-chip .sc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.student-chip .sc-meta { font-size: 10.5px; color: var(--muted); }

.login-fingerprint {
  margin-top: 6px;
  font-size: 10.5px;
  color: #94a3b8;
  letter-spacing: .4px;
  font-family: Consolas, monospace;
}
.login-fingerprint.bad { color: #dc2626; font-weight: 600; }
.about-integrity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.fingerprint {
  font-size: 11.5px;
  color: var(--muted);
  font-family: Consolas, monospace;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
}
.fingerprint.bad { color: #dc2626; border-color: #fca5a5; background: #fef2f2; font-weight: 600; }
.about-copyright {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.login-credit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
  font-size: 11px;
  color: #64748b;
  letter-spacing: .5px;
}
.about-card { display: flex; align-items: center; gap: 14px; }
.about-seal {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, #c2412e, #a83224);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-4deg);
  font-family: "KaiTi", "STKaiti", serif;
  box-shadow: 0 4px 12px rgba(168, 50, 36, .3);
}
.about-title { font-size: 14px; font-weight: 600; color: var(--text); }
.about-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }

.nav {
  margin-top: 16px;
  flex: 1;
  overflow-y: auto;
}
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }

.nav-group { margin-bottom: 14px; }
.nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  padding: 6px 10px;
  margin-bottom: 4px;
}
.nav-item {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  margin: 1px 0;
  transition: var(--transition);
}
.nav-item:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.sidebar-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  padding-top: 14px;
  margin-top: 12px;
}
.period-picker {
  background: rgba(15, 23, 42, 0.5);
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.period-picker label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.period-picker select {
  width: 100%;
  background: transparent;
  color: #fff;
  border: none;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.period-picker select option { color: #0f172a; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.4);
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600;
}
.user-name { color: #fff; font-size: 13px; }
.user-role { font-size: 11px; color: #94a3b8; }

/* ========== 主区域 ========== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* 主区右下角的浅色背景水印：优先使用 assets/ink-accounting.png（用户上传的水墨插画），
   若该文件不存在，则自动回退到内置水墨 SVG，保证画面不空缺 */
.main::after {
  content: '';
  position: fixed;
  right: 0; bottom: 0;
  width: min(56vw, 830px);
  height: 66vh;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("assets/ink-accounting.png"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='760' height='420' viewBox='0 0 760 420'><path d='M0 420 L0 300 Q110 190 230 262 T470 250 T760 268 L760 420 Z' fill='%2364748b' opacity='.5'/><path d='M0 420 L0 348 Q170 272 330 336 T640 320 T760 340 L760 420 Z' fill='%2364748b' opacity='.6'/><path d='M520 356 L548 292 L574 330 L600 272 L628 322 L654 296 L682 334 L712 306 L760 336 L760 420 L520 420 Z' fill='%2364748b' opacity='.45'/><path d='M20 372 Q200 268 400 312 T740 226' fill='none' stroke='%23c9a24b' stroke-width='2'/><circle cx='400' cy='312' r='4' fill='%23c9a24b'/><circle cx='740' cy='226' r='4' fill='%23c9a24b'/><g><rect x='196' y='286' width='188' height='104' rx='9' fill='none' stroke='%237c5c3e' stroke-width='6'/><line x1='200' y1='332' x2='380' y2='332' stroke='%237c5c3e' stroke-width='5'/><g stroke='%237c5c3e' stroke-width='3'><line x1='232' y1='290' x2='232' y2='386'/><line x1='268' y1='290' x2='268' y2='386'/><line x1='304' y1='290' x2='304' y2='386'/><line x1='340' y1='290' x2='340' y2='386'/></g><g fill='%2333302a'><circle cx='232' cy='310' r='9'/><circle cx='268' cy='310' r='9'/><circle cx='304' cy='310' r='9'/><circle cx='340' cy='310' r='9'/><circle cx='232' cy='376' r='9'/><circle cx='232' cy='358' r='9'/><circle cx='268' cy='376' r='9'/><circle cx='268' cy='358' r='9'/><circle cx='304' cy='376' r='9'/><circle cx='340' cy='376' r='9'/><circle cx='340' cy='358' r='9'/></g></g></svg>");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: right bottom, right bottom, right bottom;
  background-size: contain, contain, contain;
  opacity: .55;
  /* 向左上柔和淡出，避免与内容争抢注意力 */
  -webkit-mask-image: radial-gradient(130% 130% at 100% 100%, #000 0%, rgba(0,0,0,.7) 52%, transparent 92%);
  mask-image: radial-gradient(130% 130% at 100% 100%, #000 0%, rgba(0,0,0,.7) 52%, transparent 92%);
}

/* 内容层需盖在水印之上 */
.view-root { position: relative; z-index: 1; }

@media (max-width: 960px) {
  .main::after { display: none; }
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.view-root {
  flex: 1;
  padding: 24px 28px 40px;
}

/* ========== 通用组件 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn:hover { background: var(--panel-2); border-color: var(--border-strong); }
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn.danger:hover { background: #dc2626; border-color: #dc2626; }
.btn.success {
  background: var(--success); color: #fff; border-color: var(--success);
}
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.icon-btn:hover { background: var(--panel-2); }

.input, select.input, textarea.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea.input { min-height: 60px; resize: vertical; }

label.field { display: block; margin-bottom: 12px; }
label.field .lbl {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
  font-weight: 500;
}

/* ========== 卡片 ========== */
.card {
  /* 半透明白：让右下角水墨背景隐隐透出（宣纸透墨效果） */
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ========== 工作台统计 ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
}
.stat.green::before { background: var(--success); }
.stat.red::before { background: var(--danger); }
.stat.orange::before { background: var(--warning); }
.stat.cyan::before { background: var(--info); }
.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.stat-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ========== 表格 ========== */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
table.report {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 13px;
}
table.report th, table.report td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.report th {
  background: var(--panel-2);
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
}
table.report tbody tr:hover { background: var(--panel-2); }
table.report td.num, table.report th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.report td.center, table.report th.center { text-align: center; }
table.report tr.total {
  background: #fef3c7 !important;
  font-weight: 600;
}
table.report tr.section td {
  background: #f1f5f9;
  font-weight: 600;
}
table.report tr.grand {
  background: #dbeafe !important;
  font-weight: 700;
}
table.report .empty {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.amount-debit { color: var(--text, #0f172a); font-weight: 500; }
.amount-credit { color: var(--text, #0f172a); font-weight: 500; }
.amount-neg { color: var(--danger); font-weight: 500; }
.amount { font-variant-numeric: tabular-nums; }

/* ========== 工具条 ========== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toolbar .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.toolbar .input { width: auto; min-width: 140px; }

/* ========== 录入表单 ========== */
.entry-form {
  display: grid;
  gap: 12px;
}
.entry-row {
  display: grid;
  grid-template-columns: 130px 1fr 160px 160px 60px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  background: var(--panel-2);
  border-radius: 8px;
}
.entry-row-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: transparent !important;
  padding-left: 12px;
}
.entry-row .lbl {
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 4px;
  display: block;
}

.balance-check {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.balance-check.ok { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.balance-check.fail { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ========== 模态框 ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal.open { display: flex; animation: fadeIn 0.18s ease; }
.modal-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  width: min(720px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ========== Toast ========== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn 0.18s ease;
  min-width: 200px;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== 报表头样式 ========== */
.report-head {
  text-align: center;
  margin-bottom: 18px;
}
.report-head .name { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.report-head .period { font-size: 13px; color: var(--text-2); }
.report-head .unit { font-size: 12px; color: var(--muted); }

/* ========== 科目树 ========== */
.account-tree {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.account-tree-row {
  display: grid;
  grid-template-columns: 78px 70px 1fr 130px 70px 1.4fr;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.account-tree-row.header {
  background: var(--panel-2);
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
}
.account-tree-row .code { color: var(--muted); }
.account-tree-row .name { font-weight: 500; }
.account-tree-row .type-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.type-资产 { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.type-负债 { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.type-共同 { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.type-权益 { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.type-成本 { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
.type-损益 { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }
.type-收入 { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.type-费用 { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }

/* ========== 仪表盘快捷 ========== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.quick-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.quick-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.quick-card .ico { font-size: 22px; margin-bottom: 6px; }
.quick-card .ttl { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.quick-card .desc { font-size: 12px; color: var(--muted); }

/* ========== 列表行 ========== */
.voucher-row {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 60px 110px 1fr auto;
  gap: 12px;
  align-items: center;
}
.voucher-row .vno {
  font-family: ui-monospace, monospace;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
}
.voucher-row .vdate { font-size: 13px; color: var(--text-2); }
.voucher-row .vsum { font-size: 13px; }
.voucher-row .vamt { font-weight: 600; font-variant-numeric: tabular-nums; }
.voucher-row .vactions { display: flex; gap: 6px; }

/* ========== 响应式 ========== */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 14px;
  }
  .sidebar-footer { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; overflow: visible; }
  .nav-group { width: 100%; }
  .nav-title { display: none; }
  .nav-item { padding: 6px 10px; font-size: 12px; }
  .entry-row { grid-template-columns: 1fr; gap: 6px; }
  .topbar { padding: 12px 16px; }
  .view-root { padding: 16px; }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ========== 提示 ========== */
.hint {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--panel-2);
  border-radius: 8px;
  border-left: 3px solid var(--info);
  margin-bottom: 14px;
}
.hint.warn { border-left-color: var(--warning); }
.hint.success { border-left-color: var(--success); }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mt-12 { margin-top: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ========== 登录界面 ========== */
.login-overlay {
  position: fixed; inset: 0; z-index: 2000;
  /* 水墨远山 + 金色走势线：呼应「会计学原理」插画——传统账本遇见现代金融 */
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .30) 0%, rgba(15, 23, 42, .55) 55%, rgba(15, 23, 42, .74) 100%),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='1440' height='460' viewBox='0 0 1440 460'><path d='M0 460 L0 320 Q150 190 300 280 T620 260 T950 300 T1250 240 T1440 280 L1440 460 Z' fill='%23e2e8f0' opacity='.26'/><path d='M1180 300 L1210 210 L1240 260 L1270 180 L1300 250 L1330 220 L1360 270 L1390 235 L1420 280 L1440 262 L1440 460 L1180 460 Z' fill='%23cbd5e1' opacity='.22'/><path d='M0 460 L0 380 Q200 280 400 350 T820 330 T1200 370 T1440 350 L1440 460 Z' fill='%23cbd5e1' opacity='.34'/><path d='M0 460 L0 420 Q260 340 520 392 T1040 384 T1440 404 L1440 460 Z' fill='%2394a3b8' opacity='.50'/><path d='M40 400 Q400 250 760 300 T1400 210' fill='none' stroke='%23d9b36c' stroke-width='1.8' opacity='.75'/><circle cx='760' cy='300' r='3.5' fill='%23d9b36c' opacity='.85'/><circle cx='1400' cy='210' r='3.5' fill='%23d9b36c' opacity='.85'/><rect x='1215' y='330' width='14' height='70' fill='%23e2e8f0' opacity='.12'/><rect x='1240' y='352' width='12' height='48' fill='%23e2e8f0' opacity='.10'/><rect x='1262' y='318' width='16' height='82' fill='%23e2e8f0' opacity='.13'/><rect x='1288' y='345' width='12' height='55' fill='%23e2e8f0' opacity='.10'/><rect x='1310' y='332' width='15' height='68' fill='%23e2e8f0' opacity='.12'/></svg>") bottom center / cover no-repeat,
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #1e3a8a 100%);
  display: flex; justify-content: center;
  overflow-y: auto;              /* 手机上卡片高于屏幕时可滚动，避免底部按钮够不到 */
  /* 显式取视口高度：手机上初始包含块可能被内容撑大，导致登录卡片跑到屏幕外 */
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 24px;
}
.login-card {
  background: #fff; border-radius: 18px;
  width: min(420px, 94vw);
  margin: auto;                  /* 居中，且内容超高时不会裁掉顶部 */
  padding: 30px 34px 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
  text-align: center;
  animation: slideUp .25s ease;
}
/* 院系官方标识：置于卡片顶部，作为归属的正式表达 */
.login-logo-img {
  display: block;
  width: 246px; max-width: 88%;
  margin: 0 auto 12px;
  user-select: none;
}
.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0 22%, #e2e8f0 78%, transparent);
  margin: 0 auto 20px;
}
.about-logo {
  width: 190px; max-width: 42%;
  flex-shrink: 0;
  user-select: none;
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .45);
}
.login-title { font-size: 20px; font-weight: 700; color: #0f172a; }
.login-sub { font-size: 13px; color: #94a3b8; margin: 4px 0 24px; }
.login-field { text-align: left; margin-bottom: 14px; }
.login-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: #475569; margin-bottom: 5px;
}
.login-btn { width: 100%; margin-top: 6px; padding: 10px; font-size: 14px; }
.login-hint { font-size: 11px; color: #94a3b8; margin-top: 14px; line-height: 1.5; }

.user-card { cursor: pointer; transition: var(--transition); }
.user-card:hover { background: rgba(59, 130, 246, 0.15); }

/* ========== 下拉菜单（导出报表） ========== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; animation: slideUp .15s ease; }
.dropdown-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.dropdown-menu button:hover { background: var(--primary-soft); color: var(--primary); }
.dm-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.dropdown-menu button:hover .dm-tag { border-color: currentColor; color: inherit; }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 4px; }
/* 报表页内的小导出按钮 */
.report-head { position: relative; }
.report-export {
  position: absolute;
  right: 0; top: 0;
}

/* ========== 水墨主题元素（会计学原理） ========== */
/* 工作台欢迎横幅：宣纸底 + 右侧水墨远山/城市/算盘，左侧印章 */
.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #fbf9f3 0%, #f7f4ec 55%, #f0ebde 100%);
  border: 1px solid #e8e1d0;
  border-radius: var(--radius-lg);
  padding: 20px 26px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.hero-art {
  position: absolute;
  right: -6px; bottom: -4px;
  height: 132px; width: auto;
  opacity: .85;
  pointer-events: none;
  user-select: none;
}
.hero-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: #1f2937;
}
.hero-seal {
  width: 32px; height: 32px; flex-shrink: 0;
  background: linear-gradient(160deg, #c2412e, #a83224);
  color: #fff; font-size: 17px; font-weight: 700;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-4deg);
  box-shadow: 0 2px 6px rgba(168, 50, 36, .35);
  font-family: "KaiTi", "STKaiti", serif;
}
.hero-sub { font-size: 12.5px; color: #857c6b; margin-top: 6px; }
.hero-quote {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px; color: #6b5d3f;
  font-family: "KaiTi", "STKaiti", serif;
  letter-spacing: 1.5px;
  padding: 3px 12px;
  border: 1px solid #ddd2b6;
  border-radius: 999px;
  background: rgba(255, 253, 247, .7);
}
@media (max-width: 960px) {
  .hero-art { opacity: .3; }
}

/* 侧边栏品牌区：极淡的水墨山影，安静地存在 */
.sidebar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 150px;
  pointer-events: none;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='264' height='150' viewBox='0 0 264 150'><path d='M0 150 L0 96 Q40 58 82 88 T168 80 T264 92 L264 150 Z' fill='%23ffffff' opacity='.11'/><path d='M0 150 L0 116 Q56 84 112 112 T264 108 L264 150 Z' fill='%23ffffff' opacity='.13'/><path d='M150 118 L170 78 L188 106 L206 72 L226 104 L244 88 L264 110 L264 150 L150 150 Z' fill='%23ffffff' opacity='.09'/></svg>") bottom center / cover no-repeat;
}

/* ========== 手机端适配（课堂场景：学生用手机操作） ========== */
/* 底部快捷操作栏，仅手机显示 */
.mobile-bar { display: none; }

@media (max-width: 960px) {
  /* 侧边栏压缩成一行横向滑动的导航，节省纵向空间 */
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 10px 10px 8px; height: auto; min-width: 0; }
  .sidebar::after { display: none; }
  .brand { padding: 2px 4px 8px; gap: 8px; }
  .brand-logo { width: 34px; height: 34px; font-size: 15px; border-radius: 8px; }
  .brand-seal { width: 15px; height: 15px; font-size: 9px; }
  .brand-title { font-size: 13px; }
  .brand-sub, .brand-course { font-size: 10px; }

  .nav { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin-top: 8px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; min-width: 0; }
  .nav::-webkit-scrollbar { height: 3px; }
  .nav-group { display: flex; width: auto; margin-bottom: 0; gap: 6px; }
  .nav-item { display: inline-block; white-space: nowrap; padding: 9px 13px; font-size: 13px; }

  /* 期间选择 + 学生身份（可切换账本）在手机上仍需可见 */
  .sidebar-footer { display: block; margin-top: 8px; padding-top: 8px; }
  .period-picker { margin-bottom: 8px; padding: 6px 8px; }
  .user-card { padding: 6px 8px; }
  .avatar { width: 30px; height: 30px; }
  .sidebar-credit { margin-top: 6px; }

  /* 顶栏与内容区 */
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar > div:first-child { min-width: 0; }
  .topbar h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #page-subtitle { display: none; }
  /* 底部快捷栏已有「记一笔」，顶栏不再重复 */
  #btn-quick-entry { display: none; }
  .topbar-actions .btn { padding: 8px 12px; font-size: 12.5px; }
  .view-root { padding: 14px 14px 92px; }

  /* 卡片与统计：单列/双列，触控友好 */
  .card { padding: 14px 15px; margin-bottom: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 18px; }
  .btn { padding: 10px 16px; }
  .btn.sm { padding: 6px 12px; }
  .hero-card { padding: 14px 16px 12px; }
  .hero-art { display: none; }
  .hero-title { font-size: 15px; }
  .company-form { grid-template-columns: 1fr; }
  .period-form { flex-direction: column; align-items: stretch; }

  /* iOS 聚焦时会自动放大页面，字号小于 16px 会触发，统一提到 16px */
  .input, select.input, textarea.input, .period-picker select { font-size: 16px; }
  input[type="number"].input { font-size: 16px; }

  /* 报表表格：横向滑动查看，避免挤成一团 */
  .table-wrap { border-radius: 8px; }
  table.report { min-width: 620px; font-size: 12.5px; }
  table.report th, table.report td { padding: 8px 10px; }
  .report-head .name { font-size: 18px; }
  .account-tree-row { grid-template-columns: 64px 1fr 84px; gap: 6px; font-size: 12.5px; }
  .account-tree-row.header { display: none; }
  .voucher-row { grid-template-columns: 54px 92px 1fr auto; gap: 8px; padding: 10px 12px; }

  /* 凭证录入：手机上全屏弹窗，便于输入 */
  #modal-entry .modal-card { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  #modal-entry .modal-body { padding: 14px 14px 26px; }
  .entry-row { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .entry-row .lbl { font-size: 12px; }
  .acct-suggest { max-height: 200px; }
  .sg-item { padding: 10px 12px; }

  /* 底部快捷操作栏 */
  .mobile-bar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    background: var(--panel);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(15, 23, 42, .08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-bar button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: transparent; border: none;
    font-family: inherit; font-size: 11px; color: var(--text-2);
    padding: 6px 2px; cursor: pointer;
  }
  .mobile-bar button .ico { font-size: 19px; line-height: 1; }
  .mobile-bar button.active { color: var(--primary); font-weight: 600; }
}

@media (max-width: 960px) {
  /* 登录页在手机上自适应收缩 */
  .login-overlay { padding: 14px; }
  .login-card { padding: 20px 18px 16px; border-radius: 16px; }
  .login-logo-img { width: 196px; margin-bottom: 10px; }
  .login-divider { margin-bottom: 14px; }
  .login-logo { width: 48px; height: 48px; font-size: 22px; border-radius: 12px; margin-bottom: 10px; }
  .login-seal { width: 22px; height: 22px; font-size: 13px; }
  .login-title { font-size: 18px; }
  .login-sub { font-size: 12px; margin-bottom: 16px; }
  .login-btn { padding: 12px; font-size: 15px; }
  .login-students-list { max-height: 92px; }
  .login-credit { font-size: 10.5px; }
  .login-fingerprint { font-size: 9.5px; }
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn { padding: 7px 10px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
