/* =========================================================
   永續採購學堂 — AI 賦能永續採購管理
   配色：teal（永續）× indigo（AI）
   版面：參考 SAP Learning（learning.sap.com）
   ========================================================= */

:root {
  color-scheme: light;

  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-2: #f0f6f3;
  --ink: #15282c;
  --muted: #5a6c70;
  --faint: #8aa0a0;
  --line: #e1eae6;

  --brand: #0e7c6b;
  --brand-strong: #0a5c50;
  --brand-deep: #07332d;
  --brand-soft: #e2f3ee;

  --accent: #4655c4;
  --accent-soft: #eceffb;

  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --green: #15803d;
  --green-soft: #e8f6ec;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --sky: #0369a1;
  --sky-soft: #e7f4fb;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(21, 40, 44, 0.05), 0 8px 24px rgba(21, 40, 44, 0.07);
  --shadow-soft: 0 1px 3px rgba(21, 40, 44, 0.08);

  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC",
    system-ui, -apple-system, "Segoe UI", sans-serif;

  --topbar-h: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

img,
svg {
  vertical-align: middle;
}

a {
  color: var(--brand-strong);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-deep);
  color: #fff;
  padding: 10px 18px;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

/* =================== Top bar =================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  white-space: nowrap;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 11.5px;
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.top-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14.5px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.top-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.top-nav a[aria-current="true"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  white-space: nowrap;
}

#progressRing {
  transition: stroke-dashoffset 0.4s ease;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.read-progress {
  height: 3px;
  background: transparent;
}

.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.1s linear;
}

/* =================== Mobile menu =================== */

.mobile-menu {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 14px 20px 20px;
  max-height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}

.mobile-menu-chapters {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}

.mobile-menu-chapters a {
  display: grid;
  place-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.mobile-menu-chapters a.is-done {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: transparent;
}

.mobile-menu-chapters a[aria-current="true"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(11, 30, 28, 0.45);
}

/* =================== Hero =================== */

.hero {
  background: radial-gradient(900px 480px at 88% -12%, rgba(70, 85, 196, 0.12), transparent 60%),
    radial-gradient(1000px 520px at -10% 110%, rgba(14, 124, 107, 0.12), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #e2f3ee 100%);
  color: var(--ink);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) 24px clamp(56px, 8vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.hero-badge span {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c4e6dc;
  color: var(--brand-strong);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.18;
  letter-spacing: 0.01em;
  color: var(--brand-deep);
}

.hero-sub {
  margin: 0 0 28px;
  max-width: 56ch;
  font-size: clamp(15.5px, 1.4vw, 17.5px);
  color: var(--muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  font-size: 15.5px;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
  border: none;
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(14, 124, 107, 0.35);
}

.btn-primary:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.btn-ghost {
  background: #ffffff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn-ghost:hover {
  background: var(--brand-soft);
}

.btn-light {
  background: #fff;
  color: var(--brand-deep);
}

.hero-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3.4vw, 44px);
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.hero-stats strong {
  font-size: clamp(24px, 2.6vw, 32px);
  color: var(--brand-deep);
}

.hero-stats span {
  font-size: 13px;
  color: var(--muted);
}

.hero-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(7, 51, 45, 0.14);
}

.hero-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.hero-card-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand);
}

.hero-card-head strong {
  font-size: 19px;
}

.hero-card-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-card-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--brand-soft);
  border: 1px solid #cdeae2;
  border-radius: 14px;
  padding: 12px 16px;
}

.hero-card-steps span {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand);
  flex: none;
}

.hero-card-steps strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}

.hero-card-steps small {
  color: var(--muted);
  font-size: 12.5px;
}

/* =================== Home sections =================== */

.section {
  padding: clamp(52px, 7vw, 88px) 0;
}

.section-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--brand);
  text-transform: uppercase;
}

.section h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.3;
}

.section-lead {
  margin: 0 0 30px;
  max-width: 72ch;
  color: var(--muted);
}

/* outcomes */

.outcome-grid {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
}

.outcome-grid li {
  position: relative;
  padding: 16px 18px 16px 52px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15.5px;
  box-shadow: var(--shadow-soft);
}

.outcome-grid li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--brand-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%230a5c50' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

/* parts */

.parts {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.part-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.part-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 130%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.part-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.part-card .part-no {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.part-card h3 {
  margin: 0;
  font-size: 18.5px;
}

.part-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  flex: 1;
}

.part-card .part-meta {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-strong);
}

/* curriculum */

.curriculum-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.curriculum-part > h3 {
  margin: 0 0 4px;
  font-size: 19px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.curriculum-part > h3 .part-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.curriculum-part > p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--faint);
}

.chapter-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform 0.13s, box-shadow 0.13s, border-color 0.13s;
}

.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #c8ddd6;
}

.chapter-card .chap-no {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 18px;
}

.chapter-card.is-done .chap-no {
  background: var(--brand);
  color: #fff;
}

.chapter-card .chap-info strong {
  display: block;
  font-size: 16.5px;
  line-height: 1.45;
}

.chapter-card .chap-info span {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}

.chapter-card .chap-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

.chip.done {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

/* audience / method */

.audience {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.audience-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.audience-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg);
}

.audience-grid h3 {
  margin: 0 0 8px;
  font-size: 17.5px;
}

.audience-grid p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.method-steps {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  counter-reset: step;
}

.method-steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow-soft);
}

.method-steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.method-steps strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.method-steps span {
  font-size: 13.5px;
  color: var(--muted);
}

/* CTA band */

.cta-band {
  background: linear-gradient(130deg, var(--brand-deep), var(--brand-strong));
  color: #fff;
  text-align: center;
  padding: clamp(48px, 6vw, 72px) 0;
}

.cta-band h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 32px);
}

.cta-band p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.82);
}

/* =================== Chapter view =================== */

.chapter-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* sidebar: 本章目錄 */

.chapter-toc {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  max-height: calc(100dvh - var(--topbar-h) - 40px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.chapter-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chapter-toc-head strong {
  font-size: 15px;
}

.chapter-toc-close {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 8px;
}

.chapter-toc a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.5;
  transition: background 0.12s;
}

.chapter-toc a:hover {
  background: var(--surface-2);
  color: var(--brand-strong);
}

.chapter-toc a.is-active {
  background: var(--brand-soft);
  font-weight: 700;
  color: var(--brand-deep);
}

/* main column */

.chapter-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.breadcrumb {
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.breadcrumb .sep {
  color: var(--faint);
}

.chapter-toc-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.chapter-head {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3.4vw, 40px);
  margin-bottom: 28px;
  box-shadow: var(--shadow-soft);
}

.chapter-head .head-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.badge-part {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-num {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.badge-done {
  background: var(--green-soft);
  color: var(--green);
}

.chapter-head h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.3;
}

.chapter-head .head-tagline {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16px;
}

.chapter-head .head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--faint);
  margin-bottom: 18px;
}

.objectives {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
}

.objectives strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--brand-deep);
}

.objectives ul {
  margin: 0;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--ink);
}

.objectives li {
  margin: 4px 0;
}

/* =================== Chapter content =================== */

.chapter-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3.6vw, 44px);
  box-shadow: var(--shadow-soft);
  font-size: 16px;
  overflow-wrap: break-word;
}

.chapter-body > :first-child {
  margin-top: 0;
}

.chapter-body p.lead {
  font-size: 17.5px;
  color: var(--ink);
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px;
  margin: 0 0 30px;
}

.chapter-body h2 {
  font-size: clamp(20px, 2.4vw, 25px);
  margin: 44px 0 14px;
  line-height: 1.35;
  padding-top: 10px;
}

.chapter-body h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  margin-bottom: 12px;
}

.chapter-body h3 {
  font-size: 18px;
  margin: 28px 0 8px;
}

.chapter-body p {
  margin: 0 0 16px;
}

.chapter-body ul,
.chapter-body ol {
  margin: 0 0 18px;
  padding-left: 26px;
}

.chapter-body li {
  margin: 6px 0;
}

.chapter-body strong {
  color: var(--brand-deep);
}

/* tables */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.chapter-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 540px;
}

.chapter-body thead th {
  background: var(--brand-deep);
  color: #fff;
  text-align: left;
  font-weight: 700;
  padding: 11px 14px;
  white-space: nowrap;
}

.chapter-body tbody td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.chapter-body tbody tr:nth-child(even) {
  background: var(--surface-2);
}

/* callouts */

.callout {
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 0 0 22px;
  border: 1px solid transparent;
}

.callout p {
  margin: 0 0 10px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.callout-def {
  background: var(--brand-soft);
  border-color: #c4e6dc;
}

.callout-def .callout-tag {
  color: var(--brand-strong);
}

.callout-ai {
  background: var(--accent-soft);
  border-color: #d4daf6;
}

.callout-ai .callout-tag {
  color: var(--accent);
}

.callout-esg {
  background: var(--green-soft);
  border-color: #c9e9d3;
}

.callout-esg .callout-tag {
  color: var(--green);
}

.callout-case {
  background: var(--amber-soft);
  border-color: #f3e0bd;
}

.callout-case .callout-tag {
  color: var(--amber);
}

.callout-think {
  background: var(--sky-soft);
  border-color: #c8e4f4;
}

.callout-think .callout-tag {
  color: var(--sky);
}

.callout-warn {
  background: var(--red-soft);
  border-color: #f4cfcf;
}

.callout-warn .callout-tag {
  color: var(--red);
}

/* key terms */

.key-terms dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.key-terms dl > div {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.key-terms dt {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--brand-deep);
  margin-bottom: 4px;
}

.key-terms dd {
  margin: 0;
  font-size: 13.8px;
  color: var(--muted);
}

/* quiz */

.quiz-q {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--bg);
}

.quiz-q h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-options button {
  text-align: left;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.quiz-options button:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.quiz-options button:disabled {
  cursor: default;
  opacity: 0.72;
}

.quiz-options button.is-right {
  border-color: var(--green);
  background: var(--green-soft);
  opacity: 1;
  font-weight: 700;
}

.quiz-options button.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  opacity: 1;
}

.quiz-explain {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.quiz-result {
  font-weight: 800;
  font-size: 13px;
  margin-left: 8px;
}

.quiz-result.ok {
  color: var(--green);
}

.quiz-result.no {
  color: var(--red);
}

/* takeaways */

.takeaways {
  background: linear-gradient(160deg, var(--brand-soft), var(--accent-soft));
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 36px;
}

.takeaways h2 {
  margin-top: 0;
  padding-top: 0;
}

.takeaways h2::before {
  display: none;
}

.takeaways ul {
  margin-bottom: 0;
}

/* actions / pager */

.chapter-actions {
  margin: 26px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.btn-complete {
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 800;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 14px 30px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 124, 107, 0.35);
  transition: background 0.15s, transform 0.12s;
}

.btn-complete:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.btn-complete.is-done {
  background: var(--surface);
  color: var(--brand-strong);
  border-color: var(--brand);
  box-shadow: none;
}

.complete-hint {
  font-size: 13.5px;
  color: var(--muted);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pager a,
.pager span.pager-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.13s, box-shadow 0.13s;
  min-height: 78px;
}

.pager a:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-soft);
}

.pager .pager-dir {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.06em;
}

.pager .pager-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
}

.pager a.pager-next {
  text-align: right;
  align-items: flex-end;
}

.pager span.pager-empty {
  visibility: hidden;
}

/* =================== Footer =================== */

.footer {
  background: var(--brand-deep);
  color: rgba(255, 255, 255, 0.82);
  padding: 52px 0 32px;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 36px;
}

.footer-brand strong {
  display: block;
  color: #fff;
  font-size: 18px;
  margin-bottom: 8px;
}

.footer-brand p {
  margin: 0;
  font-size: 14px;
  max-width: 36ch;
}

.footer-col strong {
  display: block;
  color: #fff;
  font-size: 14px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 13.8px;
  padding: 4px 0;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-note {
  max-width: 1240px;
  margin: 36px auto 0;
  padding: 18px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}

/* =================== Loading / error =================== */

.loading,
.load-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.load-error a {
  font-weight: 700;
}

/* =================== RWD =================== */

@media (max-width: 1023px) {
  .chapter-layout {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 20px;
  }

  .chapter-toc {
    position: fixed;
    z-index: 120;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(330px, 86vw);
    max-height: none;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--line);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    padding-top: 22px;
  }

  body.toc-open .chapter-toc {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
  }

  .chapter-toc-close {
    display: block;
  }

  .chapter-toc-toggle {
    display: inline-flex;
  }

  .part-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audience-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 899px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    max-width: 520px;
  }

  .outcome-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 719px) {
  body {
    font-size: 15.5px;
  }

  .topbar-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .top-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .brand-text small {
    display: none;
  }

  .progress-pill {
    font-size: 12px;
    padding: 5px 10px 5px 7px;
  }

  .section-inner,
  .hero-inner,
  .footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chapter-layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chapter-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
  }

  .chapter-card .chap-no {
    width: 44px;
    height: 44px;
    font-size: 16px;
    border-radius: 12px;
  }

  .chapter-card .chap-side {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .part-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .method-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .key-terms dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager a.pager-next {
    text-align: left;
    align-items: flex-start;
  }

  .chapter-body p.lead {
    font-size: 16px;
    padding: 14px 16px;
  }

  /* stacked responsive tables */
  .chapter-body table {
    min-width: 0;
  }

  .chapter-body thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .chapter-body tbody tr {
    display: block;
    border-top: 1px solid var(--line);
    padding: 6px 0;
  }

  .chapter-body tbody tr:first-child {
    border-top: none;
  }

  .chapter-body tbody td {
    display: block;
    border: none;
    padding: 6px 14px;
  }

  .chapter-body tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--brand-strong);
    margin-bottom: 2px;
  }
}

@media (min-width: 720px) {
  .mobile-menu {
    display: none !important;
  }
}

@media print {
  .topbar,
  .footer,
  .chapter-toc,
  .pager,
  .chapter-actions,
  .chapter-toc-toggle {
    display: none !important;
  }

  .chapter-layout {
    display: block;
  }

  .chapter-body {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
