/* 17FIT 商學院 — 統一文章模板 */
:root {
  --blue: #2F6FEB;
  --blue-700: #1F54C4;
  --blue-50: #EEF3FE;
  --blue-100: #DCE7FD;
  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #5B6472;
  --line: #E3E7EE;
  --bg: #F6F8FB;
  --card: #FFFFFF;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --fs-body: 17px;
  --radius: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden]:not([hidden="until-found" i]) { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: 1.8; color: var(--ink-2); background: var(--bg); }
@media (max-width: 768px) { :root { --fs-body: 16px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
a { color: var(--blue-700); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.od-icon { width: var(--od-icon-size, 1em); height: var(--od-icon-size, 1em); flex: none; display: inline-block; vertical-align: middle; }

/* Hero */
.hero { background: var(--card); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 48px 24px 40px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--blue-700); background: var(--blue-50); }
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.hero h1 { margin: 0 0 16px; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.3; font-weight: 800; color: var(--ink); letter-spacing: -.005em; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-3); }
.meta li { white-space: nowrap; }
.hero-cover { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.hero-cover img { display: block; width: 100%; height: auto; }
@media (max-width: 1023px) { .hero-inner { grid-template-columns: 1fr; gap: 24px; padding: 32px 16px; } }

/* Layout */
.layout { max-width: 1120px; margin: 0 auto; padding: 48px 24px 96px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; }
.layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.layout.no-toc .article { margin: 0 auto; }
@media (max-width: 1023px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 16px 64px; } }
.toc { position: sticky; top: calc(var(--top-offset, 64px) + 24px); align-self: start; max-height: calc(100vh - var(--top-offset, 64px) - 48px); overflow-y: auto; }
.toc-title { font-size: 14px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 16px; margin-left: -2px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.5; color: var(--ink-3); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--blue-700); border-left-color: var(--blue); font-weight: 600; }
.toc-mobile { display: none; }
@media (max-width: 1023px) {
  .toc { display: none; }
  .toc-mobile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
  .toc-mobile summary { cursor: pointer; list-style: none; padding: 12px 16px; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary::after { content: "＋"; color: var(--blue); }
  .toc-mobile[open] summary::after { content: "－"; }
  .toc-mobile ol { margin: 0; padding: 0 16px 12px 32px; }
  .toc-mobile li { padding: 4px 0; }
  .toc-mobile a { text-decoration: none; }
}

/* Prose */
.article { max-width: 720px; min-width: 0; }
.prose > * { margin-top: 0; margin-bottom: 24px; }
.prose h2 { font-size: clamp(22px, 2.8vw, 28px); line-height: 1.4; color: var(--ink); font-weight: 800; margin: 56px 0 20px; padding-top: 4px; scroll-margin-top: calc(var(--top-offset, 64px) + 16px); }
.prose h3 { font-size: 20px; line-height: 1.5; color: var(--ink); font-weight: 700; margin: 36px 0 12px; }
.prose h4 { font-size: 17px; color: var(--ink); font-weight: 700; margin: 28px 0 8px; }
.prose > :first-child { margin-top: 0; }
.prose strong, .prose b { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--blue); }
.prose img { max-width: 100%; height: auto; border-radius: 8px; vertical-align: middle; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figure img { display: block; margin: 0 auto; }
.prose figcaption { font-size: 14px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 20px 24px; background: var(--blue-50); border-radius: var(--radius); color: var(--ink-2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg); color: var(--ink); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose .embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.prose .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Related */
.related { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.related h2 { font-size: 22px; margin: 0 0 16px; color: var(--ink); }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-list li { margin: 0; }
.related-list a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink-2); transition: border-color .2s var(--ease); }
.related-list a:hover { border-color: var(--blue); }
.rl-date { font-size: 13px; color: var(--ink-3); }
.rl-title { font-weight: 700; color: var(--ink); line-height: 1.5; }
.related-empty { padding: 24px; background: var(--card); border: 1px dashed #C9D1DD; border-radius: var(--radius); }
.related-empty p { margin: 0 0 8px; color: var(--ink-3); }
.related-home { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; --od-icon-size: 16px; }
@media (max-width: 560px) { .related-list { grid-template-columns: 1fr; } }

/* About + CTA */
.about { margin-top: 48px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.about h2 { font-size: 22px; margin: 0; color: var(--ink); }
.about p { margin: 16px 0 0; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 16px; transition: background-color .2s var(--ease), color .2s var(--ease); --od-icon-size: 18px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-ghost { border: 2px solid var(--blue); color: var(--blue-700); background: #fff; }
.btn-ghost:hover { background: var(--blue-50); color: var(--ink); }
@media (max-width: 560px) { .about { padding: 24px; } }

@media print {
  body { background: #fff; padding-top: 0 !important; }
  .toc, .toc-mobile, .cta, .related, #pages-footer { display: none !important; }
  .layout { display: block; padding: 0; }
  .prose h2, .prose h3 { break-after: avoid; }
  .prose figure, .prose table, .prose blockquote { break-inside: avoid; }
}
