/* === 基礎 Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Serif TC", "Hiragino Mincho ProN", serif;
  background: #1a1209;
  color: #f5e6c8;
  min-height: 100vh;
  line-height: 1.6;
}

/* === 容器 === */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* === 標題區 === */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #d4a01744;
}

.header-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-size: 1.8rem;
  color: #d4a017;
  letter-spacing: 0.15em;
  margin-bottom: 0.8rem;
}

.subtitle {
  font-size: 0.95rem;
  color: #c8b48a;
  max-width: 500px;
  margin: 0 auto 1rem;
}

.notice {
  display: inline-block;
  background: #c0392b22;
  border: 1px solid #c0392b88;
  color: #e74c3c;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: #c0392b88; }
  50% { border-color: #e74c3c; }
}

/* === 段落 === */
.section {
  margin-bottom: 2rem;
}

.section h2 {
  font-size: 1.3rem;
  color: #d4a017;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid #d4a017;
  border-radius: 50%;
  font-size: 0.9rem;
}

.section-hint {
  font-size: 0.85rem;
  color: #a89060;
  margin-bottom: 1rem;
}

/* === 輸入欄 === */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.9rem;
  color: #c8b48a;
}

.input-group input {
  background: #2a1f10;
  border: 1px solid #d4a01744;
  color: #f5e6c8;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #d4a017;
  box-shadow: 0 0 8px #d4a01733;
}

.input-group input::placeholder {
  color: #6b5a3e;
}

/* === 交通工具分組標籤 === */
.group-label {
  text-align: center;
  color: #a89060;
  font-size: 0.85rem;
  margin: 1.2rem 0 0.8rem;
  letter-spacing: 0.2em;
}

/* === 交通工具卡片 Grid === */
.transport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.8rem;
}

.transport-card {
  background: #2a1f10;
  border: 2px solid #d4a01733;
  border-radius: 10px;
  padding: 1rem 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.transport-card:hover {
  border-color: #d4a01788;
  transform: translateY(-2px);
}

.transport-card.selected {
  border-color: #d4a017;
  background: #3a2a14;
  box-shadow: 0 0 16px #d4a01733;
}

.transport-card .card-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.4rem;
}

.transport-card .card-name {
  font-size: 0.95rem;
  color: #d4a017;
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.transport-card .card-desc {
  font-size: 0.75rem;
  color: #a89060;
  line-height: 1.4;
}

/* === 產生按鈕 === */
.generate-section {
  text-align: center;
  margin: 2rem 0;
}

.generate-btn {
  background: linear-gradient(135deg, #d4a017, #b8860b);
  color: #1a1209;
  border: none;
  padding: 0.8rem 2.5rem;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}

.generate-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px #d4a01744;
}

.generate-btn:active {
  transform: scale(0.98);
}

.error-msg {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

/* === 通行證展示區 === */
.pass-section {
  text-align: center;
  margin-top: 2rem;
}

.pass-section h2 {
  justify-content: center;
  margin-bottom: 1rem;
}

.pass-section canvas {
  display: block;
  margin: 0 auto 1rem;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}

.download-btn {
  background: #2a1f10;
  border: 2px solid #d4a017;
  color: #d4a017;
  padding: 0.6rem 1.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.download-btn:hover {
  background: #d4a017;
  color: #1a1209;
}

/* === 頁尾 === */
.footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d4a01722;
  font-size: 0.75rem;
  color: #6b5a3e;
}

/* === 響應式 === */
@media (max-width: 500px) {
  .header h1 {
    font-size: 1.4rem;
  }

  .transport-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pass-section canvas {
    width: 100%;
  }
}
