/* 沉稳商务风格（2026-10-23 用户选定）：深蓝侧栏、白色内容区、宝蓝主色、等宽数字 */
:root {
  --ink: #14213d;
  --ink-2: #1e2f55;
  --ink-3: #2a3d68;
  --accent: #2952cc;
  --accent-soft: #eaf0fc;
  --page-bg: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-soft: #eef1f6;
  --text: #17223b;
  --text-muted: #6b7487;
  --success: #1f8a5b;
  --warning: #b45309;
  --danger: #c2362b;
  --radius: 10px;
  --num-font: "DIN Alternate", "Bahnschrift", "SF Pro Display", -apple-system, "Helvetica Neue", Arial, sans-serif;

  --van-primary-color: var(--accent);
  --van-success-color: var(--success);
  --van-warning-color: var(--warning);
  --van-danger-color: var(--danger);
  --van-text-color: var(--text);
  --van-text-color-2: var(--text-muted);
  --van-border-color: var(--line-soft);
  --van-background: var(--page-bg);
  --van-active-color: #f0f3f9;
  --van-radius-md: 8px;
  --van-radius-lg: var(--radius);
  --van-cell-group-inset-radius: var(--radius);
  --van-cell-group-inset-padding: 0 16px;
  --van-cell-group-title-color: var(--text-muted);
  --van-cell-vertical-padding: 12px;
  --van-nav-bar-background: var(--ink);
  --van-nav-bar-title-text-color: #fff;
  --van-nav-bar-icon-color: #fff;
  --van-nav-bar-text-color: #fff;
  --van-nav-bar-title-font-size: 17px;
  --van-button-radius: 8px;
  --van-button-default-height: 42px;
  --van-tabs-bottom-bar-color: var(--accent);
  --van-tab-active-text-color: var(--ink);
  --van-tab-text-color: var(--text-muted);
  --van-tabbar-item-active-color: var(--accent);
  --van-tag-radius: 4px;
  --van-tag-padding: 1px 6px;
  --van-search-background: transparent;
  --van-search-content-background: #fff;
  --van-collapse-item-content-padding: 4px 16px 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.boot { padding: 48px 16px; text-align: center; color: var(--text-muted); }

.app { max-width: 760px; margin: 0 auto; min-height: 100vh; background: var(--page-bg); }

.num, .stat-value, table.data td.num, .van-cell__value { font-variant-numeric: tabular-nums; }

.fiction-banner {
  background: #fff6e6;
  color: #8a5300;
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
  border-bottom: 1px solid #f3e1bd;
}

.page { padding: 14px 0 28px; }

/* ---------- 卡片与列表 ---------- */
.van-cell-group--inset { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20, 33, 61, 0.04); }
.van-cell-group__title { padding: 18px 16px 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.van-cell-group__title--inset { padding: 18px 20px 8px; }
.van-cell__title { color: var(--text); }
.van-cell__label { color: var(--text-muted); }

.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 22px 16px 10px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); }

.note {
  margin: 12px 16px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d9e3f7;
  background: var(--accent-soft);
  color: #2d3f63;
  font-size: 12px;
  line-height: 1.7;
}
.note.warn { background: #fff6e6; border-color: #f3e1bd; color: #7a4a00; }

.actions { display: flex; gap: 10px; margin: 16px; }
.actions .van-button { flex: 1; }
.van-button--primary { background: var(--ink); border-color: var(--ink); }
.van-button--primary:active, .van-button--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.van-button--plain.van-button--primary { background: #fff; color: var(--ink); border-color: var(--ink); }

.tag-row { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.van-tag--success { background: #e6f4ed; color: var(--success); }
.van-tag--warning { background: #fdf1e1; color: var(--warning); }
.van-tag--danger { background: #fbe9e7; color: var(--danger); }
.van-tag--primary { background: var(--accent-soft); color: var(--accent); }

.muted { color: var(--text-muted); font-size: 12px; }

/* ---------- 顶部标题（电脑） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.topbar-back:hover { background: var(--line-soft); }
.topbar-title { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: 0.2px; }
.topbar-sub { margin-left: auto; font-size: 13px; color: var(--text-muted); }

/* ---------- 登录 ---------- */
.login-wrap { min-height: calc(100vh - 64px); display: flex; flex-direction: column; background: var(--page-bg); }
.login-brand {
  padding: 40px 24px 32px;
  background: var(--ink);
  color: #fff;
}
.login-brand .brand-mark { margin-bottom: 18px; }
.login-brand h1 { margin: 0 0 8px; font-size: 26px; font-weight: 600; letter-spacing: 1px; }
.login-brand p { margin: 0; font-size: 13px; line-height: 1.8; color: #aeb9d3; }
.login-brand .points { margin-top: 24px; display: grid; gap: 10px; font-size: 13px; color: #d5ddef; }
.login-brand .points div { display: flex; align-items: center; gap: 8px; }
.login-panel { flex: 1; padding: 8px 0 32px; }
.login-panel .panel-title { margin: 22px 20px 6px; font-size: 16px; font-weight: 600; color: var(--ink); }
.login-panel .panel-sub { margin: 0 20px 14px; font-size: 12px; color: var(--text-muted); }

@media (min-width: 1024px) {
  .login-wrap { flex-direction: row; }
  .login-brand {
    width: 44%; max-width: 560px; padding: 72px 56px;
    display: flex; flex-direction: column; justify-content: center;
  }
  .login-brand h1 { font-size: 34px; }
  .login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px 0; }
  .login-panel > * { width: 100%; max-width: 480px; margin-left: auto; margin-right: auto; }
}

.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent); color: #fff;
  font-size: 18px; font-weight: 700;
}

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto; margin: 0 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.04);
}
table.data { border-collapse: collapse; font-size: 13px; min-width: 100%; }
table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; text-align: left; }
table.data th {
  background: #f7f8fb; color: var(--text-muted);
  font-size: 12px; font-weight: 500; letter-spacing: 0.3px;
  position: sticky; top: 0;
  border-bottom: 1px solid var(--line);
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num { text-align: right; font-family: var(--num-font); font-size: 14px; }
table.data th.num { text-align: right; }
table.data.clickable tbody tr { cursor: pointer; transition: background 0.12s; }
table.data.clickable tbody tr:hover td { background: #f5f8fe; }
td.strong { font-weight: 600; color: var(--ink); }

.file-pick { display: flex; align-items: center; gap: 8px; }
.file-pick input[type=file] { font-size: 13px; max-width: 100%; }

/* ---------- 智能助手 ---------- */
.chat { margin: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.bubble.user { align-self: flex-end; background: var(--ink); color: #fff; max-width: 85%; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); max-width: 92%; border-bottom-left-radius: 4px; }
.bubble.err { align-self: flex-start; background: #fbe9e7; color: #8c2a20; }

pre.json { margin: 0; padding: 8px 10px; background: #f7f8fb; border-radius: 6px; font-size: 11px; white-space: pre-wrap; word-break: break-all; }

/* ---------- 弹窗 ---------- */
.popup-body { padding: 4px 0 18px; max-height: 80vh; overflow-y: auto; }
.popup-title { padding: 20px 20px 6px; font-size: 17px; font-weight: 600; color: var(--ink); }
.popup-title small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.desk-popup { width: 580px; max-width: calc(100vw - 32px); }

.wide-title .van-cell__title { flex: 5; }
.wide-title .van-cell__value { flex: 1; min-width: 44px; }

.total-row { background: #f7f8fb; }
.total-row .van-cell__title, .total-row .van-cell__value { font-weight: 700; color: var(--ink); }
.total-row .van-cell__value { font-family: var(--num-font); font-size: 16px; }
.run-current { background: var(--accent-soft); }
.run-current .van-cell__title { color: var(--accent); font-weight: 600; }

/* 宽屏（电脑、企业微信电脑版）时底部标签栏和内容同宽 */
.van-tabbar--fixed { max-width: 760px; left: 50%; transform: translateX(-50%); border-top: 1px solid var(--line); }

/* ---------- 数字卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 16px 4px; }
.stat {
  position: relative; padding: 14px 16px;
  border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20, 33, 61, 0.04);
}
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.stat-value {
  margin-top: 6px;
  font-family: var(--num-font); font-size: 24px; font-weight: 600; color: var(--ink);
  letter-spacing: 0.2px; line-height: 1.2; white-space: nowrap;
}
.stat-value small { font-family: -apple-system, "PingFang SC", sans-serif; font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 2px; }
.stat-value .unit { font-size: 14px; margin-right: 2px; color: var(--text-muted); font-weight: 500; }
.stat-value.danger { color: var(--danger); }
.stat-value.warn { color: var(--warning); }
.stat-hint { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.stat.primary { background: var(--ink); border-color: var(--ink); }
.stat.primary .stat-label, .stat.primary .stat-hint, .stat.primary .stat-value .unit { color: #aeb9d3; }
.stat.primary .stat-value { color: #fff; }

.toolbar { display: flex; align-items: center; gap: 12px; margin: 0 16px; }
.toolbar .van-cell-group { flex: 1; margin: 0; }
.run-meta { margin: 10px 16px 0; font-size: 12px; color: var(--text-muted); }

/* ---------- 电脑宽屏（≥1024px）：左侧深蓝导航，内容加宽 ---------- */
.app.desktop { max-width: none; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 18px; background: var(--ink); color: #c9d2e6;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; }
.side .brand-text { font-size: 17px; font-weight: 600; color: #fff; letter-spacing: 0.5px; }
.side .brand-text small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: #8e9bbb; letter-spacing: 0; }
.side .nav-label { padding: 16px 10px 8px; font-size: 11px; color: #7f8bab; letter-spacing: 1px; }
.side .nav-item {
  display: flex; align-items: center; gap: 12px;
  margin: 2px 0; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; cursor: pointer; color: #c9d2e6;
  transition: background 0.12s, color 0.12s;
}
.side .nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side .nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.side .user {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.side .user-info { flex: 1; min-width: 0; font-size: 13px; color: #fff; }
.side .user-info .muted { color: #8e9bbb; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .logout { padding: 6px; border-radius: 6px; cursor: pointer; color: #8e9bbb; }
.side .logout:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink-3); color: #fff; font-size: 14px; font-weight: 600;
}

.main { min-width: 0; }
.desktop .page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
.desktop .page.narrow { max-width: 780px; }
.desktop .fiction-banner { text-align: left; padding: 6px 32px; }

.desktop .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 16px 6px; }
.desktop .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.desktop .stat { padding: 18px 20px; }
.desktop .stat-value { font-size: 30px; margin-top: 8px; }

.desktop .home-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }

.desktop .actions { justify-content: flex-start; }
.desktop .actions .van-button { flex: 0 1 auto; min-width: 150px; }
.desktop .actions .van-button--block { width: auto; }
.desktop .toolbar .van-cell-group { flex: 0 0 280px; }
.desktop .toolbar .van-button { min-width: 170px; }

/* 手机：三张卡片一行，数字略小 */
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.three .stat { padding: 12px; }
.stats.three .stat-value { font-size: 22px; }
.desktop .stats.three .stat { padding: 18px 20px; }
.desktop .stats.three .stat-value { font-size: 30px; }
@media (max-width: 420px) { .stat-value { font-size: 20px; } }

/* 搜索框、标签页与卡片对齐，不铺满整行 */
.page .van-search { padding: 4px 16px 6px; }
.page .van-search__content { border: 1px solid var(--line); border-radius: 8px; }
.page .van-tabs__wrap { margin: 0 16px; border-bottom: 1px solid var(--line); }
.page .van-tabs__nav { background: transparent; }
.page .van-tab--active { font-weight: 600; }

/* ---------- 工资审批（V122） ---------- */
.side .nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #e5484d; color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}
.approvals { display: grid; gap: 12px; margin: 14px 16px 0; }
.desktop .approvals { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.approval-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: 0 1px 2px rgba(20, 33, 61, 0.04);
}
.approval-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.approval-title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.approval-head .muted { margin-top: 2px; }
.approval-diff {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px;
  margin: 14px 0 12px;
}
.diff-col { padding: 10px 12px; border-radius: 8px; background: #f7f8fb; border: 1px solid var(--line-soft); }
.diff-col.after { background: var(--accent-soft); border-color: #d6e1f8; }
.diff-label { font-size: 12px; color: var(--text-muted); }
.diff-type { margin-top: 4px; font-size: 13px; color: var(--text); }
.diff-amount { margin-top: 2px; font-family: var(--num-font); font-size: 20px; font-weight: 600; color: var(--ink); }
.diff-col.after .diff-amount { color: var(--accent); }
.diff-arrow { color: var(--text-muted); }
.approval-line { display: flex; gap: 8px; font-size: 13px; line-height: 1.7; color: var(--text); }
.approval-line .muted { flex: none; width: 3em; font-size: 13px; }
.approval-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.approval-actions .van-button { min-width: 72px; }
.approval-head .van-tag { flex: none; white-space: nowrap; }

/* ---------- 页面底部备案号（备案要求，写在 index.html 里，每页都有） ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  font-size: 12px; line-height: 1.6; color: var(--text-muted); text-align: center;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
body:has(.van-tabbar--fixed) .site-footer { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.gate-box .van-button { margin: 8px 20px 0; width: calc(100% - 40px); }
