:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #f8fafc;
  --surface: #ffffff;
  --soft: #eef2ff;
  --primary: #4f46e5;
  --secondary: #7c3aed;
  --success: #10b981;
  --coral: #f97316;
  --blue: #4f46e5;
  --radius-card: 12px;
  --radius-control: 8px;
  --shadow: 0 4px 20px -2px rgba(79, 70, 229, 0.1);
  --shadow-hover: 0 10px 25px -5px rgba(79, 70, 229, 0.15), 0 8px 10px -6px rgba(79, 70, 229, 0.1);
  --button-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.3);
  --gradient-brand: linear-gradient(135deg, var(--primary), var(--secondary));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--ink);
  font-family:
    "Plus Jakarta Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    sans-serif;
  letter-spacing: 0;
}

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

button,
a {
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease,
    background 200ms ease,
    color 200ms ease;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 252, 0.94)),
    var(--paper);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.08);
}

.kicker,
.label {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-panel,
.info-panel {
  margin: 16px;
}

[hidden] {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.88);
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(16px);
}

.app-header strong {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-control);
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: var(--button-shadow);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

.day-tabs {
  position: sticky;
  top: calc(50px + env(safe-area-inset-top));
  z-index: 5;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(74px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.day-tab {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  text-align: left;
  padding: 9px;
  box-shadow: 0 2px 8px -4px rgba(79, 70, 229, 0.18);
}

.day-tab:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow);
}

.day-tab small {
  display: block;
  margin-top: 4px;
  font-weight: 700;
  color: inherit;
}

.day-tab.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--gradient-brand);
  box-shadow: var(--button-shadow);
}

.day-header {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: #312e81;
  color: #fff;
  box-shadow: var(--shadow-hover);
}

.day-header img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.day-header-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 16px 16px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.4) 65%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-number {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.day-theme {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  font-weight: 700;
}

.day-title {
  margin: 0;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.weather-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-control);
  color: #fff;
  background: rgba(49, 46, 129, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px -10px rgba(79, 70, 229, 0.6);
}

.weather-badge svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

.weather-badge span,
.weather-badge strong,
.weather-badge small {
  display: block;
}

.weather-badge strong {
  font-size: 0.78rem;
  line-height: 1.1;
}

.weather-badge small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.pill svg,
.tool svg,
.link-button svg,
.map-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.section-title {
  margin: 22px 2px 10px;
  font-size: 1.05rem;
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 10px;
}

.stop {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stop:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-hover);
}

.stop__media {
  display: grid;
  gap: 8px;
  align-content: start;
}

.stop time {
  color: var(--blue);
  font-weight: 900;
  line-height: 1.2;
}

.stop-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-control);
  object-fit: cover;
  background: var(--soft);
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.45);
}

.stop__heading {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 8px;
  align-items: start;
  margin-bottom: 6px;
}

.stop h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.map-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-control);
  color: var(--primary);
  background: #eef2ff;
  text-decoration: none;
}

.map-icon:hover {
  transform: translateY(-1px);
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: var(--button-shadow);
}

.stop p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.note-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.note-card,
.source-card {
  padding: 14px;
  border: 1px solid #e0e7ff;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #ffffff, #f5f7ff);
  box-shadow: var(--shadow);
}

.note-card strong,
.source-card strong {
  display: block;
  margin-bottom: 6px;
}

.note-card p,
.source-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.source-list {
  display: grid;
  gap: 8px;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.link-button:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-hover);
}

.quick-tools {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(100%, 520px);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(248, 250, 252, 0.94);
  border-top: 1px solid rgba(226, 232, 240, 0.92);
  backdrop-filter: blur(18px);
}

.tool {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 900;
}

.exchange-hero {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.exchange-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-card);
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: var(--button-shadow);
}

.exchange-icon svg {
  width: 21px;
  height: 21px;
}

.exchange-hero h2 {
  margin-bottom: 6px;
}

.exchange-hero p,
.exchange-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.rate-field,
.money-field {
  display: grid;
  gap: 7px;
}

.rate-field {
  margin-bottom: 12px;
}

.rate-field span,
.money-field span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.rate-field input,
.money-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.rate-control {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
}

.refresh-rate {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-control);
  color: var(--primary);
  background: #eef2ff;
  box-shadow: var(--shadow);
}

.refresh-rate:hover {
  transform: translateY(-1px);
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: var(--button-shadow);
}

.refresh-rate:disabled {
  cursor: progress;
  opacity: 0.75;
}

.refresh-rate.is-loading svg {
  animation: spin 900ms linear infinite;
}

.rate-field small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.rate-field small[data-state="success"] {
  color: var(--success);
}

.rate-field small[data-state="error"] {
  color: var(--coral);
}

.rate-field input:focus,
.money-field input:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(79, 70, 229, 0.22);
  outline-offset: 2px;
}

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

.exchange-grid {
  display: grid;
  gap: 10px;
}

.quick-convert {
  margin-top: 16px;
}

.quick-convert h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-rate {
  min-height: 62px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-card);
  padding: 10px;
  color: var(--ink);
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow);
}

.quick-rate:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.quick-rate strong,
.quick-rate span {
  display: block;
}

.quick-rate strong {
  color: var(--primary);
  font-size: 1rem;
}

.quick-rate span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.exchange-note {
  margin-top: 14px;
  font-size: 0.82rem;
}

.tool.is-active {
  border-color: transparent;
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-hover);
}

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

.info-card h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.panel-intro {
  margin: -4px 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.info-panel.is-standalone {
  margin-top: 16px;
}

.info-panel.is-standalone .info-card {
  min-height: calc(100vh - 120px);
}

.info-sections {
  display: grid;
  gap: 12px;
}

.info-section {
  overflow: hidden;
  padding: 14px;
  border: 1px solid #e0e7ff;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #ffffff, #f5f7ff);
}

.info-section__image {
  display: block;
  width: calc(100% + 28px);
  height: 138px;
  margin: -14px -14px 12px;
  object-fit: cover;
  background: #e2e8f0;
}

.info-section__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.info-section__heading svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.info-section h3 {
  margin: 0;
  font-size: 1rem;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  color: var(--muted);
  line-height: 1.48;
}

.panel-links {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.check-list i {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--success);
}

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

@media (min-width: 480px) {
  .note-grid {
    grid-template-columns: 1fr 1fr;
  }
}
