/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }

/* ============ Tokens ============ */
:root {
  --bg-base: #14161a;
  --bg-surface: #1c1f26;
  --bg-elevated: #242832;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0aa;
  --text-muted: #5f6672;
  --accent: #f0a050;
  --accent-dim: rgba(240, 160, 80, 0.12);
  --border-subtle: #2a2f3a;
  --radius-card: 10px;
  --max-width: 1280px;
  --font-ui: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Monaco, monospace;
}

/* ============ Utilities ============ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -100px; left: 16px;
  background: var(--accent); color: #14161a;
  padding: 8px 16px; border-radius: 6px; z-index: 10000;
}
.skip-link:focus { top: 16px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 22, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.brand__logo { font-size: 22px; }
.brand__name { letter-spacing: 0.5px; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  padding: 6px 12px; border-radius: 6px;
  font-size: 14px; color: var(--text-secondary);
  transition: background .18s ease, color .18s ease;
}
.site-nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* ============ Hero ============ */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 20px 32px;
  text-align: center;
}
.hero__title {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #e8eaed 0%, #f0a050 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}
.hero__subtitle {
  color: var(--text-secondary);
  font-size: clamp(14px, 1.8vw, 17px);
  max-width: 640px; margin: 0 auto 28px;
}
.hero__search { position: relative; max-width: 520px; margin: 0 auto; }
.hero__search input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.hero__search input::placeholder { color: var(--text-muted); }
.hero__search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.hero__hint {
  display: block; margin-top: 8px; min-height: 20px;
  font-size: 13px; color: var(--text-muted);
}

/* ============ Section ============ */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
  scroll-margin-top: 72px;
}
.section__head { margin-bottom: 20px; }
.section__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  padding-left: 14px;
}
.section__title::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 4px; border-radius: 2px;
  background: var(--accent);
}
.section__intro {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
  max-width: 860px;
}

/* ============ Tool Grid ============ */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  overflow: hidden;
}
.tool-card:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tool-card.is-hidden { display: none; }
.tool-card__link {
  display: flex; gap: 12px;
  padding: 16px;
  height: 100%;
}
.tool-card__icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--accent-dim);
  border-radius: 8px;
}
.tool-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tool-card__name {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
}
.tool-card__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ============ Countdown ============ */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.countdown-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  text-align: center;
}
.countdown-card__label {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: 1px;
}
.countdown-card__value {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: var(--accent);
  margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.countdown-card__note {
  font-size: 12px; color: var(--text-muted);
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
  padding: 32px 20px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  display: flex; flex-direction: column; gap: 10px;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.footer-links a { color: var(--text-secondary); transition: color .18s ease; }
.footer-links a:hover { color: var(--accent); }

/* ============ Boss Key ============ */
#bossKey {
  position: fixed; right: 20px; top: 20px; z-index: 9999;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-elevated); color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-size: 16px; cursor: pointer;
  transition: color .18s ease, border-color .18s ease, transform .18s ease;
  display: flex; align-items: center; justify-content: center;
}
#bossKey:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.06);
}

.boss-screen {
  position: fixed; inset: 0; z-index: 9998;
  background: #1e1e1e;
  display: flex; flex-direction: column;
}
.boss-screen[hidden] { display: none; }
.boss-screen__code {
  flex: 1;
  margin: 0;
  padding: 32px 40px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: #d4d4d4;
  white-space: pre;
}
.boss-screen__hint {
  position: absolute; right: 72px; top: 28px;
  font-size: 12px; color: #555;
  font-family: var(--font-ui);
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .nav-grid { grid-template-columns: repeat(2, 1fr); }
  .countdown-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 6px 8px; font-size: 13px; }
  .hero { padding: 36px 20px 20px; }
  .nav-grid { grid-template-columns: 1fr; }
  .countdown-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 32px 16px; }
  #bossKey { top: auto; bottom: 20px; }
  .boss-screen__hint { right: 72px; top: 16px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}