:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #059669; /* Emerald Green - Civic Trust */
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --accent-blue: #2563eb;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --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), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

* {
  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;
  backdrop-filter: blur(8px);
}

.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;
  letter-spacing: 0.5px;
}

.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 #a7f3d0;
}

/* 核心內容版面 */
.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;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

select, input[type="number"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  background-color: #f8fafc;
  color: var(--text-main);
  transition: all 0.2s ease;
  min-width: 0;
}

select:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  padding-right: 70px;
}

.input-with-unit .unit {
  position: absolute;
  right: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.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;
  transition: all 0.2s ease;
  padding: 12px 24px;
  text-decoration: none;
  border: none;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 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;
  border-color: #cbd5e1;
}

/* 報價檢驗提示框 */
.alert-box {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* 數據概覽格狀卡 */
.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(--accent-blue); }
.text-emerald { color: var(--primary); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }

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

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

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.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);
  color: #1e293b;
}

.hospital-name {
  font-weight: 700;
  color: #0f172a;
}

.hospital-level {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.price-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
}

.level-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag-low { background: #dcfce7; color: #15803d; }
.tag-med { background: #e0f2fe; color: #0369a1; }
.tag-high { background: #fef3c7; color: #b45309; }

/* 須知導覽區 */
.guide-card h2 {
  font-size: 1.25rem;
  margin-bottom: 18px;
  color: #0f172a;
}

.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;
}
