/* Shared tool-page theme — mirrors the blog's indigo/cyan glass look so the
   standalone tool pages don't clash with the rest of the site. Link this LAST
   in each page's <head> so it overrides the page's own inline :root/body/surface
   declarations by cascade order. */

/* Remap every palette token these pages use (they vary in naming) to the blog. */
:root {
  --bg: #0c1222;
  --surface: rgba(20,30,50,0.55);
  --surface2: rgba(25,38,60,0.65);
  --surface-hover: rgba(25,38,60,0.72);
  --border: rgba(56,189,248,0.12);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-subtle: rgba(56,189,248,0.12);
  --accent2: rgba(56,189,248,0.12);
  --accent-rgb: 56,189,248;
  --green: #34d399; --green2: rgba(52,211,153,0.12);
  --yellow: #fbbf24; --yellow2: rgba(251,191,36,0.12);
  --red: #fb7185; --red2: rgba(251,113,133,0.12);
  --purple: #a78bfa; --purple2: rgba(167,139,250,0.12);
  --radius: 14px; --radius-sm: 8px;
}

html { scrollbar-width: thin; scrollbar-color: rgba(56,189,248,0.3) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.22); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(56,189,248,0.4); border: 2px solid transparent; background-clip: padding-box; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif !important;
  background: #0c1222 !important;
  color: var(--text);
}
/* Fixed ambient gradient behind everything, echoing the blog's WebGL backdrop. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, rgba(56,189,248,0.10) 0%, transparent 42%),
    radial-gradient(circle at 82% 12%, rgba(167,139,250,0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(56,189,248,0.06) 0%, transparent 55%),
    linear-gradient(180deg, #111a30 0%, #0c1222 55%, #080d1a 100%);
}

/* Glassify the common surface/card/panel classes across all tool pages. */
.container, .card, .guide-item, .overview, .step, .step-loc, .toc,
.pending, .items-table, .relic-table, .hero, .section, .relic-card,
.input-panel, .result-panel, .grid-card, .result-card, .empty-card,
.tip, .warn, .badge, .meta {
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.hero { background: linear-gradient(135deg, rgba(30,41,59,0.6) 0%, rgba(20,30,50,0.5) 100%) !important; border: 1px solid var(--border) !important; }
.card, .guide-item, .overview, .step, .toc, .relic-card, .input-panel,
.result-panel, .grid-card, .result-card, .empty-card {
  border: 1px solid var(--border);
}
.card:hover, .guide-item:hover, .relic-card:hover {
  border-color: rgba(56,189,248,0.35) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
}

/* Back-to-blog affordance shown on every tool page (injected per page). */
.tool-topbar {
  max-width: 860px; margin: 0 auto 1.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.tool-topbar a.home {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; padding: 0.4rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); backdrop-filter: blur(10px); transition: all 0.2s;
}
.tool-topbar a.home:hover { color: var(--accent); border-color: var(--accent); }
.tool-topbar a.home svg { width: 14px; height: 14px; }

/* Image slot — put a screenshot here by dropping a file at the given src.
   Until the image exists, the alt/caption text shows what it should contain.
   Usage: <figure class="img-slot"><img src="img/<map>/<name>.jpg" alt="说明">
            <figcaption>说明文字</figcaption></figure> */
.img-slot { margin: 10px 0; border: 1px dashed var(--border); border-radius: var(--radius-sm); overflow: hidden; background: rgba(56,189,248,0.04); }
.img-slot img { display: block; width: 100%; height: auto; }
.img-slot img[src=""], .img-slot img:not([src]) { display: none; }
/* When the image is absent (no <img> at all, or empty src), show the dashed
   placeholder box so the caption stays visible instead of collapsing. */
.img-slot:has(img[src=""]), .img-slot:has(img:not([src])), .img-slot:not(:has(img)), .img-slot.empty { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.img-slot figcaption { font-size: 12px; color: var(--muted); padding: 8px 12px; line-height: 1.55; border-top: 1px solid var(--border); }
.img-slot figcaption::before { content: "📷 "; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 10px 0; }
.img-grid .img-slot { margin: 0; }

/* ---- Shared guide-page components (used by all cod-*.html map guides) ---- */
.guide-body { max-width: 820px; margin: 0 auto; padding: 0 16px 60px; line-height: 1.7; }
.guide-body .back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 20px; }
.guide-body .back:hover { color: var(--accent); }
.guide-hero { text-align: center; margin-bottom: 30px; padding: 32px 20px; background: linear-gradient(135deg, rgba(30,41,59,0.6) 0%, rgba(20,30,50,0.5) 100%); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(14px); }
.guide-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.guide-hero .sub { color: var(--muted); font-size: 14px; }
.guide-hero .tags { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.gtag { font-size: 12px; padding: 4px 12px; border-radius: 20px; font-weight: 500; background: var(--accent2); color: var(--accent); }
.gtag.season { background: var(--purple2); color: var(--purple); }
.gtag.diff { background: var(--yellow2); color: var(--yellow); }
.guide-body .notice { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 26px; font-size: 13px; color: var(--muted); line-height: 1.65; backdrop-filter: blur(14px); }
.guide-body .notice strong { color: var(--text); }
.guide-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 28px; backdrop-filter: blur(14px); }
.guide-toc h3 { font-size: 15px; margin-bottom: 12px; color: var(--muted); }
.guide-toc ul { list-style: none; column-count: 2; column-gap: 24px; }
.guide-toc li { margin-bottom: 6px; break-inside: avoid; }
.guide-toc a { color: var(--accent); text-decoration: none; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.guide-toc a:hover { text-decoration: underline; }
.guide-toc .num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent2); color: var(--accent); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.gsection { margin-bottom: 32px; scroll-margin-top: 20px; }
.gsection-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.gsection-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; background: var(--accent2); }
.gsection-title { font-size: 20px; font-weight: 700; }
.gsection-sub { font-size: 13px; color: var(--muted); }
.gsteps { display: flex; flex-direction: column; gap: 12px; }
.gstep { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; backdrop-filter: blur(14px); }
.gstep-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.gstep-num { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; background: var(--accent2); color: var(--accent); }
.gstep-num.green { background: var(--green2); color: var(--green); }
.gstep-num.yellow { background: var(--yellow2); color: var(--yellow); }
.gstep-num.red { background: var(--red2); color: var(--red); }
.gstep-num.purple { background: var(--purple2); color: var(--purple); }
.gstep-title { font-size: 15px; font-weight: 600; }
.gstep-loc { font-size: 12px; color: var(--muted); background: var(--surface2); padding: 2px 8px; border-radius: 4px; margin-left: auto; }
.gstep p, .gstep li { font-size: 14px; color: var(--text); line-height: 1.7; }
.gstep ul { padding-left: 18px; margin: 6px 0; }
.gstep li { margin-bottom: 4px; }
.gstep strong { color: var(--accent-hover); }
.gstep .warn { background: var(--yellow2); border: 1px solid rgba(251,191,36,0.2); border-radius: 8px; padding: 10px 14px; margin-top: 8px; font-size: 13px; }
.gstep .warn::before { content: "⚠️ "; }
.gstep .verify { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-style: italic; }
.gstep .effect { background: var(--green2); border: 1px solid rgba(52,211,153,0.2); border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-size: 12.5px; font-weight: 600; }
.gstep .effect::before { content: "✨ 遗物效果："; }
.gtable { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.gtable th, .gtable td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.gtable th { background: var(--surface2); font-weight: 600; color: var(--muted); }
.guide-footer { text-align: center; color: var(--muted); font-size: 13px; padding-top: 20px; border-top: 1px solid var(--border); margin-top: 40px; }
.guide-footer a { color: var(--accent); text-decoration: none; }
.guide-footer .sources, .footer .sources { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.guide-footer .sources a, .footer .sources a { color: var(--accent); margin: 0 2px; }
.guide-footer .sources a:hover, .footer .sources a:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .guide-hero h1 { font-size: 22px; }
  .gsection-title { font-size: 17px; }
  .gstep { padding: 14px; }
  .guide-toc ul { column-count: 1; }
}
