:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #0284c7; /* Sky Blue - Auto Service */
  --primary-hover: #0369a1;
  --primary-light: #f0f9ff;
  --accent-rose: #e11d48;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --font-sans: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 導航 */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-badge {
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.brand-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.1rem;
}

.nav-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #bae6fd;
}

/* 主內容區 */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px;
  flex: 1;
  width: 100%;
}

.hero-section {
  text-align: center;
  margin-bottom: 28px;
}

.hero-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: 1px solid #cbd5e1;
}

.hero-section h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

/* 車牌輸入區域 */
.plate-input-container label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.plate-box {
  display: flex;
  gap: 12px;
  align-items: center;
}

@media (max-width: 640px) {
  .plate-box {
    flex-direction: column;
  }
}

.plate-icon {
  font-size: 1.5rem;
}

.plate-box input {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #f8fafc;
  letter-spacing: 2px;
  transition: all 0.2s;
  min-width: 0;
  width: 100%;
}

.plate-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.sample-plates {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: #e2e8f0;
}

.chip-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.chip-danger:hover {
  background: #fecaca;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 14px 28px;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: #f1f5f9;
}

/* 狀態卡 */
.status-card {
  border-left: 6px solid var(--primary);
}

.status-card.status-safe {
  border-left-color: var(--accent-emerald);
  background: #f0fdf4;
}

.status-card.status-danger {
  border-left-color: var(--accent-rose);
  background: #fff1f2;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.status-badge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.status-safe .status-badge {
  background: #dcfce7;
  color: #166534;
}

.status-danger .status-badge {
  background: #fee2e2;
  color: #991b1b;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.plate-title {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
}

.status-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-desc {
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
}

/* 統計格狀卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-align: center;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.text-blue { color: var(--primary); }
.text-emerald { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }

.stat-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* 折線圖 */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  margin-top: 10px;
}

canvas {
  width: 100% !important;
  height: 100% !important;
}

/* 表格 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
}

.row-danger {
  background: #fff1f2 !important;
  color: #991b1b;
  font-weight: 700;
}

/* 指南卡 */
.guide-card h2 {
  font-size: 1.25rem;
  margin-bottom: 18px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 768px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.guide-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.guide-num {
  background: var(--primary);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-text h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #0f172a;
}

.guide-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 頁尾 */
.footer-notice {
  text-align: center;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 10px;
  margin-bottom: 24px;
}

.home-link-wrap {
  margin-top: 20px;
}

.footer {
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  padding: 20px;
  text-align: center;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-brand {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}
