:root {
  --ink: #10233f;
  --ink-soft: #34445d;
  --paper: #f7f5ef;
  --paper-deep: #ece8de;
  --gold: #d79432;
  --gold-light: #efb75f;
  --line: #d8d4ca;
  --white: #fffefb;
  --shadow: 0 22px 60px rgba(16, 35, 63, 0.11);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.55rem 0.8rem;
  background: var(--white);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid rgba(16, 35, 63, 0.08);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 0.6rem 0.6rem 0.6rem 0.15rem;
  font-size: 0.95rem;
}

nav { display: flex; gap: 2rem; }

nav a,
.footer-main a {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible,
.footer-main a:hover,
.footer-main a:focus-visible { color: var(--gold); }

.hero {
  position: relative;
  overflow: hidden;
  padding: 8rem 0 7rem;
  background:
    linear-gradient(90deg, rgba(16, 35, 63, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(rgba(16, 35, 63, 0.045) 1px, transparent 1px) 0 0 / 72px 72px;
}

.hero::after {
  content: "拾";
  position: absolute;
  right: -2rem;
  bottom: -10rem;
  color: rgba(16, 35, 63, 0.035);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(19rem, 40vw, 34rem);
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow { display: flex; align-items: center; gap: 0.65rem; }

.eyebrow span { width: 2rem; height: 2px; background: var(--gold); }

h1,
h2,
h3 { font-family: "Noto Serif SC", "Songti SC", serif; }

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.7rem, 6vw, 5.3rem);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.intro {
  max-width: 660px;
  margin: 2rem 0 1.8rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.text-link {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35rem;
}

.code-card {
  transform: rotate(1.2deg);
  overflow: hidden;
  color: #eaf0f8;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-bar span { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #e66b59; }
.code-bar span:nth-child(2) { background: #e4b449; }
.code-bar span:nth-child(3) { background: #55b979; }
.code-bar b { margin-left: auto; color: #9eaabd; font: 500 0.72rem ui-monospace, monospace; }

pre {
  margin: 0;
  padding: 1.8rem;
  font: 500 0.92rem/1.9 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

.code-dim { color: #8795aa; }
.code-key { color: var(--gold-light); }

.section { padding: 7rem 0; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.section-heading h2,
.about h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.2; }
.section-heading > p { max-width: 24rem; margin: 0 0 0.35rem; color: var(--ink-soft); }

.article-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.article-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 1.7rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.article-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(16, 35, 63, 0.08); }
.article-card.featured { color: var(--white); background: var(--ink); border-color: var(--ink); }

.article-meta { display: flex; justify-content: space-between; gap: 1rem; color: #66758a; font-size: 0.78rem; font-weight: 700; }
.featured .article-meta { color: #aab6c7; }
.article-meta span { color: var(--gold); }
.article-card h3 { margin: 2rem 0 1rem; font-size: 1.45rem; line-height: 1.45; }
.article-card > p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.featured > p { color: #c5cedb; }

.tags { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 1.5rem; }
.tags span { padding: 0.25rem 0.6rem; border: 1px solid var(--line); border-radius: 99px; font-size: 0.72rem; }
.featured .tags span { border-color: rgba(255, 255, 255, 0.18); }

.about { background: var(--paper-deep); border-block: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 5rem; }
.about-copy { max-width: 690px; color: var(--ink-soft); font-size: 1.05rem; }
.about-copy p { margin: 0 0 1.3rem; }

.site-footer { background: var(--ink); color: var(--white); }
.footer-main { min-height: 180px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.footer-main strong { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 1.4rem; }
.footer-main p { margin: 0.3rem 0 0; color: #aeb8c7; font-size: 0.88rem; }
.filing { padding: 1rem 1.5rem; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.filing a { color: #cbd4e1; font-size: 0.88rem; text-decoration: none; }
.filing a:hover,
.filing a:focus-visible { color: var(--gold-light); text-decoration: underline; }

:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 4px; }

@media (max-width: 820px) {
  .shell { width: min(100% - 32px, 680px); }
  .hero { padding: 5rem 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .code-card { max-width: 520px; transform: none; }
  .article-list { grid-template-columns: 1fr; }
  .article-card { min-height: 260px; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 520px) {
  .header-inner { min-height: 66px; }
  nav { gap: 1rem; }
  .hero { padding: 4rem 0; }
  h1 { font-size: 2.55rem; }
  .section { padding: 5rem 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 1rem; }
  .footer-main { align-items: flex-start; flex-direction: column; justify-content: center; }
}

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