/* ============================================================
   财税通 · 样式表
   浅色主题，财务系统风格：紧凑、数据优先、弱装饰
   ============================================================ */

:root {
  --c-bg: #f3f5fa;
  --c-panel: #ffffff;
  --c-line: #e4e8f0;
  --c-line-soft: #eef1f7;
  --c-text: #16202f;
  --c-text-2: #58637a;
  --c-text-3: #8c96a8;
  --c-primary: #2f6bff;
  --c-primary-d: #1f52d0;
  --c-primary-soft: #edf2ff;
  --c-green: #0e9f6e;
  --c-green-soft: #e6f7f1;
  --c-orange: #e07b39;
  --c-orange-soft: #fdf0e6;
  --c-red: #d64545;
  --c-red-soft: #fdecec;
  --c-purple: #6d5bd0;
  --c-purple-soft: #f0edfd;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 56, .05);
  --shadow: 0 4px 16px rgba(20, 32, 56, .08);
  --shadow-lg: 0 18px 48px rgba(20, 32, 56, .18);
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.num, td.num, th.num { font-variant-numeric: tabular-nums; }

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

.sidebar {
  background: #0f1726;
  color: #cfd8e8;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 18px;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b7bff, #6d5bd0);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(47, 107, 255, .35);
  flex: none;
}

.brand-name { color: #fff; font-size: 15px; font-weight: 650; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: #7b8aa5; letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #a9b6cc;
  text-decoration: none;
  font-size: 13.5px;
  transition: background .14s, color .14s;
  white-space: nowrap;
}

.nav a .ico { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #e8eefb; }
.nav a.active { background: rgba(47, 107, 255, .18); color: #fff; box-shadow: inset 2px 0 0 #4b83ff; }
.nav a.active .ico { opacity: 1; }

.nav-group {
  font-size: 10.5px;
  color: #5b6b86;
  letter-spacing: 1.2px;
  padding: 14px 10px 5px;
  text-transform: uppercase;
}

.side-foot { padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
.company-chip { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .045); }
.cc-name { color: #dbe4f5; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-meta { color: #7b8aa5; font-size: 11px; margin-top: 2px; }
.ver { color: #4d5b74; font-size: 10.5px; text-align: center; padding-top: 8px; }

.main { display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 66px;
  flex: none;
  background: var(--c-panel);
  border-bottom: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 16px;
}

.topbar-title h1 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: .2px; }
.topbar-title p { margin: 1px 0 0; font-size: 12px; color: var(--c-text-3); }

.top-actions { display: flex; align-items: center; gap: 8px; }

.period-picker { display: flex; align-items: center; gap: 7px; margin-right: 4px; }
.period-picker .lbl { font-size: 12px; color: var(--c-text-3); }

.view { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }

.loading { color: var(--c-text-3); padding: 40px; text-align: center; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-line);
  background: #fff;
  color: var(--c-text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
}

.btn:hover { border-color: #cfd8e8; color: var(--c-text); background: #fbfcfe; }
.btn .ico { width: 15px; height: 15px; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: 0 2px 8px rgba(47, 107, 255, .28); }
.btn-primary:hover { background: var(--c-primary-d); border-color: var(--c-primary-d); color: #fff; }
.btn-danger { color: var(--c-red); border-color: #f3cfcf; background: #fff; }
.btn-danger:hover { background: var(--c-red-soft); color: var(--c-red); }
.btn-sm { height: 27px; padding: 0 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

select, input[type=text], input[type=date], input[type=number], input[type=month], textarea {
  height: 32px;
  min-height: 32px;
  flex: none;
  line-height: 18px;
  padding: 6px 9px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--c-text);
  outline: none;
  transition: border-color .14s, box-shadow .14s;
}

select:focus, input:focus, textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}

textarea { height: auto; line-height: 1.6; padding: 8px 9px; resize: vertical; }

/* 数字输入统一用 text + inputmode=decimal：type=number 在部分 Chromium 下会把文字压到底部 */
/* 数字输入框：保持左对齐。
   注意：这个 Chromium 版本里 input 一旦 text-align:right 或
   font-variant-numeric:tabular-nums，文字就会沉到框底，故不做右对齐。 */
input[data-num] { text-align: left; }
input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; color: var(--c-text-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--c-text-3); }

.card {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-line-soft);
  gap: 12px;
}

.card-hd h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.card-hd .sub { font-size: 11.5px; color: var(--c-text-3); }
.card-bd { padding: 16px; }
.card-bd.tight { padding: 0; }

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

/* ---------- KPI ---------- */
.kpi {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.kpi::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kpi-color, var(--c-primary));
}

.kpi-label { font-size: 12px; color: var(--c-text-2); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 23px; font-weight: 650; letter-spacing: -.4px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: 13px; font-weight: 500; color: var(--c-text-3); margin-right: 2px; }
.kpi-foot { font-size: 11.5px; color: var(--c-text-3); margin-top: 4px; }
.kpi-foot .up { color: var(--c-green); }
.kpi-foot .down { color: var(--c-red); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }

table.tbl th {
  text-align: left;
  font-weight: 550;
  color: var(--c-text-2);
  background: #fafbfd;
  border-bottom: 1px solid var(--c-line);
  padding: 9px 12px;
  white-space: nowrap;
  font-size: 12.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--c-line-soft);
  vertical-align: middle;
}

table.tbl tbody tr:hover { background: #f8faff; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tr.total-row td { background: #fafbfd; font-weight: 650; border-top: 1px solid var(--c-line); }
table.tbl tr.subtotal td { font-weight: 600; background: #fcfdff; }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl td.mono { font-family: var(--mono); font-size: 12px; }
table.tbl tr.hl td { background: var(--c-primary-soft); }

.empty { padding: 44px; text-align: center; color: var(--c-text-3); font-size: 13px; }
.empty .big { font-size: 26px; margin-bottom: 6px; opacity: .45; }

/* ---------- 标签 / 徽标 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 500;
  background: #f1f4f9;
  color: var(--c-text-2);
  white-space: nowrap;
}

.tag-blue { background: var(--c-primary-soft); color: var(--c-primary-d); }
.tag-green { background: var(--c-green-soft); color: #0a7a53; }
.tag-orange { background: var(--c-orange-soft); color: #b25a1c; }
.tag-red { background: var(--c-red-soft); color: #b13333; }
.tag-purple { background: var(--c-purple-soft); color: #5545b3; }
.tag-gray { background: #f1f4f9; color: var(--c-text-3); }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--c-line); margin-bottom: 16px; }
.tabs button {
  border: 0;
  background: none;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--c-text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .14s;
}
.tabs button:hover { color: var(--c-text); }
.tabs button.on { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.toolbar .search { width: 220px; }

/* ---------- 模态框 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(14, 22, 38, .42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  z-index: 100;
  overflow-y: auto;
  animation: fade .16s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }

.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 640px;
  max-width: 100%;
  animation: pop .18s ease;
  margin: auto 0;
}

.modal.wide { width: 920px; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--c-line-soft); }
.modal-hd h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-hd .x { border: 0; background: none; font-size: 20px; color: var(--c-text-3); cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-hd .x:hover { background: #f2f5fa; color: var(--c-text); }
.modal-bd { padding: 18px 20px; }
.modal-ft { padding: 13px 20px; border-top: 1px solid var(--c-line-soft); display: flex; justify-content: flex-end; gap: 9px; align-items: center; }
.modal-ft .tip { margin-right: auto; font-size: 12px; color: var(--c-text-3); }

/* ---------- 表单网格 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- 凭证录入 ---------- */
.entry-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.entry-tbl th { font-size: 12px; color: var(--c-text-2); font-weight: 550; text-align: left; padding: 7px 8px; background: #fafbfd; border-bottom: 1px solid var(--c-line); }
.entry-tbl td { padding: 5px 4px; border-bottom: 1px solid var(--c-line-soft); }
.entry-tbl input, .entry-tbl select { width: 100%; height: 30px; }
.entry-tbl td.amt { width: 128px; }
.entry-tbl td.act { width: 34px; text-align: center; }
.entry-tbl .rowdel { border: 0; background: none; color: var(--c-text-3); cursor: pointer; font-size: 15px; padding: 3px 6px; border-radius: 5px; }
.entry-tbl .rowdel:hover { background: var(--c-red-soft); color: var(--c-red); }

.entry-foot { display: flex; align-items: center; justify-content: flex-end; gap: 22px; padding: 10px 8px 0; font-size: 13px; }
.entry-foot .lab { color: var(--c-text-2); }
.entry-foot .val { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14.5px; min-width: 96px; text-align: right; }

.bal-ok { color: var(--c-green); font-size: 12.5px; }
.bal-bad { color: var(--c-red); font-size: 12.5px; font-weight: 600; }

/* ---------- 报表 ---------- */
.report-head { text-align: center; padding: 8px 0 14px; }
.report-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: 1px; }
.report-head .meta { font-size: 11.5px; color: var(--c-text-3); margin-top: 3px; }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--c-line); }
.report-cols > div:first-child { border-right: 1px solid var(--c-line); }

table.rep { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.rep th { padding: 7px 10px; font-size: 12px; color: var(--c-text-2); font-weight: 550; background: #fafbfd; border-bottom: 1px solid var(--c-line); text-align: right; }
table.rep th:first-child { text-align: left; }
table.rep td { padding: 6px 10px; border-bottom: 1px solid #f3f5fa; }
table.rep td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.rep tr.b td { font-weight: 650; }
table.rep tr.hl td { background: var(--c-primary-soft); font-weight: 700; }
table.rep tr.indent td:first-child { padding-left: 22px; color: var(--c-text-2); }

/* ---------- 图表 ---------- */
.chart-box { padding: 4px 0 0; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--c-text-2); padding: 0 4px 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.bar-row { display: grid; grid-template-columns: 96px 1fr 78px; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.bar-track { height: 8px; background: #f0f3f9; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #5b8dff, #2f6bff); transition: width .5s ease; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--c-text-2); }

/* ---------- 税务 ---------- */
.tax-total {
  background: linear-gradient(135deg, #1b2942, #2b3d5e);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.tax-total .lab { font-size: 12.5px; color: #9fb0cd; letter-spacing: .5px; }
.tax-total .amt { font-size: 32px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin-top: 2px; display: flex; align-items: baseline; gap: 5px; }
.tax-total .amt .unit { font-size: 15px; font-weight: 500; color: #b9c7de; margin: 0; }
.tax-total .side { text-align: right; font-size: 12px; color: #9fb0cd; line-height: 1.9; }
.tax-total .side b { color: #fff; font-variant-numeric: tabular-nums; }

.kv { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--c-line-soft); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--c-text-2); }
.kv .v { font-variant-numeric: tabular-nums; font-weight: 550; }
.kv.total { border-top: 1px solid var(--c-line); margin-top: 4px; padding-top: 9px; font-weight: 650; }
.kv.total .k { color: var(--c-text); font-weight: 650; }

.policy { list-style: none; margin: 0; padding: 0; }
.policy li { display: flex; gap: 8px; padding: 7px 0; font-size: 12.5px; color: var(--c-text-2); line-height: 1.65; border-bottom: 1px dashed var(--c-line-soft); }
.policy li:last-child { border-bottom: 0; }
.policy li::before { content: "§"; color: var(--c-primary); font-weight: 700; flex: none; }

.notice {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--c-primary-soft);
  color: #26417e;
  font-size: 12.5px;
  line-height: 1.65;
}
.notice.warn { background: var(--c-orange-soft); color: #8a4a14; }
.notice.ok { background: var(--c-green-soft); color: #0a6b4a; }
.notice .ico { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: #16202f;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slide .2s ease;
  max-width: 380px;
}
.toast.ok { background: #0f7a55; }
.toast.err { background: #b33a3a; }

@keyframes slide { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .report-cols { grid-template-columns: 1fr; }
  .report-cols > div:first-child { border-right: 0; border-bottom: 1px solid var(--c-line); }
  .form-grid { grid-template-columns: 1fr; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3dae6; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #bcc6d6; }
::-webkit-scrollbar-track { background: transparent; }

/* 打印：报表页可直接打印 */
@media print {
  .sidebar, .topbar, .tabs, .toolbar, .btn { display: none !important; }
  .app { display: block; height: auto; }
  .view { padding: 0; overflow: visible; }
  .card { border: 0; box-shadow: none; }
  body { background: #fff; }
}

/* ============================================================
   登录 / 用户 / CRM
   ============================================================ */
.login-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: radial-gradient(1200px 600px at 20% 10%, #1d3057 0%, #0d1524 55%, #080d16 100%);
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: 372px;
  max-width: 100%;
  background: #fff;
  border-radius: 14px;
  padding: 30px 28px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .38);
}

.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-brand .logo { width: 40px; height: 40px; font-size: 19px; }
.login-brand h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: .5px; }
.login-brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--c-text-3); }

.login-card .field { margin-bottom: 14px; }
.login-card input { height: 38px; line-height: 36px; }
.login-card .btn-primary { width: 100%; height: 38px; justify-content: center; font-size: 14px; margin-top: 6px; }
.login-tip { margin-top: 14px; font-size: 11.5px; color: var(--c-text-3); text-align: center; line-height: 1.7; }
.login-err { background: var(--c-red-soft); color: #b13333; font-size: 12.5px; padding: 8px 11px; border-radius: 7px; margin-bottom: 12px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .14s;
}
.user-row:hover { background: rgba(255, 255, 255, .09); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #4b83ff, #6d5bd0);
  color: #fff; font-size: 12px; font-weight: 600;
  display: grid; place-items: center; flex: none;
}
.user-row .u-name { color: #e6ecf8; font-size: 12.5px; font-weight: 600; }
.user-row .u-role { color: #7b8aa5; font-size: 10.5px; }

.nav a .badge {
  margin-left: auto;
  background: #e0453f;
  color: #fff;
  font-size: 10px;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  text-align: center;
  border-radius: 9px;
  padding: 0 5px;
  font-weight: 600;
}

/* 客户详情 */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-head h4 { margin: 0; font-size: 16px; font-weight: 650; }
.detail-meta { font-size: 12.5px; color: var(--c-text-2); line-height: 1.9; }
.detail-meta b { color: var(--c-text); font-weight: 550; }

.section-title {
  font-size: 12.5px; font-weight: 600; color: var(--c-text-2);
  padding: 14px 0 8px; border-top: 1px dashed var(--c-line); margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--c-line-soft); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before {
  content: ""; position: absolute; left: -21px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--c-primary);
}
.timeline .t-head { font-size: 12.5px; color: var(--c-text); font-weight: 550; }
.timeline .t-date { font-size: 11.5px; color: var(--c-text-3); margin-left: 8px; font-weight: 400; }
.timeline .t-body { font-size: 12.5px; color: var(--c-text-2); margin-top: 3px; line-height: 1.6; }

.stage-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* ============================================================
   UI 组件：确认弹窗 / 日期选择器（自研，零依赖）
   ============================================================ */
.dlg-mask { z-index: 400; align-items: center; padding: 20px; }
.dlg-modal { width: 420px; }
.dlg-msg { font-size: 13.5px; color: var(--c-text-2); line-height: 1.8; }
.dlg-input { width: 100%; margin-top: 14px; }

.dp-panel {
  position: fixed;
  z-index: 350;
  display: none;
  width: 262px;
  padding: 10px 10px 8px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(20, 32, 56, .16);
  user-select: none;
}

.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-size: 13px; font-weight: 600; color: var(--c-text); letter-spacing: .3px; }
.dp-nav {
  border: 0; background: none; cursor: pointer; color: var(--c-text-3);
  width: 22px; height: 22px; border-radius: 5px; font-size: 13px; line-height: 1;
  display: grid; place-items: center; transition: all .12s;
}
.dp-nav:hover { background: var(--c-primary-soft); color: var(--c-primary); }

.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-w { font-size: 11px; color: var(--c-text-3); text-align: center; padding: 4px 0 5px; }
.dp-d {
  height: 28px; display: grid; place-items: center;
  font-size: 12.5px; border-radius: 6px; cursor: pointer; color: var(--c-text);
  transition: background .1s, color .1s;
}
.dp-d:hover { background: var(--c-primary-soft); color: var(--c-primary-d); }
.dp-d.out { color: #c6ccd8; }
.dp-d.today { box-shadow: inset 0 0 0 1px #b9cdfd; }
.dp-d.sel { background: var(--c-primary); color: #fff; font-weight: 600; box-shadow: none; }
.dp-d.sel:hover { background: var(--c-primary-d); color: #fff; }

.dp-foot {
  display: flex; justify-content: space-between;
  margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--c-line-soft);
}
.dp-btn {
  border: 0; background: none; cursor: pointer;
  color: var(--c-primary); font-size: 12px; padding: 3px 8px; border-radius: 5px;
}
.dp-btn:hover { background: var(--c-primary-soft); }

input[data-date] { cursor: pointer; background-image: none; }
input[data-date].dp-active { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }

/* 确认弹窗里的危险操作按钮：实心红，避免误点 */
.dlg-modal .btn-danger { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.dlg-modal .btn-danger:hover { background: #b93636; border-color: #b93636; color: #fff; }

/* 数据初始化勾选项 */
.chk {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 11px; margin-bottom: 7px;
  border: 1px solid var(--c-line); border-radius: 8px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.chk:hover { border-color: #cfd8e8; background: #fbfcfe; }
.chk input[type=checkbox] { margin-top: 2px; height: auto; flex: none; }
.chk b { display: block; font-size: 13px; font-weight: 600; color: var(--c-text); }
.chk em { display: block; font-style: normal; font-size: 11.5px; color: var(--c-text-3); margin-top: 1px; }

/* ---------- 附件 ---------- */
.att-box {
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  overflow: hidden;
}
.att-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--c-line-soft);
}
.att-title { font-size: 12.5px; font-weight: 600; color: var(--c-text-2); }
.att-hint { font-size: 11.5px; color: var(--c-text-3); }
.att-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--c-line-soft);
}
.att-row:last-child { border-bottom: 0; }
.att-row.queued { background: var(--c-primary-soft); }
.att-ico { display: inline-flex; flex: none; color: var(--c-text-3); }
.att-ico.ico-sm { width: 15px; height: 15px; }
.att-name {
  font: inherit; font-size: 12.5px; color: var(--c-primary);
  border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 46%;
}
button.att-name:hover { text-decoration: underline; }
.att-dl {
  flex: none; font-size: 11.5px; color: var(--c-text-2); text-decoration: none;
  padding: 0 5px; border-radius: 4px;
}
.att-dl:hover { color: var(--c-primary); background: var(--c-primary-soft); }
.att-row.queued .att-name { color: var(--c-text); cursor: default; }
.att-meta {
  margin-left: auto; white-space: nowrap;
  font-size: 11.5px; color: var(--c-text-3);
}
.att-del {
  flex: none; border: 0; background: transparent;
  color: var(--c-text-3); font-size: 16px; line-height: 1;
  padding: 0 3px; border-radius: 4px; cursor: pointer;
}
.att-del:hover { color: var(--c-red); background: var(--c-red-soft); }
.att-empty { padding: 12px 10px; font-size: 12px; color: var(--c-text-3); }
.att-badge {
  display: inline-block; margin-left: 4px; padding: 0 5px;
  border-radius: 8px; background: var(--c-primary-soft); color: var(--c-primary);
  font-size: 11px; line-height: 16px; vertical-align: 1px; white-space: nowrap;
}

/* ---------- 附件预览 ---------- */
.pv-wrap {
  display: flex; justify-content: center;
  max-height: 70vh; overflow: auto;
  background: #f6f8fc; border-radius: 8px;
}
.pv-img { max-width: 100%; height: auto; display: block; }
.pv-frame { width: 100%; height: 70vh; border: 0; border-radius: 8px; background: #fff; }
.pv-text {
  margin: 0; max-height: 70vh; overflow: auto;
  background: #fbfcfe; border: 1px solid var(--c-line-soft); border-radius: 8px;
  padding: 12px; font-family: var(--mono); font-size: 12px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-all;
}
.pv-none { padding: 44px 10px; text-align: center; color: var(--c-text-2); font-size: 13px; }
.pv-none span { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--c-text-3); }
a.btn { text-decoration: none; }
