/* ==========================================================================
   Follow Your Tension — Continuing Education
   Design system. Plain CSS, no build step.
   ========================================================================== */

:root {
  --bg:           #FBF9F6;
  --surface:      #FFFFFF;
  --surface-alt:  #F4F1EC;
  --ink:          #1A1917;
  --body:         #3D3A35;
  --muted:        #6B6660;
  --faint:        #9C9690;
  --line:         #E4DFD8;
  --line-strong:  #CFC8BE;
  --accent:       #1E5A4C;
  --accent-ink:   #164237;
  --accent-soft:  #EDF4F1;
  --warn-soft:    #FBF3E9;
  --warn-line:    #E8D9C3;
  --warn-ink:     #7A5526;

  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", "Songti SC", "SimSun", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
                "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius:  10px;
  --radius-sm: 6px;
  --max:     1080px;
  --max-text: 720px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: 2.6rem; }
h2 { font-size: 1.75rem; margin-top: 2.4em; }
h3 { font-size: 1.2rem; margin-top: 2em; }
h4 { font-size: 1.02rem; font-family: var(--font-sans); font-weight: 600; }

p { margin: 0 0 1.1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.35em; }
li { margin-bottom: 0.45em; }

code, .mono { font-family: var(--font-mono); font-size: 0.88em; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.9em;
}
.lede { font-size: 1.14rem; color: var(--body); line-height: 1.72; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.tiny { font-size: 0.82rem; color: var(--faint); }

/* ---------- Layout ---------- */

.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: var(--max-text); }
section { padding: 62px 0; }
section.tight { padding: 40px 0; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 249, 246, 0.94);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(150%) blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 68px;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.12rem; color: var(--ink);
  letter-spacing: -0.01em; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--faint); font-size: 0.82rem; display: block; letter-spacing: 0.02em; }

.nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.nav a { color: var(--body); font-size: 0.93rem; }
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.active { color: var(--accent); font-weight: 600; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-sm { padding: 9px 16px; font-size: 0.88rem; }

/* ---------- Hero ---------- */

.hero { padding: 78px 0 58px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 3.05rem; margin-bottom: 0.5em; }
.hero .lede { max-width: 660px; }
.hero-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 22px; font-size: 0.88rem; color: var(--muted); }

/* ---------- Cards ---------- */

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3, .card h4 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .num {
  font-family: var(--font-serif);
  font-size: 0.85rem; color: var(--accent);
  display: block; margin-bottom: 10px; letter-spacing: 0.06em;
}

.card-accent { background: var(--accent-soft); border-color: #CFE3DC; }
.card-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.card-warn h3, .card-warn h4 { color: var(--warn-ink); }

/* ---------- Clinical chain ---------- */

.chain { list-style: none; padding: 0; margin: 26px 0; counter-reset: chain; }
.chain li {
  position: relative; padding: 12px 0 12px 52px; margin: 0;
  border-bottom: 1px dashed var(--line);
  counter-increment: chain;
}
.chain li:last-child { border-bottom: 0; }
.chain li::before {
  content: counter(chain);
  position: absolute; left: 0; top: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.84rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
}
.chain li strong { display: block; color: var(--ink); }
.chain li span { font-size: 0.92rem; color: var(--muted); }

/* ---------- Definition list ---------- */

.defs { border-top: 1px solid var(--line); margin: 26px 0; }
.defs .def { border-bottom: 1px solid var(--line); padding: 22px 0; }
.defs .def h3 { margin: 0 0 4px; font-size: 1.14rem; }
.defs .def .term-zh {
  font-family: "Songti SC", "SimSun", var(--font-serif);
  color: var(--faint); font-size: 0.92rem; margin-left: 8px;
}
.defs .def p { margin: 0.5em 0 0; }
.defs .def .boundary {
  margin-top: 10px; font-size: 0.88rem; color: var(--muted);
  border-left: 2px solid var(--line-strong); padding-left: 12px;
}

/* ---------- Forms ---------- */

.form { max-width: 560px; }
.field { margin-bottom: 20px; }
.field label {
  display: block; font-size: 0.9rem; font-weight: 600;
  color: var(--ink); margin-bottom: 7px;
}
.field .hint { font-weight: 400; color: var(--faint); font-size: 0.84rem; }
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%; padding: 11px 13px;
  font-family: inherit; font-size: 0.97rem; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 110px; resize: vertical; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.checkbox input { margin-top: 5px; flex: 0 0 auto; }

.hp { position: absolute; left: -9999px; }   /* honeypot */

.form-msg { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.93rem; display: none; }
.form-msg.ok  { display: block; background: var(--accent-soft); border: 1px solid #CFE3DC; color: var(--accent-ink); }
.form-msg.err { display: block; background: #FBECEA; border: 1px solid #EBC9C4; color: #8A2F22; }

/* ---------- Chinese gate ---------- */

.gate { max-width: 460px; margin: 0 auto; text-align: center; }
.gate h1 { font-size: 2rem; }
.gate-code {
  font-family: var(--font-mono); font-size: 1.25rem; letter-spacing: 0.28em;
  text-align: center; text-transform: none;
}
.gate-code::placeholder {
  font-family: var(--font-sans); font-size: 0.95rem;
  letter-spacing: normal; color: var(--faint);
}
.gated { display: none; }
.gated.unlocked { display: block; }

/* ---------- Invitation popup ---------- */

.opt { font-weight: 400; color: var(--faint); font-size: 0.86em; }

.modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
}
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(26, 25, 23, 0.5); }
.modal-panel {
  position: relative; width: 100%; max-width: 430px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px 30px 30px;
  text-align: center; box-shadow: 0 22px 60px rgba(26, 25, 23, 0.26);
  max-height: calc(100vh - 44px); overflow-y: auto;
}
.modal-panel h2 { font-size: 1.6rem; margin: 0 0 0.5em; }
.modal-panel .form { max-width: none; }
.modal-close {
  position: absolute; top: 6px; right: 8px; width: 34px; height: 34px;
  border: 0; background: none; color: var(--faint);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--surface-alt); color: var(--ink); }
body.modal-open { overflow: hidden; }

/* ---------- Notice ---------- */

.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px; margin: 24px 0; font-size: 0.94rem;
}
.notice p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 56px; margin-top: 40px;
  font-size: 0.9rem; color: var(--muted);
}
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-note { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--faint); max-width: 780px; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  h1 { font-size: 2.1rem; }
  .hero { padding: 52px 0 44px; }
  .hero h1 { font-size: 2.3rem; }
  section { padding: 46px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .site-header .container { min-height: auto; padding-top: 14px; padding-bottom: 14px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .nav { gap: 16px; }
}
