:root {
  --page: #202521;
  --panel: #213d30;
  --panel-raised: #214e3a;
  --text: #f4e9d1;
  --muted: #ccd9c0;
  --border: rgba(244, 233, 209, 0.1);
  --border-strong: rgba(244, 233, 209, 0.18);
  --accent: #e06b3c;
  --accent-hover: #c9572b;
  --accent-strong: #e8835c;
  --link: #e8835c;
  --focus: #e8835c;
  --radius: 10px;
  --radius-lg: 16px;
  --cta-bg: #c1512c;
  --cta-hover: #a8442a;
  --cta-text: #ffffff;
  color-scheme: dark;
}
html[data-theme="light"] {
  --page: #f4e9d1;
  --panel: #f6f0e2;
  --panel-raised: #dcddc8;
  --text: #202521;
  --muted: #4c5a50;
  --border: rgba(32, 37, 33, 0.12);
  --border-strong: rgba(32, 37, 33, 0.2);
  --accent: #d95f2f;
  --accent-hover: #c9572b;
  --accent-strong: #1f4a37;
  --link: #1f4a37;
  --focus: #1f4a37;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--page); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--cta-bg); color: var(--cta-text); padding: 8px 16px; border-radius: 0 0 var(--radius) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); color: var(--text);
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--accent-strong); color: var(--accent-strong); }
.btn-primary { background: var(--cta-bg); border-color: var(--cta-bg); color: var(--cta-text); }
.btn-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: var(--cta-text); }
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--panel); border-bottom: 1px solid var(--border-strong);
}
.site-header-inner {
  max-width: 1232px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 20px;
}
.site-header-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--text); white-space: nowrap;
}
.site-header-brand:hover { text-decoration: none; color: var(--accent-strong); }
.site-header-logo img { display: block; width: 40px; height: 40px; border-radius: 8px; }
.site-header-navigation { margin-left: auto; }
.site-header-navigation ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-header-navigation a {
  display: inline-block; padding: 8px 12px; border-radius: var(--radius);
  color: var(--text); font-size: 14px;
}
.site-header-navigation a:hover { background: var(--panel-raised); text-decoration: none; }
.site-header-controls { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.lang-switch a { padding: 6px 10px; font-size: 13px; color: var(--muted); }
.lang-switch a[aria-current="page"] { background: var(--panel-raised); color: var(--text); font-weight: 600; }
.lang-switch a:hover { text-decoration: none; color: var(--text); }
.theme-toggle {
  border: 1px solid var(--border-strong); background: transparent; color: var(--muted);
  border-radius: var(--radius); padding: 6px 10px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent-strong); }

.site-frame-grid {
  max-width: 1232px; margin: 0 auto; padding: 32px 24px 64px;
  display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 32px;
}
.site-main { min-width: 0; }
.site-sidebar { min-width: 0; }
.wiki-sidebar { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; padding-right: 4px; }
.wiki-sidebar-group { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--panel); }
.wiki-sidebar-group summary {
  list-style: none; cursor: pointer; padding: 10px 12px;
  font-weight: 600; font-size: 14px; border-radius: var(--radius); color: var(--text);
}
.wiki-sidebar-group summary::-webkit-details-marker { display: none; }
.wiki-sidebar-group summary::before { content: "+ "; color: var(--accent-strong); font-weight: 700; }
.wiki-sidebar-group[open] summary::before { content: "\2212  "; }
.wiki-sidebar-group summary:hover { background: var(--panel-raised); }
.wiki-sidebar-group ul { list-style: none; margin: 0; padding: 4px 6px 10px; }
.wiki-sidebar-item {
  display: block; padding: 7px 10px 7px 26px; border-radius: 8px;
  font-size: 14px; color: var(--muted);
}
.wiki-sidebar-item:hover { background: var(--panel-raised); color: var(--text); text-decoration: none; }
.wiki-sidebar-item.is-active { background: var(--panel-raised); color: var(--text); font-weight: 600; }
.wiki-sidebar-redemption { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-top: 16px; }
.wiki-sidebar-redemption h2 { margin: 0 0 6px; font-size: 14px; }
.wiki-sidebar-redemption-value { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: var(--accent-strong); }
.wiki-sidebar-redemption p { margin: 0; font-size: 13px; color: var(--muted); }
.article-page, .home-page { max-width: 880px; }
.article-header h1 { margin: 0 0 8px; font-size: 36px; line-height: 1.2; letter-spacing: -0.01em; }
.article-meta { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.article-hero { margin: 16px 0 24px; }
.article-hero img { display: block; width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.article-body { max-width: 72ch; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body h2 { margin: 1.8em 0 0.6em; font-size: 26px; line-height: 1.25; }
.article-body h3 { margin: 1.6em 0 0.5em; font-size: 19px; line-height: 1.3; }
.article-body p { margin: 0 0 1em; }
.article-body ul, .article-body ol { margin: 0 0 1em; padding-left: 1.5em; }
.article-body li { margin-bottom: 0.4em; }
.article-body strong { color: var(--text); }
.article-body blockquote {
  margin: 1.2em 0; padding: 12px 16px;
  background: var(--panel); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--text);
}
.article-body blockquote p { margin: 0.4em 0; }
.article-body blockquote p:first-child { margin-top: 0; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body blockquote a { word-break: break-word; overflow-wrap: anywhere; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--border-strong); padding: 8px 12px; text-align: left; vertical-align: top; }
.article-body th { background: var(--panel); font-weight: 600; white-space: nowrap; }
.article-body code { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-body img { border-radius: var(--radius); }
.article-related { margin-top: 48px; }
.article-related h2 { font-size: 22px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.link-card, .category-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.link-card h3, .category-card h3 { margin: 0; font-size: 17px; }
.link-card p, .category-card p { margin: 0; font-size: 14px; color: var(--muted); flex: 1; }
.link-card a { font-size: 14px; font-weight: 600; color: var(--accent-strong); }
.home-page { max-width: 960px; }
.home-hero-header { margin-bottom: 16px; }
.home-wiki-badge {
  display: inline-block; margin: 0 0 10px; padding: 4px 12px;
  background: var(--panel-raised); border: 1px solid var(--border-strong);
  border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.home-hero-header h1 { margin: 0; font-size: 40px; line-height: 1.15; letter-spacing: -0.01em; }
.home-trailer-hero { position: relative; margin: 0 0 20px; }
.home-trailer-hero img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: var(--panel);
}
.home-trailer-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--cta-bg); color: var(--cta-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 120ms ease;
}
.home-trailer-play:hover { transform: translate(-50%, -50%) scale(1.06); text-decoration: none; }
.home-summary { font-size: 18px; max-width: 70ch; overflow-wrap: anywhere; }
.home-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin: 20px 0 24px;
}
.home-fact { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.home-fact dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.home-fact dd { margin: 0; font-size: 15px; font-weight: 600; }
.home-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.home-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px; }
.home-overview-grid h2 { font-size: 22px; margin: 0 0 12px; }
.home-overview-grid ul, .home-overview-grid ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.home-overview-grid ol { counter-reset: step; }
.home-overview-grid ol > li { counter-increment: step; position: relative; padding-left: 36px; }
.home-overview-grid ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--cta-bg); color: var(--cta-text);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.home-overview-grid li { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.home-overview-grid h3 { margin: 0 0 4px; font-size: 16px; }
.home-overview-grid p { margin: 0; font-size: 14px; color: var(--muted); }
.home-popular, .home-redemption, .home-categories, .home-faq { margin-bottom: 48px; }
.home-popular h2, .home-redemption h2, .home-categories h2, .home-faq h2 { font-size: 24px; margin: 0 0 16px; }
.home-mdx-content { margin-bottom: 48px; }
.home-redemption { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; }
.home-redemption-value { font-size: 22px; font-weight: 700; color: var(--accent-strong); margin: 0 0 6px; }
.home-redemption p { margin: 0; color: var(--muted); }
.home-faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); margin-bottom: 8px; }
.home-faq summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 15px; }
.home-faq summary:hover { color: var(--accent-strong); }
.home-faq details p { margin: 0; padding: 0 16px 12px; color: var(--muted); font-size: 15px; }
.home-closing-cta { background: var(--panel-raised); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 24px 28px; }
.home-closing-cta h2 { margin: 0 0 8px; font-size: 24px; }
.home-closing-cta p { margin: 0 0 16px; color: var(--muted); max-width: 60ch; }
.home-closing-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.site-footer { border-top: 1px solid var(--border-strong); background: var(--panel); margin-top: 24px; }
.site-footer-disclaimer {
  max-width: 1232px; margin: 0 auto; padding: 12px 24px 0;
  font-size: 13px; color: var(--muted); overflow-wrap: anywhere;
}
.site-footer-content {
  max-width: 1232px; margin: 0 auto; padding: 20px 24px 40px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.site-footer-brand { display: flex; align-items: center; gap: 14px; }
.site-footer-brand p { margin: 0; font-weight: 700; font-size: 15px; }
.site-footer-logo img { display: block; width: 56px; height: 56px; border-radius: 12px; }
.site-footer nav ul { display: flex; gap: 4px 18px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer nav a, .site-footer nav span { font-size: 14px; color: var(--muted); }
.site-footer nav a:hover { color: var(--accent-strong); }
.nf-page { padding-top: 32px; }
.nf-page h1 { font-size: 36px; }
@media (max-width: 1024px) {
  .site-frame-grid { grid-template-columns: minmax(0, 1fr) 232px; gap: 24px; }
}
@media (max-width: 960px) {
  .site-header-navigation { display: none; }
  .site-frame-grid { grid-template-columns: minmax(0, 1fr); padding: 24px 16px 48px; }
  .wiki-sidebar { position: static; max-height: none; overflow: visible; }
  .site-main { order: 1; }
  .site-sidebar { order: 2; }
  .home-overview-grid { grid-template-columns: 1fr; }
  .article-hero-header h1, .home-hero-header h1 { font-size: 30px; }
  .article-header h1 { font-size: 28px; }
  .article-body h2 { font-size: 23px; }
}
@media (max-width: 640px) {
  .site-header-inner { padding: 8px 16px; gap: 10px; }
  .site-header-brand span:last-child { font-size: 16px; }
  .site-header-logo img { width: 32px; height: 32px; }
  .theme-toggle { padding: 6px 8px; font-size: 12px; }
  .site-frame-grid { padding: 20px 16px 40px; }
  .home-summary { font-size: 16px; }
  .home-trailer-play { width: 60px; height: 60px; font-size: 22px; }
  .card-grid { grid-template-columns: 1fr; }
  .site-footer-content { gap: 16px; }
  .home-closing-cta { padding: 18px 20px; }
}
