/* ═══════════════════════════════════════
   AI Arsenal — Shared Design System
   Inherits AI 未來學院 visual language
   ═══════════════════════════════════════ */

:root {
  --bg: #09090f;
  --surface: #111118;
  --surface2: #16161f;
  --surface3: #1c1c28;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #7cffb2;
  --accent-dim: rgba(124, 255, 178, 0.08);
  --accent-strong: #b4ffd8;
  --blue: #5b8fff;
  --purple: #a855f7;
  --orange: #ff9f43;
  --red: #ff6b6b;
  --text: #f0f0f5;
  --text-muted: rgba(240, 240, 245, 0.45);
  --text-sub: rgba(240, 240, 245, 0.65);
  --text-faint: rgba(240, 240, 245, 0.25);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', 'Noto Sans TC', -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(124, 255, 178, 0.2); color: #fff; }

/* ── Scroll progress ── */
#prog { position: fixed; top: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--blue)); z-index: 999; width: 0; pointer-events: none; }

/* ── Nav ── */
.arsenal-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 72px); height: 64px;
  background: rgba(9, 9, 15, 0.75);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.arsenal-nav.scrolled { border-bottom-color: var(--border); }
.arsenal-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.arsenal-logo .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 12px rgba(124, 255, 178, 0.6); animation: livePulse 2s ease infinite; }
.arsenal-logo span { color: var(--accent); }
.arsenal-nav-links { display: flex; gap: 1.8rem; list-style: none; }
.arsenal-nav-links a { font-size: 0.82rem; color: var(--text-sub); text-decoration: none; transition: color 0.2s; position: relative; }
.arsenal-nav-links a:hover { color: var(--text); }
.arsenal-nav-links a.active { color: var(--accent); }
.arsenal-nav-links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent); border-radius: 2px; }
.arsenal-nav-right { display: flex; align-items: center; gap: 12px; }
.arsenal-user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 100px; font-size: 0.74rem; color: var(--text-sub); background: var(--surface2); }
.arsenal-user-chip .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.arsenal-kbd-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-sub); border-radius: 8px; font-size: 0.72rem; font-family: 'JetBrains Mono', monospace; cursor: pointer; transition: all 0.2s; }
.arsenal-kbd-btn:hover { color: var(--accent); border-color: var(--accent); }
.arsenal-kbd-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.arsenal-kbd-btn kbd { font-family: inherit; padding: 1px 5px; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 3px; font-size: 0.65rem; }

@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

/* ── Layout ── */
.arsenal-main { padding-top: 64px; min-height: 100vh; }
.arsenal-container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 48px); }
section.arsenal-section { padding: clamp(60px, 10vw, 120px) 0; position: relative; }

/* ── Section label ── */
.arsenal-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; display: inline-block; }
.arsenal-h1 { font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 1.25rem; }
.arsenal-h1 em { font-style: normal; color: var(--accent); }
.arsenal-h2 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 1rem; }
.arsenal-h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.3; }
.arsenal-lead { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--text-sub); max-width: 620px; line-height: 1.75; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: all 0.25s var(--ease); font-family: inherit; }
.btn-primary { background: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(124, 255, 178, 0.3); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface2); transform: translateY(-1px); }
.btn-sm { padding: 8px 14px; font-size: 0.76rem; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.04em; border: 1px solid var(--border); background: var(--surface2); color: var(--text-sub); }
.badge-accent { background: rgba(124, 255, 178, 0.08); color: var(--accent); border-color: rgba(124, 255, 178, 0.18); }
.badge-blue { background: rgba(91, 143, 255, 0.08); color: var(--blue); border-color: rgba(91, 143, 255, 0.18); }
.badge-purple { background: rgba(168, 85, 247, 0.08); color: var(--purple); border-color: rgba(168, 85, 247, 0.18); }
.badge-orange { background: rgba(255, 159, 67, 0.08); color: var(--orange); border-color: rgba(255, 159, 67, 0.18); }
.badge-red { background: rgba(255, 107, 107, 0.08); color: var(--red); border-color: rgba(255, 107, 107, 0.18); }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── Difficulty stars ── */
.diff { display: inline-flex; gap: 2px; font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.02em; }
.diff .on { color: var(--accent); }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: all 0.3s var(--ease); position: relative; overflow: hidden; }
.card:hover { border-color: rgba(124, 255, 178, 0.2); transform: translateY(-4px); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4); }

/* ── Reveal animation ── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Hero ── */
.arsenal-hero { min-height: 82vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 80px 5%; text-align: center; }
.arsenal-hero-bg { position: absolute; inset: 0; background:
  radial-gradient(ellipse 70% 50% at 50% 30%, rgba(124, 255, 178, 0.08), transparent 60%),
  radial-gradient(ellipse 40% 40% at 85% 75%, rgba(91, 143, 255, 0.06), transparent 55%);
}
.arsenal-hero-grid { position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 80%);
}
.arsenal-hero-inner { position: relative; z-index: 2; max-width: 880px; }
.arsenal-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border: 1px solid rgba(124, 255, 178, 0.2); border-radius: 100px; background: rgba(124, 255, 178, 0.04); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 2rem; }
.arsenal-eyebrow .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: livePulse 2s ease infinite; }

/* ── Ticker ── */
.arsenal-ticker-wrap { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 14px 0; background: var(--surface); position: relative; z-index: 2; }
.arsenal-ticker { display: flex; gap: 3rem; animation: tickerScroll 60s linear infinite; width: max-content; }
.arsenal-ticker span { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; }
.arsenal-ticker span::before { content: ''; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── Footer ── */
.arsenal-footer { border-top: 1px solid var(--border); padding: 48px 5%; text-align: center; background: var(--surface); }
.arsenal-footer-copy { font-size: 0.78rem; color: var(--text-muted); margin-top: 12px; }
.arsenal-footer-tag { font-size: 0.7rem; color: var(--text-faint); letter-spacing: 0.1em; text-transform: uppercase; }

/* ── Tabular nums (prevent layout shift on counters) ── */
.num, .counter, .hn-num { font-variant-numeric: tabular-nums; }

/* ── Mobile Menu ── */
.arsenal-menu-btn { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-family: inherit; font-size: 0.82rem; align-items: center; gap: 6px; }
.arsenal-menu-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* 中型螢幕：nav 縮字級、收用戶 chip，避免 8 個連結擁擠 */
@media (max-width: 1200px) {
  .arsenal-nav-links { gap: 1.2rem; }
  .arsenal-nav-links a { font-size: 0.78rem; }
  .arsenal-kbd-btn span { display: none; }
  .arsenal-user-chip { display: none; }
}

/* 平板以下：切換成 hamburger 選單（避免擠在一起） */
@media (max-width: 1024px) {
  .arsenal-nav-links {
    display: none;
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(9, 9, 15, 0.98); backdrop-filter: blur(20px);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .arsenal-nav-links.open { display: flex; }
  .arsenal-nav-links li { width: 100%; }
  .arsenal-nav-links a { display: block; padding: 12px 0; font-size: 0.95rem; border-bottom: 1px solid var(--border); }
  .arsenal-nav-links a.active { color: var(--accent); }
  .arsenal-nav-links a.active::after { display: none; }
  .arsenal-menu-btn { display: inline-flex; }
  .arsenal-nav { padding: 0 16px; }
  .arsenal-kbd-btn { display: none; }
}

/* ── 統一 Hero 規範（design review 2026-04-18） ── */
.arsenal-hero h1,
.home-hero h1,
.news-hero h1,
.lib-hero h1,
.my-hero h1,
.admin-hero h1,
.path-hero h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.home-hero h1 {
  font-size: clamp(2.2rem, 5.8vw, 4.4rem);
  letter-spacing: -0.035em;
}
.admin-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}
.arsenal-lead, .home-lead { text-wrap: pretty; }

/* ── 暫時隱藏收藏 / 我的頁功能 ── */
.wf-fav, [data-fav-id] { display: none !important; }
a[href="my.html"], a[href="news.html"], a[href="learn.html"] { display: none !important; }
