/* ==========================================================================
   知引力 — 共用樣式（淺底 · 深色導覽 · 靛紫漸層 Hero · 圓角卡片）
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;800&display=swap');

:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-soft: #4a4a68;
  --text-mute: #737389;
  --line: #e6e6ef;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --accent-2: #7c3aed;
  --dark: #12122b;
  --code-bg: #f3f3fb;
  --max: 1120px;
  --read: 760px;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(18,18,43,.06), 0 8px 24px rgba(18,18,43,.05);

  --font-sans: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  --read-size: 1.05rem;
  --read-line: 1.95;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18,18,43,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  color: #fff;
  letter-spacing: .3px;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: block;
  filter: drop-shadow(0 4px 9px rgba(79,70,229,.25));
}
.brand .tag { color: #a9a9d6; font-weight: 500; font-size: .78rem; }
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.nav-links a {
  color: #d4d4ec;
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.read { max-width: var(--read); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1000px 400px at 15% -10%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(79,70,229,.20), transparent 55%),
    var(--dark);
  color: #fff;
  padding: 84px 24px 76px;
  text-align: center;
}
.hero .kicker {
  display: inline-block;
  font-size: .82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b7b7e6;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.25;
  margin: 0 auto 18px;
  max-width: 820px;
  letter-spacing: -.5px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, #a78bfa, #818cf8, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  font-size: 1.12rem;
  color: #cfcfe8;
  max-width: 660px;
  margin: 0 auto 30px;
}
.hero .cta {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(79,70,229,.4);
}
.hero .cta:hover { text-decoration: none; transform: translateY(-1px); }
.engines {
  margin-top: 40px;
  display: flex;
  gap: 10px 20px;
  flex-wrap: wrap;
  justify-content: center;
  color: #9a9ac8;
  font-size: .86rem;
}
.engines span {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 5px 14px;
}
.engines span::after { content: none; }

/* ---------- Section headings ---------- */
.section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: 1.9rem; margin: 0 0 10px; letter-spacing: -.3px; }
.section-head p { color: var(--text-mute); margin: 0; }

/* ---------- Category sections (homepage) ---------- */
.cat-section { padding: 46px 0; border-top: 1px solid var(--line); }
.cat-section:first-of-type { border-top: none; padding-top: 56px; }
.cat-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.cat-head .cat-index {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 5px 12px;
  border-radius: 8px;
}
.cat-head h2 { font-size: 1.55rem; margin: 0; letter-spacing: -.3px; }
.cat-head p { margin: 0; color: var(--text-mute); font-size: .95rem; flex-basis: 100%; }

/* ---------- Article cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #cfcffa;
  box-shadow: 0 12px 34px rgba(18,18,43,.10);
  text-decoration: none;
}
.card .num { display: none; }
.card h3 { margin: 0 0 10px; font-size: 1.2rem; color: var(--text); line-height: 1.5; }
.card p { margin: 0 0 16px; color: var(--text-soft); font-size: .95rem; }
.card .more { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--accent); }

/* ---------- Topic entry cards ---------- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.topic-card {
  position: relative;
  min-height: 300px;
  padding: 28px 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.topic-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.topic-card:nth-child(2)::before { background: linear-gradient(90deg, #2563eb, #22c55e); }
.topic-card:nth-child(3)::before { background: linear-gradient(90deg, #db2777, #f59e0b); }
.topic-card:hover {
  transform: translateY(-5px);
  border-color: #cfcffa;
  box-shadow: 0 16px 40px rgba(18,18,43,.12);
  text-decoration: none;
}
.topic-index {
  color: var(--accent);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: 2px;
}
.topic-label {
  margin: 0 0 8px;
  color: var(--text-mute);
  font-size: .82rem;
  font-weight: 700;
}
.topic-card h3 { margin: 0 0 14px; font-size: 1.55rem; }
.topic-card p:not(.topic-label) { margin: 0; color: var(--text-soft); }
.topic-count {
  display: inline-block;
  margin-top: 20px;
  padding: 5px 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.topic-arrow {
  position: absolute;
  right: 24px;
  bottom: 24px;
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 700;
}

/* ---------- Topic pages ---------- */
.topic-hero {
  padding: 42px 0 34px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7f7ff 0%, #fff 100%);
}
.topic-hero .wrap { max-width: 920px; }
.topic-hero .breadcrumb { margin-bottom: 18px; }
.topic-hero .topic-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.topic-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -1.2px;
}
.topic-hero .topic-intro {
  max-width: 720px;
  margin: 0;
  color: var(--text-soft);
  font-size: 1.08rem;
}
.topic-articles { padding: 38px 0 12px; }
.topic-articles .section-head { text-align: left; margin-bottom: 22px; }
.topic-articles .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.topic-articles .card { min-height: 220px; }
.topic-sequence {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.topic-next {
  margin-top: 44px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius);
}
.topic-next p { margin: 5px 0 0; color: #c8c8e8; }
.topic-next a {
  flex: 0 0 auto;
  color: #fff;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  font-weight: 700;
}
.topic-next a:hover { background: rgba(255,255,255,.08); text-decoration: none; }

/* ---------- Article page ---------- */
.article { padding: 52px 0 30px; }
.breadcrumb { font-size: .86rem; color: var(--text-mute); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-mute); }
.breadcrumb a:hover { color: var(--accent); }
.article h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.3;
  letter-spacing: -.4px;
  margin: 0 0 16px;
}
.article .lede { font-size: 1.16rem; color: var(--text-soft); margin: 0 0 24px; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  color: var(--text-mute);
  font-size: .85rem;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.pill {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.article h2 {
  font-size: 1.5rem;
  margin: 46px 0 14px;
  padding-top: 8px;
  letter-spacing: -.2px;
  scroll-margin-top: 80px;
}
.article h3 { font-size: 1.18rem; margin: 30px 0 10px; }
.article p {
  margin: 0 0 18px;
  color: var(--text);
  font-size: var(--read-size);
  line-height: var(--read-line);
}
.article ul, .article ol { margin: 0 0 20px; padding-left: 1.4em; }
.article li { margin-bottom: 10px; font-size: var(--read-size); line-height: var(--read-line); }
.article strong { color: var(--text); }

.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
  color: #33306a;
}
.callout strong { color: var(--accent-2); }

blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 4px solid var(--accent-2);
  color: var(--text-soft);
  font-style: italic;
}

/* ---------- Data table ---------- */
.table-scroll { overflow-x: auto; margin: 22px 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: .94rem;
  min-width: 480px;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--dark); color: #fff; font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafaff; }

/* ---------- TOC ---------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 0 0 36px;
  box-shadow: var(--shadow);
}
.toc h4 { margin: 0 0 12px; font-size: .82rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-mute); }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin-bottom: 7px; }
.toc a { color: var(--text-soft); }

/* ---------- Citations & references ---------- */
sup.cite { font-size: .72em; line-height: 0; vertical-align: super; }
sup.cite a { color: var(--accent); font-weight: 700; padding: 0 1px; }
.references {
  margin-top: 54px;
  padding-top: 26px;
  border-top: 2px solid var(--line);
}
.references h2 { font-size: 1.3rem; margin: 0 0 18px; }
.references ol { padding-left: 0; list-style: none; counter-reset: ref; }
.references li {
  counter-increment: ref;
  position: relative;
  padding-left: 40px;
  margin-bottom: 16px;
  font-size: .92rem;
  color: var(--text-soft);
  line-height: 1.7;
  scroll-margin-top: 80px;
}
.references li::before {
  content: "[" counter(ref) "]";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  color: var(--accent);
  font-size: .86rem;
}
.references li a { word-break: break-word; }
.ref-note { font-size: .82rem; color: var(--text-mute); margin-top: 18px; }

/* ---------- Related / next ---------- */
.related {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.related h3 { margin: 0 0 16px; font-size: 1.05rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.related-grid a {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: border-color .15s, transform .15s;
}
.related-grid a:hover { border-color: #cfcffa; transform: translateY(-2px); text-decoration: none; }
.related-grid a span { display: block; font-size: .78rem; color: var(--text-mute); font-weight: 500; margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: #b7b7d6;
  padding: 48px 24px 34px;
  margin-top: 70px;
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
.site-footer h5 { color: #fff; font-size: .82rem; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 14px; }
.site-footer a { color: #b7b7d6; display: block; margin-bottom: 9px; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.site-footer .desc { font-size: .92rem; line-height: 1.7; max-width: 320px; }
.copyright {
  max-width: var(--max);
  margin: 34px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .82rem;
  color: #8a8ab0;
}
.copyright .powered { margin: 8px 0 0; font-size: .9rem; color: #cfcfe8; }
.copyright .powered a { display: inline; color: #a78bfa; font-weight: 700; }
.copyright .powered a:hover { color: #c4b5fd; }
.disclaimer { font-size: .78rem; color: #75759c; margin-top: 8px; line-height: 1.6; }

/* ---------- Hero 次要按鈕 ---------- */
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .cta.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.32);
  box-shadow: none;
}
.hero .cta.ghost:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }

/* ---------- Section eyebrow（小標） ---------- */
.eyebrow {
  text-align: center;
  font-size: .8rem;
  letter-spacing: .45em;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 14px;
  padding-left: .45em;
}

/* ---------- Intro / 導言與數據 ---------- */
.lead { text-align: center; max-width: 680px; margin: 0 auto; }
.lead p { color: var(--text-soft); font-size: 1.08rem; line-height: 1.9; margin: 0 0 16px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 44px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat .stat-num { font-size: 2.1rem; font-weight: 800; color: var(--accent); letter-spacing: -.5px; }
.stat .stat-label { color: var(--text-mute); font-size: .9rem; margin-top: 8px; line-height: 1.6; }

/* ---------- 關於本站 ---------- */
.about {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 46px 44px;
  box-shadow: var(--shadow);
}
.about h2 { font-size: 1.7rem; margin: 0 0 18px; letter-spacing: -.3px; }
.about p { color: var(--text-soft); margin: 0 0 16px; }
.about-points {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}
.about-points li { position: relative; padding-left: 28px; color: var(--text); }
.about-points li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  color: var(--accent);
  font-weight: 800;
}

/* ---------- 特點卡片 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 42px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.feature .fnum {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: 14px;
}
.feature h3 { margin: 0 0 8px; font-size: 1.08rem; color: var(--text); }
.feature p { margin: 0; color: var(--text-soft); font-size: .92rem; line-height: 1.75; }

@media (max-width: 940px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- 金句 ---------- */
.quote-band {
  text-align: center;
  padding: 72px 24px;
  background:
    radial-gradient(700px 220px at 50% 0%, rgba(79,70,229,.10), transparent 70%),
    var(--accent-soft);
  border-top: 1px solid #dcdcf5;
  border-bottom: 1px solid #dcdcf5;
}
.quote-band blockquote {
  border: none;
  margin: 0 auto;
  max-width: 720px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.6;
  letter-spacing: -.3px;
  color: var(--text);
  padding: 0;
}
.quote-band .qmark { color: var(--accent); }
.quote-band cite { display: block; margin-top: 18px; font-style: normal; color: var(--text-mute); font-size: .95rem; }

/* ---------- 常見問題 ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--text);
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--text); }
.faq-item p { margin: 0; color: var(--text-soft); }
.faq-item:hover { text-decoration: none; }
.faq-item:hover h3 { color: var(--accent); }
.faq-more { flex: 0 0 auto; color: var(--accent); font-size: .88rem; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .topic-grid, .topic-articles .card-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 280px; }
  .topic-next { align-items: flex-start; flex-direction: column; }
  .faq-item { align-items: flex-start; flex-direction: column; gap: 10px; }
  .related-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .about-points { grid-template-columns: 1fr; }
  .about { padding: 32px 24px; }
  .nav { gap: 10px; padding: 12px 18px; flex-wrap: wrap; }
  .nav-links { width: 100%; margin-left: 40px; gap: 8px 14px; }
  .nav-links a { font-size: .82rem; }
  .hero { padding: 60px 20px 54px; }
  .section { padding: 48px 0; }
}
