/* ============================================
   CSS 自訂屬性 — Coffee Atelier 設計系統
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=Noto+Serif+TC:wght@500;600;700&family=Allura&display=swap');

:root {
  /* 羊皮紙底色 */
  --bg-primary:    #F3E8CC;
  --bg-secondary:  #E8D9B4;
  --bg-surface:    #FBF7EC;
  --bg-glass:      rgba(251, 247, 236, 0.86);

  /* 深度文字 */
  --text-primary:  #1A0D04;
  --text-secondary:#4A2C12;
  --text-muted:    #876040;

  /* 琥珀金 */
  --accent:        #8A5518;
  --accent-light:  #BE8D2A;
  --accent-gold:   #C49A35;
  --accent-hover:  #9A6522;

  /* 邊框 */
  --border:        #D4C299;
  --border-light:  #E6D9B5;

  /* 陰影 */
  --shadow-sm:     0 2px 10px rgba(40, 20, 5, 0.09);
  --shadow-md:     0 6px 28px rgba(40, 20, 5, 0.13);
  --shadow-lg:     0 12px 52px rgba(40, 20, 5, 0.18);

  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     18px;

  --transition:    160ms ease;
}

[data-theme="dark"] {
  --bg-primary:    #0E0804;
  --bg-secondary:  #1A0E08;
  --bg-surface:    #221408;
  --bg-glass:      rgba(34, 20, 8, 0.9);

  --text-primary:  #EEE0C0;
  --text-secondary:#C4A060;
  --text-muted:    #886848;

  --accent:        #C49A35;
  --accent-light:  #D4AE50;
  --accent-gold:   #D4AE50;
  --accent-hover:  #DCBA60;

  --border:        #382210;
  --border-light:  #281808;

  --shadow-sm:     0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-md:     0 6px 28px rgba(0, 0, 0, 0.55);
  --shadow-lg:     0 12px 52px rgba(0, 0, 0, 0.65);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* 細緻紋理層 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.header-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  color: var(--accent-gold);
  flex-shrink: 0;
  opacity: 0.9;
}

.brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--accent-light);
  margin-top: 1px;
  letter-spacing: 0.02em;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  color: var(--accent-gold);
  border-color: var(--accent-light);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================
   Main Layout
   ============================================ */
.main {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
  position: relative;
  padding-top: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 1.5px;
  background: var(--accent-gold);
}

.section-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ============================================
   Mode Tabs — 下劃線編輯風格
   ============================================ */
.mode-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.tab-btn {
  flex: none;
  padding: 13px 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
  min-height: 44px;
  transition: color var(--transition);
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--accent-gold);
  transition: left 220ms cubic-bezier(0.4,0,0.2,1),
              right 220ms cubic-bezier(0.4,0,0.2,1);
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn--active,
.tab-btn[aria-selected="true"] {
  color: var(--accent);
  font-weight: 600;
}

.tab-btn--active::after,
.tab-btn[aria-selected="true"]::after {
  left: 0;
  right: 0;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   Sliders
   ============================================ */
.sliders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 640px) {
  .sliders-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 40px;
  }
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

/* ===== 滑桿膠囊（只有 icon 圓圈帶主題色 + 文字浮在外面） ===== */
.slider-pill {
  --tag-gold: #D5B468;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.slider-pill__icon {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--tag-gold);
  flex-shrink: 0;
  box-shadow:
    0 3px 7px rgba(20, 15, 5, 0.18),
    0 1px 2px rgba(20, 15, 5, 0.10);
}

/* 皮革雜訊紋理只覆蓋圓圈 */
.slider-pill__icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.slider-pill__icon svg {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  stroke: var(--tag-gold);
  fill: none;
  stroke-linecap: round;
}

.slider-pill__label {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}

.slider-pill__zh {
  font-family: 'Noto Serif TC', 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  line-height: 1.1;
}

.slider-pill__en {
  font-size: 0.65rem;
  letter-spacing: 0.20em;
  color: var(--text-muted);
  line-height: 1;
}

/* 4 主題色（套用在 icon 圓圈上） */
.slider-pill--acid .slider-pill__icon {
  background: linear-gradient(145deg, #4F617A 0%, #323E4B 55%, #212A34 100%);
}

.slider-pill--sweet .slider-pill__icon {
  background: linear-gradient(145deg, #D4A858 0%, #B58730 55%, #7C5614 100%);
}

.slider-pill--bitter .slider-pill__icon {
  background: linear-gradient(145deg, #A06040 0%, #7A4A2A 55%, #5A3318 100%);
}

.slider-pill--body .slider-pill__icon {
  background: linear-gradient(145deg, #6E8E78 0%, #4E6B56 55%, #36493D 100%);
}

.slider-value {
  font-family: 'Allura', 'Cormorant Garamond', cursive;
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--text-primary);
  font-variant-numeric: lining-nums tabular-nums;
  min-width: 28px;
  line-height: 1;
  text-align: right;
  line-height: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    var(--track-color, var(--accent-gold)) 0%,
    var(--track-color, var(--accent-gold)) var(--fill, 50%),
    var(--border) var(--fill, 50%),
    var(--border) 100%
  );
  cursor: pointer;
  outline: none;
  transition: background var(--transition);
  touch-action: manipulation;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 3px solid var(--track-color, var(--accent-gold));
  box-shadow: 0 0 0 4px rgba(196, 154, 53, 0.14), var(--shadow-sm);
  transition: transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(196, 154, 53, 0.20), var(--shadow-md);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 3px solid var(--track-color, var(--accent-gold));
  cursor: pointer;
}

/* 4 個滑桿軌道色：對齊 icon 圓圈主題色（再提亮一階）*/
#slider-acid   { --track-color: #596984; }
#slider-sweet  { --track-color: #C49640; }
#slider-bitter { --track-color: #A86E48; }
#slider-body   { --track-color: #74937C; }

input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.slider-steps {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}

.slider-steps span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  opacity: 0.7;
}

.slider-ref {
  font-family: 'Noto Serif TC', 'Cormorant Garamond', Georgia, serif;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-left: 2px solid var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  transition: background var(--transition);
}

.ref-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 3px;
  letter-spacing: 0.01em;
}

.ref-desc {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   Results
   ============================================ */
.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 560px) {
  .results-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.bean-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform 180ms ease;
  position: relative;
  overflow: hidden;
}

.bean-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-light);
  transition: background var(--transition);
}

.bean-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.bean-card--primary {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 1px rgba(190, 141, 42, 0.3), var(--shadow-md);
}

.bean-card--primary::before {
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-light));
}

.bean-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bean-card__split {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.bean-card__split-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bean-card__split-right {
  display: flex;
  flex-direction: column;
}

.bean-card__tasting {
  position: relative;
  overflow: hidden;
  font-family: 'Noto Serif TC', 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  padding: 14px 16px;
  background: linear-gradient(135deg,
    rgba(196, 154, 53, 0.08) 0%,
    rgba(138, 85, 24, 0.04) 100%);
  border: 1px solid rgba(196, 154, 53, 0.18);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-md);
  height: 100%;
}

.bean-card__tasting-text {
  position: relative;
  z-index: 1;
}

.bean-card__leaf-decor {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 88px;
  height: auto;
  color: var(--accent);
  opacity: 0.20;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .bean-card__tasting {
  background: linear-gradient(135deg,
    rgba(212, 174, 80, 0.10) 0%,
    rgba(212, 174, 80, 0.04) 100%);
  border-color: rgba(212, 174, 80, 0.18);
}

[data-theme="dark"] .bean-card__leaf-decor {
  opacity: 0.16;
}

@media (min-width: 360px) {
  .bean-card__split {
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
  }

  .bean-card__split-left {
    flex: 0 0 38%;
    max-width: 200px;
    min-width: 0;
  }

  .bean-card__split-right {
    flex: 1;
    min-width: 0;
  }
}

.bean-card__rank {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(138, 85, 24, 0.08);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(138, 85, 24, 0.18);
}

.bean-card__match {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1;
  letter-spacing: -0.01em;
}

.match-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.bean-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bean-name {
  font-family: 'Noto Serif TC', 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: 0.12em;
}

.bean-name-en {
  font-size: 0.78rem;
  color: var(--accent-light);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 4px;
}

.bean-name-en::after {
  content: '';
  display: block;
  width: 28px;
  height: 1.5px;
  background: var(--accent-gold);
  margin-top: 10px;
  opacity: 0.85;
}

.bean-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.bean-meta__item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-family: 'Noto Serif TC', 'Cormorant Garamond', Georgia, serif;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  line-height: 1.45;
}

.bean-meta__item svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}

.bean-meta__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.process-tag {
  --tag-gold: #8A5518;
  display: inline-block;
  align-self: flex-start;
  font-family: 'Noto Serif TC', 'Cormorant Garamond', Georgia, serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--tag-gold);
  background: linear-gradient(135deg,
    rgba(196, 154, 53, 0.10) 0%,
    rgba(138, 85, 24, 0.05) 100%);
  border: 1px solid rgba(138, 85, 24, 0.40);
  border-radius: 999px;
  padding: 5px 16px;
  margin-top: 4px;
  text-shadow: 0 1px 0 rgba(255, 248, 230, 0.65);
  box-shadow:
    0 2px 5px rgba(40, 20, 5, 0.10),
    0 1px 2px rgba(40, 20, 5, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .process-tag {
  --tag-gold: #E5C880;
  background: linear-gradient(135deg,
    rgba(212, 174, 80, 0.12) 0%,
    rgba(212, 174, 80, 0.05) 100%);
  border-color: rgba(212, 174, 80, 0.28);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.40);
}

.bean-card__scores-box {
  margin-top: 4px;
}

.bean-card__scores {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.bean-card__scores::after {
  content: '';
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 1px;
  background: rgba(196, 154, 53, 0.22);
  pointer-events: none;
}

[data-theme="dark"] .bean-card__scores::after {
  background: rgba(212, 174, 80, 0.20);
}

.score-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.score-dim {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.score-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.bean-dot {
  width: 11px;
  height: 14px;
  flex-shrink: 0;
  transform: translateY(0);
  transition: transform var(--transition);
}

.bean-dot ellipse {
  fill: var(--border);
  transition: fill var(--transition);
}

.bean-dot__groove {
  stroke: rgba(40, 20, 5, 0.18);
  stroke-width: 0.8;
  stroke-linecap: round;
  transition: stroke var(--transition);
}

.bean-dot--filled ellipse {
  fill: var(--accent-gold);
}

.bean-dot--filled .bean-dot__groove {
  stroke: rgba(40, 20, 5, 0.50);
}

[data-theme="dark"] .bean-dot__groove {
  stroke: rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] .bean-dot--filled .bean-dot__groove {
  stroke: rgba(0, 0, 0, 0.65);
}

.bean-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

/* ===== 風味標籤：金色描邊浮雕膠囊（4 主題分組） ===== */
.flavor-tag {
  --tag-gold: #D5B468;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--tag-gold);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.20);
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow:
    0 4px 10px rgba(20, 15, 5, 0.22),
    0 2px 4px rgba(20, 15, 5, 0.14),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.20),
    inset 0 -1.5px 1.5px rgba(0, 0, 0, 0.22),
    inset 0 0 12px rgba(0, 0, 0, 0.12);
}

.flavor-tag:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 14px rgba(20, 15, 5, 0.28),
    0 3px 6px rgba(20, 15, 5, 0.18),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.22),
    inset 0 -1.5px 1.5px rgba(0, 0, 0, 0.24),
    inset 0 0 12px rgba(0, 0, 0, 0.12);
}

.flavor-tag__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--tag-gold);
  background: rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
}

.flavor-tag__icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--tag-gold);
  fill: none;
  stroke-linecap: round;
}

.flavor-tag__text {
  font-family: 'Noto Serif TC', 'Cormorant Garamond', Georgia, serif;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.32);
}

/* 4 種主題色（對應參考圖：藍 / 橄欖 / 古銅 / 森林綠） */
.flavor-tag--berry {
  background: linear-gradient(145deg, #536276 0%, #353E49 55%, #232A32 100%);
}

.flavor-tag--wine {
  background: linear-gradient(145deg, #6A7559 0%, #4D5540 55%, #353B2E 100%);
}

.flavor-tag--wild {
  background: linear-gradient(145deg, #8F7A5E 0%, #6F5A45 55%, #51422E 100%);
}

.flavor-tag--fermented {
  background: linear-gradient(145deg, #73877A 0%, #526558 55%, #39453D 100%);
}

[data-theme="dark"] .flavor-tag {
  --tag-gold: #E5C880;
  border-color: rgba(0, 0, 0, 0.50);
}

/* ============================================
   Radar Chart
   ============================================ */
.chart-section {
  display: flex;
  flex-direction: column;
}

.chart-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  font-style: italic;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.chart-meta strong {
  color: var(--accent);
  font-style: normal;
}

.chart-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: center;
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}

/* 攝影底圖 + 極薄遮罩 */
[data-theme="light"] .chart-container {
  background:
    linear-gradient(rgba(245, 235, 215, 0.18), rgba(245, 235, 215, 0.18)),
    url('assets/chart-bg.png.png') center 65% / cover no-repeat;
  border-color: rgba(160, 120, 55, 0.25);
}

[data-theme="dark"] .chart-container {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.38) 100%),
    radial-gradient(ellipse at 22% 28%, rgba(90, 60, 22, 0.28) 0%, transparent 44%),
    radial-gradient(ellipse at 75% 65%, rgba(60, 38, 12, 0.20) 0%, transparent 38%),
    linear-gradient(148deg, #201208 0%, #2C1A0A 35%, #1C0E06 65%, #221408 100%);
  border-color: rgba(80, 50, 18, 0.5);
}

.chart-canvas-wrap {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  text-align: center;
  padding: 36px 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  letter-spacing: 0.04em;
}

/* ============================================
   Quiz Section
   ============================================ */
.progress-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.progress-dots {
  display: flex;
  gap: 10px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition), transform 220ms ease, width 220ms ease;
}

.progress-dot--done {
  background: var(--accent-light);
}

.progress-dot--active {
  background: var(--accent-gold);
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(196, 154, 53, 0.2);
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
}

/* Question Card */
.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 36px 38px;
  box-shadow: var(--shadow-md);
  animation: fadeSlideIn 280ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.question-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold) 0%, transparent 100%);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-number {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 18px;
}

.question-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

.question-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 34px;
  line-height: 1.6;
}

.answer-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .answer-btns { flex-direction: row; }
  .answer-btn  { flex: 1; }
}

.answer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 54px;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow 160ms ease, transform 120ms ease;
  text-align: center;
  letter-spacing: 0.01em;
}

.answer-btn:hover {
  border-color: var(--accent-light);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-surface));
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

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

.answer-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.answer-btn--selected {
  border-color: var(--accent-gold);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-surface));
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(196, 154, 53, 0.2);
}

/* Quiz Nav */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 22px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  min-height: 44px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.back-btn:hover {
  color: var(--text-secondary);
  border-color: var(--accent-light);
  background: var(--bg-secondary);
}

.back-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.back-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--transition), border-color var(--transition);
  letter-spacing: 0.02em;
}

.restart-btn:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.restart-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.fallback-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-left: 2px solid var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 16px;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ============================================
   Accessibility
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
