/* Palette inspired by NKUHT Department of Hotel Management (hotel.nkuht.edu.tw):
   Deep Hospitality Emerald (#004d3d / #003c30) & Warm Champagne Gold (#a68942 / #f7f4eb). */
:root {
  --bg: #f7f4eb;          /* warm champagne ivory surface */
  --surface: #ffffff;
  --ink: #182421;         /* deep charcoal-pine ink */
  --muted: #52635e;       /* muted sage-slate */
  --line: #d6ceb8;        /* warm sand border */
  --brand: #004d3d;       /* NKUHT hospitality emerald green */
  --accent: #005645;      /* interactive emerald (AA on white) */
  --accent-hover: #00382c;
  --accent-ink: #ffffff;
  --highlight: #f7df8b;   /* champagne gold highlight */
  --chip: #efeadd;
  /* HOTEL 5 Core Pillars colors (all pass AA contrast on light surfaces and with white text). */
  --heart-h: #9e2a2b;     /* H 專業款待 Hospitality - Burgundy Red */
  --heart-o: #0b5394;     /* O 營運管理 Operation - Royal Blue */
  --heart-t: #1f6173;     /* T 智慧科技 Technology - Teal Cyan */
  --heart-e: #673ab7;     /* E 實習接軌 Experience - Deep Purple */
  --heart-l: #13744b;     /* L 國際領航 Leadership - Emerald Green */
  --heart-a: #0b5394;
  --heart-r: #1f6173;
  --radius: 12px;
  color-scheme: light;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.top, .searchbar, .controls, .summary, main, .foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
.top-band {
  background: linear-gradient(135deg, #003c30 0%, #005a47 100%);
  color: #f7f4eb;
  border-bottom: 4px solid #c5a659;
}
.top { padding-top: 40px; padding-bottom: 28px; }
.eyebrow {
  display: inline-block;
  margin: 0;
  padding: 3px 12px;
  border-radius: 999px;
  background: #f7df8b;
  color: #182421;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
h1 { margin: 12px 0 10px; font-size: clamp(30px, 6vw, 46px); font-weight: 900; line-height: 1.15; color: #fff; word-break: keep-all; }
.top .lede { margin: 0 0 8px; max-width: 48em; font-weight: 500; color: #f0ece1; }
.top .meta { margin: 0; font-size: 13px; color: #d6ceb8; }
.top a { color: #f7df8b; font-weight: 700; }
.top a:hover { color: #ffffff; }
.top .cta { margin: 16px 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.top .cta a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: #f7df8b;
  color: #182421;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.top .cta a.cta-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(247, 223, 139, 0.5);
}
.top .cta a:hover { background: #ffffff; color: #003c30; }
.top .cta a:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }

:root { --search-h: 64px; }
.searchbar {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--search-h);
  padding-top: 12px;
  padding-bottom: 8px;
  background: var(--bg);
}
.controls {
  background: var(--bg);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
#q {
  width: 100%;
  height: 44px;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
#q:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
@media (max-width: 719px) {
  .searchbar { border-bottom: 2px solid var(--line); padding-bottom: 6px; }
  .controls { padding-top: 4px; }
}
@media (min-width: 720px) {
  .controls { position: sticky; top: var(--search-h); z-index: 2; }
}
.filter { display: flex; gap: 4px 10px; align-items: baseline; margin-top: 6px; }
.filter-label { flex: none; width: 7.5em; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--muted); }
@media (max-width: 540px) {
  .filter { flex-direction: column; }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  font: inherit;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--ink);
  cursor: pointer;
}
.chips button:hover:enabled { border-color: var(--brand); }
.chips button:disabled { opacity: .35; cursor: default; }
.chips button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
/* HOTEL 5 Core Pillars pills */
[data-h="H"] { --heart: var(--heart-h); }
[data-h="O"] { --heart: var(--heart-o); }
[data-h="T"] { --heart: var(--heart-t); }
[data-h="E"] { --heart: var(--heart-e); }
[data-h="L"] { --heart: var(--heart-l); }
[data-h="A"] { --heart: var(--heart-a); }
[data-h="R"] { --heart: var(--heart-r); }
.chips button[data-h] { background: var(--surface); color: var(--heart); font-weight: 700; }
.chips button[data-h] .heart-l { font-weight: 900; }
.chips button[data-h]:hover:enabled { border-color: var(--heart); }
.chips button[data-h][aria-pressed="true"] { background: var(--heart); border-color: var(--heart); color: #fff; }
.chips .num { font-weight: 700; color: var(--accent); }
.chips button[aria-pressed="true"] .num { color: inherit; }
@media (max-width: 540px) {
  .chips { gap: 4px; }
  .chips button { padding: 4px 8px; }
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 16px;
}
.sum-group { flex: 3 1 300px; min-width: 0; }
.sum-group:last-child { flex: 1 1 96px; }
.sum-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sum-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sum-group:last-child .sum-tiles { grid-template-columns: 1fr; }
@media (max-width: 540px) {
  .sum-group:last-child { flex: 0 0 calc((100% - 12px) / 3); }
}
.summary a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}
.summary a.empty { opacity: .45; }
.summary a:hover { border-color: var(--brand); }
.summary b { font-size: 22px; font-weight: 900; color: var(--brand); margin-right: 4px; }
.summary .bar { height: 4px; margin-top: 4px; border-radius: 2px; background: var(--brand); }

.bucket { margin-top: 36px; scroll-margin-top: calc(var(--search-h) + 16px); }
@media (min-width: 720px) {
  .bucket { scroll-margin-top: 220px; }
}
.bucket > h2 {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 4px solid var(--brand);
  font-size: 28px;
  font-weight: 900;
}
.bucket > h2 small { font-size: 14px; font-weight: normal; color: var(--muted); margin-left: 8px; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 -4px 0 0 var(--brand);
}
.card .tag { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.card .heart { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: auto; }
.card .heart-b {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--heart);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.card .heart-b b { font-weight: 900; }
.card h3 { margin: 0; font-size: 17px; font-weight: 700; }
.card .steps { margin: 0; padding: 0; list-style: none; }
.card .steps li { font-size: 14px; }
.card .when {
  display: inline;
  background: var(--highlight);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
}
.card .desc { margin: 0; font-size: 14px; }
.card .who { margin: 0; font-size: 12px; color: var(--muted); }
.card details { font-size: 13px; color: var(--muted); }
.card details ul { margin: 4px 0 0; padding-left: 18px; }
.card .links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-top: auto; padding-top: 6px; font-size: 13px; }
.share { position: relative; }
.share-copy { padding: 0; border: 0; background: none; font: inherit; }
.share summary, .share-copy {
  list-style: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.share summary::-webkit-details-marker { display: none; }
.share summary::after { content: "▼"; margin-left: 3px; font-size: .6em; vertical-align: .15em; }
.share[open] summary::after { content: "▲"; }
.share summary:hover, .share-copy:hover { color: var(--accent-hover); }
.share-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 9em;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(24 36 33 / .18);
}
.share-menu.flip { left: auto; right: 0; }
.share-menu a, .share-menu button {
  display: block;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.share-menu a:hover, .share-menu button:hover { background: var(--chip); color: var(--ink); }
@media (pointer: coarse) {
  .card .links { align-items: center; }
  .share summary, .share-copy {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--chip);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
  }
  .share-menu { min-width: 11em; }
  .share-menu a, .share-menu button {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 16px;
  }
}
.card { scroll-margin-top: calc(var(--search-h) + 16px); }
@media (min-width: 720px) {
  .card { scroll-margin-top: 220px; }
}
.card.linked { outline: 3px solid var(--highlight); outline-offset: 2px; animation: linked 1.2s ease-out 2; }
@keyframes linked { 50% { outline-color: var(--brand); } }
@media (prefers-reduced-motion: reduce) {
  .card.linked { animation: none; }
}

.foot { margin-top: 56px; padding-bottom: 88px; font-size: 12px; color: var(--muted); }
.foot .credit a { color: inherit; }
.foot .credit a:hover { color: var(--accent); }
.no-match { margin-top: 32px; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px);
  z-index: 4;
  width: max-content;
  max-width: min(92vw, 560px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 18px rgb(24 36 33 / .3);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgb(24 36 33 / .25);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent-hover); }
.to-top:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: none; }
}
