/* ==========================================================================
   Aeroplus 资产评估模型 — 极简线条样式表
   只有黑、白与其间的灰。没有阴影、没有圆角、没有色块，
   层级完全靠 1px 线与留白表达。
   ========================================================================== */

:root {
  --ink: #000;
  --ink-2: #2b2b2b;
  --ink-3: #6b6b6b;
  --ink-4: #9a9a9a;
  --line: #dcdcdc;
  --line-2: #ededed;
  --bg: #fff;
  --bg-2: #fafafa;
  --bg-3: #f4f4f4;

  --sans: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --unit: 8px;
  --shell: 1440px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== 排版基元 ===== */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ===== 顶栏 ===== */
.topbar {
  border-bottom: 1px solid var(--ink);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand .mark {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand .sub {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.whoami {
  font-size: 11px;
  color: var(--ink-3);
  border-left: 1px solid var(--line);
  padding-left: 12px;
  margin-left: 4px;
  white-space: nowrap;
}

/* ===== 按钮 ===== */
.btn {
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
  transition: background .12s linear, color .12s linear;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--bg); color: var(--ink); }
.btn--quiet { border-color: var(--line); color: var(--ink-3); }
.btn--quiet:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn--sm { padding: 5px 10px; font-size: 11px; }
.btn--icon {
  border: none;
  background: none;
  padding: 2px 6px;
  font-size: 13px;
  color: var(--ink-4);
  cursor: pointer;
  line-height: 1;
}
.btn--icon:hover { color: var(--ink); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:disabled:hover { background: var(--bg); color: var(--ink); }

/* ===== 导航 ===== */
.nav {
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  background: var(--bg);
  position: sticky;
  top: 52px;
  z-index: 49;
  scrollbar-width: thin;
}
.nav-item {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-item:hover { color: var(--ink); }
.nav-item[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.nav-item .close {
  font-size: 11px;
  color: var(--ink-4);
  padding: 0 2px;
  line-height: 1;
}
.nav-item .close:hover { color: var(--ink); }
.nav-add {
  font-family: inherit;
  font-size: 11px;
  padding: 5px 10px;
  border: 1px dashed var(--line);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  align-self: center;
  margin-left: 8px;
  white-space: nowrap;
}
.nav-add:hover { border-color: var(--ink); border-style: solid; color: var(--ink); }

/* ===== 主体 ===== */
.shell { max-width: var(--shell); margin: 0 auto; padding: 28px 24px 96px; }
.pane { display: none; }
.pane.is-active { display: block; }

/* ===== 区块 ===== */
.block { border: 1px solid var(--line); margin-bottom: 24px; background: var(--bg); }
.block-head {
  border-bottom: 1px solid var(--ink);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.block-head h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.block-head .tag {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.block-head .head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.block-body { padding: 18px; }

.subhead {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
  margin: 28px 0 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.subhead:first-child { margin-top: 0; }
.subhead .note { font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-3); }

/* ===== 表单栅格 ===== */
.grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--1 { grid-template-columns: 1fr; }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid, .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field > label .req { color: var(--ink); font-weight: 700; }
.auto-tag {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  border: 1px solid var(--line);
  padding: 1px 5px;
  text-transform: none;
  font-weight: 400;
}
.hint { font-size: 10px; color: var(--ink-4); }

/* ===== 控件 ===== */
.input, select.input, textarea.input {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
  transition: border-color .12s linear;
  appearance: none;
}
.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: var(--ink); }
.input::placeholder { color: var(--ink-4); }
.input[readonly] {
  background: var(--bg-2);
  border-style: dashed;
  color: var(--ink-2);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.input[readonly]:focus { border-color: var(--line); }
.input.num, .input.money { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.input.strong { font-weight: 700; }
.input.total { font-weight: 700; font-size: 15px; border-color: var(--ink); border-style: solid; background: var(--bg); }
textarea.input { resize: vertical; min-height: 72px; line-height: 1.6; font-family: inherit; }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
  cursor: pointer;
}
input[type="date"].input { min-height: 35px; }

/* ===== 结论按钮组 ===== */
.verdicts { display: flex; gap: -1px; }
.verdict {
  font-family: inherit;
  font-size: 11px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-3);
  cursor: pointer;
  margin-right: -1px;
  white-space: nowrap;
}
.verdict:hover { border-color: var(--ink); color: var(--ink); z-index: 1; position: relative; }
.verdict[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); z-index: 2; position: relative; font-weight: 600; }
/* Reject 用反白 + 粗描边区分，不引入颜色 */
.verdict[aria-pressed="true"][data-v="reject"] {
  background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink);
}
.verdict[aria-pressed="true"][data-v="open"] {
  background: repeating-linear-gradient(45deg, var(--ink) 0 2px, var(--bg) 2px 5px);
  color: var(--ink);
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 3px var(--bg);
}

/* ===== 检查项 ===== */
.checkitem { border: 1px solid var(--line); padding: 14px; margin-bottom: -1px; }
.checkitem-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.checkitem-head .name { font-size: 12px; font-weight: 600; }
.checkitem-body { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 720px) { .checkitem-body { grid-template-columns: 1fr; } }
.file-note { font-size: 10px; color: var(--ink-3); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.file-note[hidden] { display: none; }

/* 隐藏原生 file input，用 label 当按钮 */
.file-btn { display: inline-block; }
.file-btn input[type="file"] { display: none; }

/* ===== 表格 ===== */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); }
table.grid-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.grid-table th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  padding: 8px 8px;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
  background: var(--bg);
  position: sticky;
  top: 0;
}
table.grid-table td { border-bottom: 1px solid var(--line-2); padding: 0; }
table.grid-table tbody tr:last-child td { border-bottom: none; }
table.grid-table td.idx { text-align: center; color: var(--ink-4); font-family: var(--mono); font-size: 11px; padding: 0 6px; width: 34px; }
table.grid-table td.act { text-align: center; width: 34px; }
table.grid-table td input {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  border: none;
  background: none;
  padding: 8px 8px;
  width: 100%;
  min-width: 70px;
  color: var(--ink);
  border-radius: 0;
}
table.grid-table td input:focus { outline: 1px solid var(--ink); outline-offset: -1px; }
table.grid-table td input[readonly] { background: var(--bg-2); color: var(--ink-2); cursor: default; }
table.grid-table td input[readonly]:focus { outline: none; }
table.grid-table td input.text-cell { font-family: var(--sans); }
/* Limiter 行：左侧粗竖线标记，不用底色 */
table.grid-table tr.is-limiter td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
table.grid-table tr.is-limiter td input[readonly] { background: var(--bg-3); }
table.grid-table tr.is-hpt td input.text-cell { font-weight: 700; }
.limiter-flag {
  font-size: 9px;
  border: 1px solid var(--ink);
  padding: 1px 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ===== 公式说明 ===== */
.formula {
  border-left: 2px solid var(--ink);
  padding: 12px 14px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.85;
  color: var(--ink-2);
  background: var(--bg-2);
}
.formula b { color: var(--ink); }
.formula .title {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

/* ===== 汇总 ===== */
.headline { border: 1px solid var(--ink); padding: 28px 24px; margin-bottom: 24px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
@media (max-width: 820px) { .headline { grid-template-columns: 1fr; } }
.headline .meta { font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; margin-bottom: 4px; }
.headline .meta b { color: var(--ink); font-weight: 600; }
.headline .amount {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 12px 0 4px;
  word-break: break-all;
}
.headline .denom { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.headline .ledger { min-width: 260px; }
.ledger-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.ledger-row:last-child { border-bottom: none; }
.ledger-row .k { color: var(--ink-3); }
.ledger-row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ledger-row .pct { color: var(--ink-4); font-size: 11px; margin-left: 6px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: -1px; margin-bottom: 24px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile { border: 1px solid var(--line); padding: 16px; margin-right: -1px; margin-bottom: -1px; }
.tile .k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.tile .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; margin: 10px 0 6px; word-break: break-all; }
.tile .d { font-size: 10px; color: var(--ink-4); line-height: 1.5; }

.stat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0; }
.stat { border: 1px solid var(--line); margin: 0 -1px -1px 0; padding: 12px 14px; }
.stat .k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; margin-top: 4px; }

/* ===== 单据列表 ===== */
.records { width: 100%; border-collapse: collapse; font-size: 12px; }
.records th { text-align: left; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--ink); }
.records td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.records tr:last-child td { border-bottom: none; }
.records td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.records .empty { text-align: center; color: var(--ink-4); padding: 28px; }
.chip { font-size: 9px; border: 1px solid var(--line); padding: 1px 5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

/* ===== 弹层 ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.82);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px; z-index: 200; backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.sheet { background: var(--bg); border: 1px solid var(--ink); width: 100%; max-width: 760px; max-height: 82vh; display: flex; flex-direction: column; }
.sheet-head { padding: 14px 18px; border-bottom: 1px solid var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; }
.sheet-body { padding: 18px; overflow: auto; }
.sheet-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  border: 1px solid var(--ink); background: var(--bg); color: var(--ink);
  padding: 10px 18px; font-size: 12px; z-index: 300; max-width: 88vw;
  opacity: 0; pointer-events: none; transition: opacity .18s linear;
}
.toast.is-on { opacity: 1; }

/* ===== 启动闸门 =====
   校验登录状态期间先不画主界面：令牌可能已经过期，
   那样会先闪一下主界面再跳登录页 */
html.is-booting body { visibility: hidden; }

.boot-error { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--bg); z-index: 400; }
.boot-error[hidden] { display: none; }
.boot-error-card { border: 1px solid var(--ink); padding: 28px 32px; max-width: 420px; }
.boot-error-card p { font-size: 13px; line-height: 1.7; margin: 10px 0 20px; color: var(--ink-2); }

/* ===== 登录页 ===== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; border: 1px solid var(--ink); padding: 36px 32px; }
.auth-card .mark { font-size: 15px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.auth-card .tagline { font-size: 11px; color: var(--ink-3); margin-top: 6px; letter-spacing: 0.04em; }
.auth-card form { margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .btn { width: 100%; padding: 11px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.auth-msg { font-size: 11px; border: 1px solid var(--ink); padding: 8px 10px; line-height: 1.5; }
.auth-msg[hidden] { display: none; }
.auth-tabs { display: flex; margin-top: 28px; border-bottom: 1px solid var(--line); }
.auth-tab {
  font-family: inherit;
  font-size: 12px;
  padding: 9px 0;
  margin-right: 22px;
  border: none;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

.auth-card form { margin-top: 22px; }
.auth-card form[hidden] { display: none; }
.auth-msg { margin-top: 20px; }

/* 验证码输入框 + 获取按钮并排；按钮宽度固定，倒计时文字变化时不会把输入框挤动 */
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; letter-spacing: 4px; }
.code-row .btn { flex: 0 0 104px; padding: 8px 0; font-size: 11px; }

.auth-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-4); line-height: 1.7; }

/* ===== 打印 ===== */
@media print {
  @page { margin: 14mm; }
  .topbar, .nav, .toast, .overlay, .no-print, .btn, .nav-add { display: none !important; }
  body { font-size: 11px; }
  .shell { max-width: none; padding: 0; }
  .pane { display: block !important; page-break-before: always; }
  .pane:first-of-type { page-break-before: avoid; }
  .block { border-color: #000; break-inside: avoid; }
  .block-head { border-bottom-color: #000; }
  .input, select.input, textarea.input { border-color: #999; background: none !important; }
  .table-scroll { overflow: visible; }
  .headline { border-color: #000; }
}
