/* ============================================================
   MeiTu Numbers — foundations
   Bone paper, pine ink, brass. Editorial, not decorative.
   ============================================================ */

@font-face {
  font-family: 'Meitu Serif SC';
  src: url('/assets/fonts/noto-serif-sc.woff2?v=5') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-var.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   色板（方案 B · 松墨与骨白）
   比例 60 / 30 / 10：
     60 —— 页面底 --paper（骨白）
     30 —— 主色系 --card / --ink / --ink-soft / --line-strong（次级按钮、强线）
     10 —— 强调 --accent（只允许三处：主 CTA 实底、「最受欢迎」角标、焦点环）
   深色区块（顶栏、购买流程、页脚、区号条）一律用 --ink，即同一色相的近黑墨绿，
   不再出现「蓝灰 + 赭铜」这种两个色相打架的组合。
   边框按底色写死具体色值，不再用一个 rgba token 压 4 种底色：
     纸底一组 --line / --line-strong，卡面一组 --line-card / --line-card-strong。
   --------------------------------------------------------------------------- */
:root {
  --paper: #f2f0e7;              /* 页面底 —— 骨白，60% */
  --paper-deep: #e7e4d7;         /* 已售 / 预留卡灰底（合规态，非装饰） */
  --paper-warm: #ece9dd;
  --card: #fbfaf5;               /* 卡面 */
  --ink: #141a16;                /* 主色：标题、价格数字、深色区块底 */
  --ink-soft: #2c3731;           /* 主柔 */
  --muted: #5c6459;              /* 次级文字（纸底 ≥5.5:1，禁止再调浅） */
  --muted-light: #656c63;        /* 辅助（纸底 ≥4.5:1，余量很小，禁止再调浅） */
  --line: #d9d6c9;               /* 弱线 · 纸底 */
  --line-strong: #b3b5a6;        /* 强线 · 纸底 */
  --line-card: #e2dfd3;          /* 弱线 · 卡面 */
  --line-card-strong: #c0bfb1;   /* 强线 · 卡面 */
  --line-soft: var(--line-card); /* 卡内细分隔，并入卡面弱线这一档 */
  --accent: #7a6435;             /* 强调 —— 米金压深，正文档位满足 4.5:1 */
  --accent-soft: #a08b5c;        /* 仅用于大字号/装饰；深色底品牌强调用 --accent-on-dark */
  --accent-on-dark: #c9b484;     /* 深色底（页脚/购买流程/后台侧栏）上的品牌强调 */
  --accent-wash: rgba(122, 100, 53, 0.08);
  --green: #2f5b49;
  --green-wash: rgba(47, 91, 73, 0.09);
  --warn: #7a6120;               /* 提示（纸底 ≥5:1） */
  --danger: #8c2f26;             /* 危险 */
  --font-display: 'Instrument Serif', 'Meitu Serif SC', 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --font-sans: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 2px;
  --radius-lg: 4px;
  --shadow-sm: 0 1px 2px rgba(20, 26, 22, 0.04);
  --shadow-md: 0 18px 45px -18px rgba(20, 26, 22, 0.24);
  --shadow-lg: 0 36px 80px -30px rgba(20, 26, 22, 0.32);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 76px;
  --gutter: clamp(20px, 4vw, 48px);
  --fs-min: 11px;                /* 正文级文字下限，任何渲染结果不得更小 */
}

/* 卡面（#FFFFFF）上的边框单独一组：同一组色值压在白底上会比纸底上更跳，
   所以纸底 / 卡面各写死 2 档，共 4 个具体值，不再出现第 3 档灰。 */
.num-card, .plan-card, .door, .filter-bar, .seg, .chip, .cart-item, .contact-card,
.reserve, .mini-plan, .selected-number, .zip-bar, .similar-item, .skeleton-card,
.door-search, .active-chip, .cart-empty, .cart-item-term select, .cart-wechat-row button,
.icon-btn, .zip-clear, .zip-code, .code-card, .field input, .field textarea, .field select,
.price-cell, .state-card, .specimen {
  --line: var(--line-card);
  --line-strong: var(--line-card-strong);
  --line-soft: var(--line-card);
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: multiply;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

body.is-locked { overflow: hidden; }

::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3, h4, h5, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 16px; height: 16px; }

.container {
  width: min(1240px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; }
.serif { font-family: var(--font-display); font-weight: 400; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-min);
  line-height: 1.4;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
/* 装饰性短横线改中性灰：强调色只留给主 CTA 实底 / 最受欢迎角标 / 焦点环 */
.eyebrow-rule { width: 32px; height: 1px; background: var(--line-strong); flex: none; }
.eyebrow-invert { color: rgba(242, 240, 231, 0.68); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: -50px; left: 20px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-size: 13px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------- 按钮 ---------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn .ico { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ink:hover { background: var(--ink-soft); border-color: var(--ink-soft); color: var(--paper); }
.btn-outline { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
/* 主 CTA 实底：强调色三处合法用法之一 */
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 12px; gap: 7px; }
.btn-sm .ico { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.text-btn .ico { width: 14px; height: 14px; }
.text-btn:hover { color: var(--ink-soft); border-color: var(--ink-soft); }
/* 「重置」这类文字按钮视觉上只有 20px 高，用伪元素把热区补到可点范围，外观不变 */
.text-btn { position: relative; }
.text-btn::after { content: ''; position: absolute; inset: -10px -8px; }

/* ---------------------------------- 表单 ---------------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 600; }
.field > span { color: var(--ink-soft); letter-spacing: 0.01em; }
.field > span em { font-style: normal; color: var(--muted-light); font-weight: 400; margin-left: 4px; }
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted-light); }
.field input:focus,
.field textarea:focus,
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.select-wrap { position: relative; display: inline-flex; width: 100%; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding-right: 34px;
  cursor: pointer;
}
.select-wrap > .ico {
  position: absolute;
  right: 11px; top: 50%;
  width: 15px; height: 15px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}

/* ---------------------------------- 弹层 ---------------------------------- */

dialog { padding: 0; border: 0; background: transparent; color: inherit; }
dialog::backdrop {
  background: rgba(20, 26, 22, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  padding: 11px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------- 页面骨架 -------------------------------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 42px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.2vw, 54px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.section-head h2 br { display: none; }
.section-note { max-width: 430px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.section-head-invert h2 { color: var(--paper); }
.section-head-invert .section-note { color: rgba(242, 240, 231, 0.68); }

@media (max-width: 900px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 30px; }
  .section-note { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------- 可读性基线 --------------------------------- */
body { font-size: 17px; }
.mono { font-size: 12px; letter-spacing: 0.07em; }
.eyebrow { font-size: var(--fs-min); letter-spacing: 0.17em; }
.section-note { font-size: 16px; line-height: 1.85; }
.btn { font-size: 13px; height: 50px; padding: 0 24px; }
.btn-sm { font-size: 13px; height: 38px; padding: 0 15px; }
.field { font-size: 13px; }
.field > span { font-size: 13px; }
.field input,
.field textarea,
.field select { font-size: 14px; }

/* --------------------------------- 无障碍补强 --------------------------------- */

/* 键盘焦点：统一铜色焦点环，只在键盘导航时出现，不影响鼠标点击 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.btn:focus-visible,
.chip:focus-visible,
.num-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 尊重系统「减少动态」偏好：关闭入场动画与滚动视差 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .num-card { animation: none; }
  .marquee-track { animation: none; }
  .specimen.is-swapping .specimen-number,
  .specimen.is-swapping .specimen-loc { transition: none; }
  .num-card,
  .btn,
  .contact-card,
  .zip-code,
  .active-chip { transition-duration: 0.01ms; }
}

/* 入场 / 滚动揭示（尊重 prefers-reduced-motion）。
   仅在主页面流中的元素上加 .reveal；对话框内部元素不可加，否则关闭时永远不可见。 */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); will-change: opacity, transform; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
