/* ── Google Fonts（@import 必須在最前面）── */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

/* ── CSS 變數 ── */
:root {
  --bg: #0f1114;
  --panel: rgba(30, 32, 38, 0.95);
  --panel-2: rgba(40, 43, 50, 0.95);
  --line: rgba(255,255,255,0.06);
  --line-light: rgba(255,255,255,0.10);
  --purple: #b07cff;
  --purple-deep: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.15);
  --purple-subtle: rgba(139, 92, 246, 0.08);
  --text: #f0eee6;
  --text-secondary: #a8a5b8;
  --muted: #8b879e;
  --yellow: #fbbf24;
  --pink: #f472b6;
  --shadow: 0 4px 24px rgba(0,0,0,.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.35);
  --radius: 16px;
  --radius-sm: 10px;
}

/* ── Font Face ── */
@font-face {
  font-family: 'Iansui';
  src: url('./assets/fonts/Iansui-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Iansui';
  src: url('./assets/fonts/Iansui-Regular.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Iansui';
  src: url('./assets/fonts/Iansui-Regular.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* ── Reset / Body ── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(139,92,246,.12), transparent),
    radial-gradient(ellipse 50% 40% at 90% 5%, rgba(244,114,182,.06), transparent);
}

h1, h2, h3 {
  font-family: 'Iansui', 'Noto Sans TC', sans-serif;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 20, 0.8);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  transition: box-shadow .2s ease;
}

.navbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar.scrolled {
  box-shadow: 0 1px 0 var(--line-light), 0 8px 32px rgba(0,0,0,.3);
}

.navbar-brand {
  font-family: 'Iansui', 'Noto Sans TC', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  letter-spacing: .02em;
}

.navbar-back {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .88rem;
  transition: color .15s;
}

.navbar-back:hover {
  color: var(--purple);
}

/* ── Wrap ── */
.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 28px auto 60px;
}

/* ── Hero ── */
.hero {
  border: 1px solid rgba(139,92,246,.3);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  background: linear-gradient(135deg, rgba(139,92,246,.85), rgba(109,40,217,.75));
  padding: 32px 28px 28px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,.12), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(251,191,36,.08), transparent 40%);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.2;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
  letter-spacing: .02em;
  font-weight: 700;
}

.hero .sub {
  position: relative;
  z-index: 1;
  max-width: 720px;
  line-height: 1.7;
  margin: 0;
  font-size: .95rem;
  color: rgba(255,255,255,.85);
}

.chip-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.12);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .82rem;
  color: rgba(255,255,255,.9);
}

/* ── Panel ── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  padding: 12px 16px;
  font-size: .95rem;
  font-family: 'Iansui', 'Noto Sans TC', sans-serif;
  font-weight: 500;
  background: var(--purple-subtle);
  color: var(--purple);
  border-bottom: 1px solid var(--line);
}

.panel .body {
  padding: 16px;
  line-height: 1.8;
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.full {
  grid-column: 1 / -1;
}

/* ── 首頁卡片 ── */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(139,92,246,.3);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(139,92,246,.1);
}

.card-head {
  padding: 8px 14px;
  background: var(--purple-subtle);
  font-family: 'Iansui', 'Noto Sans TC', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  color: var(--purple);
  letter-spacing: .02em;
  border-bottom: 1px solid var(--line);
}

.card-body {
  padding: 14px 14px 16px;
}

.emoji {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-desc {
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.6;
}

.cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--purple);
  font-weight: 600;
  font-size: .88rem;
}

/* ── 表格 ── */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .88rem;
}

th, td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--purple-subtle);
  color: var(--purple);
  font-family: 'Iansui', 'Noto Sans TC', sans-serif;
  font-weight: 500;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: .85rem;
}

/* ── 提示區塊 ── */
.note {
  background: rgba(251,191,36,.06);
  border: 1px solid rgba(251,191,36,.15);
  color: #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
  font-size: .92rem;
}

.warn {
  background: rgba(248,113,113,.06);
  border: 1px solid rgba(248,113,113,.15);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
  font-size: .92rem;
}

.source {
  margin-top: 18px;
  padding: 14px;
  background: rgba(255,255,255,.02);
  border: 1px dashed rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  color: var(--muted);
  line-height: 1.7;
  font-size: .85rem;
}

/* ── 步驟 ── */
.timeline {
  display: grid;
  gap: 10px;
}

.step {
  background: var(--panel-2);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.step .n {
  font-family: 'Fredoka', sans-serif;
  color: var(--purple);
  font-size: .95rem;
  font-weight: 600;
}

.step p {
  margin: 6px 0 0;
}

/* ── Tag ── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  margin-right: 4px;
}

.tag-build {
  background: rgba(251,146,60,.12);
  color: #fdba74;
}

.tag-gather {
  background: rgba(74,222,128,.12);
  color: #86efac;
}

.tag-combat {
  background: rgba(248,113,113,.12);
  color: #fca5a5;
}

.tag-utility {
  background: rgba(147,197,253,.12);
  color: #93c5fd;
}

.tag-exclusive {
  background: rgba(251,191,36,.12);
  color: #fde68a;
}

/* ── Highlight ── */
.highlight {
  color: var(--yellow);
  font-weight: 700;
}

/* ── Back ── */
.back {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-light);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .88rem;
  transition: all .15s;
}

.back:hover {
  background: rgba(255,255,255,.08);
  color: var(--text);
}

/* ── 連結 ── */
a {
  color: var(--purple);
}

/* ── 清單 ── */
ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

li {
  margin-bottom: 6px;
}

/* ── Footer ── */
.site-footer {
  margin: 0 auto 32px;
  width: min(1080px, calc(100% - 32px));
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

/* ── 動畫 ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
  animation-delay: var(--delay, 0ms);
}

.fade-left {
  opacity: 0;
  animation: fadeInLeft 0.4s ease forwards;
}

/* ── 響應式 ── */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-grid { grid-template-columns: 1fr; gap: 10px; }
  .navbar { padding: 12px 16px; }
  .wrap { width: calc(100% - 24px); margin-top: 20px; }
  .hero { padding: 24px 20px 20px; border-radius: 14px; }
  .hero h1 { font-size: 1.4rem; }
  .card { border-radius: 14px; }
  .card-body { padding: 12px 14px 14px; }
  .card-desc { font-size: .85rem; }
  .panel { border-radius: 14px; }
}
