:root {
  --ink: #202124;
  --muted: #626974;
  --paper: #fff8ee;
  --surface: #fffdf8;
  --soft: #fff0dc;
  --line: #e7d9c4;
  --red: #d6402d;
  --red-dark: #9f2d20;
  --gold: #f2b432;
  --green: #08795b;
  --blue: #145da0;
  --dark: #15171b;
  --shadow: 0 14px 34px rgba(32, 33, 36, .09);
  --max: 1180px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.66;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, p, a, span, label, button, input, select { overflow-wrap: anywhere; line-break: loose; }
p { color: #3b4047; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.site-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(231, 217, 196, .86);
  background: rgba(255, 253, 248, .94);
  backdrop-filter: blur(18px);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
  font-weight: 900;
  line-height: 1.12;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  background: var(--red-dark);
  font-size: .78rem;
  font-weight: 900;
}
.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #343941;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}
.nav-links a:hover {
  border-color: var(--line);
  background: #fff;
}
.nav-links a.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 62px 0 58px;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(42, 15, 10, .93) 0%, rgba(154, 45, 32, .78) 52%, rgba(21, 23, 27, .58) 100%),
    url("https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Taipei_Night_Skyline_20210102.jpg/1920px-Taipei_Night_Skyline_20210102.jpg");
  background-size: cover;
  background-position: center;
}
.hero.alt {
  background:
    linear-gradient(105deg, rgba(13, 41, 45, .9) 0%, rgba(8, 121, 91, .68) 54%, rgba(214, 64, 45, .34) 100%),
    url("https://images.unsplash.com/photo-1523240795612-9a054b0db644?auto=format&fit=crop&w=1800&q=82");
  background-size: cover;
  background-position: center;
}
.hero .wrap { display: grid; gap: 18px; }
.eyebrow {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 4.9rem);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 16px 38px rgba(0, 0, 0, .34);
}
.hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, .86);
  font-size: 1.04rem;
  font-weight: 760;
}
.hero-actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}
.btn.primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 28px rgba(214, 64, 45, .22);
}
.btn.dark {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}
.btn.ghost {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border-color: rgba(255, 255, 255, .36);
}
main { min-height: 70vh; }
section { padding: 58px 0; }
.section-head {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
}
.kicker {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  color: var(--red-dark);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 5.6vw, 3.1rem);
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: 0;
}
.lead {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}
.notice {
  padding: 14px;
  border: 1px solid rgba(214, 64, 45, .24);
  border-radius: 8px;
  background: #fff3eb;
  color: #5a332c;
  font-size: .9rem;
  font-weight: 800;
}
.grid { display: grid; gap: 14px; }
.two-col { display: grid; gap: 18px; align-items: start; }
.card, .filter-panel, .result-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card {
  display: grid;
  gap: 10px;
  padding: 16px;
}
.card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.28;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: .93rem;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff0dc;
  color: #845a08;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1.2;
}
.tag.red { background: #ffe4dd; color: var(--red-dark); }
.tag.green { background: #e8f8f1; color: var(--green); }
.tag.blue { background: #e8f0ff; color: var(--blue); }
.option-grid {
  display: grid;
  gap: 10px;
}
.choice-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.choice-card.active {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(214, 64, 45, .12);
}
.choice-card strong {
  font-size: 1rem;
  line-height: 1.25;
}
.choice-card span {
  color: var(--muted);
  font-size: .86rem;
}
.filter-panel, .result-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.fields {
  display: grid;
  gap: 10px;
}
.field {
  display: grid;
  gap: 5px;
}
.field label {
  color: #4d535c;
  font-size: .78rem;
  font-weight: 900;
}
.field input, .field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  outline: none;
  font-weight: 800;
}
.field textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  outline: none;
}
.program-grid, .pathway-grid, .article-grid {
  display: grid;
  gap: 12px;
}
.program-card {
  align-content: start;
}
.program-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.program-card footer, .pathway-card footer, .article-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.source-link {
  color: var(--red-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.steps {
  display: grid;
  gap: 8px;
  counter-reset: step;
  margin-top: 4px;
}
.step {
  position: relative;
  min-height: 42px;
  padding: 9px 10px 9px 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #41464d;
  font-size: .88rem;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
}
.source-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.source-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}
.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, .62);
  font-weight: 800;
}
.score {
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 46px;
  border-radius: 8px;
  color: #fff;
  background: var(--dark);
  font-size: .84rem;
  font-weight: 900;
}
.result-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.result-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}
.footer-note {
  padding: 26px 0 calc(30px + var(--safe-bottom));
  color: var(--muted);
  font-size: .8rem;
}

@media (min-width: 760px) {
  body { font-size: 17px; }
  .hero { padding: 88px 0 76px; }
  .option-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .program-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .pathway-grid, .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-panel ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1040px) {
  .filter-panel.sticky {
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 104px);
    overflow: auto;
  }
}

@media (max-width: 759px) {
  html { scroll-padding-top: 12px; }
  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }
  .nav-inner {
    display: block;
    min-height: 0;
    padding: 6px 8px calc(6px + var(--safe-bottom));
  }
  .brand { display: none; }
  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 10px;
    border-color: var(--line);
    background: #fff;
    font-size: .78rem;
  }
  .hero { padding: 48px 0 64px; }
  main { padding-bottom: 70px; }
  section { padding: 44px 0; }
  .result-top { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .wrap { width: min(100% - 24px, 360px); }
  .hero h1 { font-size: 2rem; }
  .btn { width: 100%; }
}
