/* 转租交接簿 · 建筑图纸视觉
   米色描图纸、细墨线、标注箭头、尺寸线、图例框 */

:root {
  --paper: #F4EEDF;
  --paper-2: #EDE4CC;
  --paper-3: #E3D8BB;
  --ink: #24343A;
  --ink-soft: #6B7779;
  --rule: #C8BDA2;
  --rule-soft: #DBD2BB;
  --accent: #B4452C;
  --blue: #4B7385;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --serif: "Songti SC", "Noto Serif SC", SimSun, Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(36, 52, 58, .045) 27px 28px),
    repeating-linear-gradient(90deg, transparent 0 27px, rgba(36, 52, 58, .045) 27px 28px),
    repeating-linear-gradient(0deg, transparent 0 139px, rgba(36, 52, 58, .075) 139px 140px),
    repeating-linear-gradient(90deg, transparent 0 139px, rgba(36, 52, 58, .075) 139px 140px),
    var(--paper);
}

main { max-width: 720px; margin: 0 auto; padding: 0 22px 90px; position: relative; }

/* ---------- 图纸边缘 ---------- */
.sheet-edge {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 22px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 10px/1 var(--mono);
  letter-spacing: .18em;
  color: var(--ink-soft);
}
.edge-rule { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 12px); opacity: .45; }

/* ---------- 图签栏 ---------- */
.titleblock {
  margin-top: 20px;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 3px;
  background: rgba(255, 255, 255, .3);
  display: flex;
  justify-content: space-between;
  align-items: stretch;
}
.tb-left { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.tb-seal {
  width: 40px; height: 40px; flex: none;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  display: grid; place-items: center;
  font: 700 24px/1 var(--serif);
}
.tb-name { font: 700 26px/1.2 var(--serif); letter-spacing: .16em; white-space: nowrap; }
.tb-right {
  border-left: 1px solid var(--ink);
  padding: 10px 16px;
  display: flex; flex-direction: column; justify-content: center; gap: 7px;
  font: 10px/1 var(--mono); letter-spacing: .14em;
  color: var(--ink-soft); text-align: right;
}

/* ---------- 标题 ---------- */
.intro { padding: 44px 0 8px; }
.eyebrow { font: 10px/1 var(--mono); letter-spacing: .3em; color: var(--accent); margin: 0 0 14px; }
h1 { font: 800 clamp(38px, 7vw, 56px)/1.12 var(--serif); letter-spacing: .08em; margin: 0 0 16px; }
.lede { color: var(--ink-soft); margin: 0; max-width: 640px; }

.dimline { height: 16px; max-width: 640px; margin-top: 28px; position: relative; }
.dimline::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; border-top: 1px solid var(--accent); }
.dimline::after {
  content: ''; position: absolute; left: 0; right: 0; top: 3px; height: 11px;
  border-left: 1px solid var(--accent); border-right: 1px solid var(--accent);
}
.dimline span {
  position: relative; display: inline-block; padding: 0 10px;
  background: var(--paper); color: var(--accent);
  font: 10px/1 var(--mono); letter-spacing: .16em;
}

/* ---------- 标注表格 ---------- */
.drawing {
  margin-top: 38px;
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, .32);
  padding: 26px 24px 22px;
  position: relative;
}
.drawing::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }

.group { padding: 12px 0 16px; border-bottom: 1px dashed var(--rule); position: relative; }
.group:last-of-type { border-bottom: none; }
.index {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; font-weight: 700; font-size: 14px; letter-spacing: .12em;
}
.zone {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font: 700 12px/1 var(--mono);
}
.zone-line { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--rule) 0 7px, transparent 7px 13px); }
.hint { margin: -6px 0 12px 34px; font-size: 12px; color: var(--ink-soft); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; }
.line { display: flex; align-items: baseline; gap: 10px; position: relative; }
.line.full { grid-column: 1 / -1; }
.line > span { flex: none; min-width: 5.5em; font-size: 13px; }
.line input, .line select {
  flex: 1; min-width: 0;
  border: none; border-bottom: 1px solid var(--ink-soft);
  background: transparent; color: var(--ink);
  padding: 5px 2px;
  font: 15px/1.7 var(--mono);
  outline: none;
  border-radius: 0;
}
.line select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%2324343A'/></svg>");
  background-repeat: no-repeat; background-position: right 3px center;
  padding-right: 20px; cursor: pointer;
}
.line input:focus, .line select:focus { border-bottom-color: var(--accent); }
.line em { font: 11px/1 var(--mono); color: var(--ink-soft); flex: none; min-width: 2.6em; font-style: normal; }

.actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
button, a.ghost { font-family: var(--sans); cursor: pointer; }
.solid {
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); padding: 12px 26px;
  font-size: 14px; letter-spacing: .08em;
}
.solid:hover { background: var(--accent); border-color: var(--accent); }
.solid:disabled { opacity: .5; cursor: wait; }
.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink); padding: 12px 22px;
  font-size: 14px; letter-spacing: .08em;
  text-decoration: none; display: inline-block;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.note { font-size: 12px; color: var(--ink-soft); margin-top: 22px; }

/* ---------- 读图 ---------- */
.section-head { margin-top: 50px; }
.section-head.tight { margin-top: 42px; }
.section-head h2 { font: 700 22px/1.4 var(--serif); letter-spacing: .06em; margin: 0 0 8px; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--rule);
  border: 1px solid var(--ink); margin-top: 26px;
}
.stat { background: var(--paper); padding: 24px 14px 14px; position: relative; }
.stat::before {
  content: ''; position: absolute; left: 14px; right: 14px; top: 12px; height: 7px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent); border-right: 1px solid var(--accent);
}
.stat b { display: block; font: 700 23px/1.15 var(--mono); margin: 6px 0 4px; overflow-wrap: anywhere; }
.stat small { font: 11px/1 var(--mono); color: var(--ink-soft); margin-left: 3px; }
.stat span { font-size: 12px; color: var(--ink-soft); }

.grade-row { display: flex; gap: 26px; align-items: flex-start; margin-top: 24px; }
.grade {
  flex: none; width: 96px; height: 96px;
  border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .5);
}
.grade span { font: 800 38px/1 var(--serif); color: var(--accent); }
.grade em { font: 10px/1 var(--mono); font-style: normal; letter-spacing: .16em; color: var(--ink-soft); margin-top: 7px; }
.notes { margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 13px; }
.notes li { padding-left: 18px; position: relative; margin-bottom: 6px; }
.notes li::before { content: '▶'; position: absolute; left: 0; top: .1em; color: var(--accent); font-size: 8px; }

.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; border: 2px solid var(--ink); }
th {
  text-align: left; font: 10px/1 var(--mono); letter-spacing: .16em;
  background: var(--paper-2); color: var(--ink);
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--ink);
  padding: 9px 10px; white-space: nowrap;
}
td { border-right: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); padding: 9px 10px; vertical-align: top; }
td.id { font: 11px/1.9 var(--mono); color: var(--accent); white-space: nowrap; }
td.num { font-family: var(--mono); white-space: nowrap; }
td .yes { color: var(--blue); font-weight: 700; }
td .no { color: var(--accent); font-weight: 700; }

/* ---------- 底稿 ---------- */
.case-bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  margin-top: 36px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); flex-wrap: wrap;
}
.code { font: 12px/1.6 var(--mono); color: var(--ink-soft); }
.state { font: 11px/1 var(--mono); letter-spacing: .14em; padding: 4px 10px; border: 1px solid var(--ink); }
.state.paid { border-color: var(--accent); color: var(--accent); }

.report-head { margin-top: 30px; }
.report-head h2 { font: 700 26px/1.35 var(--serif); letter-spacing: .04em; margin: 0 0 10px; }
.report-head > p { max-width: 640px; margin: 0; color: var(--ink-soft); }
.report-meta { display: flex; gap: 16px; flex-wrap: wrap; font: 11px/1.8 var(--mono); color: var(--ink-soft); margin-top: 14px; }

.chapter { margin-top: 32px; padding-left: 38px; position: relative; }
.chapter::before { content: ''; position: absolute; left: 10px; top: 16px; bottom: -16px; border-left: 1px dashed var(--rule); }
.chapter:last-of-type::before { bottom: auto; height: 100%; }
.chapter::after { content: ''; position: absolute; left: 4px; top: 12px; width: 13px; height: 13px; background: var(--paper); border: 2px solid var(--ink); }
.chapter h3 { margin: 0 0 8px; font: 700 17px/1.4 var(--serif); letter-spacing: .06em; }
.chapter h3 small { font: 11px/1 var(--mono); color: var(--accent); margin-right: 10px; }
.chapter p { margin: 0; max-width: 640px; }
.fact-refs { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.fact-refs span { font: 10px/1 var(--mono); letter-spacing: .12em; border: 1px solid var(--rule); background: var(--paper-2); padding: 3px 8px; color: var(--ink-soft); }

.block-title {
  margin: 40px 0 14px; font-weight: 700; font-size: 15px; letter-spacing: .1em;
  display: flex; align-items: center; gap: 10px;
}
.block-title::before { content: ''; width: 0; height: 0; border-left: 7px solid var(--accent); border-top: 4px solid transparent; border-bottom: 4px solid transparent; flex: none; }
.block-title::after { content: ''; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--rule) 0 8px, transparent 8px 14px); }

.qa { margin: 0 0 16px; border: 1px solid var(--rule); background: rgba(255, 255, 255, .4); padding: 14px 18px 14px 22px; position: relative; }
.qa::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.qa .claim { margin: 0; font-weight: 700; font-size: 14px; }
.qa .exposure { margin: 4px 0 8px; font-size: 12px; color: var(--accent); }
.qa .exposure::before { content: '▸ '; }
.qa .reply { margin: 0; font-size: 13px; color: var(--ink-soft); max-width: 640px; }

.flow { list-style: none; margin: 0; padding: 0; }
.flow li { display: flex; gap: 16px; align-items: baseline; padding: 0 0 16px 26px; position: relative; }
.flow li::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: -2px; border-left: 1px dashed var(--rule); }
.flow li:last-child::before { display: none; }
.flow li::after { content: ''; position: absolute; left: 1px; top: 6px; width: 9px; height: 9px; border: 2px solid var(--ink); background: var(--paper); }
.flow .when { flex: none; font: 700 12px/2 var(--mono); color: var(--accent); min-width: 5.5em; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 2px 9px 24px; border-bottom: 1px dashed var(--rule);
  font-size: 13px; position: relative;
}
.checklist li::before { content: ''; position: absolute; left: 2px; top: 1em; width: 9px; height: 9px; border: 1.5px solid var(--accent); background: transparent; }
.checklist li span { font: 11px/2 var(--mono); color: var(--ink-soft); flex: none; }

.paywall { border: 1px solid var(--ink); background: rgba(255, 255, 255, .5); padding: 24px 26px; margin-top: 26px; position: relative; }
.paywall::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }
.paywall h3 { margin: 0 0 6px; font: 700 17px/1.4 var(--serif); letter-spacing: .08em; }
.paywall p { font-size: 13px; color: var(--ink-soft); }
.price-line {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 0; border-top: 1px dashed var(--rule); flex-wrap: wrap;
}
.price-line b { font: 700 20px/1 var(--mono); }
.price-line small { font: 12px/1 var(--mono); color: var(--ink-soft); }
.price-line div { display: flex; align-items: center; gap: 16px; }
.pay-links { margin-top: 40px; }
.pay-links a { color: var(--accent); font-size: 13px; }

.order-box, .result-box { margin-top: 30px; border-top: 2px solid var(--ink); padding-top: 18px; font-size: 13px; color: var(--ink-soft); }
.order-box b { font-family: var(--mono); color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 11px 22px; font-size: 13px; max-width: min(86vw, 520px); z-index: 9;
}

@media (max-width: 640px) {
  .tb-right { display: none; }
  .fields { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grade-row { flex-direction: column; }
  .drawing { padding: 22px 18px 18px; }
}
