:root {
  color-scheme: dark;
  --felt: #101412;
  --felt-lift: #171c19;
  --ink: #f4ead8;
  --ink-soft: #cbbfaa;
  --muted: #8a8174;
  --foil: #c49a4a;
  --candle: #e8c989;
  --mana: #6aafd4;
  --line: rgba(196, 154, 74, 0.22);
  --line-strong: rgba(232, 201, 137, 0.4);
  --radius: 3px;
  --page-width: 980px;
  --top-nav-height: 72px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.article-page {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "SF Pro Text", "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 520px at 50% -12%, rgba(196, 154, 74, 0.14), transparent 58%),
    radial-gradient(circle at 50% 0, rgba(42, 64, 52, 0.35), transparent 42%),
    var(--felt);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}
body.article-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.12) 3px 4px);
  mix-blend-mode: multiply;
}
body.article-wide { --page-width: 1120px; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--mana);
  outline-offset: 3px;
}
.skip-link {
  position: fixed; z-index: 1000; left: 16px; top: 12px;
  padding: 10px 14px; border-radius: var(--radius);
  color: #15110d; background: var(--candle); text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 2px; pointer-events: none; background: transparent;
}
.read-progress > i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--foil), var(--candle));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .12s linear;
}
.top {
  position: sticky; top: 0; z-index: 20;
  overflow: visible;
  backdrop-filter: blur(18px) saturate(130%);
  background: rgba(16, 20, 18, 0.9);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1260px; margin: 0 auto;
  min-height: 68px; padding: 10px 28px;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); justify-self: start;
}
.logo-mark {
  width: 35px; height: 35px; display: block;
  border: 1px solid rgba(232, 201, 137, 0.5); border-radius: 3px;
  object-fit: cover; background: #1a1510;
}
.logo-copy { display: grid; gap: 1px; }
.logo-copy strong { font-family: Georgia, "Songti SC", "STSong", SimSun, serif; font-size: 19px; letter-spacing: .04em; }
.logo-copy small { color: var(--muted); font-size: 9px; letter-spacing: .2em; }
nav { display: flex; gap: 22px; justify-self: center; }
nav a, .auth {
  font: 600 14px/1 inherit; color: var(--ink-soft); text-decoration: none;
  padding: 10px 2px; position: relative;
}
nav a::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: 2px;
  height: 2px; background: var(--foil);
  transition: left .18s ease, right .18s ease;
}
nav a.active, nav a:hover { color: var(--ink); }
nav a.active::after, nav a:hover::after { left: 0; right: 0; }
nav a.active { color: var(--candle); }
nav a[hidden] { display: none !important; }
.auth {
  justify-self: end; border: 1px solid var(--line); color: var(--ink);
  background: rgba(255,255,255,.035); padding: 9px 14px; border-radius: var(--radius);
}
.auth:hover { border-color: var(--line-strong); }
.auth { display: none !important; }
.page { max-width: var(--page-width); margin: 0 auto; padding: 28px 28px 80px; }
.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.site-foot a { color: var(--accent, #d8a85c); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot strong { color: var(--ink-soft); font-weight: 600; }

.article-list { display: grid; gap: 0; }
.article {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  opacity: 0;
  transform: translateY(22px) rotate(-0.4deg);
  animation: deal .72s cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.article.is-lead {
  grid-template-columns: 360px minmax(0, 1fr);
  padding-top: 8px;
  padding-bottom: 32px;
}
.foil {
  display: block;
  width: 280px;
  height: 158px;
  perspective: 720px;
  transform-style: preserve-3d;
  transform-origin: center center;
}
.article.is-lead .foil { width: 360px; height: 202px; }
.article-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  border-radius: var(--radius);
  background: #14110d;
  border: 1px solid rgba(232, 201, 137, .38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 150, .12),
    0 10px 28px rgba(0, 0, 0, .38);
  transform-origin: center center;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.article:hover .article-cover,
.article:focus-visible .article-cover {
  border-color: var(--candle);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 150, .28),
    0 16px 36px rgba(0, 0, 0, .48);
}
.article-copy { min-width: 0; }
.article-title {
  margin: 0 0 10px;
  font-family: Georgia, "Songti SC", "STSong", SimSun, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.28;
  text-wrap: pretty;
  transition: color .2s ease;
}
.article.is-lead .article-title { font-size: 34px; letter-spacing: -.02em; }
.article:hover .article-title { color: var(--candle); }
.article-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article.is-lead .article-summary { font-size: 16px; -webkit-line-clamp: 4; }

.mast {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 6px 0 32px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  animation: deal .7s cubic-bezier(.16, 1, .3, 1) both;
}
.mast .foil { width: 320px; height: 180px; }
.mast-cover,
.mast .article-cover {
  width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 28%;
  border-radius: var(--radius); background: #14110d;
  border: 1px solid rgba(232, 201, 137, .38);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 150, .12), 0 12px 32px rgba(0,0,0,.4);
}
.mast h1 {
  font-family: Georgia, "Songti SC", "STSong", SimSun, serif;
  font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px;
  letter-spacing: -.03em; line-height: 1.15; text-wrap: pretty;
}
.lede { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.75; text-wrap: pretty; }
.body { max-width: 720px; }
.body h2, .entry h2 {
  font-family: Georgia, "Songti SC", "STSong", SimSun, serif;
  text-wrap: pretty;
}
.body h2 { margin: 28px 0 10px; font-size: 20px; font-weight: 700; scroll-margin-top: calc(var(--top-nav-height) + 12px); }
.body p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; line-height: 1.85; }
.body .chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0f0d;
}
.body .copy-btn {
  appearance: none; border: 1px solid rgba(106, 175, 212, .28);
  height: 36px; padding: 0 14px; margin: 0 0 18px;
  background: rgba(54, 104, 139, .18); color: #c5e4f5;
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  border-radius: var(--radius);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.body .copy-btn:hover { background: rgba(62, 135, 184, .32); border-color: rgba(106,175,212,.55); transform: translateY(-1px); }
.body .copy-btn.is-copied { color: #b6ebc8; border-color: rgba(125,206,160,.5); background: rgba(69,130,91,.18); transform: scale(1.03); }
.will-reveal {
  opacity: 0;
  transform: translateY(18px);
}
.will-reveal.reveal {
  animation: deal .64s cubic-bezier(.16, 1, .3, 1) forwards;
}
.status {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 30; padding: 8px 12px; border-radius: var(--radius);
  background: #171c19; border: 1px solid var(--line-strong);
  color: var(--ink-soft); font-size: 12px;
  transform: translateY(120%);
  transition: transform .2s ease;
}
.status.is-on { transform: translateY(0); }

@keyframes deal {
  to { opacity: 1; transform: none; }
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .32s;
}

@media (max-width: 820px) {
  .article, .article.is-lead, .mast { grid-template-columns: 1fr; gap: 14px; }
  .foil, .article.is-lead .foil, .mast .foil { width: 100%; height: 200px; }
  .article.is-lead .article-title { font-size: 26px; }
}
.plugin-kicker {
  margin: 8px 0 10px;
  color: var(--foil);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .28em;
}
.plugin-title {
  margin: 0 0 12px;
  font-family: Georgia, "Songti SC", "STSong", SimSun, serif;
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: -.03em;
  line-height: 1.12;
}
.plugin-lede {
  margin: 0 0 28px;
  max-width: 38em;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}
.plugin-slot {
  margin: 0 0 28px;
  padding: 6px 8px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(232, 201, 137, .08), rgba(16, 20, 18, .35)),
    #14110d;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, .12), 0 18px 40px rgba(0,0,0,.35);
}
.plugin-slot-label {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.plugin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin: 0 8px 8px;
  padding: 16px 16px 16px 18px;
  border: 1px solid var(--line);
  background: rgba(23, 28, 25, .88);
}
.plugin-row strong {
  display: block;
  font-size: 18px;
  letter-spacing: .02em;
}
.plugin-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.plugin-switch {
  width: 46px;
  height: 26px;
  border-radius: 99px;
  border: 1px solid rgba(196, 154, 74, .35);
  background: rgba(255,255,255,.06);
  position: relative;
}
.plugin-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbbfaa;
}
.plugin-download {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  margin: 0 0 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: rgba(232, 201, 137, .12);
  color: var(--ink);
  font: 700 14px/1 inherit;
}
.plugin-download:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.plugin-facts {
  display: grid;
  gap: 14px;
  max-width: 40em;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.plugin-facts li {
  padding-left: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}
.plugin-facts b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
}

@media (max-width: 720px) {
  .top-inner { grid-template-columns: 1fr auto; padding-inline: 18px; }
  nav { order: 3; grid-column: 1 / -1; justify-content: center; gap: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
  .page { padding: 16px 16px 64px; }
  .foil, .article.is-lead .foil, .mast .foil { height: 168px; }
  .article-title { font-size: 18px; }
  .article.is-lead .article-title { font-size: 22px; }
  .site-foot { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .article, .mast, .will-reveal, .will-reveal.reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .body .copy-btn, .article-cover, .status, nav a::after { transition: none; }
  .read-progress > i { transition: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
