/* 一脉 · Legatie — 样式
   颜色都在下面两组变量里：浅色在 :root，深色在 prefers-color-scheme: dark。
   tests/run.js 会检查文字和焦点框的对比度。 */

:root {
  --bg: #F7F3EC;
  --surface: #FFFDF9;
  --surface-2: #EFE8DC;
  --text: #2B2622;
  --muted: #5E554C;
  --line: #D9CFC0;
  --field-line: #8C8073;
  --accent: #8E3324;
  --on-accent: #FFFFFF;
  --accent-text: #8E3324;
  --accent-soft: #F3E2DC;
  --focus: #1F5F8B;
  --ok: #2F6B3A;
  --ok-soft: #E3F0E3;
  --danger: #A12A1E;
  --danger-soft: #F8E3E0;

  /* Georgia 放最前：英文和数字用它，中文字自动落到后面的宋体 */
  --serif: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius: 12px;
  --wrap: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191512;
    --surface: #221D19;
    --surface-2: #2C2621;
    --text: #EEE6DA;
    --muted: #B9AE9F;
    --line: #40372F;
    --field-line: #857869;
    --accent: #E39A85;
    --on-accent: #1A1210;
    --accent-text: #E9A792;
    --accent-soft: #3A2621;
    --focus: #8CC4F0;
    --ok: #9AD3A4;
    --ok-soft: #1E3323;
    --danger: #F2A397;
    --danger-soft: #3A1F1B;
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.3; margin: 0 0 .5em; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip-link:focus { top: 12px; }

/* 中英切换：html 上的 l-zh / l-en 决定显示哪种语言 */
html.l-zh [data-l="en"], html.l-en [data-l="zh"] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-mark .c2 { stroke: var(--accent-text); }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--sans); font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .06em; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--text); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--accent-text); }
.lang-btn { font: inherit; font-size: .9rem; font-weight: 600; color: var(--accent-text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; }
.lang-btn:hover { border-color: var(--accent-text); }
@media (max-width: 760px) { .nav { display: none; } }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent-text); border-color: var(--accent-text); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- 首屏 ---------- */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { font-size: .9rem; font-weight: 600; color: var(--accent-text); letter-spacing: .04em; margin-bottom: 12px; }
.tagline { font-family: var(--serif); font-size: clamp(1.15rem, 2.6vw, 1.45rem); line-height: 1.5; color: var(--accent-text); margin: -2px 0 16px; letter-spacing: .02em; }
.lead { font-size: 1.12rem; color: var(--text); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 16px; }
.note { font-size: .92rem; color: var(--muted); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } .hero { padding-top: 36px; } }

/* 书页示意 */
.book { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 6px 6px 10px 10px; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .35); padding: 26px 0; }
.book::after { content: ""; position: absolute; top: 14px; bottom: 14px; left: 50%; width: 1px; background: var(--line); }
.page { padding: 0 22px; font-family: var(--serif); font-size: .95rem; line-height: 1.85; }
.page .chap { font-size: .78rem; font-family: var(--sans); color: var(--accent-text); font-weight: 600; letter-spacing: .05em; margin-bottom: 8px; }
.page .qr { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--sans); font-size: .75rem; color: var(--muted); }
.page .qr span[aria-hidden] { width: 26px; height: 26px; border: 2px solid var(--muted); border-radius: 3px; background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 6px); opacity: .7; }
.book-caption { margin-top: 10px; font-size: .82rem; color: var(--muted); text-align: center; }
@media (max-width: 480px) { .page { padding: 0 14px; font-size: .88rem; } }

/* ---------- 段落区块 ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--surface-2); }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head p { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
.card .num { font-family: var(--serif); color: var(--accent-text); font-weight: 700; font-size: 1.2rem; display: block; margin-bottom: 6px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.about-cards { margin-top: 28px; }
.card a { overflow-wrap: anywhere; }
@media (max-width: 960px) { .cards, .cards.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards, .cards.three { grid-template-columns: 1fr; } }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 24px; } }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(-45deg); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 48px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); }

.faq-list details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; margin-bottom: 10px; }
.faq-list summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent-text); font-size: 1.3rem; line-height: 1; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { color: var(--muted); padding-bottom: 6px; }

/* ---------- 可展开：按钮本身 ---------- */
.more > summary, .more-card > summary { list-style: none; }
.more > summary::-webkit-details-marker, .more-card > summary::-webkit-details-marker { display: none; }
.more-btn { min-height: 44px; padding: 8px 20px; }
.more-btn::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.more[open] > .more-btn::after,
.more-card[open] .more-btn::after { transform: translateY(2px) rotate(-135deg); }
.more > summary:focus-visible, .more-card > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.more[open] > .more-btn .more-closed, .more:not([open]) > .more-btn .more-open,
.more-card[open] .more-closed, .more-card:not([open]) .more-open { display: none; }
@media (prefers-reduced-motion: reduce) { .more-btn::after { transition: none; } }

/* ---------- 「了解更多」：四张卡片，标题本身就是按钮；一次只开一张，点开的那张铺满整行 ---------- */
.trio { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.more-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.more-card > summary { cursor: pointer; padding: 22px 24px; display: grid; align-content: start; gap: 12px; border-radius: var(--radius); }
.more-card:not([open]) > summary { height: 100%; }
.more-card .more-head { justify-self: start; font-family: var(--serif); font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.more-teaser { color: var(--muted); font-size: .97rem; }
.more-card > summary:hover .more-head, .more-card[open] .more-head { background: var(--accent-soft); }
.more-card[open] { grid-column: 1 / -1; order: 1; }
/* 有一张点开时，其余三张一排，点开的那张在下面铺满 */
.trio:has(> .more-card[open]) { grid-template-columns: repeat(3, 1fr); }
.more-body { padding: 0 24px 24px; }
.more-body .steps li, .more-body .card, .more-body .panel, .more-body .faq-list details { background: var(--bg); }
.more-body > p:first-child { margin-top: 0; color: var(--muted); max-width: 46em; }
.more-body .two-col > p { margin-top: 0; }
.more-body .faq-list details:last-child { margin-bottom: 0; }
@media (max-width: 1000px) { .trio { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .trio, .trio:has(> .more-card[open]) { grid-template-columns: 1fr; }
  .more-card[open] { order: 0; }
}

/* ---------- 预约区：一栏，留言表收在按钮后面 ---------- */
.booking-intro, .booking .more { max-width: 760px; }
.booking-alt { color: var(--muted); margin-top: 28px; }
.booking .more[open] > .more-btn { margin-bottom: 22px; }

/* ---------- 表单 ---------- */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form { padding: 20px; } }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: .95rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--field-line); border-radius: 10px; padding: 10px 12px; min-height: 46px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.status:empty { display: none; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.err { background: var(--danger-soft); color: var(--danger); }
.form-foot { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------- 隐私政策页 ---------- */
.doc { max-width: 46em; padding: 48px 16px 64px; margin: 0 auto; }
.doc h2 { font-size: 1.3rem; margin-top: 1.8em; }
.doc .updated { color: var(--muted); }
.todo { background: var(--accent-soft); color: var(--accent-text); padding: 0 4px; border-radius: 4px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .cta-row, #waitlist, .footer, .lang-btn { display: none !important; }
  body { background: #fff; color: #000; }
}
