/* Global design tokens */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-card: 0 18px 30px rgba(31, 41, 55, 0.12);
  --shadow-card-dark: 0 20px 40px rgba(0, 0, 0, 0.35);
}

:root {
  --bg-color: #f5f5f7;
  --text-color: #1d1d1f;
  --text-secondary: #6e6e73;
  --surface-color: rgba(255, 255, 255, 0.82);
  --surface-border: rgba(0, 0, 0, 0.08);
  --primary-color: #0071e3;
  --primary-hover: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --divider-color: rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] {
  --bg-color: #000000;
  --text-color: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.7);
  --surface-color: rgba(28, 28, 30, 0.85);
  --surface-border: rgba(255, 255, 255, 0.08);
  --primary-color: #0a84ff;
  --primary-hover: #409bfd;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --divider-color: rgba(255, 255, 255, 0.08);
}

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

/* Base layout */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  background: radial-gradient(120% 120% at 50% 0%, rgba(0, 112, 245, 0.08), transparent 65%),
    var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(0, 113, 227, 0.12), transparent 55%),
    linear-gradient(320deg, rgba(52, 199, 89, 0.05), transparent 50%);
  z-index: -2;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(1.75rem, 4vw, 3rem) 1.5rem;
  min-height: 100vh;
}

.page-card {
  width: min(640px, 100%);
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  backdrop-filter: saturate(180%) blur(30px);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.2rem);
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

:root[data-theme="dark"] .page-card {
  box-shadow: var(--shadow-card-dark);
}

.page-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 28px 40px rgba(12, 68, 204, 0.18);
}

header.page-header {
  text-align: center;
  display: grid;
  gap: 0.5rem;
}

.page-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0;
}

.page-subtitle {
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
}

.lead-paragraph {
  font-size: clamp(1.05rem, 3.2vw, 1.18rem);
  line-height: 1.6;
  margin: 0;
  color: var(--text-color);
}

.highlight-card {
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  padding: clamp(1rem, 2.5vw, 1.4rem);
  line-height: 1.65;
}

.action-area {
  display: grid;
  justify-content: center;
}

.primary-button {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.82rem 2.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(150deg, var(--primary-color), var(--primary-hover));
  box-shadow: 0 20px 30px rgba(0, 113, 227, 0.28);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button .zh-text {
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1.5px);
  box-shadow: 0 28px 35px rgba(10, 132, 255, 0.32);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 16px 24px rgba(0, 122, 255, 0.28);
}

.primary-button:disabled,
.primary-button[disabled] {
  cursor: default;
  opacity: 0.72;
  box-shadow: none;
  transform: none;
}

.primary-link {
  color: inherit;
  text-decoration: none;
}

.primary-link:hover,
.primary-link:focus-visible {
  text-decoration: underline;
}

.primary-button.primary-link {
  color: #ffffff;
  text-decoration: none;
}

.primary-button.primary-link:hover,
.primary-button.primary-link:focus-visible {
  text-decoration: none;
}

.theme-toggle {
  position: fixed;
  bottom: 2.25rem;
  right: 2.25rem;
  width: 52px;
  height: 52px;
  border-radius: 26px;
  border: none;
  background: var(--surface-color);
  color: var(--text-color);
  box-shadow: 0 18px 30px rgba(15, 29, 80, 0.12);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  z-index: 10;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 36px rgba(20, 40, 120, 0.14);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  transition: transform 320ms ease;
}

:root[data-theme="dark"] .theme-toggle svg {
  transform: rotate(180deg);
}

.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}

.info-list li {
  position: relative;
  padding-left: 1.65rem;
  font-size: 1.02rem;
  line-height: 1.55;
}

.info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 6px 12px rgba(0, 113, 227, 0.25);
  transform: translateY(-50%);
}

.service-hours {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  color: var(--primary-color);
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline;
  line-height: inherit;
  white-space: normal;
  text-align: left;
  text-decoration: none;
  font-weight: 500;
  transition: color 160ms ease;
}

.service-hours:hover,
.service-hours:focus-visible {
  color: var(--primary-hover);
  text-decoration: underline dotted;
}

.service-hours:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.25);
  border-radius: 6px;
}

.service-hours[aria-expanded="true"] {
  color: var(--primary-hover);
}

.page-subtitle .service-hours {
  text-decoration: underline dotted;
}

.page-subtitle .service-hours:hover,
.page-subtitle .service-hours:focus-visible {
  text-decoration: underline;
}

.qr-wrapper {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.qr-hint {
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 380px;
}

.service-tooltip {
  position: fixed;
  z-index: 30;
  padding: 0.9rem 1.2rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  box-shadow: 0 26px 46px rgba(15, 31, 68, 0.26);
  color: var(--text-color);
  max-width: min(320px, 88vw);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 200ms ease;
  display: grid;
  gap: 0.45rem;
}

.service-tooltip::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: inherit;
  border: 1px solid var(--surface-border);
  border-left: none;
  border-bottom: none;
  transform: translate(-50%, 0) rotate(45deg);
  bottom: -6px;
  left: var(--tooltip-arrow-x, 50%);
  box-shadow: inherit;
}

.service-tooltip[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.service-tooltip.tooltip-below {
  transform: translateY(-6px);
}

.service-tooltip.tooltip-below::after {
  bottom: auto;
  top: -6px;
  border: 1px solid var(--surface-border);
  border-top: none;
  border-right: none;
}

.service-tooltip.tooltip-below[data-visible="true"] {
  transform: translateY(0);
}

:root[data-theme="dark"] .service-tooltip {
  background: rgba(28, 28, 30, 0.94);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .service-tooltip::after {
  background: rgba(28, 28, 30, 0.94);
}

.service-tooltip .tooltip-primary {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-color);
}

.service-tooltip .tooltip-secondary {
  font-size: 0.78rem;
  color: rgba(110, 110, 115, 0.8);
  letter-spacing: 0.02em;
}

:root[data-theme="dark"] .service-tooltip .tooltip-secondary {
  color: rgba(190, 190, 205, 0.7);
}

.qr-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.qr-overlay[data-active="true"] {
  opacity: 1;
  pointer-events: auto;
}

.qr-modal {
  background: var(--surface-color);
  border-radius: 22px;
  padding: clamp(1.4rem, 4vw, 2rem);
  border: 1px solid var(--surface-border);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 1.2rem;
  justify-items: center;
  width: min(360px, calc(100vw - 2rem));
  position: relative;
}

.qr-modal button[type="button"] {
  appearance: none;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
}

.qr-modal h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.qr-modal p {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.qr-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .qr-close {
  background: rgba(30, 30, 32, 0.9);
}

.qr-close:hover,
.qr-close:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.18);
}

.qr-image {
  width: min(280px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  border: 1px solid var(--surface-border);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.qr-guidance {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

body.qr-open {
  overflow: hidden;
}

.page-note {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .theme-toggle {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
  }

  .page-card {
    padding: clamp(2rem, 6vw, 2.5rem);
  }
}

@media (max-width: 560px) {
  main {
    padding: 2rem 1rem 1.5rem;
    min-height: auto;
  }

  .page-card {
    border-radius: 18px;
    box-shadow: 0 16px 28px rgba(31, 41, 55, 0.16);
    max-height: none;
  }

  .lead-paragraph,
  .info-list li {
    font-size: 1rem;
  }

  .primary-button {
    width: 100%;
  }
}
.page-back {
  position: absolute;
  top: clamp(1.1rem, 3vw, 1.6rem);
  left: clamp(1.1rem, 3vw, 1.6rem);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 12px 22px rgba(15, 31, 68, 0.15);
}

:root[data-theme="dark"] .page-back {
  background: rgba(28, 28, 30, 0.85);
}

.page-back svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.page-back:hover,
.page-back:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(15, 31, 68, 0.22);
  outline: none;
}

.page-back:active {
  transform: translateY(0);
  box-shadow: 0 10px 18px rgba(15, 31, 68, 0.18);
}
