/* 所有站点共用的样式。主题色 --accent 由 site.yaml 的 color 决定 */
:root {
  --accent: #2f6fed;
  --bg: #ffffff;
  --surface: #f5f7fa;
  --text: #1b2130;
  --muted: #5d6677;
  --line: #e2e6ec;
  --code-bg: #eff2f6;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1e25;
    --text: #e7eaf0;
    --muted: #9ba4b4;
    --line: #2a303a;
    --code-bg: #232933;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Hiragino Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em;
  background: var(--code-bg); padding: 1px 6px; border-radius: 6px; }
.container { max-width: 880px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 页头 */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text);
  text-decoration: none; white-space: nowrap; }
.brand img { border-radius: 7px; }
.site-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; font-size: 15px; }
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current=page] { color: var(--accent); font-weight: 600; }
.lang-switch { position: relative; font-size: 14px; }
.lang-switch summary { cursor: pointer; list-style: none; color: var(--muted); padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: grid; min-width: 140px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.lang-switch div a { padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.lang-switch div a:hover, .lang-switch div a[aria-current] { background: var(--surface); }

/* 正文头部 */
main { padding-bottom: 48px; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 20px; }
.crumbs a { color: var(--muted); }
.page-head { margin: 20px 0 8px; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
.updated { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.lead { font-size: 1.12rem; color: var(--text); margin: 0 0 16px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
  padding: 10px 20px; border-radius: 10px; border: 2px solid var(--accent); }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); }

/* 嵌入游戏：点了才加载 iframe，不拖慢首屏 */
.embed { position: relative; display: grid; place-items: center; width: 100%; margin: 20px 0;
  background: #0d0f14; border-radius: var(--radius); overflow: hidden; }
.embed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-play { position: relative; font: inherit; font-weight: 700; font-size: 1.1rem; color: #fff; cursor: pointer;
  background: var(--accent); border: 0; padding: 14px 28px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }

/* 工具区 */
.tool-box { margin: 20px 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tool-box label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.tool-box input, .tool-box select { font: inherit; color: var(--text); background: var(--bg); padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; width: 100%; }
.tool-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tool-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.tool-result div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.tool-result span { display: block; font-size: 13px; color: var(--muted); }
.tool-result b { font-size: 1.35rem; }

/* 兑换码 */
.codes { margin: 24px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap th { background: var(--surface); font-size: 14px; color: var(--muted); font-weight: 600; }
.table-wrap td.date { white-space: nowrap; color: var(--muted); font-size: 15px; }
.copy { margin-left: 8px; font: inherit; font-size: 13px; cursor: pointer; color: var(--accent); background: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
.copy.done { color: #fff; background: var(--accent); border-color: var(--accent); }
.expired { margin: 12px 0; }
.expired summary { cursor: pointer; color: var(--muted); }
.note { background: var(--surface); border-radius: var(--radius); padding: 12px 16px; }
.steps { padding-left: 1.4em; }
.steps li { margin: 4px 0; }

/* 目录 */
.toc { background: var(--surface); border-radius: var(--radius); padding: 14px 18px; margin: 24px 0; font-size: 15px; }
.toc p { margin: 0 0 6px; font-weight: 600; }
.toc ol { margin: 0; padding-left: 1.3em; }

/* 正文 */
.prose h2 { font-size: 1.5rem; line-height: 1.3; margin: 2em 0 .6em; scroll-margin-top: 16px; }
.prose h3 { font-size: 1.2rem; margin: 1.6em 0 .5em; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface); }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid var(--accent); color: var(--muted); }
.prose pre { background: var(--code-bg); padding: 14px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 10px; }

/* 常见问题 */
.faq { margin-top: 40px; }
.faq h2 { font-size: 1.5rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq .answer p { margin: .6em 0 0; }

/* 相关页面 */
.related { margin-top: 48px; }
.related h2 { font-size: 1.2rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--accent); }
.card span { font-size: 14px; color: var(--muted); }

/* 页脚 */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 20px 0 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--muted); }
.disclaimer { max-width: 680px; }

/* 数据列表：价值表、排名、tier list */
[hidden] { display: none !important; }
.data-box { margin: 20px 0; }
.data-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.data-controls input, .data-controls select { font: inherit; font-size: 15px; color: var(--text); background: var(--bg);
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.data-controls input { flex: 1 1 200px; min-width: 0; }
.data-meta { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.data-table td { vertical-align: middle; }
/* max-width: none：全局的 img { max-width: 100% } 会让表格里的图片在窄屏上被压成 0 宽 */
.data-table td img { display: block; width: 36px; height: 36px; max-width: none; object-fit: cover; border-radius: 8px; }
.data-table th button { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.data-table th button::after { content: " ↕"; opacity: .35; }
.data-table th[aria-sort=ascending] button::after { content: " ↑"; opacity: 1; }
.data-table th[aria-sort=descending] button::after { content: " ↓"; opacity: 1; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td a { font-weight: 600; text-decoration: none; }
.data-table td a:hover { text-decoration: underline; }
.data-empty { color: var(--muted); text-align: center; padding: 16px; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; line-height: 1.6; padding: 0 8px; border-radius: 999px;
  white-space: nowrap; color: var(--tag); background: color-mix(in srgb, var(--tag) 14%, transparent); }
.tag-0 { --tag: #d9480f; } .tag-1 { --tag: #2b8a3e; } .tag-2 { --tag: #1971c2; } .tag-3 { --tag: #9c36b5; }
.tag-4 { --tag: #c2255c; } .tag-5 { --tag: #0c8599; } .tag-6 { --tag: #b7791f; } .tag-7 { --tag: #5f3dc4; }
@media (prefers-color-scheme: dark) {
  .tag-0 { --tag: #ff8a4c; } .tag-1 { --tag: #69db7c; } .tag-2 { --tag: #74c0fc; } .tag-3 { --tag: #e599f7; }
  .tag-4 { --tag: #faa2c1; } .tag-5 { --tag: #66d9e8; } .tag-6 { --tag: #ffd43b; } .tag-7 { --tag: #b197fc; }
}
.tiers { display: grid; gap: 8px; }
.tier { display: grid; grid-template-columns: 64px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tier-label { display: grid; place-items: center; padding: 8px 4px; font-size: 1.5rem; font-weight: 800; color: #fff;
  background: var(--tier); text-align: center; word-break: break-word; }
.tier-label.long { font-size: 13px; }
.tier-0 { --tier: #e5484d; } .tier-1 { --tier: #f76b15; } .tier-2 { --tier: #d4a000; } .tier-3 { --tier: #30a46c; }
.tier-4 { --tier: #0090ff; } .tier-5 { --tier: #8e4ec6; } .tier-6 { --tier: #8b8d98; }
.tier-items { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.tier-item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; }
.tier-item:not(:has(img)) { padding-left: 12px; }
a.tier-item:hover { border-color: var(--accent); }
.tier-item img { width: 28px; height: 28px; max-width: none; border-radius: 50%; object-fit: cover; }

/* 数据详情页 */
.item-box { display: flex; gap: 20px; align-items: flex-start; margin: 16px 0 8px; }
.item-image { flex: none; width: 140px; height: 140px; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.facts { flex: 1; min-width: 0; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--radius); }
.facts caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.facts th, .facts td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.facts th { width: 40%; color: var(--muted); font-weight: 500; background: var(--surface); }
.similar { margin-top: 32px; }
.similar h2 { font-size: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 15px; }
.chips a:hover { border-color: var(--accent); }
.back { margin-top: 24px; }

.not-found { text-align: center; padding: 80px 0; }
.draft-banner { background: #b45309; color: #fff; text-align: center; font-size: 14px; padding: 6px 12px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; padding-bottom: 6px; }
  .site-nav { order: 3; flex-basis: 100%; margin: 0 -10px; }
  .lang-switch { margin-left: auto; }
  .item-box { flex-direction: column; }
  .facts { width: 100%; }
  .table-wrap th, .table-wrap td { padding: 8px 10px; }
  .tier { grid-template-columns: 48px minmax(0, 1fr); }
  .data-meta { margin-left: 0; }
}
