:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #007aff;
  --ocean: #32ade6;
  --mint: #64d2ff;
  --warning: #ff9f0a;
  --danger: #ff3b30;
  --success: #34c759;
  --shadow: 0 18px 48px rgba(29, 29, 31, 0.08);
  --radius: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang TC", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 3%, rgba(100, 210, 255, 0.24), transparent 28rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 245, 247, 0.76);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 58px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 750;
  background: linear-gradient(145deg, var(--blue), var(--ocean));
  box-shadow: 0 7px 18px rgba(0, 122, 255, 0.24);
}

.status-chip {
  max-width: 56vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid rgba(0, 122, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 550;
}

main {
  width: min(1180px, calc(100% - 32px));
  min-width: 0;
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  margin: 28px 0 18px;
  padding: clamp(32px, 7vw, 68px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,255,255,0.75)),
    var(--surface-solid);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero__glow {
  position: absolute;
  z-index: -1;
  right: -9rem;
  top: -13rem;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 44%, rgba(100,210,255,0.8), rgba(50,173,230,0.42) 35%, rgba(0,122,255,0.08) 63%, transparent 70%);
  filter: blur(4px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero__subtitle {
  margin: 18px 0 0;
  color: var(--secondary);
  font-size: clamp(16px, 2.2vw, 21px);
  line-height: 1.55;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.fact-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 560;
}

.section-tabs, .day-tabs {
  max-width: 100%;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(229, 229, 234, 0.68);
  scrollbar-width: none;
}

.section-tabs { margin: 20px 0; }
.section-tabs::-webkit-scrollbar, .day-tabs::-webkit-scrollbar { display: none; }

.tab-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 620;
  transition: 150ms ease;
}

.tab-button:hover { color: var(--text); }

.tab-button[aria-selected="true"] {
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.content-shell { min-width: 0; min-height: 320px; }

.loading-card, .error-card, .section-card, .day-panel {
  border: 1px solid rgba(255,255,255,0.84);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(29,29,31,0.06);
}

.loading-card, .error-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px;
}

.loading-card p, .error-card p { margin: 5px 0 0; color: var(--secondary); }

.spinner {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 3px solid rgba(0,122,255,0.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.section-stack { display: grid; min-width: 0; gap: 18px; }

.section-card, .day-panel { min-width: 0; max-width: 100%; padding: clamp(20px, 4vw, 34px); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.section-heading h2, .group-heading {
  margin: 0;
  letter-spacing: -0.025em;
}

.section-heading h2 { font-size: clamp(24px, 4vw, 34px); }
.group-heading { margin: 28px 0 12px; font-size: 19px; }
.group-heading:first-child { margin-top: 0; }

.day-tabs { margin-bottom: 14px; }

.content-block { margin: 15px 0; }
.content-block:first-child { margin-top: 0; }
.content-block:last-child { margin-bottom: 0; }

.prose, .list-block, .checklist {
  color: #3a3a3c;
  font-size: 15px;
  line-height: 1.72;
}

.prose { margin: 0; white-space: pre-line; }

.list-block, .checklist { margin: 0; padding-left: 1.2rem; }
.list-block li, .checklist li { margin: 7px 0; }
.checklist { list-style: none; padding-left: 0; }

.check-item { display: flex; gap: 10px; align-items: flex-start; }
.check-mark {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-top: 3px;
  border: 1px solid #c7c7cc;
  border-radius: 6px;
  color: white;
  font-size: 12px;
}
.check-mark.done { border-color: var(--success); background: var(--success); }

.callout {
  padding: 14px 16px;
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: rgba(0,122,255,0.07);
  color: #2c2c2e;
  font-size: 14px;
  line-height: 1.65;
}

.callout.warning, .callout.important { border-left-color: var(--warning); background: rgba(255,159,10,0.09); }
.callout.danger { border-left-color: var(--danger); background: rgba(255,59,48,0.08); }
.callout__title { display: block; margin-bottom: 4px; font-weight: 700; }

.table-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }

table { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.55; }
th { color: var(--secondary); background: rgba(245,245,247,0.7); font-size: 12px; font-weight: 680; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 590; color: #3a3a3c; }

.sensitive-value {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.masked-text {
  min-width: 88px;
  color: var(--tertiary);
  letter-spacing: 0.12em;
  user-select: none;
}

.privacy-button, .copy-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  padding: 5px 8px;
  color: var(--blue);
  background: rgba(0,122,255,0.08);
  font-size: 12px;
  font-weight: 650;
}

.copy-button { color: var(--secondary); background: rgba(118,118,128,0.1); }

.inline-link { color: var(--blue); text-decoration: none; }
.inline-link:hover { text-decoration: underline; }

.empty-state { padding: 48px 24px; color: var(--secondary); text-align: center; }

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 0;
  padding: 24px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--tertiary);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 680px) {
  main { width: min(100% - 20px, 1180px); }
  .topbar__inner { padding-inline: 12px; }
  .hero { min-height: 270px; margin-top: 12px; border-radius: 25px; padding: 30px 24px; }
  .hero__glow { right: -18rem; }
  .section-tabs { position: sticky; top: 66px; z-index: 20; backdrop-filter: blur(16px); }
  .section-card, .day-panel { border-radius: 20px; padding: 20px 17px; }
  .section-heading { margin-bottom: 16px; }
  table { min-width: 460px; }
  th, td { padding: 10px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
