/* ============================================================
   SOMA-BN · 学术档案
   移动优先；无外部字体、无框架；总样式 < 20KB
   ============================================================ */

:root {
  --paper: #F6F3ED;
  --paper-2: #EFEAE0;
  --ink: #161513;
  --ink-2: #575249;
  --ink-3: #8A8479;
  --rule: #D9D3C7;
  --accent: #1F4A3C;
  --accent-ink: #F2F0E9;

  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;

  --maxw: 1120px;
  --pad: 20px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  text-decoration: none;
  font-size: .9rem;
  transition: top .2s var(--ease);
}
.skip:focus { top: 16px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(246, 243, 237, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217, 211, 199, .7);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark span { color: var(--accent); margin: 0 .1em; }
.wordmark--sm { font-size: 12px; letter-spacing: .18em; color: var(--ink-2); }

.langbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.langbtn:hover { border-color: var(--ink); color: var(--ink); }
html[data-lang="zh"] .langbtn__zh { color: var(--accent); font-weight: 700; }
html[data-lang="en"] .langbtn__en { color: var(--accent); font-weight: 700; }
.langbtn__sep { opacity: .4; }

/* ---------------- 首屏 ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 64px;
}

.hero__inner { position: relative; z-index: 2; }
.hero__copy { max-width: 700px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: .6;
}

.hero__title {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: .01em;
  max-width: 19ch;
}

.hero__lead {
  margin: 0 0 30px;
  max-width: 36em;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
}
.fact {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-2);
  margin-right: 18px;
}
.fact:last-child { margin-right: 0; }

.hero__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  width: 100%;
  max-width: 340px;
  padding: 0 28px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: .04em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn__arrow { transition: transform .18s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.hero__notice { margin: 0; font-size: .875rem; color: var(--ink-3); }

.graph {
  display: none;
  position: absolute;
  right: -70px;
  top: 50%;
  width: 620px;
  transform: translateY(-50%);
  opacity: .6;
  pointer-events: none;
}

.graph__edges path {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw 1.8s var(--ease) forwards;
}
.graph__edges path:nth-child(2) { animation-delay: .12s; }
.graph__edges path:nth-child(3) { animation-delay: .24s; }
.graph__edges path:nth-child(4) { animation-delay: .36s; }
.graph__edges path:nth-child(5) { animation-delay: .48s; }
.graph__edges path:nth-child(6) { animation-delay: .6s; }
.graph__nodes circle { opacity: 0; animation: fadein .9s var(--ease) .7s forwards; }
.graph__labels { opacity: 0; animation: fadein 1s var(--ease) .9s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* ---------------- 折叠栏目 ---------------- */
.sec { border-top: 1px solid var(--rule); }

.panel { margin: 0; }

.sec__summary {
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.sec__summary::-webkit-details-marker { display: none; }
.sec__summary::marker { content: ""; }

.sec__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--accent);
  padding-top: 4px;
}

.sec__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 5.2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
  transition: color .2s var(--ease);
}
.sec__summary:hover .sec__title { color: var(--accent); }

.sec__icon {
  position: relative;
  width: 16px;
  height: 16px;
  justify-self: end;
}
.sec__icon::before,
.sec__icon::after {
  content: "";
  position: absolute;
  background: var(--ink-2);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.sec__icon::before { left: 0; top: 7.5px; width: 16px; height: 1px; }
.sec__icon::after { left: 7.5px; top: 0; width: 1px; height: 16px; }
details[open] .sec__icon::after { transform: rotate(90deg); opacity: 0; }

.sec__body {
  padding: 0 0 48px 46px;
  max-width: 760px;
  animation: bodyin .28s var(--ease);
}
@keyframes bodyin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.sec__body p {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.85;
  color: #2C2A26;
}
.sec__body p:last-child { margin-bottom: 0; }

.lead {
  font-family: var(--serif);
  font-size: 1.15rem !important;
  line-height: 1.75 !important;
  color: var(--ink) !important;
  margin-bottom: 24px !important;
}

.points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.point h3 {
  margin: 0 0 6px;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.point h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  vertical-align: 2px;
  background: var(--accent);
}
.point p {
  margin: 0;
  font-size: .9375rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.subhead {
  margin: 36px 0 8px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-3);
}

/* 文档列表 */
.docs { border-top: 1px solid var(--rule); }

.doc {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  transition: color .18s var(--ease);
}
.doc:hover { color: var(--accent); }
.doc__name { font-size: .9375rem; line-height: 1.5; }
.doc__meta {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.docs__empty { margin: 0; padding: 20px 0; font-size: .9375rem; color: var(--ink-3); }

/* 时间线 */
.timeline {
  margin: 8px 0 0;
  padding: 0 0 0 4px;
  list-style: none;
  border-left: 1px solid var(--rule);
}
.tl-item { position: relative; padding: 0 0 32px 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 7px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
}
.tl-item.is-ongoing::before { background: var(--accent); border-color: var(--accent); }
.tl-item.is-done::before { background: var(--ink-3); border-color: var(--ink-3); }
.tl-item.is-planned::before { background: var(--paper); border-color: var(--rule); }

.tl-date {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.tl-title { margin: 0 0 4px; font-size: 1.0625rem; font-weight: 600; }
.tl-text { margin: 0 0 10px; font-size: .9375rem; line-height: 1.7; color: var(--ink-2); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.pill--now { border-color: var(--accent); color: var(--accent); background: rgba(31, 74, 60, .06); }
.tl-item.is-ongoing .pill { border-color: var(--accent); color: var(--accent); background: rgba(31, 74, 60, .06); }
.tl-item.is-done .pill { color: var(--ink-3); border-color: var(--rule); }
.tl-item.is-planned .pill { color: var(--ink-3); border-color: var(--rule); }

/* ---------------- 计数带 ---------------- */
.band { background: var(--accent); color: var(--accent-ink); }
.band__inner { padding-block: 56px; }

.band__title {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  color: rgba(242, 240, 233, .7);
}

.counter { display: flex; align-items: baseline; gap: 12px; }
.counter__num {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 18vw, 6.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.counter__unit { font-size: 1rem; opacity: .75; }
.counter__note { margin: 10px 0 0; font-size: .875rem; line-height: 1.6; opacity: .7; max-width: 34em; }

/* ---------------- 声明 ---------------- */
.privacy { display: grid; grid-template-columns: 1fr; gap: 28px; }
.privacy__block h3 {
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.privacy__block p { margin: 0; font-size: .9375rem; line-height: 1.75; color: var(--ink-2); }
.footnote {
  margin: 28px 0 0;
  font-size: .8125rem;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--rule); padding: 28px 0 44px; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__copy { font-size: .8125rem; color: var(--ink-3); }

/* ---------------- 语言门 ---------------- */
.gate {
  border: 0;
  padding: 0;
  background: transparent;
  width: calc(100% - 40px);
  max-width: 480px;
}
.gate::backdrop { background: rgba(22, 21, 19, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.gate__card { background: var(--paper); padding: 32px 24px; border-radius: 3px; }
.gate__title { margin: 0 0 10px; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.gate__desc { margin: 0 0 26px; font-size: .9375rem; line-height: 1.7; color: var(--ink-2); }
.gate__actions { display: grid; gap: 10px; }
.gate__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.gate__btn:hover { border-color: var(--ink); }
.gate__btn--primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.gate__btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.gate__note {
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .06em;
  opacity: .7;
}
.gate__foot { margin: 18px 0 0; font-size: .8125rem; color: var(--ink-3); }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translate(-50%, 12px);
  padding: 12px 18px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: .875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 英文排版微调 ---------------- */
html[data-lang="en"] .hero__title {
  font-size: clamp(1.55rem, 6.2vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: -.01em;
  max-width: 22ch;
}
html[data-lang="en"] .sec__title { letter-spacing: 0; }
html[data-lang="en"] .lead { line-height: 1.6 !important; }
html[data-lang="en"] .sec__body p { line-height: 1.7; }
html[data-lang="en"] .hero__lead { line-height: 1.7; }

/* ---------------- 断点 ---------------- */
@media (min-width: 560px) {
  .hero__actions { flex-direction: row; align-items: center; }
  .btn { width: auto; }
  .gate__actions { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  :root { --pad: 40px; }
  .topbar__inner { height: 68px; }
  .hero { padding: 104px 0 88px; }
  .hero__title { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.26; max-width: 24ch; }
  .hero__lead { font-size: 1.0625rem; }
  .sec__summary { grid-template-columns: 48px 1fr 18px; gap: 16px; padding: 30px 0; }
  .sec__body { padding-left: 64px; padding-bottom: 56px; }
  .points { grid-template-columns: 1fr 1fr; gap: 28px 40px; }
  .privacy { grid-template-columns: 1fr 1fr; gap: 32px 48px; }
  .band__inner { padding-block: 72px; }
  .gate__card { padding: 40px 36px; }
  html[data-lang="en"] .hero__title { font-size: clamp(1.7rem, 3.2vw, 2.6rem); max-width: 26ch; line-height: 1.16; }
}

@media (min-width: 1200px) {
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 56px;
    align-items: center;
  }
  .hero__copy { max-width: 620px; }
  .graph {
    display: block;
    position: static;
    width: 100%;
    max-width: 400px;
    justify-self: end;
    transform: none;
    opacity: 1;
  }
  .hero__title { font-size: 3.2rem; max-width: 19ch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .graph__edges path { stroke-dashoffset: 0; }
  .graph__nodes circle, .graph__labels { opacity: 1; }
}

@media print {
  .topbar, .graph, .gate, .toast, .skip { display: none !important; }
  .sec__body { display: block !important; }
}
