/* ==========================================================================
   物业租赁工作台 · 视觉系统
   气质：纸质台账 / Editorial Ledger
   - 纸底 #FAF9F5，唯一强调色 陶土橙 #D97757
   - 发丝线承担分隔职责，环形阴影替代可见描边
   - 圆角分级：4 / 8 / 12 / 16 / 999（按组件层级，不统一 12px）
   - 中文正文行高 1.75、行长 ≤ 34em，不用 letter-spacing、不用斜体
   ========================================================================== */

:root {
  /* 纸面 */
  --bg: #faf9f5;
  --bg-soft: #f4f2ea;
  --paper: #fffdf9;
  --panel: #fffdf9;
  --panel-2: #f6f4ed;
  --panel-3: #ece9df;

  /* 墨色 */
  --text: #141413;
  --text-2: #3b3a34;
  --muted: #6b6a64;
  --faint: #94918a;

  /* 线 */
  --line: rgba(20, 20, 19, .085);
  --line-2: rgba(20, 20, 19, .16);
  --border: rgba(20, 20, 19, .13);
  --border-2: rgba(20, 20, 19, .2);

  /* 强调：陶土 */
  --accent: #d97757;
  --accent-strong: #c15f3c;
  --accent-soft: #fbefe8;
  --accent-ink: #8e4426;
  --on-accent: #211008;

  /* 语义（全部暖底） */
  --danger: #ae3a2b;
  --danger-soft: #f9e9e5;
  --warn: #b96a2c;
  --warn-soft: #faeedf;
  --caution: #8e731d;
  --caution-soft: #f7f1dc;
  --ok: #4c7a5b;
  --ok-soft: #ebf1eb;

  /* 阴影：环形描边 + 极轻暖投影 */
  --ring: 0 0 0 1px rgba(20, 20, 19, .075);
  --ring-2: 0 0 0 1px rgba(20, 20, 19, .14);
  --shadow-1: 0 1px 2px rgba(46, 38, 26, .04);
  --shadow-2: 0 1px 2px rgba(46, 38, 26, .04), 0 10px 26px -14px rgba(46, 38, 26, .18);
  --shadow-3: 0 18px 48px -16px rgba(46, 38, 26, .26);

  /* 圆角体系 */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 999px;

  /* 排版 */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC",
    "Source Han Sans CN", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", monospace;
  --lh-body: 1.75;
  --lh-tight: 1.45;
  --measure: 34em;

  --sidebar: 226px;
}

[data-theme="dark"] {
  --bg: #171614;
  --bg-soft: #1e1c19;
  --paper: #211f1b;
  --panel: #211f1b;
  --panel-2: #272420;
  --panel-3: #2f2b26;

  --text: #f2efe7;
  --text-2: #d9d4c8;
  --muted: #a39d90;
  --faint: #7d776b;

  --line: rgba(242, 239, 231, .1);
  --line-2: rgba(242, 239, 231, .18);
  --border: rgba(242, 239, 231, .14);
  --border-2: rgba(242, 239, 231, .22);

  --accent: #e08c6b;
  --accent-strong: #ec9d7e;
  --accent-soft: #2f211b;
  --accent-ink: #eda184;
  --on-accent: #241206;

  --danger: #e8796a;
  --danger-soft: #2f1a16;
  --warn: #dfa05e;
  --warn-soft: #2b2014;
  --caution: #d4b858;
  --caution-soft: #2a2513;
  --ok: #7fb394;
  --ok-soft: #1a2721;

  --ring: 0 0 0 1px rgba(242, 239, 231, .09);
  --ring-2: 0 0 0 1px rgba(242, 239, 231, .18);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 26px -14px rgba(0, 0, 0, .6);
  --shadow-3: 0 18px 48px -16px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: normal;
  line-break: normal;
  text-autospace: ideograph-alpha ideograph-numeric;
  transition: background-color .24s ease, color .24s ease;
}

/* 纸张颗粒：固定在视口，不干扰正文 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}

[data-theme="dark"] body::after { opacity: .35; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------------------------------- 布局 --------------------------------- */

.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  padding: 28px 14px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand {
  padding: 0 10px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.brand-rule {
  width: 22px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 12px;
}
.brand-word {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.brand-word em { font-style: normal; color: var(--accent-strong); }
.brand-sub {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 5px;
  line-height: 1.6;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 450;
  text-align: left;
  width: 100%;
  transition: background .16s ease, color .16s ease;
}
.nav-item .n {
  flex: 0 0 17px;
  width: 17px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  transition: color .16s ease;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 550;
}
.nav-item.active .n { color: var(--accent); }

.sidebar-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--faint);
  line-height: 1.7;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 页头：编辑式，非工具条 */
.page-head { border-bottom: 1px solid var(--line); }
.page-head-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 34px 40px 22px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
}
.page-head-main { min-width: 0; flex: 1; }
.kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.page-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text);
}
.page-sub {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: var(--lh-body);
  max-width: var(--measure);
}
.page-head-side { flex: 0 0 auto; padding-bottom: 4px; }

.content {
  padding: 26px 40px 96px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; animation: viewIn .26s ease both; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------- 通用组件 -------------------------------- */

.card {
  background: var(--panel);
  border-radius: var(--r-lg);
  box-shadow: var(--ring), var(--shadow-2);
}
.card-pad { padding: 22px; }

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 20px 22px 0;
}
.card-head .dot {
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--accent);
  margin-top: 9px;
}
.card-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text);
}
.card-sub {
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.65;
  margin-top: 3px;
  max-width: var(--measure);
}
.card-head .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--paper);
  color: var(--text-2);
  box-shadow: var(--ring);
  transition: background .16s, color .16s, box-shadow .16s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--bg-soft); color: var(--text); box-shadow: var(--ring-2); }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 550;
  box-shadow: 0 1px 2px rgba(150, 70, 40, .22);
}
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 2px 8px -2px rgba(150, 70, 40, .35); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg-soft); box-shadow: none; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  background: var(--panel-2);
  color: var(--muted);
  white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-caution { background: var(--caution-soft); color: var(--caution); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }

.divider { height: 1px; background: var(--line); margin: 0; border: 0; }

.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .16s, box-shadow .16s;
}
.input::placeholder { color: var(--faint); }
.input:focus {
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono, .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 64px 24px;
  color: var(--muted);
}
.empty svg { width: 34px; height: 34px; opacity: .3; stroke-width: 1.4; }
.empty h3 {
  margin: 2px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
  line-height: var(--lh-tight);
}
.empty p {
  margin: 0;
  font-size: 12.5px;
  max-width: 30em;
  line-height: var(--lh-body);
  color: var(--muted);
}

.note-strip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--muted);
  line-height: var(--lh-body);
  padding: 11px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  border-left: 1.5px solid var(--line-2);
}
.note-strip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 5px;
  color: var(--faint);
}
.note-strip strong { color: var(--text-2); font-weight: 600; }

.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 主题切换：分段控件 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.theme-toggle button {
  width: 28px;
  height: 25px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  color: var(--faint);
  transition: background .16s, color .16s;
}
.theme-toggle button svg { width: 14px; height: 14px; }
.theme-toggle button:hover { color: var(--muted); }
.theme-toggle button.on {
  background: var(--paper);
  color: var(--accent-strong);
  box-shadow: var(--shadow-1), var(--ring);
}

/* -------------------------------- 隐患识别 -------------------------------- */

.inspect-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.dropzone {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--ring);
  overflow: hidden;
  transition: background .2s, box-shadow .2s;
}
.dropzone.dragging { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dropzone.has-photo { box-shadow: var(--ring), var(--shadow-2); }

.dz-inner {
  padding: 54px 28px 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  min-height: 430px;
  justify-content: center;
}
.dz-frame {
  width: 118px;
  height: 86px;
  color: var(--accent);
  opacity: .55;
}
.dz-title {
  font-size: 17px;
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text);
}
.dz-desc {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 28em;
  line-height: var(--lh-body);
  margin-top: -6px;
}
.dz-actions { display: flex; gap: 9px; margin-top: 2px; flex-wrap: wrap; justify-content: center; }
.dz-hint {
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.7;
  margin-top: 4px;
}

.photo-wrap { position: relative; background: #14130f; }
.photo-wrap img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
.photo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.photo-bar .name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 15, .12), rgba(20, 18, 15, .6));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fffdf9;
}
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 22px 3px rgba(217, 119, 87, .45);
  animation: scan 2.4s ease-in-out infinite;
}
@keyframes scan { 0%, 100% { top: 5%; } 50% { top: 95%; } }
.scan-text { font-size: 13px; font-weight: 550; text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
.scan-sub { font-size: 11.5px; opacity: .7; }

/* 结论块 */
.verdict {
  padding: 20px 22px 20px 24px;
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--ring);
  position: relative;
  overflow: hidden;
}
.verdict::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.verdict-kicker {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 7px;
}
/* 拉丁小标才加字距，中文不加 */
.latin {
  font-style: normal;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.verdict-kicker .latin { color: var(--accent); }
.verdict-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}
.verdict-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: var(--lh-body);
  max-width: var(--measure);
}
.verdict-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.verdict.v-danger { background: color-mix(in srgb, var(--danger-soft) 52%, var(--panel)); }
.verdict.v-danger::before { background: var(--danger); }
.verdict.v-warn { background: color-mix(in srgb, var(--warn-soft) 46%, var(--panel)); }
.verdict.v-warn::before { background: var(--warn); }
.verdict.v-ok { background: color-mix(in srgb, var(--ok-soft) 46%, var(--panel)); }
.verdict.v-ok::before { background: var(--ok); }

/* 待办清单：印刷式检查表 */
.todo-group { margin-top: 30px; }
.todo-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1.5px solid var(--line-2);
}
.todo-group-head .n {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.todo-group-head .t { font-size: 13.5px; font-weight: 600; color: var(--text); }
.todo-group-head .c { margin-left: auto; font-size: 11.5px; color: var(--faint); }

.todo-list { display: flex; flex-direction: column; margin: 0; }
.todo {
  display: flex;
  gap: 12px;
  padding: 15px 6px 15px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s ease, opacity .2s ease;
}
.todo:hover { background: var(--bg-soft); }
.todo input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 5px 0 0;
  border-radius: var(--r-xs);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .16s, box-shadow .16s;
}
.todo input:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.todo input:checked { background: var(--accent); box-shadow: none; }
.todo input:checked::after {
  content: "";
  width: 8px;
  height: 4.5px;
  border-left: 1.7px solid var(--on-accent);
  border-bottom: 1.7px solid var(--on-accent);
  transform: rotate(-45deg) translateY(-1px);
}
.todo.done { opacity: .42; }
.todo.done .t-title { text-decoration: line-through; text-decoration-color: var(--faint); text-decoration-thickness: 1px; }

.t-body { flex: 1; min-width: 0; }
.t-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.t-title {
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.6;
  color: var(--text);
}
.t-check {
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.7;
  margin-top: 4px;
  max-width: var(--measure);
}
.t-check::before { content: "对照 "; opacity: .8; }
.t-ev {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: var(--lh-body);
  margin-top: 8px;
  padding-left: 11px;
  border-left: 1px solid var(--line-2);
  max-width: var(--measure);
}
.t-act {
  font-size: 12.5px;
  margin-top: 8px;
  color: var(--accent-ink);
  display: flex;
  gap: 6px;
  line-height: var(--lh-body);
  max-width: var(--measure);
}
.t-act svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 5px; }

/* -------------------------------- 租金调研 -------------------------------- */

.rent-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.pt-card { overflow: hidden; }
.pt-card-head {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.pt-card-head .card-sub { margin-bottom: 12px; }

.pt-list {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding: 0;
}
.pt-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 18px;
  text-align: left;
  width: 100%;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  background: transparent;
  transition: background .14s, border-left-color .14s;
}
.pt-item:last-child { border-bottom: 0; }
.pt-item:hover { background: var(--bg-soft); }
.pt-item.on { background: var(--accent-soft); border-left-color: var(--accent); }
.pt-name { font-size: 13.5px; font-weight: 550; line-height: 1.5; color: var(--text); }
.pt-meta {
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  line-height: 1.6;
}
.pt-rent {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.pt-rent span { font-size: 10.5px; font-weight: 400; color: var(--faint); }

.rent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rent-grid .full { grid-column: 1 / -1; }

/* 概览头 */
.pv-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.pv-name { font-size: 21px; font-weight: 600; line-height: var(--lh-tight); color: var(--text); }
.pv-addr { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.pv-chips { display: flex; gap: 6px; margin-top: 13px; flex-wrap: wrap; }
.pv-rent { text-align: right; min-width: 168px; }

.big-num {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.big-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
  margin-left: 5px;
  vertical-align: baseline;
}
.big-label {
  font-size: 11.5px;
  color: var(--faint);
  margin-bottom: 4px;
}

.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--r-xs);
  font-size: 12px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.delta-up { background: var(--danger-soft); color: var(--danger); }
.delta-down { background: var(--ok-soft); color: var(--ok); }
.delta-flat { background: var(--panel-2); color: var(--muted); }

/* 刻度尺 */
.ruler { position: relative; height: 164px; margin: 4px 0 0; }
.ruler-band {
  position: absolute;
  top: 85px;
  height: 14px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: var(--r-full);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
}
.ruler-axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 92px;
  height: 1px;
  background: var(--line-2);
}
.ruler-rug {
  position: absolute;
  top: 99px;
  width: 1px;
  height: 7px;
  background: color-mix(in srgb, var(--text) 26%, transparent);
}
.ruler-median {
  position: absolute;
  top: 76px;
  width: 1px;
  height: 32px;
  background: var(--text);
  opacity: .55;
}
.ruler-tick { position: absolute; top: 100px; width: 1px; height: 8px; background: var(--line-2); }
.ruler-tick-label {
  position: absolute;
  top: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
  transform: translateX(-50%);
  line-height: 1.35;
}
.ruler-tick-label.mid { top: 106px; }
.ruler-tick-label .lb { font-size: 9.5px; color: var(--faint); }
.ruler-tick-label .lv {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ruler-tick-label.mid .lv { color: var(--text); font-weight: 600; }
.ruler-cur { position: absolute; top: 0; bottom: 0; width: 0; }
.ruler-cur .pin {
  position: absolute;
  top: 2px;
  left: 0;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  padding: 3px 9px;
  border-radius: var(--r-xs);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ruler-cur .stem {
  position: absolute;
  top: 26px;
  height: 66px;
  left: 0;
  width: 1.5px;
  background: var(--accent);
  transform: translateX(-50%);
  opacity: .7;
}
.ruler-cur .dot {
  position: absolute;
  top: 88px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: var(--r-full);
  background: var(--accent);
  transform: translateX(-50%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}
.ruler-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  color: var(--faint);
  padding-top: 2px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 8px;
}

/* 统计行：发丝线分栏 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid var(--line);
}
.stat { padding: 14px 16px 0; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-k { font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.stat-v {
  font-size: 21px;
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.3;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-v em { font-size: 11px; font-weight: 400; color: var(--faint); font-style: normal; margin-left: 3px; }
.stat-v.accent { color: var(--accent-ink); }

/* 修正因素 */
.factors { margin-top: 20px; }
.factors-h {
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.factors-h .latin { color: var(--accent); letter-spacing: .13em; margin-right: 2px; }
.factor-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  padding: 3px 0;
}
.factor-row .imp {
  flex: 0 0 46px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.factor-row .nm { font-weight: 550; color: var(--text); }
.factor-row .rs { color: var(--muted); font-size: 11.5px; }

/* 可比房源 */
.comp-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.comp-row:first-child { border-top: 1px solid var(--line); }
.comp-main { flex: 1; min-width: 0; }
.comp-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comp-meta {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.6;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comp-unit {
  flex: 0 0 auto;
  text-align: right;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.comp-unit em { font-size: 10.5px; font-weight: 400; color: var(--faint); font-style: normal; margin-left: 2px; }

/* 评分：大数字 + 发丝条 */
.score-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.score-main { flex: 0 0 132px; }
.score-k { font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.score-v {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.05;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.score-v span { font-size: 13px; font-weight: 400; color: var(--faint); margin-left: 3px; }
.score-bar {
  height: 3px;
  border-radius: var(--r-full);
  background: var(--panel-3);
  margin-top: 10px;
  overflow: hidden;
}
.score-bar i { display: block; height: 100%; border-radius: var(--r-full); }
.score-dims { flex: 1; min-width: 190px; }

.dim-row { padding: 8px 0; }
.dim-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  margin-bottom: 5px;
  color: var(--text-2);
}
.dim-top b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dim-track { height: 3px; border-radius: var(--r-full); background: var(--panel-3); overflow: hidden; }
.dim-fill { height: 100%; border-radius: var(--r-full); transition: width .6s cubic-bezier(.22, 1, .36, 1); }

/* 键值行 */
.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.kv-row:last-of-type { border-bottom: 0; }
.kv-k { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
.kv-v { font-size: 13px; font-weight: 500; text-align: right; color: var(--text); }

/* 列表 */
.bullet-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.bullet-list li {
  display: flex;
  gap: 9px;
  font-size: 12.5px;
  line-height: var(--lh-body);
  color: var(--text-2);
  max-width: var(--measure);
}
.bullet-list li::before {
  content: "";
  flex: 0 0 4px;
  width: 4px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--line-2);
  margin-top: 9px;
}
.bullet-list.risk li::before { background: var(--warn); }
.bullet-list.act { counter-reset: act; }
.bullet-list.act li { counter-increment: act; gap: 10px; }
.bullet-list.act li::before {
  content: counter(act);
  flex: 0 0 16px;
  width: 16px;
  height: auto;
  background: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 0;
  text-align: left;
}

.src-list { display: flex; flex-direction: column; }
.src-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
  transition: color .15s;
}
.src-item:hover { color: var(--accent-ink); }
.src-item .n {
  flex: 0 0 auto;
  width: 15px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.src-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.src-item .site { flex: 0 0 auto; color: var(--faint); }

/* --------------------------------- 物业点库 -------------------------------- */

.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left;
  font-weight: 600;
  color: var(--faint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  font-size: 11px;
  background: transparent;
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--bg-soft); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------- 弹层 ---------------------------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 18, 15, .45);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: viewIn .18s ease both;
}
.modal-mask[hidden] { display: none; }
.modal {
  width: min(480px, 100%);
  background: var(--panel);
  border-radius: var(--r-lg);
  box-shadow: var(--ring), var(--shadow-3);
  overflow: hidden;
}
.modal-body { padding: 24px 24px 6px; }
.modal-title { font-size: 16px; font-weight: 600; margin: 0 0 9px; line-height: var(--lh-tight); }
.modal-desc { font-size: 15px; color: var(--text-2); line-height: var(--lh-body); margin: 0 0 14px; max-width: var(--measure); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }

.toast-wrap {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: #211f1b;
  color: #f2efe7;
  font-size: 12.5px;
  font-weight: 450;
  line-height: 1.6;
  box-shadow: var(--shadow-3);
  animation: toastIn .24s cubic-bezier(.22, 1, .36, 1);
  max-width: 88vw;
}
.toast.err { background: var(--danger); color: #fffdf9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------- 招商意向表单 ---------------------------- */

.intent { display: flex; flex-direction: column; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-k { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-h { font-size: 11.5px; color: var(--faint); line-height: 1.65; }
.field select,
.field input {
  height: 40px;
  width: 100%;
  border: 0;
  box-shadow: var(--ring-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
.field select:focus,
.field input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 34%, transparent); }
.field input::placeholder { color: var(--faint); opacity: .75; }
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 82px; }
.input-wrap .unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11.5px;
  color: var(--faint);
  pointer-events: none;
}

.intent-input {
  width: 100%;
  height: 46px;
  border: 0;
  box-shadow: var(--ring-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-size: 14.5px;
  outline: none;
}
.intent-input::placeholder { color: var(--faint); opacity: .8; }
.intent-input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 34%, transparent); }

/* ---------------------------- 台账导入 ---------------------------- */

.ledger-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--line);
}
.ledger-info { font-size: 12.5px; color: var(--muted); min-width: 0; line-height: 1.6; }
.ledger-info strong { color: var(--text-2); font-weight: 600; }
.ledger-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.import-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.import-msg > svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 3px; color: var(--muted); }
.import-msg.ok { background: var(--ok-soft); }
.import-msg.ok > svg { color: var(--ok); }
.import-msg.err { background: var(--danger-soft); }
.import-msg.err > svg { color: var(--danger); }
.import-msg ul { margin: 5px 0 0; padding-left: 1.15em; }
.import-msg li { margin-top: 2px; }

/* ---------------------------- 业态适配 ---------------------------- */

.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 34px; }
.fit-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.fit-row:last-child { border-bottom: 0; }
.fit-top { display: flex; align-items: baseline; gap: 8px; }
.fit-rank {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  width: 17px;
  height: 17px;
  line-height: 15px;
  text-align: center;
  flex: 0 0 17px;
}
.fit-name { font-size: 13.5px; font-weight: 620; }
.fit-parent { font-size: 11px; color: var(--faint); }
.fit-score { margin-left: auto; font-size: 14px; font-weight: 680; font-variant-numeric: tabular-nums; }
.fit-bar { height: 4px; background: var(--panel-3); border-radius: var(--r-full); margin: 9px 0 10px; overflow: hidden; }
.fit-bar i { display: block; height: 100%; border-radius: var(--r-full); }
.fit-why { font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.fit-notes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.req-chip {
  font-size: 10.5px;
  line-height: 1.5;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.req-chip.met { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.req-chip.miss { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

.verdict-inline { display: flex; gap: 14px; align-items: flex-start; }
.verdict-inline .verdict-mark {
  width: 3px;
  flex: 0 0 3px;
  align-self: stretch;
  background: var(--accent);
  border-radius: var(--r-full);
}

/* 承受力刻度尺的估算带：斜纹示意，与实测区间的实色带区分 */
.ruler-band.soft {
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 6px, transparent 6px 12px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
}

/* --------------------------------- 响应式 --------------------------------- */

@media (max-width: 1180px) {
  .page-head-inner, .content { padding-left: 28px; padding-right: 28px; }
  .inspect-grid { grid-template-columns: minmax(0, 1fr); }
  .rent-layout { grid-template-columns: minmax(0, 1fr); }
  .pt-list { max-height: 320px; }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  body { font-size: 14px; }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px) saturate(140%);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; flex: 1; gap: 4px; }
  .nav-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 11px;
    padding: 7px 4px;
    text-align: center;
  }
  .nav-item .n { display: none; }

  .page-head-inner { padding: 22px 18px 16px; align-items: flex-start; }
  .page-head h1 { font-size: 23px; }
  .page-sub { font-size: 12.5px; margin-top: 5px; }
  .kicker { font-size: 9.5px; margin-bottom: 6px; }
  .content { padding: 18px 18px 100px; }

  .dz-inner { padding: 40px 20px 36px; min-height: 340px; gap: 14px; }
  .dz-frame { width: 88px; height: 64px; }
  .dz-title { font-size: 15.5px; }

  .rent-grid { grid-template-columns: minmax(0, 1fr); }
  .rec-grid { grid-template-columns: minmax(0, 1fr); gap: 22px 0; }
  .ledger-actions { margin-left: 0; }
  .big-num { font-size: 30px; }
  .pv-rent { text-align: left; min-width: 0; }
  .stat-row { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 10px 0 0; border-left: 0; }
  .stat:first-child { padding-top: 12px; }
  .stat + .stat { border-top: 1px solid var(--line); }
  .verdict-title { font-size: 17px; }
  .score-main { flex: 0 0 108px; }
  .score-v { font-size: 36px; }
  .comp-meta { white-space: normal; }

  /* 修正因素：窄屏换行，避免名称被挤成两字一行 */
  .factor-row { flex-wrap: wrap; row-gap: 1px; }
  .factor-row .nm { white-space: nowrap; }
  .factor-row .rs { flex: 1 0 100%; margin-left: 56px; margin-top: 1px; }

  .todo input { width: 18px; height: 18px; flex: 0 0 18px; }
  .t-title { font-size: 15px; }
  .ruler-tick-label { font-size: 10px; }
}

@media print {
  body::after, .sidebar, .page-head-side, .dz-actions, .photo-bar { display: none !important; }
  .card { box-shadow: var(--ring); break-inside: avoid; }
  .content { padding: 0; max-width: none; }
}
