/* ============================================================
   EngMaker Tools — 共享主题
   设计取向：工程化、朴素、可复现。不用渐变/发光等 "AI 感" 视觉——
   工程用户对"AI Generated"更警惕，朴素的工程仪表盘风格反而更可信。
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #16202c;
  --ink-2: #46576b;
  --muted: #7488a0;
  --line: #dde3ea;
  --line-2: #eef2f6;
  --accent: #0b6bcb;
  --accent-ink: #084d94;
  --accent-soft: #eaf3fc;
  --ok: #0f7b4f;
  --warn: #8a5a00;
  --warn-soft: #fff6e5;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- 共享导航 ---------- */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-nav .wrap {
  display: flex; align-items: center; gap: 20px;
  height: 56px; flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--ink); font-size: 16px; letter-spacing: -.2px; }
.brand span { color: var(--accent); font-weight: 600; }
.site-nav nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.site-nav nav a { color: var(--ink-2); }
.site-nav nav a.is-active { color: var(--accent); font-weight: 600; }
.nav-soon { color: var(--muted); cursor: default; }

/* ---------- 语言切换（右上角） ---------- */
.lang-switch { margin-left: auto; display: flex; gap: 4px; flex: 0 0 auto; }
.lang-switch a {
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2); text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.lang-switch a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.lang-switch a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 560px) {
  .lang-switch { margin-left: 0; }
}

/* ---------- 页头 ---------- */
.page-head { padding: 28px 0 8px; }
.page-head h1 { font-size: 26px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.3px; }
.page-head .lede { color: var(--ink-2); margin: 0; max-width: 68ch; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card > h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 0 0 14px; font-weight: 700;
}

/* ---------- 表单 ---------- */
.grid {
  display: grid; gap: 14px 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.field label {
  display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600;
}
.field .hint { font-weight: 400; color: var(--muted); }
.field .row { display: flex; gap: 0; }
.field input, .field select {
  width: 100%; padding: 9px 11px; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit;
}
.field input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.field .unit {
  flex: 0 0 auto; display: flex; align-items: center; padding: 0 11px;
  background: var(--line-2); border: 1px solid var(--line); border-radius: 0 6px 6px 0;
  font-size: 13px; color: var(--ink-2); font-family: var(--mono); min-width: 52px; justify-content: center;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ---------- 单位切换 ---------- */
.unit-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: var(--surface);
}
.unit-switch button {
  border: 0; background: transparent; padding: 7px 14px; font: inherit; font-size: 13px;
  color: var(--ink-2); cursor: pointer;
}
.unit-switch button.on { background: var(--accent); color: #fff; font-weight: 600; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- 结果 ---------- */
.results { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.result {
  background: var(--accent-soft); border: 1px solid #cfe4f8; border-radius: 6px; padding: 12px 14px;
}
.result .k { font-size: 12px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.result .v { font-family: var(--mono); font-size: 21px; font-weight: 600; color: var(--ink); margin-top: 3px; }
.result .v small { font-size: 13px; color: var(--ink-2); font-weight: 400; }

/* ---------- 计算过程（可复现） ---------- */
.steps { font-family: var(--mono); font-size: 13.5px; background: var(--surface); }
.steps ol { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 5px; color: var(--ink-2); }
.steps li b { color: var(--ink); }

.assump-list, .notes-list { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.assump-list li, .notes-list li { margin-bottom: 4px; }

/* ---------- 免责 / 方法 ---------- */
.notice {
  background: var(--warn-soft); border: 1px solid #f0dcae; border-left: 3px solid #d9a300;
  border-radius: 6px; padding: 12px 14px; font-size: 13.5px; color: #5c4200; margin-bottom: 16px;
}
.notice strong { color: #4a3500; }
.method { font-size: 14px; color: var(--ink-2); }
.method code {
  font-family: var(--mono); background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 13px;
}
.refs { font-size: 13px; color: var(--muted); margin: 8px 0 0; padding-left: 20px; }

/* ---------- 表格 ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: right; }
table.data th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td { font-family: var(--mono); }
table.data tr:hover td { background: var(--line-2); }

/* ---------- 目录 / 相关工具 ---------- */
.cat { margin-bottom: 26px; }
.cat > h2 { font-size: 15px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cat ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cat li a {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 13px; color: var(--ink); font-weight: 600; font-size: 14px;
}
.cat li a:hover { border-color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.cat li small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font-size: 13px; padding: 5px 11px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- 页脚 ---------- */
.site-foot { margin-top: 40px; padding: 24px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.site-foot nav { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .page-head h1 { font-size: 22px; }
  .site-nav .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; }
}

/* ============================================================
   /glossary/ 工程术语库
   ============================================================ */
.gl-search { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; }
.gl-search input {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.gl-search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.gl-count { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); }
.gl-empty { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

.cat-n { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.cat-desc { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.cat > h2 a { color: var(--ink); }
.cat > h2 a:hover { color: var(--accent); text-decoration: none; }

table.terms { font-size: 13.5px; }
table.terms th, table.terms td { text-align: left; vertical-align: top; }
table.terms .t-zh { font-family: inherit; font-weight: 600; color: var(--ink); white-space: nowrap; }
table.terms .t-en { font-family: var(--mono); color: var(--accent-ink); }
table.terms .t-fr { font-family: inherit; color: var(--accent-ink); }
table.terms .t-abbr { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
table.terms .t-note { font-family: inherit; color: var(--ink-2); font-size: 13px; }
table.terms tr:hover td { background: var(--accent-soft); }

/* ============================================================
   /app/ 工程翻译
   ============================================================ */
.seg { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg-btn {
  padding: 8px 14px; font: inherit; font-size: 14px; border: 0; background: transparent;
  color: var(--ink-2); cursor: pointer;
}
.seg-btn.on { background: var(--accent); color: #fff; font-weight: 600; }
.seg-swap {
  padding: 8px 10px; font: inherit; font-size: 14px; border: 0; border-left: 1px solid var(--line);
  border-right: 1px solid var(--line); background: var(--line-2); color: var(--ink-2); cursor: pointer;
}
.seg-swap:hover { color: var(--accent); }

.tr-count { font-size: 12.5px; color: var(--muted); }

.field textarea {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 15px; line-height: 1.6; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.tr-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-primary {
  padding: 10px 22px; font: inherit; font-weight: 600; font-size: 14px; color: #fff;
  background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius); cursor: pointer;
}
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  padding: 9px 16px; font: inherit; font-size: 14px; color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: var(--radius); cursor: pointer;
}
.btn-ghost:hover { background: var(--accent-soft); }

.tr-status { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.tr-status.err { color: #b00020; }

.tr-out {
  min-height: 96px; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--line-2); color: var(--muted); font-size: 15px; line-height: 1.65; white-space: pre-wrap;
}
.tr-out.filled { background: var(--surface); color: var(--ink); border-color: var(--line); }

.tr-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; min-height: 22px; }
.hits-label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.hit {
  display: inline-block; margin: 0 6px 0 0; padding: 3px 9px; font-size: 12.5px; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; font-family: var(--mono);
}
.conf { font-size: 12.5px; color: var(--muted); }

@media (max-width: 600px) {
  .gl-search { flex-direction: column; align-items: stretch; gap: 6px; }
  .seg { width: 100%; }
  .seg-btn { flex: 1 1 0; padding: 9px 8px; font-size: 13px; }
  table.terms { font-size: 12.5px; }
  table.terms th:nth-child(4), table.terms td:nth-child(4) { display: none; }
}

/* ---- /docs/ 文档翻译 ---- */
.dc-drop {
  margin-top: 12px; padding: 22px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--line-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dc-drop:hover, .dc-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.dc-drop-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.dc-drop-hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.dc-actions { margin-top: 12px; }
.dc-meta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.dc-warning { margin-top: 8px; font-size: 13px; color: var(--warn); background: var(--warn-soft); border: 1px solid #f0dcae; border-radius: 6px; padding: 10px 12px; }
.dc-status { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.dc-status.err { color: #b00020; }

.dc-preview {
  max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 12px 13px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--line-2);
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word;
}

.dc-out { margin-top: 10px; }
.dc-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-2);
}
.dc-pair:last-child { border-bottom: none; }
.dc-src { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.dc-tgt { font-size: 14px; line-height: 1.65; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

@media (max-width: 600px) {
  .dc-pair { grid-template-columns: 1fr; gap: 4px; }
  .dc-tgt { padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
}

/* PDF 输出选项控件组（仅 PDF 显示） */
.dc-opts {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line-2);
}
.dc-opts[hidden] { display: none; }
.dc-opt { display: flex; flex-direction: column; gap: 5px; }
.dc-opt > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dc-opt select {
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; min-width: 150px; cursor: pointer;
}
.dc-opt[hidden] { display: none; }

/* PDF 逐页预览容器 */
.dc-pages { margin-top: 14px; display: flex; flex-direction: column; gap: 18px; }
.dc-pages[hidden] { display: none; }
.dc-page { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.dc-page-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; font-size: 12.5px; color: var(--muted); background: var(--line-2);
  border-bottom: 1px solid var(--line);
}
.dc-page-body { padding: 12px; }
/* 左右对照 */
.dc-page.lr .dc-page-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 上下对照 */
.dc-page.tb .dc-page-body { display: flex; flex-direction: column; gap: 12px; }
.dc-page-img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
.dc-page-tgt {
  font-size: 14px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; background: var(--line-2);
}
.dc-page.tgt-only .dc-page-img { display: none; }

@media (max-width: 600px) {
  .dc-page.lr .dc-page-body { grid-template-columns: 1fr; }
  .dc-opts { gap: 10px; }
  .dc-opt select { min-width: 0; width: 100%; }
}

/* 下载按钮组 */
.dc-dl { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.dc-dl[hidden] { display: none; }
.dc-dl .btn {
  cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; padding: 10px 20px;
  border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
.dc-dl .btn.ghost { background: var(--surface); color: var(--accent); }
.dc-dl .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Cookie 提示条（GDPR 事前同意；默认零 Cookie，接受/拒绝同等权重） ---- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(22, 32, 44, .07);
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
}
.consent .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.consent-txt { flex: 1 1 380px; margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.consent-txt a { color: var(--accent); }
.consent-row { display: flex; gap: 10px; flex: 0 0 auto; }
.consent-row .btn { cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: var(--radius); }
.btn.consent-yes { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn.consent-no { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

@media (max-width: 600px) {
  .consent .wrap { gap: 12px; }
  .consent-txt { flex: 1 1 100%; }
  .consent-row { width: 100%; }
  .consent-row .btn { flex: 1; }
}

/* ================= 计算书（kind:'design' · assets/sheet.js） ================= */
.sheet-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sheet-lang-label { font-size: 13px; color: var(--muted); }
.sheet-lang { display: flex; gap: 4px; }
.sheet-lang button {
  font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--radius); min-height: 32px;
}
.sheet-lang button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sheet-print {
  font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer; margin-left: auto;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: var(--radius);
  min-height: 32px;
}
.sheet-doc {
  background: #fff; color: #161616; border: 1px solid var(--line);
  padding: 30px 36px; font-size: 14px; line-height: 1.75;
}
.sd-title { text-align: center; font-size: 19px; font-weight: 600; margin: 0; }
.sd-sub { text-align: center; font-size: 13px; color: #555; margin: 2px 0 0; }
.sd-head {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between;
  border-bottom: 1px solid #bbb; padding: 12px 0 8px; margin: 14px 0 16px;
}
.sd-head input {
  border: none; border-bottom: 1px dashed #999; background: transparent;
  font: inherit; font-size: 12.5px; color: #333; padding: 2px 4px; width: 130px;
}
.sd-head input::placeholder { color: #999; }
.sd-h { font-weight: 600; font-size: 15px; margin: 20px 0 6px; }
.sd-p { margin: 6px 0; text-align: justify; }
.sd-f { margin: 10px 0 12px; }
.sd-f-eq { font-family: var(--mono); font-size: 14px; margin: 0 0 4px; padding-left: 24px; }
.sd-f-where { font-size: 12.5px; color: #444; margin: 2px 0 2px; padding-left: 24px; }
.sd-f-sub { font-family: var(--mono); font-size: 13.5px; margin: 6px 0 0; padding-left: 24px; }
.sd-fig { margin: 14px auto; text-align: center; }
.sd-fig img { max-width: min(440px, 88%); height: auto; border: 1px solid #ddd; background: #fff; padding: 6px; }
.sd-fig figcaption { font-size: 12.5px; color: #444; margin-top: 6px; }
.sd-check {
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  padding: 10px 14px; border-radius: var(--radius); margin: 12px 0 8px;
}
.sd-check.ok { background: #e8f3e4; color: #2c5f14; border: 1px solid #bcd9ae; }
.sd-check.bad { background: #fbeaea; color: #8f1f1f; border: 1px solid #eab8b8; }
.sd-sign {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid #bbb; padding-top: 12px; margin-top: 18px;
  font-size: 12.5px; color: #333;
}

/* 打印：只输出计算书本体（A4 友好） */
@media print {
  .site-nav, .site-foot, .site-footer, .consent, .notice, .page-head, .card:not(.sheet-card),
  .sheet-toolbar, .sheet-card > h2 { display: none !important; }
  main.wrap { max-width: none; padding: 0; display: flex; flex-direction: column; }
  /* 屏幕顺序是「设计表→计算书」（免费区在前），打印报告顺序保持工程惯例：
     计算书（计算过程）→ 设计表 → 说明 → 签名收尾 */
  .sheet-card { order: 1; }
  .dtable-card { order: 2; }
  .card.sheet-card { border: none; padding: 0; margin: 0; }
  .sheet-doc { border: none; padding: 0; font-size: 12.5px; }
  /* 签名落款在打印时移到设计表末尾（.dt-sign），避免夹在计算书与设计表之间割裂报告 */
  .sheet-doc .sd-sign { display: none !important; }
  .sd-fig { break-inside: avoid; }
  .sd-f { break-inside: avoid; }
}

/* ================= 设计计算表（dtable.js · 随计算书导出） ================= */
.dtable-card .dt-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dt-klabel { font-size: 13px; color: var(--muted); }
.dt-ksel {
  font: inherit; font-size: 14px; padding: 5px 8px; min-height: 32px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.dt-reset {
  font: inherit; font-size: 13px; padding: 5px 12px; min-height: 32px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--radius);
}
.dt-reset:hover { border-color: var(--accent); color: var(--accent); }
.dt-status { font-size: 12.5px; color: var(--accent); min-height: 1.1em; margin: 4px 0; opacity: 0; transition: opacity .2s; }
.dt-status.on { opacity: 1; }
.dt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt-table th, .dt-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.dt-table thead th { background: var(--surface); font-weight: 600; }
.dt-table .num { font-family: var(--mono, monospace); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-table .dt-kind { font-weight: 600; background: var(--surface); }
.dt-table input[type="number"] {
  width: 74px; font-family: var(--mono, monospace); font-size: 13px; text-align: center;
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); color: var(--ink);
}
.dt-table input[type="number"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.dt-table tr.dt-bad td { background: #fdeeee; }
.dt-table tr.dt-bad input[type="number"] { border-color: #d99; background: #fff6f6; }
.dt-diff-bad { color: #b3261e; font-weight: 600; }
.dt-diff-ok { color: #2c5f14; }
.dt-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.dt-badge.ok { background: #e8f3e4; color: #2c5f14; }
.dt-badge.bad { background: #fbeaea; color: #8f1f1f; }
.print-only { display: none; }

/* 报告说明区：生成声明/打印说明/复核要求统一收在报告末尾（不进正文） */
.dt-notes { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.dt-notes .dt-notes-t { font-weight: 600; margin: 0 0 4px; }
.dt-notes ol { margin: 0; padding-left: 20px; }
.dt-notes li { margin: 2px 0; }

/* 打印：设计计算表与计算书合成一份报告（计算过程 + 尺寸结果表） */
@media print {
  .card.dtable-card { display: block !important; border: none; padding: 0; margin: 0; }
  .dtable-card > h2 { display: block !important; text-align: center; font-size: 14px; margin: 12px 0 6px; }
  .dtable-card .dt-ksel, .dtable-card .dt-reset, .dtable-card .dt-status, .dtable-card .dt-autohint { display: none !important; }
  .dtable-card .print-only { display: inline; font-size: 13px; }
  /* 签名落款：整份报告（计算书 → 设计表）的收尾，打印时出现在设计表之后 */
  .dtable-card .dt-report-end { break-inside: avoid; }   /* 说明+签名永不拆页，避免孤行签名 */
  .dtable-card .dt-sign {
    display: flex !important; justify-content: space-between; gap: 12px;
    border-top: 1px solid #bbb; padding-top: 12px; margin-top: 18px;
    font-size: 12.5px; color: #333; break-inside: avoid;
  }
  .dt-table { font-size: 11px; }
  .dt-table input[type="number"] { border: none; background: none; padding: 0; width: auto; }
  .dt-table tr { break-inside: avoid; }
}

/* ================= 计算书付费墙（paywall.js · 2026-10-12） ================= */
.sheet-bar-slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sheet-bar-slot h2 { margin: 0; }
/* 下载按钮：付费解锁后才出现（paywall 在 <html> 加 .pw-unlocked） */
.sheet-print { display: none !important; }
.pw-unlocked .sheet-print { display: inline-block !important; }

.paywall-wrap { position: relative; }
/* 蒙版内容：强模糊 + 禁选 + 禁指针（四周留一圈可见，中间盖付费卡） */
.paywall-content {
  filter: blur(7px); opacity: .55;
  user-select: none; -webkit-user-select: none; pointer-events: none;
}
.paywall-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}
.paywall-mask[hidden] { display: none; }
.pw-card {
  width: min(420px, 92%); text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 14px;
}
.pw-kicker { font-size: 12px; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
.pw-title { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.pw-price { font-size: 26px; font-weight: 600; color: var(--accent); margin: 0 0 8px; }
.pw-includes { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; }
.pw-includes li { font-size: 12.5px; color: var(--ink-2); padding: 3px 0 3px 18px; position: relative; }
.pw-includes li::before { content: '✓'; position: absolute; left: 2px; color: var(--accent); font-size: 12px; }
.pw-btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 22px; cursor: pointer;
  border: none; border-radius: var(--radius); background: var(--accent); color: #fff; width: 100%;
}
.pw-btn:disabled { opacity: .6; cursor: default; }
.pw-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.pw-unlocked-note { font-size: 12.5px; color: var(--accent); margin: 10px 0 0; }

/* 扫码弹层 */
.pw-modal { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); }
.pw-modal[hidden] { display: none; }
.pw-modal-box {
  position: relative; width: min(320px, 90vw); text-align: center; background: var(--surface);
  border-radius: var(--radius); padding: 20px 20px 16px;
}
.pw-modal-t { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.pw-qr { width: 216px; height: 216px; display: block; margin: 0 auto 12px; }
.pw-modal-s { font-size: 12.5px; color: var(--ink-2); margin: 0; min-height: 2.4em; }
.pw-modal-x {
  position: absolute; top: 6px; right: 8px; font: inherit; font-size: 14px; cursor: pointer;
  border: none; background: none; color: var(--muted); padding: 4px 8px;
}

/* report 页：令牌校验门禁 */
.report-gate { text-align: center; font-size: 13px; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 12px; }
.report-gate[hidden] { display: none; }

@media print {
  /* 计算器页不再提供免费打印出口；蒙版/弹层不进入打印 */
  .paywall-mask, .pw-modal, .pw-unlocked-note, .report-gate { display: none !important; }
  .paywall-content { filter: none; opacity: 1; user-select: text; pointer-events: auto; }
}
.bim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 14px 0 8px; }
.bim-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: box-shadow .15s, transform .15s; }
.bim-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.10); transform: translateY(-2px); }
.bim-card-link { display: block; color: inherit; text-decoration: none; }
.bim-cover-ph, .bim-cover-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.bim-cover-ph { background: linear-gradient(135deg, #2b4a6f, #1d2f45); }
.bim-card-body { padding: 14px 16px 16px; }
.bim-cat { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 2px 9px; border-radius: 10px; margin-bottom: 8px; }
.bim-card-body h3 { font-size: 17px; line-height: 1.3; margin: 0 0 6px; }
.bim-meta { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.bim-summary { font-size: 13.5px; color: var(--ink-2); margin: 0; line-height: 1.5; }
.bim-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.bim-filter { font: inherit; font-size: 13px; padding: 5px 13px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 20px; }
.bim-filter:hover { border-color: var(--accent); color: var(--accent); }
.bim-filter.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bim-empty { color: var(--ink-2); font-size: 14px; padding: 10px 0; }
.bim-detail .bim-cover-ph, .bim-detail .bim-cover-img { aspect-ratio: 21 / 9; border-radius: var(--radius); margin: 6px 0 16px; }
.bim-lede { font-size: 16px; line-height: 1.6; color: var(--ink); margin: 0 0 18px; }
.bim-detail p { font-size: 15px; line-height: 1.75; color: var(--ink); margin: 0 0 14px; }
.bim-client { font-size: 14px; color: var(--ink-2); }
.bim-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.bim-gallery-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.bim-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.bim-intro p { font-size: 15px; line-height: 1.7; margin: 0; }

/* ---------------- Contact ---------------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 10px; }
@media (max-width: 760px) { .contact-wrap { grid-template-columns: 1fr; } }
.contact-info .c-line { display: flex; gap: 10px; align-items: baseline; margin: 0 0 10px; font-size: 15px; }
.contact-info .c-label { font-weight: 600; min-width: 84px; color: var(--ink); }
.contact-info a { color: var(--accent); text-decoration: none; }
.contact-form .field { margin: 0 0 14px; }
.contact-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.contact-form label .req { color: #c0392b; margin-left: 3px; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); box-sizing: border-box;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.contact-form textarea { min-height: 110px; resize: vertical; }
.contact-submit { font: inherit; font-size: 15px; font-weight: 600; padding: 11px 22px; cursor: pointer; border: none; border-radius: var(--radius); background: var(--accent); color: #fff; }
.contact-submit:disabled { opacity: .6; cursor: default; }
.contact-status { font-size: 14px; margin-top: 12px; min-height: 1.2em; }
.contact-status.ok { color: #2c5f14; }
.contact-status.err { color: #b3261e; }
/* 后端不可用时的兜底面板：把访客填的内容原样交还，绝不静默丢弃 */
.contact-status.err p { margin: 0 0 8px; }
.contact-fallback {
  font: 12.5px/1.65 ui-monospace, Consolas, "SF Mono", Menlo, monospace;
  background: var(--surface, #fff); border: 1px solid var(--line, #dde3ea);
  border-radius: 6px; padding: 10px 12px; margin: 0 0 10px;
  white-space: pre-wrap; word-break: break-word; color: #16202c;
  max-height: 260px; overflow: auto;
}
.contact-copy {
  border: 1px solid var(--accent, #0b6bcb); background: var(--accent, #0b6bcb);
  color: #fff; border-radius: 6px; padding: 8px 16px; font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.contact-copy:hover { background: var(--accent-ink, #084d94); border-color: var(--accent-ink, #084d94); }
.contact-fallback-wechat { margin-top: 10px !important; font-weight: 600; }

/* ---------------- FAQ（计算器页结构化数据配套区块） ---------------- */
.faq { margin: 0; }
.faq dt { font-weight: 600; color: var(--ink); margin: 14px 0 4px; font-size: 15px; line-height: 1.5; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 0 0 6px; color: var(--ink2); font-size: 14.5px; line-height: 1.7; }
.contact-fallback-reason { font-size: 12.5px; opacity: .8; font-family: ui-monospace, Consolas, monospace; }
