:root {
  color-scheme: dark;
  --bg: #080808;
  --surface: #0c0c0c;
  --surface-soft: #101010;
  --text: #d9d5cd;
  --text-soft: #a19d95;
  --muted: #77746e;
  --faint: #3a3936;
  --line: rgba(217, 213, 205, 0.14);
  --line-strong: rgba(217, 213, 205, 0.34);
  --accent: #c8b99f;
  --max: 1320px;
  --pad: clamp(24px, 4.4vw, 72px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: opacity 0.36s ease, transform 0.36s ease;
}

body.is-leaving {
  opacity: 0;
  transform: translateY(-10px);
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--text); color: var(--bg); }

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.site-header,
main,
footer {
  width: min(100%, var(--max));
  margin-inline: auto;
}

.site-header {
  height: 86px;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.migration-notice {
  position: absolute;
  top: clamp(74px, 10vh, 112px);
  right: var(--pad);
  z-index: 2;
  width: min(300px, 31vw);
  padding: 15px 34px 0 0;
  border-top: 1px solid var(--line-strong);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.migration-notice p { margin: 0; }

.migration-notice-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.migration-notice-close {
  position: absolute;
  top: 7px;
  right: -9px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  opacity: 0.55;
  transition: color 180ms ease, opacity 180ms ease;
}

.migration-notice-close:hover,
.migration-notice-close:focus-visible {
  color: var(--text);
  opacity: 1;
}

.migration-notice[hidden] { display: none; }

.migration-notice a {
  color: var(--accent);
  white-space: nowrap;
}

.migration-notice a:hover,
.migration-notice a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-migration-screen {
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  display: grid;
  min-height: calc(100svh - 86px);
  width: 100%;
  position: relative;
  z-index: 1;
}

.migration-screen-inner {
  align-items: end;
  display: grid;
  gap: clamp(28px, 8vw, 140px);
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 auto;
  max-width: var(--max);
  padding: clamp(56px, 10vh, 120px) var(--pad) clamp(42px, 8vh, 92px);
  width: 100%;
}

.migration-copy {
  max-width: 660px;
}

.migration-kicker {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.site-migration-screen h1 {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

.site-migration-screen h1 span {
  color: var(--text-soft);
}

.migration-domains {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(14px, 1.6vw, 18px);
  gap: 10px 16px;
  margin: 24px 0 0;
}

.migration-domains a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
}

.migration-domains a:hover,
.migration-domains a:focus-visible {
  text-decoration: underline;
}

.migration-domains span {
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8em;
}

.migration-deadline {
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin: 18px 0 0;
}

.migration-action-wrap {
  flex: 0 0 auto;
  max-width: 260px;
}

.migration-action {
  align-items: center;
  border: 1px solid var(--line-strong);
  color: var(--text);
  display: inline-flex;
  font-size: 14px;
  gap: 16px;
  justify-content: space-between;
  min-width: 220px;
  padding: 13px 16px;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.migration-action:hover,
.migration-action:focus-visible {
  background: var(--surface-soft);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.migration-blog-link {
  align-items: center;
  color: var(--text-soft);
  display: inline-flex;
  font-size: 13px;
  gap: 12px;
  margin-top: 22px;
  text-decoration: none;
  transition: color 180ms ease;
}

.migration-blog-link:hover,
.migration-blog-link:focus-visible {
  color: var(--text);
}

.migration-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0 0;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  letter-spacing: 0.08em;
}

.identity-mark {
  width: 7px;
  height: 7px;
  border: 1px solid var(--text);
  border-radius: 50%;
}

.site-header nav {
  display: flex;
  gap: 32px;
  color: var(--muted);
}

.site-header nav a,
footer a,
.article-back {
  transition: color 0.25s ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
footer a:hover,
footer a:focus-visible,
.article-back:hover,
.article-back:focus-visible {
  color: var(--text);
}

.time {
  margin: 0;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.timezone {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.hero {
  position: relative;
  min-height: min(820px, calc(100svh - 86px));
  padding: clamp(76px, 11vh, 132px) var(--pad) 56px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 32px 0 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(54px, 8vw, 112px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.hero-footer {
  margin-top: auto;
  padding-top: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.hero-footer p {
  max-width: 430px;
  margin: 0;
  color: var(--text-soft);
}

.down-link {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
}

.down-link span { transition: transform 0.3s ease; }
.down-link:hover span { transform: translateY(5px); }

.orbit {
  position: absolute;
  top: 19%;
  right: 5%;
  width: clamp(250px, 31vw, 470px);
  aspect-ratio: 1;
  opacity: 0.28;
  pointer-events: none;
}

.orbit-line {
  position: absolute;
  inset: 0;
  border: 1px solid var(--faint);
  border-radius: 50%;
  transform: rotate(-22deg) scaleY(0.4);
}

.orbit-dot {
  position: absolute;
  top: 47%;
  left: 5%;
  width: 5px;
  height: 5px;
  background: var(--text);
  border-radius: 50%;
  box-shadow: 0 0 22px 5px rgba(217, 213, 205, 0.12);
  animation: breathe 5s ease-in-out infinite;
}

.notes,
.about {
  padding: clamp(110px, 15vw, 210px) var(--pad);
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(240px, 1.05fr) 1fr;
  align-items: baseline;
  gap: 40px;
  margin-bottom: 72px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.section-heading > p:last-child {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.note-list { border-top: 1px solid var(--line); }

.note-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) 2fr 32px;
  gap: 28px;
  align-items: start;
  padding: 42px 0 46px;
  border-bottom: 1px solid var(--line);
  outline: none;
  transition: border-color 0.35s ease;
}

.note-card:hover,
.note-card:focus-visible {
  border-color: var(--line-strong);
}

.note-card:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 12px;
}

.note-meta,
.article-meta {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.note-body h3 {
  margin: -7px 0 12px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(24px, 2.3vw, 34px);
  font-weight: 400;
  letter-spacing: -0.035em;
  transition: color 0.35s ease;
}

.note-body p {
  max-width: 690px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #85827d;
  line-height: 1.75;
  text-overflow: ellipsis;
}

.note-card:hover .note-body h3,
.note-card:focus-visible .note-body h3 {
  color: var(--accent);
}

.note-arrow {
  justify-self: end;
  color: var(--muted);
  opacity: 0.75;
  transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.note-card:hover .note-arrow,
.note-card:focus-visible .note-arrow {
  color: var(--text);
  opacity: 1;
  transform: translate(3px, -3px);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.08fr 1.2fr;
  gap: clamp(50px, 11vw, 160px);
}

.about-lead {
  max-width: 560px;
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.3;
  letter-spacing: -0.04em;
}

.qa-panel { min-width: 0; }

.question-form {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.question-label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.question-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.question-input {
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.7;
}

.question-input::placeholder { color: var(--faint); }

.question-input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.question-input.is-erasing {
  color: var(--muted);
}

.question-submit {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.question-submit:hover,
.question-submit:focus-visible {
  border-color: var(--line-strong);
  color: var(--text);
}

.question-submit:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}

.question-submit:disabled {
  cursor: wait;
  opacity: 0.45;
}

.question-status {
  display: grid;
  gap: 4px;
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.question-echo { color: var(--text-soft); }

.qa-card {
  min-height: 360px;
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid var(--line);
  background: rgba(217, 213, 205, 0.018);
}

.qa-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.qa-label,
.qa-answer-label {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.16em;
}

.qa-question {
  max-width: 390px;
  margin: 58px 0 42px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.28;
}

.qa-answer-label { margin-bottom: 12px; }

.qa-answer {
  max-width: 560px;
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.9;
  white-space: pre-line;
}

.qa-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.qa-button {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.qa-button:hover,
.qa-button:focus-visible {
  color: var(--text);
}

.qa-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 7px;
}

.qa-progress {
  justify-self: center;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

footer {
  padding: 36px var(--pad) 54px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer p { margin: 0; }
.footer-note { text-align: center; }

.footer-middle {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.footer-contact {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.footer-contact a { transition: color 0.25s ease; }
.footer-contact a:hover,
.footer-contact a:focus-visible { color: var(--text); }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero h1.reveal { animation-delay: 0.12s; }
.hero-footer.reveal { animation-delay: 0.25s; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.is-visible { opacity: 1; transform: none; }

.article-main {
  padding: clamp(76px, 10vw, 142px) var(--pad) 160px;
}

.article-shell { max-width: 860px; margin: 0 auto; }

.article-back {
  display: inline-flex;
  margin-bottom: clamp(72px, 10vw, 132px);
  color: var(--muted);
  font-size: 14px;
}

.article-back-bottom {
  margin-top: 56px;
  margin-bottom: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.article-back-bottom:hover,
.article-back-bottom:focus-visible {
  border-color: var(--line-strong);
}

.article-header { max-width: 820px; }

.article-meta {
  flex-direction: row;
  gap: 20px;
  margin-bottom: 28px;
}

.reading-time { color: var(--text-soft); }

.article-header h1 {
  max-width: 800px;
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.article-intro {
  max-width: 650px;
  margin: 34px 0 0;
  color: var(--text-soft);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.85;
}

.article-divider {
  margin: 76px 0 70px;
  border-top: 1px solid var(--line);
}

.article-body {
  max-width: 680px;
  margin-inline: auto;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
}

.article-body p {
  margin: 0 0 30px;
  color: #b4b0a8;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 2.05;
}

.article-body .latin-run {
  font-family: "Times New Roman", Times, serif;
}

.article-page .article-main {
  animation: article-arrive 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.article-empty { color: var(--muted); }

@keyframes enter { to { opacity: 1; transform: none; } }
@keyframes article-arrive {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes breathe { 50% { opacity: 0.35; transform: scale(0.7); } }

@media (max-width: 820px) {
  .section-heading,
  .about-grid { grid-template-columns: 1fr; }
  .section-heading { gap: 18px; margin-bottom: 50px; }
  .qa-card { min-height: 320px; }
}

@media (max-width: 760px) {
  .site-migration-screen {
    min-height: calc(100svh - 76px);
  }

  .migration-screen-inner {
    align-items: start;
    gap: 28px;
    grid-template-columns: 1fr;
    padding-bottom: 34px;
    padding-top: 56px;
  }

  .migration-action-wrap {
    max-width: none;
    width: 100%;
  }

  .migration-action {
    width: 100%;
  }

  .migration-blog-link {
    margin-top: 20px;
  }

  .site-header {
    height: 76px;
    grid-template-columns: 1fr auto;
  }

  .site-header nav { display: none; }

  .migration-notice {
    top: 28px;
    right: 20px;
    width: min(218px, 62vw);
    padding-top: 11px;
    font-size: 11px;
    line-height: 1.65;
  }

  .hero {
    min-height: calc(100svh - 76px);
    padding-top: 82px;
  }

  .hero h1 {
    font-size: clamp(50px, 15vw, 78px);
    line-height: 1.12;
  }

  .orbit {
    top: 34%;
    right: -95px;
    width: 290px;
  }

  .hero-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .note-card {
    grid-template-columns: 1fr 22px;
    gap: 24px 12px;
    padding-block: 32px;
  }

  .note-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 18px;
  }

  .note-body h3 { font-size: 26px; }

  .qa-card { min-height: 0; padding: 26px; }
  .qa-topline { align-items: flex-start; gap: 18px; }
  .qa-question { margin-block: 42px 30px; font-size: 30px; }
  .qa-controls { gap: 12px; }
  .question-form-row { grid-template-columns: 1fr; }
  .question-submit { justify-self: start; }

  footer { grid-template-columns: 1fr auto; }
  .footer-middle { justify-items: start; text-align: left; }
  .footer-note { display: none; }

  .article-main { padding-top: 58px; padding-bottom: 100px; }
  .article-back { margin-bottom: 78px; }
  .article-back-bottom { margin-top: 42px; }
  .article-divider { margin-block: 56px 52px; }
  .article-body p { line-height: 1.95; }
}

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