/* ===== 基礎與變數 ===== */
:root {
  --bg: #0f1220;
  --bg-soft: #171b2e;
  --card: #1d2238;
  --text: #e8eaf2;
  --muted: #9aa0b8;
  --brand: #6c8cff;
  --brand-2: #8b6cff;
  --accent: #38e8c6;
  --border: #2a3050;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.container { width: min(1100px, 92%); margin: 0 auto; }

/* ===== 導覽列 ===== */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,18,32,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.logo { font-size: 1.25rem; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* ===== 按鈕 ===== */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: .95rem; cursor: pointer; border: none;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 8px 20px rgba(108,140,255,.35); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-block { display: block; width: 100%; text-align: center; }

/* ===== Hero ===== */
.hero { padding: 90px 0 70px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 480px;
  background: radial-gradient(closest-side, rgba(108,140,255,.25), transparent 70%);
  filter: blur(20px); z-index: -1;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.2; margin-bottom: 20px; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto 34px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.tagline-chip { display:inline-block; padding:6px 14px; border:1px solid var(--border);
  border-radius:999px; color:var(--accent); font-size:.85rem; margin-bottom:22px; }

/* ===== 區塊標題 ===== */
.section { padding: 64px 0; }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); text-align: center; margin-bottom: 12px; }
.section .sub { color: var(--muted); text-align: center; max-width: 560px; margin: 0 auto 44px; }

/* ===== 課程卡片 ===== */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand); }
.card .emoji { font-size: 2rem; }
.card h3 { margin: 14px 0 6px; font-size: 1.15rem; }
.card .meta { color: var(--accent); font-size: .82rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: .92rem; }

/* 課程卡片可點擊樣式 */
a.card { display: block; }
.card-link { display: inline-block; margin-top: 14px; color: var(--brand); font-size: .88rem; font-weight: 700; }

/* 年級分組標題 */
.year-heading { font-size: 1.15rem; margin: 36px 0 16px; padding-left: 12px;
  border-left: 4px solid var(--brand); color: var(--text); }
.year-heading:first-child { margin-top: 0; }

/* 課程詳細頁標頭 */
.back-link { display: inline-block; color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.back-link:hover { color: var(--text); }
.course-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.emoji-lg { font-size: 3rem; line-height: 1; }

/* ===== 定價 ===== */
.plans { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 760px; margin: 0 auto; }
.plan {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 28px; position: relative; display: flex; flex-direction: column;
}
.plan.highlight { border-color: var(--brand); box-shadow: var(--shadow); }
.plan .badge { position: absolute; top: -12px; right: 22px; background: linear-gradient(90deg,var(--brand),var(--brand-2));
  color:#fff; font-size:.75rem; font-weight:700; padding:5px 12px; border-radius:999px; }
.plan .pname { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.plan .price { font-size: 2.2rem; font-weight: 800; }
.plan .price span { font-size: .95rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; margin: 20px 0 26px; }
.plan li { padding: 8px 0; color: var(--muted); border-bottom: 1px dashed var(--border); font-size: .92rem; }
.plan li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.plan .btn { margin-top: auto; }

/* ===== 會員專區 / 登入 ===== */
.login-box { max-width: 420px; margin: 40px auto; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; text-align: center; }
.login-box input { width: 100%; padding: 12px 14px; margin: 14px 0; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font-size: 1rem; }
.login-box .hint { color: var(--muted); font-size: .85rem; margin-top: 12px; }
.error { color: #ff7a8a; font-size: .9rem; min-height: 1.2em; }

.lesson-list { display: grid; gap: 12px; margin-top: 24px; }
.lesson {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
}
.lesson .num { width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--bg-soft); display: grid; place-items: center; color: var(--accent); font-weight: 700; }

/* ===== 頁尾 ===== */
footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); font-size: .9rem; text-align: center; }
footer a { color: var(--brand); }

/* ===== 工具 ===== */
.center { text-align: center; }
.mt-40 { margin-top: 40px; }
.hidden { display: none !important; }

/* 章節是否已可學習 */
a.lesson { display: flex; text-decoration: none; transition: border-color .2s, transform .15s; }
a.lesson.lesson-ready:hover { border-color: var(--brand); transform: translateX(3px); }
.lesson-go { color: var(--brand); font-size: .82rem; font-weight: 700; }
.lesson-soon { color: var(--muted); font-size: .8rem; }

/* 練習與測驗兩個模式入口 */
.mode-practice .num { background: rgba(108,140,255,.18); color: var(--brand); font-size: 1.1rem; }
.mode-exam .num { background: rgba(56,232,198,.15); color: var(--accent); font-size: 1.1rem; }
