:root {
  --bg: #f6f2ea;
  --bg-subtle: #efe8dc;
  --surface: #ffffff;
  --surface-warm: #fcfaf6;
  --ink: #1f1b18;
  --ink-muted: #5b524a;
  --ink-faint: #7f746a;
  --border: #e2d8c8;
  --border-strong: #c9bca7;
  --accent: #c4551d;
  --accent-dark: #9e4012;
  --accent-soft: #fae8dc;
  --teal: #1b6d5a;
  --teal-soft: #e0f2ec;
  --amber: #9c6207;
  --amber-soft: #f9eed4;
  --danger: #b5382a;
  --danger-soft: #fbe5e2;
  --shadow-sm: 0 1px 2px rgba(31, 27, 24, 0.05);
  --shadow-md: 0 8px 24px rgba(31, 27, 24, 0.07);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(196, 85, 29, 0.06), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(27, 109, 90, 0.05), transparent 36%);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

code,
.mono {
  font-family: var(--font-mono);
}

.container {
  width: min(1160px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 242, 234, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
}

.brand-tag {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.site-nav a.active {
  background: var(--ink);
  color: #fff;
}

.site-nav a.nav-cta {
  border: 1px solid rgba(196, 85, 29, 0.35);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.site-nav a.nav-cta.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Main & Sections */
main {
  padding: 2.25rem 0 4.5rem;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.4rem 2.2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #e08e45 55%, var(--teal));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
  line-height: 1.35;
}

.lead {
  margin: 0;
  font-size: 1.04rem;
  color: var(--ink-muted);
  max-width: 72ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.94rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-warm);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
}

.section {
  margin-top: 2.5rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.section-sub {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* Grids & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.card-warm {
  background: var(--surface-warm);
}

.card-highlight {
  border-color: rgba(196, 85, 29, 0.45);
  box-shadow: 0 8px 24px rgba(196, 85, 29, 0.08);
}

.card-step {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-step:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-dark);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.badge-recommended {
  background: var(--teal-soft);
  color: var(--teal);
}

.badge-upgrade {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.badge-value {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-warning {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--ink-muted);
}

/* Metric tiles */
.metric-tile {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.metric-value.positive {
  color: var(--teal);
}

.metric-value.negative {
  color: var(--danger);
}

.metric-note {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 0.2rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.85rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-subtle);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr.row-recommended {
  background: rgba(27, 109, 90, 0.045);
}

.price-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}

.price-strike {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-decoration: line-through;
  font-weight: 400;
}

/* Filter chips & presets */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-muted);
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Interactive sliders & form controls */
.slider-row {
  display: grid;
  grid-template-columns: 140px 1fr 56px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.slider-row label {
  font-size: 0.88rem;
  font-weight: 600;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  text-align: right;
  font-weight: 700;
  color: var(--ink-muted);
}

.score-bar-row {
  margin-bottom: 0.9rem;
}

.score-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.score-bar-name {
  font-weight: 700;
  font-size: 0.93rem;
}

.score-bar-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
}

.score-track {
  height: 11px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.22s ease;
}

.score-fill.rank-1 {
  background: var(--teal);
}

.score-fill.warn {
  background: var(--danger);
}

/* Basket & Checklist items */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check-item:hover {
  border-color: var(--border-strong);
}

.check-item.checked {
  border-color: rgba(27, 109, 90, 0.4);
  background: rgba(27, 109, 90, 0.05);
}

.check-item input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.check-body {
  flex: 1;
}

.check-title {
  font-weight: 700;
  font-size: 0.93rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.check-desc {
  font-size: 0.83rem;
  color: var(--ink-muted);
  margin-top: 0.18rem;
}

/* Form fields */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.field input,
.field select {
  padding: 0.55rem 0.72rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.94rem;
  font-family: var(--font-mono);
}

.field select {
  font-family: var(--font-sans);
}

/* Callout / Notice banners */
.callout {
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--surface-warm);
  font-size: 0.92rem;
}

.callout-warn {
  background: var(--danger-soft);
  border-color: rgba(181, 56, 42, 0.3);
  color: #6b1d14;
}

.callout-teal {
  background: var(--teal-soft);
  border-color: rgba(27, 109, 90, 0.32);
  color: #124a3d;
}

.callout-amber {
  background: var(--amber-soft);
  border-color: rgba(156, 98, 7, 0.3);
  color: #5c3a04;
}

/* Stacked Cost Bar */
.stacked-bar {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-subtle);
  margin: 0.85rem 0;
}

.stacked-seg {
  height: 100%;
  transition: width 0.2s ease;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 0.35rem;
}

/* Model Preview Image */
.model-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #f5f1e8;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.9rem;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  font-size: 0.86rem;
}

.meta-list li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.meta-list li:last-child {
  border-bottom: none;
}

.meta-key {
  color: var(--ink-muted);
  flex-shrink: 0;
}

.meta-val {
  text-align: right;
  font-weight: 600;
}

.bullet-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.bullet-list li {
  margin-bottom: 0.35rem;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
}

.timeline-item.current {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(196, 85, 29, 0.08);
}

.timeline-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--accent-dark);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-warm);
  padding: 2rem 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.2rem;
}

/* Responsive */
@media (max-width: 920px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    display: none;
    width: 100%;
    padding-bottom: 0.85rem;
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav.open {
    display: flex;
  }
  .header-inner {
    flex-wrap: wrap;
    padding: 0.65rem 0;
  }
  .hero {
    padding: 1.5rem 1.25rem;
  }
  .grid-3,
  .grid-4,
  .field-grid {
    grid-template-columns: 1fr;
  }
  .slider-row {
    grid-template-columns: 118px 1fr 48px;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}
