:root {
  --blue-900: #0f3d5e;
  --blue-800: #155a7a;
  --blue-700: #1d6f8f;
  --blue-100: #e7f3f8;
  --green-700: #2b7a55;
  --green-100: #e8f5ee;
  --ink: #16313f;
  --muted: #5f7380;
  --line: #d7e2e8;
  --surface: #ffffff;
  --soft: #f4f8fa;
  --warning: #fff4c7;
  --shadow: 0 16px 38px rgba(15, 61, 94, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", Arial, sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #ffca3a;
  outline-offset: 3px;
}

a {
  color: inherit;
}

.site-header {
  background: linear-gradient(180deg, #dff0f6 0%, #f4f8fa 100%);
  border-bottom: 1px solid var(--line);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-900);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-900);
  color: #fff;
}

.nav-actions {
  display: none;
  gap: 14px;
  color: var(--blue-800);
  font-weight: 700;
}

.nav-actions a {
  text-decoration: none;
}

.hero {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: var(--blue-900);
  font-size: 2.35rem;
  line-height: 1.12;
}

.subtitle {
  margin-bottom: 0;
  color: #31505f;
  font-size: 1.05rem;
}

.search-panel,
.panel,
.result-card,
.map-section,
.info-card,
.faq-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(15, 61, 94, 0.06);
}

.search-panel {
  padding: 18px;
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--blue-900);
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
}

.search-row input {
  width: 100%;
  min-height: 52px;
  border: 2px solid #b8ccd6;
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--ink);
  font-size: 1.1rem;
  text-transform: uppercase;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.speech-guide {
  margin-top: 10px;
  border: 1px solid #cfe0e8;
  border-radius: var(--radius);
  background: #f8fbfc;
  padding: 10px 12px;
}

.speech-guide summary {
  color: var(--blue-800);
  font-size: 0.94rem;
}

.speech-guide-body {
  margin-top: 8px;
  color: #31505f;
  font-size: 0.92rem;
}

.speech-guide-body p {
  margin-bottom: 6px;
}

.speech-guide-body ul {
  margin: 0;
  padding-left: 20px;
}

.speech-guide-body li {
  margin: 5px 0;
}

.usage-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.usage-panel div {
  border: 1px solid #cfe0e8;
  border-radius: var(--radius);
  background: #f8fbfc;
  padding: 10px;
}

.usage-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.usage-panel strong {
  display: block;
  color: var(--blue-900);
  font-size: 1.45rem;
  line-height: 1.1;
}

.usage-panel p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.button-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.button-row.compact {
  margin-top: 0;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.voice-button {
  min-height: 44px;
  border-radius: var(--radius);
  border: 0;
  padding: 0 16px;
  font-weight: 800;
}

.search-row .primary-button {
  grid-column: 1 / -1;
}

.primary-button {
  background: var(--green-700);
  color: #fff;
}

.voice-button {
  border: 1px solid #b8ccd6;
  background: var(--blue-100);
  color: var(--blue-900);
  padding: 0 10px;
  white-space: nowrap;
}

.voice-button.is-listening {
  background: var(--green-700);
  color: #fff;
}

.voice-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid #b8ccd6;
  background: #fff;
  color: var(--blue-900);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.text-button {
  min-height: 36px;
  background: transparent;
  color: var(--blue-700);
  padding: 0;
}

.icon-button {
  width: 44px;
  padding: 0;
  background: var(--blue-900);
  color: #fff;
  font-size: 1.4rem;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.quick-area {
  display: grid;
  gap: 14px;
}

.panel,
.map-section,
.info-card,
.faq-section {
  padding: 16px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title-row h2,
.info-card h2,
.faq-section h2 {
  margin: 0;
  color: var(--blue-900);
  font-size: 1.25rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 40px;
  border: 1px solid #b8ccd6;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-900);
  padding: 0 13px;
  font-weight: 800;
}

.chip.secondary {
  background: var(--green-100);
  color: var(--green-700);
}

.empty-text {
  color: var(--muted);
}

.results-section {
  margin-top: 18px;
}

.result-status {
  margin-bottom: 12px;
  border-left: 4px solid var(--blue-700);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px 14px;
  color: var(--blue-900);
  font-weight: 800;
}

.result-card {
  margin-bottom: 16px;
  overflow: hidden;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: var(--blue-900);
  color: #fff;
  padding: 18px;
}

.result-label {
  color: #cde5ef;
  font-size: 0.86rem;
  font-weight: 700;
}

.room-code {
  margin: 2px 0 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.badge {
  border-radius: 999px;
  background: #dff3ea;
  color: #15543a;
  padding: 6px 10px;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.card-section {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.card-section h3 {
  margin-bottom: 10px;
  color: var(--blue-900);
  font-size: 1.05rem;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.fact {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  border-radius: var(--radius);
  background: var(--soft);
  padding: 10px;
}

.fact span:first-child {
  color: var(--muted);
  font-weight: 800;
}

.route-list,
.accessible-list,
.plain-steps {
  margin: 0;
  padding-left: 22px;
}

.route-list li,
.accessible-list li,
.plain-steps li {
  margin: 6px 0;
}

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

.media-button,
.image-tile {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.media-button img,
.image-tile img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.media-placeholder {
  display: grid;
  min-height: 128px;
  place-items: center;
  background: repeating-linear-gradient(135deg, #f4f8fa, #f4f8fa 10px, #e8f1f5 10px, #e8f1f5 20px);
  color: var(--muted);
  padding: 16px;
  text-align: center;
  font-weight: 800;
}

.media-title {
  display: block;
  padding: 10px 12px;
  color: var(--blue-900);
  font-weight: 800;
}

.notice-block {
  background: var(--warning);
}

.manager-block {
  background: #f8fbfc;
}

.manager {
  white-space: pre-line;
}

.card-actions {
  padding: 0 18px 18px;
}

.map-section,
.info-grid,
.faq-section {
  margin-top: 18px;
}

.image-tile img {
  height: auto;
  max-height: 560px;
  object-fit: contain;
  background: #fff;
}

.info-grid {
  display: grid;
  gap: 14px;
}

.code-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.code-list div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.code-list dt {
  color: var(--blue-900);
  font-weight: 900;
}

.code-list dd {
  margin: 0;
}

details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

details:first-of-type {
  margin-top: 8px;
}

summary {
  color: var(--blue-900);
  font-weight: 900;
  cursor: pointer;
}

details p {
  margin: 8px 0 0;
  color: #31505f;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 28, 40, 0.78);
}

.modal-content {
  position: relative;
  width: min(100%, 960px);
  max-height: 90vh;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  color: var(--blue-900);
  font-size: 1.1rem;
}

.modal-content img {
  display: block;
  width: 100%;
  max-height: calc(90vh - 70px);
  object-fit: contain;
  background: #fff;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: calc(100% - 32px);
  border-radius: var(--radius);
  background: var(--blue-900);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (min-width: 720px) {
  .nav-actions {
    display: flex;
  }

  .hero {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: end;
    padding-top: 36px;
    padding-bottom: 46px;
  }

  h1 {
    font-size: 3.25rem;
  }

  .search-row {
    grid-template-columns: 1fr auto auto;
  }

  .search-row .primary-button {
    grid-column: auto;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .fact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .media-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .media-button img {
    height: 132px;
  }
}

@media (max-width: 420px) {
  .top-nav {
    align-items: flex-start;
  }

  .room-code {
    font-size: 1.65rem;
  }

  .result-header {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .voice-button {
    width: 58px;
  }
}
