:root {
  --bg: #f5f1eb;
  --card: #fffefa;
  --card-soft: #f1ece5;
  --border: #ded8cd;
  --ink: #1f2630;
  --muted: #757984;
  --primary: #172f49;
  --accent: #d7a64f;
  --pink: #ee5f7f;
  --green: #4dc6a2;
  --danger: #b83d57;
  --shadow: 0 2px 8px rgba(31, 38, 48, .08), 0 1px 2px rgba(31, 38, 48, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }
code { padding: 2px 5px; border-radius: 5px; background: #eee8df; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: var(--primary);
  color: #f9f4ec;
  padding: 31px 16px 29px;
  flex: 0 0 auto;
}

.header-inner {
  position: relative;
  max-width: 672px;
  margin: 0 auto;
  text-align: center;
}

.language-pill {
  position: absolute;
  top: 1px;
  right: 0;
  height: 26px;
  padding: 3px 13px 0;
  border: 1px solid rgba(249, 244, 236, .4);
  border-radius: 999px;
  color: #f9f4ec;
  font-size: 12px;
  text-decoration: none;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
}

.site-header p {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(249, 244, 236, .9);
}

.main {
  flex: 1;
  padding: 26px 16px 120px;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
}

.label {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 14px;
  color: #5a606b;
}

.date-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.date-btn {
  min-width: 91px;
  height: 50px;
  padding: 7px 12px 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.date-btn.long { min-width: 124px; }
.date-btn.active { background: #eee9e1; color: #85838a; }
.date-btn:hover { transform: translateY(-1px); }

.date-text { display: block; line-height: 18px; }
.seats { display: flex; gap: 3px; margin-top: 4px; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: block;
}
.dot.used { background: var(--pink); }
.date-btn.active .dot { opacity: .35; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px 24px 24px;
}

.event-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 800;
}

.soldout {
  flex: 0 0 auto;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ee4c70;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.soldout .dot { background: var(--pink); width: 10px; height: 10px; }

.meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 2px 0 23px;
  font-size: 14px;
  color: #3b4652;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 9px;
  background: #eef2f4;
  color: #253241;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}

.price {
  background: #e7fbf5;
  border: 1px solid #bde9de;
  color: #2e806c;
  font-weight: 800;
}

h3 {
  margin: 0 0 17px;
  font-size: 18px;
  font-weight: 500;
}

.timeline { margin: 0 0 28px; }

.step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: 0; }

.num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 1px;
  font-weight: 800;
  font-size: 15px;
}

.duration {
  background: #f1ece5;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 600;
  color: #343b45;
}

.step p {
  margin: 0;
  color: #545b66;
  font-size: 13px;
  line-height: 1.45;
}

.takeaway {
  margin: 0 0 24px;
  padding: 18px;
  border-radius: 14px;
  background: var(--card-soft);
}

.takeaway h3,
.teacher h3 {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 800;
}

.takeaway p {
  margin: 5px 0;
  font-size: 15px;
}

.teacher {
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(241, 236, 229, .72);
  padding: 18px 18px 16px;
  margin-bottom: 24px;
}

.teacher strong {
  display: block;
  font-size: 15px;
  margin-bottom: 1px;
}

.teacher .role {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.teacher p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.tag {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 254, 250, .72);
  font-size: 12px;
  font-weight: 600;
}

.cta-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border-radius: 16px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.cta-button {
  width: 100%;
  border: 0;
  background: var(--primary);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--border);
  background: #fffefa;
  color: var(--primary);
}

.page-card {
  padding: 28px 24px;
}

.about-lead {
  margin-top: 14px;
  color: #3d4652;
  white-space: pre-line;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffefa;
  color: var(--ink);
  padding: 12px 13px;
  font: inherit;
}

.field textarea { resize: vertical; }

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.notice {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  background: #f1ece5;
  color: #3f4852;
  font-size: 14px;
}

.payment-box {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #bde9de;
  border-radius: 14px;
  background: #e7fbf5;
}

.payment-box h3 {
  margin-bottom: 8px;
  font-weight: 800;
}

.payment-box p {
  margin: 4px 0;
  color: #253241;
  font-size: 14px;
}

.error { color: var(--danger); }
.success { color: #2e806c; }
.muted { color: var(--muted); }
.status-line { min-height: 24px; font-size: 14px; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  border-top: 1px solid var(--border);
  background: rgba(250, 247, 241, .93);
  backdrop-filter: blur(12px);
  z-index: 5;
}

.bottom-inner {
  max-width: 672px;
  height: 100%;
  display: flex;
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  color: #6d7480;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.nav-item.active { color: var(--primary); }
.nav-icon { display: block; font-size: 22px; line-height: 22px; margin-bottom: 3px; }

.made-with {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: #202020;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  pointer-events: none;
}

.admin-body {
  background: #ede8df;
}

.admin-body.is-locked .admin-wrap {
  display: none;
}

.admin-login {
  display: none;
  min-height: 100vh;
  padding: 24px 16px;
  align-items: center;
  justify-content: center;
}

.admin-body.is-locked .admin-login {
  display: flex;
}

.admin-login-card {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin-bottom: 18px;
  color: var(--primary);
}

.admin-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px;
}

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.admin-head h1 { color: var(--primary); }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-weight: 700; }
.ghost-link { color: var(--primary); font-weight: 800; text-decoration: none; }
.admin-actions { display: flex; gap: 10px; margin: 20px 0 28px; }
.admin-actions .cta-button { width: auto; }
.admin-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.section-title-row,
.mini-title-row,
.course-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title-row {
  margin-bottom: 12px;
}

.section-title-row h2,
.mini-title-row h3 {
  margin: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.course-editor {
  margin: 16px 0 24px;
}

.course-toolbar {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
}

.course-toolbar p {
  margin: 0;
  font-weight: 700;
}

.sub-editor {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(241, 236, 229, .45);
}

.step-editor {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.list-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.list-item-row input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffefa;
  color: var(--ink);
  padding: 12px 13px;
  font: inherit;
}

.icon-button {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffefa;
  color: var(--danger);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.danger-button {
  color: var(--danger);
}

.empty-hint {
  margin: 12px 0 0;
}

.registrations-panel {
  margin: 16px 0 28px;
}

.registration-list {
  display: grid;
  gap: 12px;
}

.registration-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(241, 236, 229, .45);
}

.registration-card p {
  margin: 5px 0;
  color: #3f4852;
  font-size: 14px;
}

.registration-head,
.registration-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.registration-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 10px;
}

.json-editor {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #111827;
  color: #f8fafc;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .site-header { padding: 30px 16px 28px; }
  .language-pill { right: 2px; }
  .main { padding: 24px 14px 112px; }
  .card { padding: 26px 20px 22px; border-radius: 15px; }
  .event-head { display: block; }
  .soldout { width: 100%; justify-content: flex-end; margin-top: 8px; }
  .date-grid { gap: 8px; }
  .date-btn { min-width: calc(33.333% - 6px); }
  .date-btn.long { min-width: calc(50% - 4px); }
  .made-with { display: none; }
  .admin-head { display: block; }
  .section-title-row,
  .mini-title-row,
  .course-toolbar {
    align-items: stretch;
    display: grid;
  }
  .admin-grid,
  .list-item-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  h1 { font-size: 28px; }
  .language-pill { position: static; margin: 0 0 12px auto; display: inline-flex; }
  .date-btn,
  .date-btn.long { min-width: calc(50% - 4px); }
  .card { padding-left: 18px; padding-right: 18px; }
  .step { gap: 10px; }
  .meta { gap: 7px; }
  .admin-actions { display: grid; }
}

/* Course registration reference-style routes */
body { background: #f7f3ec; color: #332f2a; }
.topbar { max-width: 760px; margin: 0 auto; padding: 22px 18px 8px; }
.topbar h1 { margin: 8px 0 6px; color: #2f2b26; }
.language-pill { color: #7a6d5f; font-size: 13px; text-decoration: none; }
.app-shell, .survey-shell, .admin-content { max-width: 760px; margin: 0 auto; padding: 14px 16px 92px; }
.page-card, .survey-card, .registration-card { background: #fffaf2; border: 1px solid #eadfce; border-radius: 14px; box-shadow: 0 10px 24px rgba(74,60,40,.08); padding: 18px; }
.lead { color: #6f6253; line-height: 1.8; }
.strong-lead { color: #41372d; font-weight: 800; }
.signature-line { color: #7a5f38; font-weight: 900; line-height: 1.8; }
.home-section { margin-top: 18px; }
.hero-image, .course-image, .about-image { margin: 0 0 16px; overflow: hidden; border-radius: 14px; border: 1px solid #eadfce; background: #fffaf2; }
.hero-image { max-width: 760px; margin: 12px auto 16px; }
.hero-image img, .course-image img, .about-image img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.course-image img, .about-image img { max-height: 320px; }
.about-grid { display: grid; gap: 12px; margin: 14px 0; }
.about-item { display: grid; grid-template-columns: 42px 1fr; gap: 4px 12px; padding: 14px; border: 1px solid #eadfce; border-radius: 12px; background: #fff; }
.about-item > div { grid-row: span 2; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fbf1df; }
.about-item h4 { margin: 0; color: #2f2b26; }
.about-item p { margin: 0; color: #6f6253; line-height: 1.65; }
.contact-box { margin-top: 16px; padding: 16px; border-radius: 12px; background: #1f2d4a; color: #fff; }
.contact-box h3 { color: #fff; margin-top: 0; }
.contact-box .muted { color: rgba(255,255,255,.7); }
.survey-preview { background: #1f2d4a; color: #fff; }
.survey-preview h2 { color: #fff; }
.survey-preview .lead, .survey-preview .eyebrow { color: rgba(255,255,255,.78); }
.course-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; }
.course-tabs button { flex: 0 0 auto; border: 1px solid #d9cab5; border-radius: 999px; background: #fff; color: #675b4d; padding: 9px 12px; font-weight: 700; }
.course-tabs button.active { background: #1f2d4a; color: #fff; border-color: #1f2d4a; }
.course-title-row, .registration-head, .finance-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.status-pill { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; background: #e9f7ef; color: #26613e; font-size: 13px; font-weight: 800; }
.status-pill.closed { background: #efe7dd; color: #776756; }
.price-line { color: #70543a; font-weight: 800; }
.flow-list, .registration-list, .finance-list { display: grid; gap: 12px; }
.flow-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px; border: 1px solid #eadfce; border-radius: 12px; background: #fff; }
.flow-item > span, .q-number { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; background: #1f2d4a; color: #fff; font-weight: 800; }
.flow-item small { display: block; color: #8d7e6f; margin: 4px 0; }
.takeaway-list, .belief-list, .teacher-box, .payment-box { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: #fbf1df; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span { border-radius: 999px; padding: 6px 10px; background: #fff; border: 1px solid #eadfce; color: #685948; font-size: 13px; }
.stack-form, .survey-form { display: grid; gap: 12px; }
.stack-form input, .stack-form select, .stack-form textarea, .survey-form input, .survey-form textarea, .registration-actions select, .admin-login-card input { width: 100%; border: 1px solid #d7c8b4; border-radius: 10px; padding: 12px 13px; background: #fff; font: inherit; }
.survey-card { max-width: 680px; margin: 0 auto; }
.survey-question { display: grid; gap: 12px; padding: 20px 0; border-top: 1px solid #eadfce; }
.survey-question h2 { margin: 0; font-size: 18px; line-height: 1.45; }
.option-list { display: grid; gap: 10px; }
.option-list label, .check-field { display: flex; gap: 10px; align-items: flex-start; color: #4a433b; }
.option-list label { padding: 10px 12px; border: 1px solid #eadfce; border-radius: 10px; background: #fff; line-height: 1.55; }
.option-list input { width: auto; margin-top: 4px; }
.text-field { display: grid; gap: 6px; color: #6f6253; font-weight: 800; }
.survey-footer { text-align: center; color: #8a7865; line-height: 1.7; }
.admin-top { background: #1a2744; color: #fff; padding: 22px 18px; }
.admin-top > * { max-width: 960px; margin-left: auto; margin-right: auto; }
.admin-top h1 { color: #fff; margin: 0 0 4px; }
.admin-top p { color: rgba(255,255,255,.7); }
.admin-top nav { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.admin-top a, .admin-top button { border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: transparent; color: #fff; padding: 8px 12px; text-decoration: none; font: inherit; }
.stat-grid, .finance-structure { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.stat-grid article, .finance-structure article, .course-counts p { background: #fffaf2; border: 1px solid #eadfce; border-radius: 12px; padding: 14px; }
.stat-grid strong, .finance-structure strong { display: block; color: #1a2744; font-size: 28px; }
.course-counts { display: grid; gap: 8px; }
.course-counts p, .mini-stats { display: flex; justify-content: space-between; gap: 12px; }
.registration-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.danger-button { border: 0; border-radius: 10px; background: #fee2e2; color: #991b1b; padding: 10px 12px; font-weight: 800; }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 999px; background: #f5ead9; }
.admin-login-card { text-align: center; }
.disabled { pointer-events: none; opacity: .55; }
.content-editor { margin: 28px 0; padding: 18px; border: 1px solid #eadfce; border-radius: 14px; background: #fff7ea; }
.section-head, .course-edit-head, .sticky-save { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.content-form, .course-editor-list, .course-edit-card { display: grid; gap: 14px; }
.course-edit-card { padding: 14px; border: 1px solid #e3d4bf; border-radius: 12px; background: #fffefa; }
.editor-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.editor-grid label { display: grid; gap: 6px; color: #51483d; font-size: 13px; font-weight: 800; }
.editor-grid label.wide { grid-column: 1 / -1; }
.editor-grid label span { color: #8a7865; font-size: 12px; font-weight: 600; }
.editor-grid input, .editor-grid select, .editor-grid textarea { width: 100%; border: 1px solid #d7c8b4; border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
.editor-grid .check-field input { width: auto; }
.editor-grid textarea { min-height: 76px; resize: vertical; }
.sticky-save { position: sticky; bottom: 78px; z-index: 2; padding: 12px; border: 1px solid #dfd0bb; border-radius: 12px; background: rgba(255,250,242,.94); backdrop-filter: blur(10px); }
.sticky-save .cta-button { width: auto; min-width: 180px; }
@media (min-width: 760px) { .stat-grid, .finance-structure { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 560px) { .course-title-row, .registration-head, .finance-row, .course-counts p, .mini-stats { display: grid; } }
@media (max-width: 560px) { .section-head, .course-edit-head, .sticky-save, .editor-grid { display: grid; } .sticky-save .cta-button { width: 100%; } }
