/* 杰靠园区管理 — 深墨石板 + 琥珀实业感 */
:root {
  /* 暖灰中性 */
  --bg: #f3f0eb;
  --surface: #faf8f5;
  --surface-2: #f5f1eb;
  --ink: #1c1917;
  --ink-soft: #292524;
  --text: #292524;
  --text-secondary: #57534e;
  --muted: #78716c;
  --border: #e7e0d8;
  --border-strong: #d6cfc4;

  /* 主强调：琥珀锈 */
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fff7ed;
  --accent-ring: rgba(194, 65, 12, 0.28);

  /* 语义色（饱和克制） */
  --success: #65a30d;
  --success-bg: #ecfccb;
  --warning: #ea580c;
  --warning-bg: #ffedd5;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #3b82a8;
  --info-bg: #e0f2fe;
  --locked: #ea580c;
  --locked-bg: #ffedd5;
  --fitout: #a8a29e;
  --fitout-bg: #f5f5f4;

  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 12px rgba(28, 25, 23, 0.05);
  --radius: 10px;
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --focus: 0 0 0 3px var(--accent-ring);

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;

  /* 铺位色（鸟瞰/3D）— 空置苔绿 / 在租钢蓝 / 锁定琥珀 / 装修雾灰 */
  --c-vacant: #65a30d;
  --c-rented: #3b82a8;
  --c-locked: #ea580c;
  --c-fitout: #a8a29e;
}

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

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

body {
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.5;
  min-height: 100vh;
  font-feature-settings: "tnum" 1;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app { display: flex; min-height: 100vh; }

/* —— 侧栏（深墨石板） —— */
.sidebar {
  width: var(--sidebar-w);
  background: var(--ink);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .2s ease;
}
.brand {
  height: var(--topbar-h);
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
}
.brand-mark { display: flex; align-items: center; gap: 10px; width: 100%; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 14px;
  letter-spacing: -0.02em; flex-shrink: 0;
}
.brand h1 { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.3; letter-spacing: .02em; }
.brand p { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px; }

.nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.nav-section {
  font-size: 12px; letter-spacing: 0;
  color: rgba(255,255,255,.35); padding: 10px 12px 6px; font-weight: 400;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; height: 44px;
  padding: 0 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75); text-decoration: none;
  margin: 2px 0; font-size: var(--fs-base);
  transition: background .15s, color .15s;
  position: relative;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active {
  background: rgba(194, 65, 12, 0.22);
  color: #fff;
  font-weight: 600;
}
.nav a.active::before {
  content: "";
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--accent);
}
.nav-icon { width: 18px; text-align: center; font-size: 14px; opacity: 0.85; }

.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px; color: rgba(255,255,255,.35); line-height: 1.5;
}

.menu-toggle {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 120;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer; font-size: 18px;
  align-items: center; justify-content: center;
}
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(28,25,23,.45); z-index: 90;
}
.sidebar-backdrop.show { display: block; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
  min-height: var(--topbar-h); height: var(--topbar-h);
}
.topbar h2 { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.01em; }
.topbar .meta { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 面包屑 */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-base); color: var(--muted);
}
.breadcrumb .sep { color: var(--muted); }
.breadcrumb .cur { color: var(--text); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right .user {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); color: var(--text-secondary);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}

.content { padding: 16px 20px 28px; flex: 1; }

/* —— 按钮 —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-base); font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline {
  background: #fff; border-color: var(--border); color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm {
  min-height: 36px; height: 36px;
  padding: 0 12px; font-size: var(--fs-xs);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* —— 今日重点 / KPI —— */
.focus-strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 960px) {
  .focus-strip { grid-template-columns: 1fr; }
}
.focus-hero {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 140px;
}
.focus-hero .eyebrow {
  font-size: 11px; letter-spacing: .06em; color: rgba(255,255,255,.45); font-weight: 500;
}
.focus-hero h3 { font-size: var(--fs-xl); font-weight: 600; line-height: 1.3; }
.focus-hero p { font-size: var(--fs-sm); color: rgba(255,255,255,.65); max-width: 42em; }
.focus-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.focus-actions .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.focus-actions .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.focus-actions .btn {
  border-color: rgba(255,255,255,.2); color: #fff; background: transparent;
}
.focus-actions .btn:hover { background: rgba(255,255,255,.08); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 6px; }
.stat-value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--text);
}
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }
.stat-value.warn { color: var(--warning); }
.stat-value.ok { color: var(--success); }
.stat-value.ink { color: var(--ink); }

/* 四列 KPI */
.stat-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .stat-row-4 { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
}
.stat-card .label {
  font-size: var(--fs-xs); color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.stat-card .value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.2;
}
.stat-card .extra { font-size: 12px; color: var(--muted); margin-top: 8px; }
/* 状态指示点 */
.dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: var(--border-strong);
}
.dot-solid { background: var(--accent); }
.dot-soft { background: var(--success); }
.dot-outline {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--info);
}
.dot-line {
  width: 10px; height: 2px; border-radius: 1px; background: var(--warning);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.kpi {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.kpi-label { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 4px; }
.kpi-value {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kpi-value.teal { color: var(--info); }
.kpi-value.blue { color: var(--info); }
.kpi-value.green { color: var(--success); }
.kpi-value.orange { color: var(--accent); }
.kpi-value.gray { color: var(--muted); }

.card, .panel {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid transparent; box-shadow: var(--shadow);
  margin-bottom: 16px; overflow: hidden;
}
.card-head, .panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h3, .panel-head h3 { font-size: var(--fs-base); font-weight: 500; }
.card-body, .panel-body { padding: 16px; }

.grid-2 {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px;
}
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* —— 表格 —— */
.table-wrap { overflow-x: auto; }
table.data, table.arco-table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
}
table.data th, table.arco-table th {
  text-align: left; padding: 10px 16px;
  background: var(--surface-2);
  color: var(--text-secondary); font-weight: 500; font-size: var(--fs-xs);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td, table.arco-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle;
  color: var(--text);
}
table.data tr:last-child td, table.arco-table tr:last-child td { border-bottom: none; }
table.data tr:hover td, table.arco-table tr:hover td { background: var(--surface-2); }
table.data .row-action {
  display: inline-flex; align-items: center; min-height: 28px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: var(--fs-xs);
  color: var(--text); text-decoration: none;
  border: 1px solid transparent;
}
table.data .row-action:hover {
  background: var(--accent-soft); border-color: var(--border); text-decoration: none;
}
table.arco-table tr { cursor: default; }

.empty {
  padding: 40px 16px; text-align: center; color: var(--muted); font-size: var(--fs-sm);
}

/* —— 徽章 —— */
.badge, .tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  border: 1px solid transparent;
  background: var(--surface-2); color: var(--text-secondary);
}
.badge-vacant { background: var(--success-bg); color: #3f6212; border-color: #d9f99d; }
.badge-rented { background: var(--info-bg); color: #075985; border-color: #bae6fd; }
.badge-locked { background: var(--locked-bg); color: #9a3412; border-color: #fed7aa; }
.badge-fitout { background: var(--fitout-bg); color: #57534e; border-color: #d6d3d1; }
.badge-talk { background: #f5f5f4; color: #57534e; }
.badge-pending { background: var(--warning-bg); color: #9a3412; border-color: #fed7aa; }
.badge-signed { background: var(--success-bg); color: #3f6212; border-color: #d9f99d; }
.badge-unpaid { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.badge-partial { background: #fff7ed; color: #c2410c; border: 1px dashed #fdba74; }
.badge-paid { background: var(--success-bg); color: #3f6212; }

.tag-solid { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag-outline { background: #fff; color: var(--accent); border-color: var(--accent); }
.tag-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.tag-soft { background: var(--accent-soft); color: var(--accent); border-color: #fed7aa; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--fs-xs); color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch-vacant { background: var(--c-vacant); border: 1px solid var(--border-strong); }
.swatch-rented { background: var(--c-rented); }
.swatch-locked { background: var(--c-locked); }
.swatch-fitout { background: var(--c-fitout); }

.mini-map {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px;
  position: relative;
  min-height: 200px;
  border: 1px solid var(--border);
}
.mini-map svg { width: 100%; height: auto; display: block; }

/* —— 鸟瞰 —— */
.bird-page .content { padding-top: 12px; }
.bird-wrap {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
  overflow: auto;
  min-height: calc(100vh - 180px);
  border: 1px solid var(--border);
}
.bird-wrap svg { display: block; margin: 0 auto; max-width: 100%; }
.bird-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.booth-shape { cursor: pointer; transition: opacity .15s, filter .15s; }
.booth-shape:hover { filter: brightness(1.08); stroke-width: 2.5; }
.booth-shape.selected { stroke: var(--ink); stroke-width: 3; filter: brightness(1.05); }
.zone-label { font-size: 14px; font-weight: 700; fill: var(--text-secondary); pointer-events: none; }
.booth-label {
  font-size: 9px; font-weight: 600; fill: #fff; pointer-events: none;
  text-anchor: middle;
}

.popup {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 14px 16px;
  min-width: 220px;
  z-index: 20;
  display: none;
}
.popup.show { display: block; }
.popup h4 { font-size: var(--fs-base); margin-bottom: 8px; font-weight: 500; }
.popup dl { display: grid; grid-template-columns: 64px 1fr; gap: 4px 8px; font-size: var(--fs-xs); }
.popup dt { color: var(--text-secondary); }
.popup .actions { margin-top: 12px; display: flex; gap: 8px; }

/* —— 3D —— */
.scene-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 12px;
  min-height: calc(100vh - 120px);
  height: calc(100vh - 120px);
}
@media (max-width: 960px) {
  .scene-layout { grid-template-columns: 1fr; height: auto; min-height: 70vh; }
}
#three-canvas, .iso-stage, #three-host {
  width: 100%; height: 100%;
  min-height: 560px;
  background: linear-gradient(180deg, #c4b8a8 0%, #e8e2d8 55%, #d4cbc0 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  touch-action: none;
}
.scene-hint {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(28,25,23,.85); color: #fff;
  font-size: 11px; padding: 8px 12px; border-radius: 2px;
  pointer-events: none; z-index: 5;
}
.side-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  height: 100%;
  overflow: auto;
}
.side-panel h3 { font-size: var(--fs-lg); font-weight: 500; }
.side-panel .empty-hint { color: var(--text-secondary); font-size: var(--fs-sm); }
.side-meta { font-size: var(--fs-sm); }
.side-meta dt { color: var(--text-secondary); font-size: var(--fs-xs); margin-top: 8px; }
.side-meta dd { font-weight: 600; font-size: var(--fs-base); font-variant-numeric: tabular-nums; }

/* —— 签署步骤 —— */
.sign-steps {
  display: flex; gap: 0; margin: 8px 0 16px; flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.sign-step {
  flex: 1; min-width: 88px;
  text-align: left;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sign-step:last-child { border-right: none; }
.sign-step .num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--border-strong); color: var(--text-secondary);
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.sign-step.done .num { background: var(--success); color: #fff; }
.sign-step.current .num { background: var(--accent); color: #fff; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--accent); }
.sign-step .label { font-size: var(--fs-xs); font-weight: 600; }
.sign-step .sub { font-size: 10px; color: var(--muted); }

.timeline { list-style: none; }
.timeline li {
  padding: 8px 0 8px 16px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
  position: relative; font-size: var(--fs-sm);
}
.timeline li::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  position: absolute; left: -5px; top: 14px;
}
.timeline li .t { color: var(--muted); font-size: 11px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  min-height: 36px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface); font-size: var(--fs-xs);
  cursor: pointer; font-family: inherit; color: var(--text);
}
.chip:hover { border-color: var(--border-strong); }
.chip.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}

.term-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 4px;
}
.term-chip {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: var(--fs-xs); font-weight: 500;
  cursor: pointer; font-family: inherit; color: var(--text);
}
.term-chip:hover { border-color: var(--accent); color: var(--accent); }
.term-chip.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.form-span-2 { grid-column: 1 / -1; }
.form-field-label {
  display: block; font-size: var(--fs-xs); color: var(--text-secondary);
  font-weight: 500; margin-bottom: 8px;
}

.tag-note { font-size: 11px; color: var(--muted); margin-top: 8px; }

.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: var(--radius-sm); font-size: var(--fs-sm); z-index: 200;
  display: none; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { display: block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.acceptance-list { list-style: none; }
.acceptance-list li {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-sm);
  min-height: 44px;
}
.acceptance-list input {
  width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--accent);
}

/* —— 合同工作台 —— */
.contract-workbench {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .contract-workbench { grid-template-columns: 1fr; }
}
.cw-list {
  position: sticky; top: 72px;
  max-height: calc(100vh - 96px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cw-list .card-head { background: var(--surface-2); }
.cw-list-body { overflow-y: auto; padding: 6px; flex: 1; }
.cw-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; font-family: inherit;
  transition: .12s; min-height: 64px;
}
.cw-item:hover { background: var(--surface-2); }
.cw-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.cw-item-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 2px; font-size: var(--fs-sm);
}
.cw-item-sub { font-size: var(--fs-xs); color: var(--text-secondary); }
.cw-empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label, .form-field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 500;
}
.form-grid input, .form-grid select,
.form-field input, .form-field select {
  min-height: 36px;
  padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--fs-base); font-family: inherit; color: var(--text);
  background: #fff; font-weight: 400;
}
.form-grid input:focus, .form-grid select:focus,
.form-field input:focus, .form-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus);
}

.view-meta {
  display: grid !important; grid-template-columns: 1fr 1fr; gap: 4px 24px;
  margin-bottom: 14px;
}
.cw-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.sig-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 800px) { .sig-grid { grid-template-columns: 1fr; } }
.sig-box {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  background: var(--surface-2);
}
.sig-label { font-size: var(--fs-xs); font-weight: 500; margin-bottom: 8px; color: var(--text-secondary); }
.sig-canvas {
  width: 100%; height: 140px; display: block;
  background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  cursor: crosshair; touch-action: none;
}
.sig-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }

.contract-doc {
  position: relative;
  background: #fff;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 48px 48px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
}
.contract-doc .doc-title {
  text-align: center;
  font-family: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: 22px; font-weight: 700;
  letter-spacing: .18em; margin-bottom: 8px;
  color: var(--ink);
}
.contract-doc .doc-no { text-align: right; color: var(--text-secondary); margin-bottom: 16px; font-size: var(--fs-xs); }
.contract-doc h2 {
  font-size: var(--fs-sm); margin: 18px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.contract-doc p { margin-bottom: 6px; }
.contract-doc .doc-lead { margin: 12px 0 8px; text-indent: 2em; }
.doc-sign-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: 28px; padding-top: 16px;
}
.doc-sign-col { min-height: 120px; }
.doc-sign-meta { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 4px; }
.sig-img { max-width: 200px; max-height: 72px; display: block; margin: 8px 0; }
.sig-placeholder { display: inline-block; color: var(--muted); margin: 12px 0; font-size: var(--fs-xs); }
.doc-watermark {
  position: absolute; right: 36px; top: 80px;
  font-size: 48px; font-weight: 800; color: rgba(194,65,12,.10);
  transform: rotate(-18deg); pointer-events: none; letter-spacing: .2em;
}
.doc-seal {
  position: absolute; right: 56px; top: 140px;
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid rgba(194,65,12,.45); color: rgba(194,65,12,.55);
  display: grid; place-items: center; text-align: center;
  font-size: 12px; font-weight: 700; line-height: 1.3;
  transform: rotate(-12deg); pointer-events: none;
  background: rgba(255,247,237,.55);
}

.doc-stage {
  background: var(--surface-2);
  padding: 20px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.todo-priority {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.todo-priority .tp-item {
  flex: 1; padding: 14px 16px;
  border-right: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background .12s;
  min-height: 72px;
}
.todo-priority .tp-item:last-child { border-right: none; }
.todo-priority .tp-item:hover { background: var(--surface-2); text-decoration: none; }
.todo-priority .tp-k { font-size: 11px; color: var(--text-secondary); font-weight: 500; letter-spacing: .04em; }
.todo-priority .tp-v {
  font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
  margin: 4px 0 2px; letter-spacing: -0.02em; color: var(--text);
}
.todo-priority .tp-v.hot { color: var(--accent); }
.todo-priority .tp-h { font-size: 11px; color: var(--muted); }

@media (max-width: 720px) {
  .todo-priority { flex-direction: column; }
  .todo-priority .tp-item { border-right: none; border-bottom: 1px solid var(--border); }
  .todo-priority .tp-item:last-child { border-bottom: none; }
}

@media print {
  .sidebar, .topbar, .cw-list, .cw-actions, #signCard, .card-head button,
  #btnPrintFallback, .filters, .timeline, .sign-steps, .menu-toggle, .sidebar-backdrop { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  .contract-workbench { display: block !important; }
  .card { border: none !important; box-shadow: none !important; }
  .contract-doc { box-shadow: none; border: none; max-width: 100%; padding: 12mm; }
  .doc-stage { background: #fff; padding: 0; }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { padding-left: 56px; }
  .content { padding: 16px; }
}
