:root {
  --ink: #212529;
  --muted: #6c757d;
  --line: #dee2e6;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --accent: #1f4e79;
  --accent-dark: #163a5b;
  --accent-soft: #e8f0f8;
  --danger: #b42318;
  --ok: #067647;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
img { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .5rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 头部与底部 */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding: .85rem 0; }
.logo { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: .95rem; }
.site-header nav a { color: var(--ink); text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }
.site-footer { margin-top: 3rem; padding: 1.5rem 0; border-top: 1px solid var(--line); background: var(--panel); font-size: .9rem; }

/* 首屏 */
.hero { padding: 2.5rem 0 1rem; }
.hero.compact { padding-top: 1.5rem; }
.lead { font-size: 1.1rem; color: #343a40; max-width: 760px; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.pills li { background: var(--accent-soft); color: var(--accent-dark); padding: .25rem .7rem; border-radius: 999px; font-size: .9rem; }
.crumbs { padding-top: 1rem; font-size: .9rem; color: var(--muted); }

/* 按钮与表单 */
button, .button {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: .6rem 1.1rem; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-dark); }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { background: #fff; color: var(--accent); }
button.secondary:hover { background: var(--accent-soft); }
.link-button { background: none; border: 0; color: var(--danger); padding: .25rem 0; font-weight: 500; }
.link-button:hover { background: none; text-decoration: underline; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 600; }
label.inline { flex-direction: row; align-items: center; gap: .5rem; }
label.check { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: .5rem .6rem; border: 1px solid #ced4da; border-radius: 6px; background: #fff; width: 100%; min-width: 0;
}
input[type=checkbox] { width: auto; margin-top: .25rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.form-grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.error { color: var(--danger); font-weight: 600; margin: .5rem 0 0; }
.fine { font-size: .85rem; color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: .92rem; margin-top: 0; }
.is-success { color: var(--ok); font-weight: 600; }
.is-error { color: var(--danger); font-weight: 600; }

/* 生成器 */
.builder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 1rem 0 2rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; min-width: 0; }
.panel h2 { margin: 0 0 .9rem; font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.panel-head h2 { margin: 0; }
.step { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; }
.sketch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.sketch-slot { border: 1px dashed #adb5bd; border-radius: 8px; padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.sketch-slot img { max-height: 220px; object-fit: contain; background: #fff; }
.table-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: .75rem; }
.edit-table { border-collapse: collapse; width: 100%; min-width: 960px; font-size: .9rem; }
.edit-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .35rem .3rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.edit-table td { padding: .2rem .15rem; border-bottom: 1px solid #f1f3f5; }
.edit-table input { padding: .35rem .4rem; font-size: .88rem; }
.edit-table .pom-code { width: 3.2rem; }
.edit-table .pom-name { min-width: 10rem; }
.edit-table .pom-how { min-width: 18rem; }
.edit-table .pom-val, .edit-table .pom-tol { width: 4.2rem; text-align: right; }
.edit-table .is-base, .spec-table .is-base { background: var(--accent-soft); }
.edit-table input.is-invalid { border-color: var(--danger); background: #fef3f2; }
.row-remove { background: none; border: 0; color: var(--muted); font-size: 1.2rem; padding: .2rem .5rem; line-height: 1; }
.row-remove:hover { background: none; color: var(--danger); }
.export-panel { border-color: var(--accent); }
.export-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* 留邮箱弹窗 */
dialog { border: 0; border-radius: var(--radius); padding: 1.5rem; width: min(460px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 23, 42, .5); }
dialog h2 { margin-top: 0; }
#gate-form { display: grid; gap: .85rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }

/* 内容页 */
.prose { max-width: 900px; }
.prose p, .prose li { font-size: 1rem; }
.spec-table { border-collapse: collapse; width: 100%; font-size: .9rem; background: #fff; }
.spec-table th, .spec-table td { border: 1px solid var(--line); padding: .4rem .5rem; text-align: left; vertical-align: top; }
.spec-table thead th { background: var(--accent); color: #fff; border-color: var(--accent); }
.spec-table thead th.is-base { background: var(--accent-dark); }
.checklist { padding-left: 1.2rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 .3rem; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; margin-bottom: .5rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.cta-row { margin: 1.25rem 0; }
.note { background: var(--accent-soft); border-radius: 8px; padding: .75rem 1rem; }
.quote { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-top: 2rem; }
.quote h2 { margin-top: 0; }

@media (max-width: 640px) {
  .panel { padding: .9rem; }
  .site-header nav { font-size: .88rem; }
}
