/* 缘起格物门户 — 温暖治愈 / Soft UI · 设计令牌见 design-system/yuanqi-gewu-portal/MASTER.md（配色按暖色调整） */
:root {
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --surface-2: #F4EDE2;
  --peach: #F6E3D6;
  --ink: #2B2520;
  --ink-2: #5C534B;
  --muted: #8A7F75;
  --line: #E9DFD2;
  --primary: #B5482B;
  --primary-hover: #9A3B22;
  --on-primary: #FFFFFF;
  --accent: #D98A2B;
  --sage: #5F7A61;
  --sage-soft: #E6EDE3;
  --sky: #5B7A99;
  --sky-soft: #E3EAF1;
  --danger: #B42318;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(43, 37, 32, .06), 0 2px 8px rgba(43, 37, 32, .05);
  --shadow: 0 2px 6px rgba(43, 37, 32, .06), 0 12px 32px rgba(43, 37, 32, .08);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px; --space-5: 48px; --space-6: 64px; --space-7: 96px;
  --container: 1120px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; margin: 0 0 var(--space-2); letter-spacing: .01em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 1.05rem + 1.3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 var(--space-2); }
small { font-weight: 400; color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; }
.container { width: min(100% - 2 * var(--space-3), var(--container)); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1.5px solid transparent; font: inherit; font-weight: 600; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
  text-decoration: none !important; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px rgba(181, 72, 43, .22); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--primary); border-color: rgba(181, 72, 43, .4); }
.btn-ghost:hover { background: rgba(181, 72, 43, .06); }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { min-height: 38px; padding: 6px 16px; font-size: .92rem; }
.link-arrow::after { content: " →"; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 247, 240, .88); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.12rem; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; }
.site-nav { display: flex; align-items: center; gap: var(--space-3); }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a:not(.btn) { display: inline-block; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; }
.site-nav a:not(.btn):hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--primary); background: rgba(181, 72, 43, .08); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle-bar { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-3); background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav a:not(.btn) { display: block; padding: 12px; font-size: 1.05rem; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- layout blocks ---------- */
.section { padding-block: var(--space-5); }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 720px; margin-bottom: var(--space-4); }
.section-head p { color: var(--ink-2); font-size: 1.05rem; }
.section-more { margin-top: var(--space-3); font-weight: 600; }
.page-head { padding-block: var(--space-4) var(--space-2); max-width: 820px; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.eyebrow { font-size: .92rem; color: var(--primary); font-weight: 600; letter-spacing: .06em; margin-bottom: var(--space-2); }
.two-col { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: var(--space-3); }

/* hero */
.hero { position: relative; overflow: hidden; padding-block: var(--space-6) var(--space-5); background: radial-gradient(900px 500px at 85% -10%, var(--peach) 0%, transparent 60%), linear-gradient(180deg, #FFFBF4 0%, var(--bg) 100%); }
.hero-inner { position: relative; z-index: 1; max-width: 640px; }
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem); margin-bottom: var(--space-3); }
.hero .lead { font-size: 1.15rem; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.hero-art { position: absolute; right: max(2vw, calc((100vw - var(--container)) / 2 - 20px)); top: 50%; transform: translateY(-50%); width: min(38vw, 420px); opacity: .95; pointer-events: none; }
@media (max-width: 900px) { .hero-art { display: none; } }

/* pillars */
.pillars { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow-sm); }
.pillar h3 { margin-bottom: 8px; }
.pillar p { margin: 0; color: var(--ink-2); }

/* type cards */
.type-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.type-grid-compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.type-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "num name" "num tag" "num center"; column-gap: 14px; row-gap: 2px; align-items: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--card-accent, var(--primary)); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.type-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.type-num { grid-area: num; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; background: var(--card-soft, var(--peach)); color: var(--card-accent, var(--primary)); }
.type-name { grid-area: name; font-weight: 700; font-size: 1.05rem; }
.type-name small { margin-left: 6px; font-size: .85rem; }
.type-tag { grid-area: tag; color: var(--ink-2); font-size: .93rem; line-height: 1.5; }
.type-center { grid-area: center; margin-top: 6px; font-size: .78rem; color: var(--card-accent, var(--primary)); font-weight: 600; letter-spacing: .04em; }
.c-gut { --card-accent: #B5482B; --card-soft: #F6E3D6; }
.c-heart { --card-accent: #C4832A; --card-soft: #F8EBD5; }
.c-head { --card-accent: #4F6E8A; --card-soft: #E3EAF1; }

/* type page */
.type-head { position: relative; }
.type-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--card-soft, var(--peach)); color: var(--card-accent, var(--primary)); font-weight: 600; font-size: .85rem; margin-bottom: var(--space-2); }
.type-head h1 small { display: block; font-size: 1rem; margin-top: 4px; }
.kv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); }
.kv h3 { font-size: .95rem; color: var(--primary); letter-spacing: .04em; margin-bottom: 6px; }
.kv p { margin: 0; }
.state-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.state-card { background: var(--surface); border-radius: var(--radius); padding: var(--space-3); border: 1px solid var(--line); }
.state-card h3 { font-size: 1rem; color: var(--primary); }
.state-card ul { margin: 0; padding-left: 1.2em; }
.state-card li { margin-bottom: 6px; color: var(--ink-2); }
.pager { display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; padding-block: var(--space-4); border-top: 1px solid var(--line); font-weight: 600; }

/* center cards (hub) */
.center-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.center-card { background: var(--surface); border-radius: var(--radius); padding: var(--space-3); border-top: 5px solid var(--card-accent, var(--primary)); box-shadow: var(--shadow-sm); }
.center-kicker { font-size: .82rem; color: var(--card-accent, var(--primary)); font-weight: 600; letter-spacing: .04em; }
.center-card h3 { margin-top: 6px; }
.center-card h3 small { margin-left: 8px; }
.center-card p { margin: 0; color: var(--ink-2); }

/* articles */
.article-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.article-card { display: flex; flex-direction: column; gap: 8px; padding: var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.article-meta .dot { margin-inline: 2px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); font-weight: 600; font-size: .78rem; }
.article-title { font-weight: 700; font-size: 1.12rem; line-height: 1.4; }
.article-summary { color: var(--ink-2); font-size: .95rem; }
.article { max-width: 760px; }
.article .page-head { max-width: none; }

/* prose */
.prose { max-width: 760px; font-size: 1.04rem; }
.prose h2 { margin-top: var(--space-5); padding-top: var(--space-1); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--space-4); }
.prose p { color: var(--ink); }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 8px; }
.check-list { list-style: none; padding-left: 0 !important; }
.check-list li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .42em; width: 18px; height: 18px; border-radius: 50%; background: var(--sage-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F7A61' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); background-size: 12px; background-position: center; background-repeat: no-repeat; }
.prompt-list { list-style: none; padding-left: 0 !important; counter-reset: q; }
.prompt-list li { counter-increment: q; position: relative; padding: 14px 18px 14px 56px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.prompt-list li::before { content: counter(q); position: absolute; left: 16px; top: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--peach); color: var(--primary); font-weight: 700; font-size: .9rem; }
.callout { background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: var(--space-3); margin-block: var(--space-4); }
.callout h3 { margin-bottom: 8px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.legal .prose h2 { font-size: 1.2rem; margin-top: var(--space-4); }
.refs { color: var(--ink-2); font-size: .95rem; }
blockquote.quote { margin: 0; padding: var(--space-4); text-align: center; font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); font-weight: 600; color: var(--primary); background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }

/* faq */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; position: relative; padding-right: 32px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.3rem; color: var(--primary); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: 12px; margin: 0; }

/* teaser + app */
.test-teaser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.test-teaser h2 { margin-bottom: 6px; }
.test-teaser p { margin: 0; color: var(--ink-2); max-width: 600px; }
.app-panel { display: grid; gap: var(--space-4); grid-template-columns: 1.2fr .8fr; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: var(--space-4); box-shadow: var(--shadow-sm); }
@media (max-width: 760px) { .app-panel { grid-template-columns: 1fr; } }
.feature-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 10px; }
.feature-list li { display: grid; gap: 2px; padding-left: 18px; border-left: 3px solid var(--peach); }
.feature-list span { color: var(--ink-2); font-size: .95rem; }
.app-panel-visual { display: grid; place-items: center; }
.phone { width: 210px; aspect-ratio: 9 / 18; border-radius: 32px; background: #2B2520; padding: 12px; box-shadow: var(--shadow); }
.phone-screen { height: 100%; border-radius: 22px; background: linear-gradient(180deg, #FFFBF4, #F6E3D6); padding: 22px 16px; display: flex; flex-direction: column; gap: 10px; }
.phone-brand { font-weight: 700; font-size: .9rem; color: var(--primary); letter-spacing: .06em; }
.phone-card { margin-top: 10px; font-weight: 700; font-size: .95rem; }
.phone-line { height: 8px; border-radius: 4px; background: rgba(43, 37, 32, .12); }
.phone-line.short { width: 60%; }
.phone-chip { margin-top: auto; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .78rem; font-weight: 600; }
.app-cta { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow-sm); }
@media (max-width: 600px) { .app-cta { grid-template-columns: 1fr; } .app-cta-qr { justify-self: start; } }
.app-cta h3 { margin-bottom: 6px; }
.app-cta p { color: var(--ink-2); }
.app-cta-qr img { width: 140px; height: 140px; border-radius: 12px; }
.qr-panel { display: grid; grid-template-columns: 1fr auto; gap: var(--space-4); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); }
@media (max-width: 600px) { .qr-panel { grid-template-columns: 1fr; } }
.persona-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.persona { background: var(--surface); border-radius: var(--radius); padding: var(--space-3); border: 1px solid var(--line); }
.persona-name { font-weight: 700; font-size: 1.1rem; }
.persona-style { margin-left: 8px; font-size: .85rem; color: var(--primary); font-weight: 600; }
.persona p { margin: 8px 0 0; color: var(--ink-2); }

/* crumbs */
.crumbs { padding-top: var(--space-3); font-size: .9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-2); }

/* quiz */
.quiz { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: var(--space-4); box-shadow: var(--shadow-sm); max-width: 760px; }
.quiz-progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.quiz-progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--primary)); transition: width .3s var(--ease); }
.quiz-counter { margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.quiz-item { border: 0; padding: 0; margin: var(--space-3) 0; }
.quiz-question { font-size: clamp(1.15rem, 1rem + .8vw, 1.45rem); font-weight: 700; line-height: 1.5; padding: 0; margin-bottom: var(--space-3); }
.likert { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); }
.likert button { min-height: 64px; padding: 10px 6px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); font: inherit; font-size: .9rem; line-height: 1.3; color: var(--ink-2); cursor: pointer; display: grid; gap: 4px; place-items: center; transition: background-color .15s, border-color .15s, transform .15s; }
.likert button strong { font-size: 1.15rem; color: var(--ink); }
.likert button:hover { border-color: var(--primary); background: #fff; }
.likert button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.likert button[aria-pressed="true"] strong { color: #fff; }
@media (max-width: 560px) { .likert { grid-template-columns: repeat(5, 1fr); gap: 6px; } .likert button { font-size: .72rem; padding: 8px 2px; } }
.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.quiz-hint { font-size: .85rem; color: var(--muted); }
.result-head { text-align: center; margin-bottom: var(--space-3); }
.result-type { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--peach); color: var(--primary); font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.result-bars { display: grid; gap: 8px; margin: var(--space-3) 0; }
.result-bar { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 10px; font-size: .92rem; }
.result-bar .bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.result-bar .bar span { display: block; height: 100%; background: var(--card-accent, var(--primary)); border-radius: 6px; }
.result-bar.is-top { font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.disclaimer { margin-top: var(--space-3); font-size: .9rem; color: var(--muted); max-width: 760px; }

/* footer */
.site-footer { margin-top: var(--space-6); background: #F3EBDF; border-top: 1px solid var(--line); padding-block: var(--space-5) var(--space-3); }
.footer-grid { display: grid; gap: var(--space-4); grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand { margin-bottom: 8px; }
.footer-slogan { font-weight: 600; margin-bottom: 6px; }
.footer-col h4 { margin-bottom: 10px; color: var(--ink-2); font-size: .9rem; letter-spacing: .06em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--ink-2); }
.footer-bottom { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); }
.footer-bottom p { margin-bottom: 6px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .type-card, .article-card, .likert button { transition: none; }
}
@media print { .site-header, .site-footer, .app-cta, .nav-cta { display: none; } }
