/* ============================================================
   小店记账报税助手 · 现代响应式设计系统（温暖金主题）
   断点：
     ≥ 1024px  桌面
     768–1023  平板
     ≤ 768px   手机（顶部栏堆叠、导航变底部固定栏）
     ≤ 420px   小屏微调
   ============================================================ */
:root {
  --bg: #f4f6fb;            /* 页面底色 浅冷灰 */
  --bg-2: #eceff5;         /* 次级背景 */
  --panel: #ffffff;        /* 卡片底 纯白 */
  --panel-2: #f7f9fc;      /* 卡片高亮 */
  --border: #e6e9f0;       /* 普通边框 */
  --border-gold: #ecd9a0;  /* 金色边框 */

  --text: #1c2030;         /* 主文字 */
  --text-2: #515a6e;       /* 次文字 */
  --muted: #8a93a6;        /* 弱文字 */

  --gold: #c9a227;         /* 金色主 */
  --gold-light: #d9b94a;   /* 亮金 */
  --gold-bright: #a9801a;  /* 暗金（白底文字用，保证对比度） */
  --gold-soft: #fbf6e8;    /* 金底提示 */

  --green: #18a558;        /* 收入/成功 */
  --red: #e04646;          /* 支出/危险 */
  --amber: #d98324;        /* 报销/警告 */

  /* 设计令牌 */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20,28,55,.04), 0 2px 8px rgba(20,28,55,.05);
  --shadow: 0 2px 4px rgba(20,28,55,.04), 0 8px 24px rgba(20,28,55,.06);
  --shadow-gold: 0 6px 20px rgba(201,162,39,.14);
  --ring: 0 0 0 4px rgba(201,162,39,.16);
  --space: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--gold) var(--bg-2); }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--gold-bright); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #d9b94a; border-radius: 6px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-bright); }

/* ===================== 顶部栏 ===================== */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 26px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 6px 22px rgba(20,28,55,.05);
  position: sticky; top: 0; z-index: 200;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #f0d878, #c9a227);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800;
  box-shadow: 0 0 0 1px rgba(201,162,39,.4), 0 4px 12px rgba(201,162,39,.3);
}
.topbar h1 {
  font-size: 18px; margin: 0; font-weight: 700; letter-spacing: .3px;
  color: var(--text);
}
.topbar h1::after {
  content: ""; display: inline-block; width: 4px; height: 17px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-bright));
  border-radius: 2px; margin-left: 9px; vertical-align: -2px;
}
.sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* ===================== Tab 导航（桌面：顶部） ===================== */
.tabs {
  display: flex; gap: 4px; padding: 10px 26px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
  scrollbar-width: thin;
}
.tab {
  border: none; background: none; padding: 10px 16px; font-size: 14px;
  cursor: pointer; color: var(--muted); border-radius: var(--radius-sm);
  white-space: nowrap; transition: color .18s, background .18s;
  position: relative; font-weight: 500;
}
.tab:hover { color: var(--text-2); background: rgba(201,162,39,.07); }
.tab.active {
  color: var(--gold-bright); background: var(--gold-soft); font-weight: 600;
}

/* ===================== 主区 ===================== */
main { padding: 22px 26px 40px; max-width: 1080px; margin: 0 auto; }
.panel { display: none; animation: fade .25s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===================== 说明框 note ===================== */
.note {
  background: var(--gold-soft); border: 1px solid var(--border-gold);
  color: #6b561f; font-size: 13px; line-height: 1.8;
  border-radius: var(--radius); padding: 13px 18px; margin-bottom: var(--space);
}
.note b { color: var(--gold-bright); }

/* ===================== 卡片 ===================== */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: var(--space); box-shadow: var(--shadow);
}
.card-title { margin: 0 0 14px; font-size: 15px; font-weight: 650; color: var(--gold-bright); }

/* ===================== 工作台步骤 ===================== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: var(--space); }
.step {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  position: relative; display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  box-shadow: var(--shadow-sm);
}
.step:hover { transform: translateY(-3px); border-color: var(--border-gold); box-shadow: 0 10px 26px rgba(201,162,39,.14); }
.step-no {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #f0d878, #c9a227);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; box-shadow: 0 0 0 1px rgba(201,162,39,.35), 0 3px 8px rgba(201,162,39,.3);
}
.step h3 { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.step p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; flex: 1; }
.step.done .step-no { background: linear-gradient(135deg, #4ade80, #18a558); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px; display: flex; flex-direction: column; gap: 6px;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-num { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-bright); }
.suggest p { font-size: 14px; line-height: 1.8; min-height: 60px; color: var(--text-2); }

/* ===================== 表单 ===================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.form-grid label, .card label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.span2 { grid-column: span 2; }
.tip { font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.6; }

input, select, textarea {
  padding: 10px 12px; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font); background: #fff; color: var(--text); font-weight: 400;
  transition: border-color .18s, box-shadow .18s;
}
input::placeholder { color: #aab0b8; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold-light); box-shadow: var(--ring);
}

/* ===================== 按钮（触控友好，min-height 40） ===================== */
.btn {
  padding: 10px 18px; min-height: 40px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; color: var(--text-2);
  transition: background .16s, border-color .16s, color .16s, transform .08s, box-shadow .16s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--panel-2); border-color: var(--border-gold); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #f0d878, #c9a227);
  border-color: #c9a227; color: #fff; font-weight: 600; box-shadow: 0 2px 10px rgba(201,162,39,.28);
}
.btn.primary:hover { background: linear-gradient(180deg, #f3de8c, #d4af37); box-shadow: 0 4px 14px rgba(201,162,39,.4); }
.btn.big { padding: 13px 30px; font-size: 15px; min-height: 46px; }
.btn.danger { color: var(--red); border-color: #f3c2c2; background: #fff; }
.btn.danger:hover { background: #fdeeee; border-color: #e8a8a8; }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; min-height: 32px; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.2); }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.msg { font-size: 13px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

/* ===================== 记一笔：收支切换 ===================== */
.type-toggle { display: flex; gap: 14px; margin-bottom: var(--space); }
.tt { flex: 1; }
.tt input { display: none; }
.tt span {
  display: block; text-align: center; padding: 15px; border: 2px solid var(--border);
  border-radius: var(--radius); font-size: 17px; font-weight: 700; cursor: pointer; color: var(--muted);
  transition: border-color .18s, color .18s, background .18s;
}
.tt input:checked + .tt-income { border-color: var(--green); color: var(--green); background: #eef9f1; }
.tt input:checked + .tt-expense { border-color: var(--red); color: var(--red); background: #fdeeee; }
.recent { margin-top: 4px; }
.recent-item {
  display: flex; justify-content: space-between; padding: 11px 4px;
  border-bottom: 1px dashed #e8e8e8; font-size: 13.5px;
}
.recent-item .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.recent-item .amt.in { color: var(--green); }
.recent-item .amt.out { color: var(--red); }

/* ===================== 算税结果 ===================== */
.tax-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 16px 0; }
.tax-card { border-radius: var(--radius-sm); padding: 15px; background: var(--panel-2); border: 1px solid var(--border); }
.tax-card .t-label { font-size: 12px; color: var(--muted); }
.tax-card .t-num { font-size: 21px; font-weight: 700; margin-top: 7px; font-variant-numeric: tabular-nums; color: var(--text); }
.tax-card.free .t-num { color: var(--green); }
.tax-card.total { background: var(--gold-soft); border-color: var(--border-gold); }
.tax-card.total .t-num { color: var(--gold-bright); }
.calc-steps { background: var(--panel-2); border: 1px solid var(--border-gold); border-radius: var(--radius-sm); padding: 15px 20px; }
.calc-steps h4 { margin: 0 0 10px; font-size: 14px; color: var(--gold-bright); }
.calc-steps ol { margin: 0; padding-left: 20px; }
.calc-steps li { font-size: 13px; line-height: 1.95; color: var(--text-2); }
.free-banner { background: #e7f6ec; border: 1px solid #b9e6c6; color: var(--green); padding: 11px 16px; border-radius: var(--radius-sm); font-weight: 600; margin-bottom: 13px; }

/* ===================== 报税提醒 ===================== */
.remind-item {
  background: var(--panel); border: 1px solid var(--border);
  border-left: 4px solid var(--muted); border-radius: var(--radius); padding: 15px 18px; margin-bottom: 13px;
  transition: border-color .16s, box-shadow .16s;
}
.remind-item.soon { border-left-color: var(--red); background: linear-gradient(90deg, #fff5f3, var(--panel) 30%); }
.remind-item.overdue { border-left-color: var(--red); background: linear-gradient(90deg, #fdeeee, var(--panel) 30%); }
.remind-item.upcoming { border-left-color: var(--gold-light); }
.remind-item.done { border-left-color: var(--green); background: linear-gradient(90deg, #e7f6ec, var(--panel) 40%); opacity: .88; }
.remind-item.done .t { text-decoration: line-through; color: var(--muted); }
.remind-item:hover { box-shadow: 0 4px 14px rgba(20,28,55,.06); }
.remind-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; gap: 12px; }
.remind-head .t { font-weight: 700; font-size: 14.5px; color: var(--text); }
.remind-head .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.head-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.badge { padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.soon, .badge.overdue { background: #fde8e8; color: var(--red); }
.badge.upcoming { background: var(--gold-soft); color: var(--gold-bright); }
.badge.done { background: #d4f4dc; color: #15803d; border: 1px solid #b9e6c6; }
.remind-steps { margin-top: 11px; padding-top: 11px; border-top: 1px dashed #e8e8e8; }
.remind-steps ol { margin: 6px 0 0; padding-left: 20px; }
.remind-steps li { font-size: 13px; line-height: 1.95; color: var(--text-2); }

/* ===================== 账簿 / 表格 ===================== */
.filter { display: flex; gap: 14px; align-items: flex-end; margin: 4px 0 16px; flex-wrap: wrap; }
.filter label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.filter input { width: 120px; }
.data { width: 100%; border-collapse: collapse; margin-top: 6px; background: var(--panel); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.data th, .data td { border: 1px solid var(--border); padding: 9px 11px; font-size: 13px; text-align: left; }
.data th { background: var(--gold-soft); font-weight: 600; color: var(--gold-bright); }
.data tbody tr { transition: background .12s; }
.data tbody tr:hover { background: rgba(201,162,39,.06); }
.data td.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.entries { width: 100%; border-collapse: collapse; margin-top: 14px; }
.entries th, .entries td { border: 1px solid var(--border); padding: 8px 10px; font-size: 13px; }
.entries th { background: var(--gold-soft); color: var(--gold-bright); }
.entries input, .entries select { width: 100%; }
.entry-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.totals { font-size: 13px; color: var(--text-2); }
.totals b { font-variant-numeric: tabular-nums; color: var(--gold-bright); }
.state.ok { color: var(--green); font-weight: 600; }
.state.bad { color: var(--red); font-weight: 600; }
.voucher-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 13px; box-shadow: var(--shadow-sm); }
.voucher-card:hover { border-color: var(--border-gold); }
.voucher-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.voucher-head .no { font-weight: 700; color: var(--gold-bright); }
.voucher-card table { width: 100%; border-collapse: collapse; }
.voucher-card td { padding: 5px 7px; font-size: 13px; border-bottom: 1px dashed #e8e8e8; }
.balance-summary { display: flex; gap: 18px; font-size: 13px; margin: 6px 0 12px; flex-wrap: wrap; color: var(--text-2); }
.balance-summary .badge.ok { background: #e7f6ec; color: var(--green); }
.balance-summary .badge.bad { background: #fde8e8; color: var(--red); }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--amber); font-size: 14px; }

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

/* ===================== 报销 ===================== */
.preview { max-width: 200px; max-height: 160px; margin-top: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-gold); }
.reimb-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 13px; background: var(--panel); box-shadow: var(--shadow-sm); }
.reimb-item:hover { border-color: var(--border-gold); box-shadow: var(--shadow); }
.reimb-head { font-size: 14px; line-height: 1.65; color: var(--text-2); }
.reimb-head b { color: var(--gold-bright); }
.reimb-meta { font-size: 12.5px; color: var(--muted); margin: 6px 0 9px; }
.reimb-meta a { color: var(--gold-bright); }
.reimb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.warn { color: var(--red); font-size: 12px; }
.save-box { background: #eef9f1; border: 1px solid #b9e6c6; border-radius: var(--radius); padding: 15px 20px; margin-top: 15px; }
.save-box h4 { margin: 0 0 9px; font-size: 14px; color: var(--green); }
.save-box ul { margin: 0; padding-left: 20px; }
.save-box li { font-size: 13px; line-height: 1.95; color: #335; }
.save-box b { color: var(--green); }

.order-item {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; font-size: 13px; background: var(--panel); box-shadow: var(--shadow-sm);
}
.order-item .tip { width: 100%; }

.export-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 20px; margin-top: 15px; }
.export-box h4 { margin: 0 0 11px; font-size: 14px; color: var(--gold-bright); }
.export-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.export-btns .btn { text-align: left; font-size: 13px; font-weight: 500; padding: 12px 14px; line-height: 1.4; white-space: normal; background: #fff; }
.export-btns .btn:hover { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 3px 10px rgba(201,162,39,.18); }
.export-hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ===================== AI 聊天 ===================== */
.chat { padding: 0; overflow: hidden; border-radius: var(--radius); }
.chat-log { height: 360px; overflow-y: auto; padding: 18px; background: var(--panel-2); }
.chat-empty { color: var(--muted); text-align: center; padding: 70px 0; font-size: 14px; }
.msg-line { display: flex; flex-direction: column; margin-bottom: 14px; }
.msg-line.me { align-items: flex-end; }
.msg-line.me .bubble { background: linear-gradient(180deg, #f0d878, #c9a227); color: #fff; box-shadow: 0 2px 10px rgba(201,162,39,.25); }
.msg-line.bot .bubble { background: #fff; border: 1px solid var(--border); color: var(--text); }
.msg-line.err .bubble { background: #fdeeee; color: var(--red); border: 1px solid #f3c2c2; }
.bubble { max-width: 82%; padding: 11px 15px; border-radius: 14px; font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.mode { font-size: 11px; color: var(--muted); margin: 4px 5px 0; }
.chat-input { display: flex; gap: 9px; padding: 13px; border-top: 1px solid var(--border); background: #fff; }
.chat-input input { flex: 1; }
.quick-q { display: flex; gap: 8px; padding: 0 13px 13px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-gold); background: var(--gold-soft); border-radius: 999px; padding: 6px 15px; font-size: 12.5px; cursor: pointer; color: var(--gold-bright); transition: background .15s; }
.chip:hover { background: rgba(201,162,39,.18); }

/* ===================== 公司总览 ===================== */
.co-card {
  border: 1px solid var(--border); border-left: 4px solid var(--green);
  border-radius: var(--radius); padding: 15px 18px; margin-bottom: 13px; background: var(--panel);
  transition: border-color .16s, transform .16s, box-shadow .16s; box-shadow: var(--shadow-sm);
}
.co-card:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.co-card.bar-amber { border-left-color: var(--amber); background: linear-gradient(90deg, #fffdf6, var(--panel) 30%); }
.co-card.bar-red { border-left-color: var(--red); background: linear-gradient(90deg, #fff7f6, var(--panel) 30%); }
.co-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; font-size: 15px; color: var(--text); }
.co-stats { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 11px; }
.co-stats b { font-variant-numeric: tabular-nums; color: var(--gold-bright); }
.bar { height: 11px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; transition: width .4s; }
.bar-fill.bar-green { background: linear-gradient(90deg, #4ade80, #18a558); }
.bar-fill.bar-amber { background: linear-gradient(90deg, #fbbf24, #d98324); }
.bar-fill.bar-red { background: linear-gradient(90deg, #f87171, #e04646); }
.bar-label { font-size: 12px; color: var(--muted); margin-top: 5px; }
.suggest-box { background: var(--gold-soft); border: 1px solid var(--border-gold); border-radius: var(--radius); padding: 15px 18px; margin: 13px 0; }
.alloc-pick { font-size: 15px; margin-bottom: 7px; color: var(--text); }
.alloc-pick b { color: var(--gold-bright); }
.alloc-reason { font-size: 13px; line-height: 1.75; color: var(--text-2); margin-bottom: 11px; }

/* ===================== 记账明细 ===================== */
.tx-summary { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 16px; font-size: 13px; }
.tx-summary span { background: var(--panel-2); border: 1px solid var(--border); padding: 7px 15px; border-radius: var(--radius-sm); color: var(--text-2); }
.tx-summary b { font-variant-numeric: tabular-nums; }
.tx-summary .s-in b { color: var(--green); }
.tx-summary .s-out b { color: var(--red); }
.tx-summary .s-re b { color: var(--amber); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
.tx-table { min-width: 760px; border-collapse: collapse; }
.tx-table th, .tx-table td { border: 1px solid var(--border); padding: 9px 11px; font-size: 13px; }
.tx-table th { background: var(--gold-soft); color: var(--gold-bright); font-weight: 600; text-align: left; position: sticky; top: 0; }
.tx-table tbody tr { transition: background .12s; }
.tx-table tbody tr:hover { background: rgba(201,162,39,.06); }
.tx-table td { white-space: nowrap; }
.tx-table td.tx-summary-cell { white-space: normal; max-width: 220px; }
.tx-type { font-weight: 600; padding: 2px 9px; border-radius: 6px; font-size: 12px; }
.tx-type.income { background: #e7f6ec; color: var(--green); }
.tx-type.expense { background: #fdeeee; color: var(--red); }
.tx-type.reimb { background: #fff7e6; color: var(--amber); }
.tx-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.tx-amt.in { color: var(--green); }
.tx-amt.out { color: var(--red); }
.tx-amt.re { color: var(--amber); }
.tx-invoice { font-size: 11px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager .pg-info { font-size: 12px; color: var(--muted); margin-right: 8px; }
.pager .pg-btn {
  min-width: 36px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--border);
  background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s;
}
.pager .pg-btn:hover:not(:disabled):not(.active) { background: var(--panel-2); border-color: var(--border-gold); color: var(--text); }
.pager .pg-btn.active { background: linear-gradient(180deg, #f0d878, #c9a227); color: #fff; border-color: #c9a227; font-weight: 600; }
.pager .pg-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ===================== 登录/注册遮罩 ===================== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(120% 120% at 50% 0%, #eef1f8 0%, #f4f6fb 60%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
  background: #fff; border: 1px solid var(--border-gold); border-radius: var(--radius-lg);
  padding: 30px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-gold), 0 2px 8px rgba(20,28,55,.06);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand h2 { margin: 0; font-size: 18px; color: var(--text); }
.auth-brand .logo { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--bg-2); border-radius: 10px; padding: 4px; }
.auth-tab {
  flex: 1; border: none; background: none; padding: 9px; border-radius: 7px;
  font-size: 14px; cursor: pointer; color: var(--muted); transition: all .15s;
}
.auth-tab.active { background: #fff; color: var(--gold-bright); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.auth-form input { padding: 10px 12px; min-height: 42px; }
.auth-form .btn.big { margin-top: 4px; }
.auth-tip { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; text-align: center; }

/* ===================== 顶栏右侧 ===================== */
.topbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.enterprise-picker, .merchant-picker, .user-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.enterprise-picker select, .merchant-picker select { min-width: 160px; }
.enterprise-picker select { min-width: 180px; border-color: var(--border-gold); }
.user-box { gap: 10px; }
.user-name { font-weight: 600; color: var(--gold-bright); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================== 企业管理 ===================== */
.ent-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; background: var(--panel-2); transition: border-color .15s;
}
.ent-item:hover { border-color: var(--border-gold); }
.ent-item.current { border-color: var(--gold-light); background: var(--gold-soft); }
.ent-item .badge { margin-left: 6px; }
.ent-info { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.ent-info b { font-size: 16px; color: var(--text); }
.invite-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--gold-soft); border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13.5px;
}
.invite-item span { flex: 1; }
.role-sel { padding: 6px 8px; font-size: 12px; min-width: 100px; min-height: 34px; }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--amber); font-size: 14px; }

/* ============================================================
   响应式：平板 / 手机 / 小屏
   ============================================================ */

/* 平板：网格收窄为 2 列，顶栏允许换行 */
@media (max-width: 1024px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .tax-cards { grid-template-columns: repeat(2, 1fr); }
  main { padding: 20px 18px 40px; }
}

/* 平板竖屏 / 大手机：网格再收窄，表单单列 */
@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap; gap: 10px; padding: 10px 14px;
    position: sticky; top: 0;
  }
  .brand { flex: 1 1 auto; }
  .topbar-right { width: 100%; justify-content: space-between; gap: 10px; }
  .enterprise-picker, .merchant-picker { flex: 1 1 140px; }
  .enterprise-picker select, .merchant-picker select { flex: 1; min-width: 0; width: 100%; }
  .merchant-picker { font-size: 13px; }

  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 500;
    padding: 6px 8px; gap: 2px;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--border); border-bottom: none;
    box-shadow: 0 -4px 16px rgba(20,28,55,.08);
    justify-content: flex-start;
  }
  .tab { flex: 0 0 auto; padding: 10px 13px; font-size: 12.5px; }
  main { padding: 16px 14px 86px; max-width: 100%; }

  .grid2, .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .steps { grid-template-columns: 1fr; }
  .tax-cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }

  /* 表格在窄屏横向滚动（.data 自身滚动，避免破版） */
  .data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data th, .data td { white-space: nowrap; }

  .card { padding: 16px; }
  .export-btns { grid-template-columns: 1fr; }
}

/* 小屏手机：进一步优化触控与间距 */
@media (max-width: 420px) {
  .topbar h1 { font-size: 16px; }
  .sub { font-size: 11px; }
  .card { padding: 14px; border-radius: var(--radius-sm); }
  .steps, .tax-cards { gap: 12px; }
  .btn.big { width: 100%; }
  /* 顶栏选择器在小屏各占一行，保证可点 */
  .topbar-right { flex-direction: column; align-items: stretch; }
  .enterprise-picker, .merchant-picker, .user-box { width: 100%; }
  .user-box { justify-content: space-between; }
  /* 底栏标签更小，避免溢出 */
  .tab { padding: 9px 10px; font-size: 12px; }
}
