:root {
  color-scheme: light;
  --ink: #16302f;
  --muted: #667876;
  --line: #d9e7e3;
  --surface: #ffffff;
  --page: #f3f8f7;
  --accent: #0f766e;
  --accent-deep: #0b5c56;
  --accent-soft: #e4f2ef;
  --shadow: 0 16px 40px rgba(25, 70, 66, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button { font: inherit; }

.page-shell {
  width: min(100% - 32px, 900px);
  margin: 0 auto;
  padding: 28px 0 32px;
}

.selector-panel, .qr-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.selector-panel { padding: 22px; }

.button-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.building-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 8px;
  color: #28504c;
  background: #fbfdfd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.building-button:hover { border-color: #8bbdb5; color: var(--accent-deep); background: #f2faf8; transform: translateY(-1px); }
.building-button:focus-visible { outline: 3px solid rgba(15,118,110,.22); outline-offset: 2px; }
.building-button.is-active { border-color: var(--accent); color: white; background: var(--accent); box-shadow: 0 5px 12px rgba(15,118,110,.2); }
.channel-button { grid-column: 1 / -1; }

.qr-section { margin-top: 18px; padding: 22px; }
.qr-frame { display: grid; justify-items: center; padding: 18px 16px 15px; border: 1px solid #e4eeec; border-radius: 8px; background: #fcfefe; }
.qr-image-wrap { display: grid; place-items: center; width: min(100%, 410px); min-height: 280px; overflow: hidden; border-radius: 6px; background: white; }
.qr-image-wrap img { display: block; width: 100%; max-height: 500px; object-fit: contain; }
.footer-note { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 20px; color: #78908d; font-size: 12px; }
.footer-note p { margin: 0; white-space: nowrap; }
.footer-line { width: 48px; height: 1px; background: #cfe0dc; }

@media (max-width: 640px) {
  .page-shell { width: min(100% - 24px, 520px); padding-top: 18px; }
  .selector-panel, .qr-section { padding: 16px; }
  .button-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .channel-button { grid-column: 1 / -1; }
  .building-button { min-height: 50px; padding: 7px 2px; font-size: 11px; line-height: 1.35; }
  .qr-frame { padding: 10px 8px 13px; }
  .qr-image-wrap { min-height: 240px; }
  .footer-line { width: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .building-button { transition: none; }
}
