:root {
  color-scheme: light;
  --ink: #1e2a26;
  --muted: #61706a;
  --forest: #173f35;
  --forest-2: #24584b;
  --paper: #f7f3ea;
  --surface: #fffdf8;
  --line: #d9d4c8;
  --gold: #b8863b;
  --gold-soft: #efe0bd;
  --sage: #dce8df;
  --danger: #a33b32;
  --shadow: 0 18px 55px rgba(37, 49, 44, 0.09);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(23, 63, 53, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 63, 53, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

a { color: var(--forest-2); text-underline-offset: 3px; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: #fff;
  color: var(--forest);
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.site-header {
  min-height: 72px;
  padding: 14px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #f8f5ed;
  background: var(--forest);
  border-bottom: 4px solid var(--gold);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: .04em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--gold-soft);
  border-radius: 50%;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 20px;
}
.header-note { color: #d6e1dc; font-size: 14px; }

#app {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 210px);
  margin: 42px auto 72px;
}

.shell { display: grid; gap: 24px; }
.narrow { width: min(760px, 100%); margin-inline: auto; }
.two-column { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.stack { display: grid; gap: 18px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 7vw, 72px);
  color: #f9f6ef;
  background: var(--forest);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "7";
  position: absolute;
  right: clamp(18px, 5vw, 68px);
  bottom: -74px;
  color: rgba(239, 224, 189, .12);
  font: 240px/1 Georgia, serif;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #e5c985; }
h1, h2, h3, h4 { color: var(--forest); line-height: 1.25; }
.hero h1 { position: relative; max-width: 760px; margin: 0 0 18px; color: #fff; font: 700 clamp(34px, 5vw, 62px)/1.12 Georgia, "Noto Serif TC", serif; }
.hero p { position: relative; max-width: 720px; color: #e4ece8; font-size: 17px; line-height: 1.9; }
.hero .button { position: relative; margin-top: 14px; }

.card {
  padding: clamp(22px, 4vw, 36px);
  background: rgba(255, 253, 248, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card h1, .card h2, .card h3 { margin-top: 0; }
.card.accent { border-top: 5px solid var(--gold); }
.card.soft { box-shadow: none; background: #f0ede4; }
.card.compact { padding: 20px; }

.prose { line-height: 1.85; }
.prose h2 { margin-top: 32px; font-size: 25px; }
.prose h3 { margin-top: 26px; font-size: 20px; }
.prose h4 { margin-top: 22px; font-size: 17px; }
.prose p { margin: 12px 0; }
.prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--sage);
  border-left: 4px solid var(--forest-2);
  border-radius: 0 10px 10px 0;
}
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 8px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.prose th { color: #fff; background: var(--forest); text-align: left; }
.prose th, .prose td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }

.button {
  appearance: none;
  min-height: 46px;
  padding: 11px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--forest);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.button:hover { background: var(--forest-2); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(23,63,53,.16); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(184,134,59,.45); outline-offset: 2px; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.secondary { color: var(--forest); background: transparent; border-color: #8a9a94; }
.button.secondary:hover { background: var(--sage); }
.button.gold { color: #2f2819; background: #e3c77e; }
.button.text { min-height: auto; padding: 6px 0; color: var(--forest-2); background: transparent; border-radius: 0; }
.button.text:hover { box-shadow: none; text-decoration: underline; }

label { display: block; margin-bottom: 7px; font-weight: 750; color: var(--forest); }
input[type="email"], input[type="text"], textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #aab4af;
  border-radius: 10px;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.field { margin: 20px 0; }
.field-help, .muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.field-error { min-height: 1.4em; margin-top: 6px; color: var(--danger); font-size: 14px; }

.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 28px 0; counter-reset: flow; }
.flow-step { padding: 16px; background: #f1ede3; border-radius: 12px; font-size: 14px; line-height: 1.55; }
.flow-step::before { counter-increment: flow; content: counter(flow); display: grid; width: 28px; height: 28px; place-items: center; margin-bottom: 10px; color: #fff; background: var(--forest); border-radius: 50%; font-weight: 800; }

.notice { padding: 14px 16px; background: var(--sage); border: 1px solid #bdd0c4; border-radius: 12px; line-height: 1.65; }
.notice.error { color: #722b25; background: #fae8e4; border-color: #efb8af; }
.notice.warning { background: #fff4d6; border-color: #ead199; }

.progress-header { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.progress-track { height: 8px; overflow: hidden; background: #d9dedb; border-radius: 99px; }
.progress-track span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.day-list { display: grid; gap: 10px; margin-top: 18px; }
.day-row { width: 100%; display: grid; grid-template-columns: 50px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px; text-align: left; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.day-row:hover:not(:disabled) { border-color: var(--gold); }
.day-row:disabled { cursor: default; opacity: .65; }
.day-number { display: grid; place-items: center; width: 42px; height: 42px; color: var(--forest); background: var(--sage); border-radius: 50%; font-weight: 800; }
.day-row strong { display: block; color: var(--forest); }
.day-row small { color: var(--muted); }
.status { padding: 5px 9px; border-radius: 999px; background: #ece9e0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status.completed { background: #d9eadf; color: #1e6548; }
.status.in_progress { background: #fff0ca; color: #795815; }

.course-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.day-kicker { color: var(--gold); font-weight: 800; letter-spacing: .12em; }
.lesson-card { padding: clamp(24px, 5vw, 48px); }
.reminder { margin: 28px 0; padding: 18px 20px; background: var(--sage); border-radius: 14px; }
.reminder h2 { margin: 0 0 8px; font-size: 18px; }
.video-card { margin: 24px 0; padding: 22px; color: #fff; background: var(--forest-2); border-radius: 16px; }
.video-card h2 { color: #fff; }
.video-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; background: #000; }

details.record-card, details.optional-reading, details.info-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
details summary { padding: 16px 18px; color: var(--forest); font-weight: 750; cursor: pointer; }
details[open] summary { border-bottom: 1px solid var(--line); }
.details-body { padding: 18px; }

.checklist { display: grid; gap: 12px; margin: 18px 0 26px; }
.check-item { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 12px; align-items: start; padding: 15px; background: #f3f0e8; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.check-item:has(input:checked) { background: var(--sage); border-color: #acc7b6; }
.check-item input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--forest); }

.sticky-actions { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 26px; padding: 12px; background: rgba(247,243,234,.94); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); }
.save-state { margin-right: auto; align-self: center; padding-left: 8px; color: var(--muted); font-size: 13px; }

.result-day { padding: 20px 0; border-bottom: 1px solid var(--line); }
.result-day:last-child { border-bottom: 0; }
.result-day h3 { margin-bottom: 10px; }
.result-answer { margin: 10px 0; padding-left: 14px; border-left: 3px solid var(--gold-soft); }

.loading-state, .empty-state { min-height: 420px; display: grid; place-items: center; align-content: center; text-align: center; }
.spinner { width: 34px; height: 34px; border: 3px solid #c8d2cd; border-top-color: var(--forest); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 360px; padding: 13px 16px; color: #fff; background: var(--forest); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }
.site-footer { padding: 28px 20px 38px; text-align: center; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 6px; }

@media (max-width: 860px) {
  .two-column { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr 1fr; }
  .header-note { display: none; }
}
@media (max-width: 560px) {
  #app { width: min(100% - 20px, 1120px); margin-top: 20px; }
  .site-header { padding-inline: 16px; }
  .hero { border-radius: 18px; padding: 30px 22px; }
  .hero h1 { font-size: 36px; }
  .card, .lesson-card { padding: 20px 17px; }
  .flow-steps { grid-template-columns: 1fr; }
  .day-row { grid-template-columns: 44px minmax(0,1fr); }
  .day-row .status { grid-column: 2; justify-self: start; }
  .sticky-actions { position: static; border-radius: 14px; }
  .sticky-actions .button { width: 100%; }
  .save-state { width: 100%; text-align: center; }
  .prose table { display: block; overflow-x: auto; }
}
