:root {
  --ink: #221f26;
  --muted: #69626e;
  --paper: #ffffff;
  --soft: #f5f2f6;
  --plum: #43285c;
  --plum-deep: #2d193f;
  --plum-light: #ede6f2;
  --gold: #c8a45d;
  --gold-light: #f1e5c9;
  --sage: #49675b;
  --sage-light: #e8f0ec;
  --line: #ded8e2;
  --danger: #a23d4d;
  --shadow: 0 18px 48px rgba(28, 19, 35, .12);
  --max: 1160px;
  --header-height: 74px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 12px); }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; line-height: 1.75; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 10px 14px; background: var(--paper); color: var(--plum); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.site-header { position: sticky; top: 0; z-index: 100; min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px max(24px, calc((100% - var(--max)) / 2)); border-bottom: 1px solid rgba(222, 216, 226, .9); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); }
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; background: var(--plum); color: #fff; font-family: "Noto Serif TC", Georgia, serif; font-size: 19px; }
.brand-copy strong, .brand-copy small { display: block; letter-spacing: 0; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: var(--muted); font-size: 11px; }
.site-nav { display: flex; align-items: center; gap: 16px; color: #4d4651; font-size: 13px; }
.site-nav a { padding: 8px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a:focus-visible { border-bottom-color: var(--gold); color: var(--plum); }
.site-nav .nav-cta { min-height: 42px; display: inline-flex; align-items: center; padding: 0 17px; border: 1px solid var(--plum); border-radius: 4px; color: var(--plum); font-weight: 700; }
.site-nav .nav-cta:hover, .site-nav .nav-cta:focus-visible { border-color: var(--plum); background: var(--plum); color: #fff; }
.menu-btn { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; }
.menu-btn span { width: 22px; height: 2px; display: block; margin: 4px auto; background: var(--plum); transition: transform .2s ease, opacity .2s ease; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-backdrop { display: none; }

.hero-banner { position: relative; min-height: 76svh; max-height: 760px; display: flex; align-items: center; overflow: hidden; color: #fff; background-color: var(--plum-deep); background-image: url("https://images.unsplash.com/photo-1506126613408-eca07ce68773?auto=format&fit=crop&w=1900&q=88"); background-position: center 42%; background-size: cover; }
.hero-shade { position: absolute; inset: 0; background: rgba(26, 14, 37, .68); }
.hero-content { position: relative; z-index: 2; width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 78px 0 94px; }
.hero-content .eyebrow { color: #f0d99d; }
.eyebrow { margin: 0 0 10px; color: #99732f; font-size: 12px; font-weight: 800; letter-spacing: 0; }
.hero-content h1 { max-width: 790px; margin: 0 0 22px; font-family: "Noto Serif TC", Georgia, serif; font-size: 64px; font-weight: 600; line-height: 1.25; letter-spacing: 0; }
.hero-lead { max-width: 650px; margin: 0 0 28px; color: rgba(255, 255, 255, .9); font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin: 13px 0 0; color: rgba(255, 255, 255, .68); font-size: 12px; }
.scroll-cue { position: absolute; right: max(24px, calc((100% - var(--max)) / 2)); bottom: 22px; z-index: 2; padding-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .5); color: rgba(255, 255, 255, .75); font-size: 12px; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 21px; border: 1px solid transparent; border-radius: 4px; font-weight: 800; line-height: 1.35; text-align: center; }
.button-primary { background: var(--plum); color: #fff; }
.button-primary:hover, .button-primary:focus-visible { background: var(--plum-deep); }
.button-primary:disabled { cursor: wait; opacity: .65; }
.button-gold { background: var(--gold); color: #211a24; }
.button-gold:hover, .button-gold:focus-visible { background: #ddbd78; }
.button-ghost { border-color: rgba(255, 255, 255, .72); background: transparent; color: #fff; }
.button-ghost:hover, .button-ghost:focus-visible { background: #fff; color: var(--plum-deep); }
.button-secondary { border-color: var(--line); background: #fff; color: var(--plum); }
.button-secondary:hover, .button-secondary:focus-visible { border-color: var(--plum); }

.section-pad { padding: 92px max(24px, calc((100% - var(--max)) / 2)); }
.section-pad[id], main [id] { scroll-margin-top: calc(var(--header-height) + 12px); }
.section-heading { max-width: 760px; margin-bottom: 42px; }
.section-heading.compact { margin-bottom: 30px; }
.section-heading h2, .service-copy h2, .story-copy h2, .shop-band h2, .final-cta h2, .flow-panel h2, .admin-view h2 { margin: 0 0 16px; font-family: "Noto Serif TC", Georgia, serif; font-size: 40px; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.section-heading p, .group-intro p, .service-copy > p, .story-copy > p, .shop-status p, .testimonial-placeholder p, .panel-lead { color: var(--muted); }

.path-band { background: var(--paper); }
.path-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.path-item { min-width: 0; min-height: 185px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 24px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; }
.path-item:hover, .path-item:focus-visible { background: var(--plum-light); outline: 0; }
.path-index { color: #9b7a3d; font: 700 12px/1 "Noto Sans TC", sans-serif; }
.path-item strong { margin-top: auto; padding-top: 28px; color: var(--plum); font: 600 22px/1.35 "Noto Serif TC", Georgia, serif; }
.path-item small { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.courses-section { background: var(--soft); }
.course-group { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); gap: 52px; padding: 48px 0; border-top: 1px solid var(--line); }
.course-group-ai { border-bottom: 1px solid var(--line); }
.group-intro > span { color: #99732f; font-size: 12px; font-weight: 800; }
.group-intro h3 { margin: 8px 0 12px; color: var(--plum); font: 600 27px/1.4 "Noto Serif TC", Georgia, serif; }
.course-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.course-card { min-width: 0; min-height: 175px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: #fff; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.course-card:hover, .course-card:focus-visible { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 14px 30px rgba(35, 24, 42, .09); }
.course-card h4 { margin: 7px 0 8px; font-size: 18px; line-height: 1.45; }
.course-card p { margin: 0; color: var(--muted); font-size: 13px; }
.course-type { color: var(--sage); font-size: 11px; font-weight: 800; }
.status-tag { align-self: flex-start; padding: 4px 8px; border: 1px solid #d8c9ad; border-radius: 3px; background: #fbf7ee; color: #775c2d; font-size: 11px; }
.center-action { display: flex; justify-content: center; padding-top: 40px; }

.service-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .75fr); gap: 70px; align-items: center; background: var(--sage); color: #fff; }
.service-band .eyebrow { color: #f0d99d; }
.service-copy > p { color: rgba(255, 255, 255, .82); }
.text-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .7); font-weight: 800; }
.service-principles { border-top: 1px solid rgba(255, 255, 255, .28); }
.service-principles div { display: grid; grid-template-columns: 80px 1fr; gap: 18px; align-items: baseline; padding: 21px 0; border-bottom: 1px solid rgba(255, 255, 255, .28); }
.service-principles span { color: #f0d99d; font: 600 20px/1.4 "Noto Serif TC", Georgia, serif; }
.service-principles p { margin: 0; color: rgba(255, 255, 255, .82); font-size: 14px; }

.resources-section { background: #fff; }
.resource-grid { display: grid; grid-template-columns: 1.15fr .85fr .85fr; gap: 14px; }
.resource-feature, .resource-item { min-width: 0; min-height: 260px; padding: 28px; border: 1px solid var(--line); border-radius: 6px; }
.resource-feature { background: var(--plum); color: #fff; }
.resource-item { background: #fff; }
.resource-label, .resource-item > span:first-child { color: var(--gold); font-size: 11px; font-weight: 800; }
.resource-feature h3, .resource-item h3 { margin: 15px 0 10px; font: 600 24px/1.4 "Noto Serif TC", Georgia, serif; }
.resource-feature p { color: rgba(255, 255, 255, .8); }
.resource-item p { color: var(--muted); }
.resource-feature .button { margin-top: 14px; background: var(--gold); color: #211a24; }

.shop-band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: center; gap: 50px; background: #242128; color: #fff; }
.shop-band .eyebrow { color: #f0d99d; }
.shop-status { padding: 24px 0 24px 28px; border-left: 2px solid var(--gold); }
.shop-status span { color: #f0d99d; font-weight: 800; }
.shop-status p { margin-bottom: 0; color: rgba(255, 255, 255, .72); }

.story-section { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); gap: 70px; align-items: center; background: var(--soft); }
.story-image { min-height: 590px; background-color: #d7c9df; background-image: url("https://images.unsplash.com/photo-1506126613408-eca07ce68773?auto=format&fit=crop&w=1100&q=88"); background-position: center; background-size: cover; }
.story-copy blockquote { margin: 30px 0 0; padding: 20px 0 20px 24px; border-left: 2px solid var(--gold); color: var(--plum); font: 600 22px/1.6 "Noto Serif TC", Georgia, serif; }

.testimonial-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); gap: 60px; align-items: center; background: #fff; }
.testimonial-placeholder { min-height: 230px; display: flex; flex-direction: column; justify-content: center; padding: 30px; border: 1px dashed #b8a7c4; background: var(--plum-light); }
.testimonial-placeholder span { color: var(--plum); font-weight: 800; }

.final-cta { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--plum-deep); color: #fff; text-align: center; }
.final-cta .eyebrow { color: #f0d99d; }
.final-cta .hero-actions { justify-content: center; }

.flow-panel, .admin-view { width: min(760px, calc(100% - 32px)); margin: 64px auto 90px; padding: 42px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); box-shadow: var(--shadow); }
.admin-view { width: min(1080px, calc(100% - 32px)); }
.panel-head { display: flex; justify-content: space-between; gap: 20px; }
.icon-button { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; }
.icon-button:hover, .icon-button:focus-visible { background: var(--soft); color: var(--plum); }
.progress { height: 6px; margin: 25px 0 35px; overflow: hidden; border-radius: 10px; background: #eee7f0; }
.progress i { display: block; width: 33.33%; height: 100%; background: var(--gold); transition: width .25s ease; }
.question h3 { margin: 0 0 22px; font: 600 25px/1.45 "Noto Serif TC", Georgia, serif; }
.options { display: grid; gap: 10px; }
.option { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); background: #fff; }
.option:hover { border-color: #b9a5c5; }
.option.selected { border-color: var(--plum); background: var(--plum-light); }
.option input { accent-color: var(--plum); }
form { display: grid; gap: 16px; }
label { display: grid; grid-template-columns: 1fr auto; gap: 6px; color: var(--muted); font-size: 13px; }
input { grid-column: 1 / -1; width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--ink); }
input:focus { border-color: var(--plum); outline: 2px solid rgba(67, 40, 92, .12); }
.required { color: var(--danger); font-size: 11px; }
.optional { color: var(--muted); font-size: 11px; }
.check { grid-template-columns: auto 1fr; align-items: start; gap: 9px; }
.check input { grid-column: 1; width: 18px; min-height: 18px; margin-top: 3px; accent-color: var(--plum); }
.check span { grid-column: 2; }
.form-error { min-height: 1.5em; margin: 0; color: var(--danger); font-size: 13px; }
.button-row, .result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.button-row .button-primary { margin-left: auto; }
.result-box { margin: 25px 0 18px; padding: 22px; border-left: 3px solid var(--gold); background: #faf5e9; }
.result-box span, .result-box strong { display: block; }
.result-box strong { margin: 5px 0 8px; color: var(--plum); font-size: 26px; }
.result-box p { margin: 0; color: var(--muted); }
.action-box { margin-bottom: 24px; padding: 18px 20px; border: 1px solid #cddbd4; background: var(--sage-light); }
.action-box h3 { margin: 0 0 5px; font-size: 15px; }
.action-box p { margin: 0; color: #425d51; }
.text-link-button { min-height: 48px; padding: 0 10px; border: 0; background: transparent; color: var(--plum); font-weight: 800; }

.admin-heading { align-items: flex-start; }
.admin-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 25px 0 18px; }
.search-field { width: min(380px, 100%); }
.admin-actions { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: var(--soft); color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.delete-btn { width: 34px; height: 34px; border: 0; background: transparent; color: var(--danger); font-size: 18px; }
.empty-row td { padding: 35px 12px; color: var(--muted); text-align: center; }

.site-footer { padding: 54px max(24px, calc((100% - var(--max)) / 2)) 22px; background: #19171c; color: rgba(255, 255, 255, .75); }
.footer-main { display: grid; grid-template-columns: 1.3fr .85fr .85fr; gap: 40px; padding-bottom: 34px; }
.footer-main strong { color: #fff; font: 600 21px/1.4 "Noto Serif TC", Georgia, serif; }
.footer-main p { margin: 8px 0 0; font-size: 13px; }
.footer-main nav { display: grid; align-content: start; gap: 9px; font-size: 13px; }
.footer-main a:hover, .footer-main a:focus-visible { color: #f0d99d; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 11px; }
.footer-bottom button { border: 0; background: transparent; color: rgba(255, 255, 255, .5); }

@media (max-width: 1080px) {
  :root { --header-height: calc(64px + env(safe-area-inset-top)); }
  body.nav-open { overflow: hidden; }
  .site-header { min-height: var(--header-height); padding: max(9px, env(safe-area-inset-top)) 16px 9px; }
  .brand-copy small { display: none; }
  .menu-btn { display: block; }
  .site-nav { position: fixed; top: var(--header-height); right: 0; bottom: 0; left: 0; z-index: 102; display: none; overflow-y: auto; align-items: stretch; align-content: start; gap: 0; padding: 10px 16px max(18px, env(safe-area-inset-bottom)); border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 16px 28px rgba(28, 19, 35, .12); }
  .site-nav.open { display: grid; }
  .site-nav a { min-height: 48px; display: flex; align-items: center; padding: 0 4px; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { justify-content: center; margin-top: 12px; border: 1px solid var(--plum); }
  .menu-backdrop.open { position: fixed; inset: var(--header-height) 0 0; z-index: 99; display: block; border: 0; background: rgba(25, 17, 29, .48); }
  .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-group, .service-band, .story-section, .testimonial-section, .shop-band { grid-template-columns: 1fr; gap: 38px; }
  .resource-grid { grid-template-columns: 1fr 1fr; }
  .resource-feature { grid-column: 1 / -1; }
  .story-image { min-height: 450px; }
}

@media (max-width: 640px) {
  .hero-banner { min-height: 78svh; max-height: none; background-position: 58% center; }
  .hero-content { width: calc(100% - 36px); padding: 62px 0 82px; }
  .hero-content h1 { max-width: 500px; font-size: 42px; }
  .hero-lead { font-size: 16px; }
  .hero-actions { display: grid; width: 100%; }
  .hero-actions .button { width: 100%; }
  .scroll-cue { display: none; }
  .section-pad { padding: 66px 18px; }
  .section-heading h2, .service-copy h2, .story-copy h2, .shop-band h2, .final-cta h2, .flow-panel h2, .admin-view h2 { font-size: 31px; }
  .path-grid { grid-template-columns: 1fr; }
  .path-item { min-height: 148px; }
  .course-list, .resource-grid { grid-template-columns: 1fr; }
  .resource-feature { grid-column: auto; }
  .course-card { min-height: 160px; }
  .service-principles div { grid-template-columns: 68px 1fr; }
  .story-image { min-height: 380px; }
  .story-copy blockquote { font-size: 19px; }
  .flow-panel, .admin-view { width: calc(100% - 24px); margin: 28px auto 55px; padding: 25px 18px; }
  .button-row, .result-actions { display: grid; }
  .button-row .button-primary { margin-left: 0; }
  .result-actions > * { width: 100%; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-actions { justify-content: space-between; }
  .footer-main { grid-template-columns: 1fr; gap: 25px; }
}

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