/* leadingmrk 2026 黑五優惠頁｜只做一種淺色（不跟系統深色） */
:root {
  --navy-900: #0f1b2b;
  --navy-800: #152538;
  --navy: #1e3148;
  --navy-600: #2a4060;
  --beige: #e8dbb8;
  --beige-hi: #f0e4c3;
  --beige-soft: #faf6ea;
  --beige-deep: #d4c397;
  --bg: #f5f3ed;
  --card: #ffffff;
  --line: #e6e1d5;
  --muted: #6b7687;
  --ember: #e8552b;      /* 黑五強調色 */
  --ember-dk: #c8431d;
  --moss: #4f6f45;
  --moss-bg: #eaf1e6;
  --amber: #85651e;
  --amber-bg: #f8efd8;
  --slate: #59647a;
  --slate-bg: #eceef2;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: 'Geist', 'Noto Sans TC', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
.num, .cd-box b { font-variant-numeric: tabular-nums lining-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--beige);
  background:
    radial-gradient(60% 80% at 85% 10%, rgba(232, 85, 43, 0.28), transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(232, 219, 184, 0.12), transparent 60%),
    linear-gradient(135deg, var(--navy-800) 0%, var(--navy) 60%, var(--navy-600) 100%);
}
.hero::before {
  /* 極淡格線底紋 */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 219, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 219, 184, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.hero::after {
  /* 緩慢漂移的光暈，畫面停著也還在動 */
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  right: -140px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 85, 43, 0.35), transparent 65%);
  filter: blur(10px);
  animation: drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-120px, 80px) scale(1.15); }
}

.ticker {
  position: relative;
  z-index: 1;
  background: var(--ember);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  line-height: 34px;
}
.ticker-track { display: inline-flex; animation: marquee 40s linear infinite; }
.ticker span, .ticker i { padding: 0 18px; font-style: normal; }
.ticker i { color: var(--navy-900); }
@keyframes marquee { to { transform: translateX(-50%); } }

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(44px, 7vw, 88px);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 26vw, 320px); gap: clamp(28px, 4vw, 56px); align-items: end; }
.hero-panel {
  padding: 24px;
  border: 1px solid rgba(232, 219, 184, 0.22);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(240, 228, 195, 0.1), rgba(15, 27, 43, 0.35));
  backdrop-filter: blur(6px);
}
.hp-title { margin: 0; font-size: 13px; letter-spacing: 0.16em; color: rgba(240, 228, 195, 0.7); }
.hp-total { margin: 4px 0 14px; font-size: 16px; color: var(--beige-hi); }
.hp-total b { font-size: 3rem; line-height: 1; margin-right: 6px; color: #fff; }
.hp-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hp-stats li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(232, 219, 184, 0.14); font-size: 15px; }
.hp-stats li[hidden] { display: none; }
.hp-stats i { width: 8px; height: 8px; border-radius: 50%; background: #9aa6b8; }
.hp-stats [data-stat='active'] i { background: #8fc27f; box-shadow: 0 0 0 4px rgba(143, 194, 127, 0.18); animation: pulse 1.8s ease-in-out infinite; }
.hp-stats [data-stat='tbd'] i { background: #e2c27a; }
.hp-stats b { margin-left: auto; font-size: 18px; color: #fff; }
.hp-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; min-height: 46px; border-radius: 12px;
  background: var(--ember); color: #fff; font-weight: 700; text-decoration: none;
  transition: background 0.2s;
}
.hp-cta:hover { background: var(--ember-dk); }
.hp-cta svg { width: 15px; height: 15px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.hero-brand { margin: 0 0 clamp(24px, 4vw, 40px); font-weight: 700; letter-spacing: 0.02em; }
.hero-brand a { text-decoration: none; color: var(--beige-hi); display: inline-block; }
.hero-brand img { display: block; height: clamp(34px, 4.4vw, 46px); width: auto; }
.hero-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border: 1px solid rgba(232, 85, 43, 0.7);
  border-radius: 999px;
  color: #ffb39b;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
}
.hero-title {
  margin: 0;
  color: var(--beige-hi);
  font-size: clamp(2.4rem, 6.4vw, 4.4rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.01em;
  word-break: keep-all;
}
.hero-sub { margin: 18px 0 0; max-width: 640px; font-size: clamp(1rem, 1.6vw, 1.125rem); color: rgba(240, 228, 195, 0.86); }

.countdown { margin-top: clamp(28px, 4vw, 44px); }
.cd-label { margin: 0 0 10px; font-size: 14px; letter-spacing: 0.06em; color: rgba(240, 228, 195, 0.8); }
.cd-boxes { display: flex; gap: 10px; flex-wrap: wrap; }
.cd-boxes[hidden], .empty[hidden], .cat[hidden] { display: none; }
.cd-box {
  min-width: 76px;
  padding: 10px 12px 8px;
  text-align: center;
  border: 1px solid rgba(232, 219, 184, 0.28);
  border-radius: 14px;
  background: rgba(15, 27, 43, 0.35);
  backdrop-filter: blur(4px);
}
.cd-box b { display: block; font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.1; color: #fff; font-weight: 700; }
.cd-box span { font-size: 12px; color: rgba(240, 228, 195, 0.75); }

/* ---------- 主內容 ---------- */
.main { max-width: 1200px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) var(--gutter) clamp(48px, 6vw, 80px); }
.intro {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  background: var(--beige-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ember);
  border-radius: 14px;
}
.notes { margin: 0; padding-left: 1.2em; }
.notes li { margin: 2px 0; }
.disclosure { margin: 0; font-size: 14px; color: var(--muted); }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  gap: 12px;
  margin: clamp(24px, 3vw, 36px) calc(var(--gutter) * -1) 0;
  padding: 14px var(--gutter);
  background: rgba(245, 243, 237, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 46px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--navy);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: #98a0ad; }
.search input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(30, 49, 72, 0.1); }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--navy);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: var(--beige-hi); }
.chip-n { font-size: 12px; opacity: 0.65; font-variant-numeric: tabular-nums; }
.result-line { min-height: 1.5em; margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.cat { margin-top: clamp(20px, 3vw, 32px); }
.cat-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.4;
}
.cat-title::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--ember); transform: rotate(45deg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }

/* ---------- 卡片 ---------- */
.deal {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(30, 49, 72, 0.04), 0 8px 24px -12px rgba(30, 49, 72, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.5s ease both;
}
.deal:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(30, 49, 72, 0.05), 0 18px 36px -16px rgba(30, 49, 72, 0.22); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.deal[hidden] { display: none; }

.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.deal-logo { display: flex; align-items: center; height: 40px; min-width: 0; }
.logo-img { display: block; height: 28px; width: auto; max-width: 150px; object-fit: contain; object-position: left center; }
.logo-mono {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mono, var(--navy));
  color: var(--beige-hi);
  font-weight: 700;
  font-size: 20px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.tag {
  flex: 0 1 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  background: var(--slate-bg);
  color: var(--slate);
}
.deal[data-status='active'] .tag { background: var(--moss-bg); color: var(--moss); }
.deal[data-status='active'] .tag::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }
.deal[data-status='tbd'] .tag { background: var(--amber-bg); color: var(--amber); }

.deal-name { margin: 14px 0 2px; font-size: 1.25rem; line-height: 1.35; }
.deal-intro { margin: 0; color: var(--muted); font-size: 15px; }
.deal-offer {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--beige-soft);
  border-left: 3px solid var(--ember);
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.6;
}
.deal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 0 0; font-size: 14px; }
.deal-meta dt { color: var(--muted); font-size: 12.5px; }
.deal-meta dd { margin: 0; }

.deal-src { margin-top: 12px; font-size: 13px; color: var(--muted); }
.deal-src summary { cursor: pointer; width: fit-content; list-style: none; }
.deal-src summary::-webkit-details-marker { display: none; }
.deal-src summary::after { content: '＋'; margin-left: 4px; }
.deal-src[open] summary::after { content: '－'; }
.deal-src ul { margin: 6px 0 0; padding-left: 1.1em; }
.deal-src li { overflow-wrap: anywhere; }
.deal-src a { color: var(--navy-600); }

.deal-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 18px; }
.btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; }
.btn-review { border: 1.5px solid var(--navy); background: transparent; color: var(--navy); }
.btn-review:hover { background: var(--navy); color: var(--beige-hi); }
.btn-buy { border: 1.5px solid var(--ember); background: var(--ember); color: #fff; }
.btn-buy:hover { background: var(--ember-dk); border-color: var(--ember-dk); }

/* 未開始：不像有效優惠 */
.deal[data-status='upcoming'] { border-style: dashed; }
.deal[data-status='upcoming'] .deal-offer { border-left-color: var(--beige-deep); background: #f6f5f1; color: var(--slate); }
.deal[data-status='upcoming'] .btn-buy,
.deal[data-status='ended'] .btn-buy,
.deal[data-status='tbd'] .btn-buy { background: transparent; color: var(--slate); border-color: #c9ced8; }
.deal[data-status='upcoming'] .btn-buy:hover,
.deal[data-status='ended'] .btn-buy:hover,
.deal[data-status='tbd'] .btn-buy:hover { background: var(--slate-bg); }
.deal[data-status='tbd'] .deal-offer { border-left-color: var(--beige-deep); }
/* 已結束：灰掉、優惠畫線 */
.deal[data-status='ended'] { background: #f3f2ee; box-shadow: none; }
.deal[data-status='ended'] .logo-img, .deal[data-status='ended'] .logo-mono { filter: grayscale(1); opacity: 0.55; }
.deal[data-status='ended'] .deal-name, .deal[data-status='ended'] .deal-intro { color: #8b93a1; }
.deal[data-status='ended'] .deal-offer { background: transparent; border-left-color: #c9ced8; color: #8b93a1; text-decoration: line-through; font-weight: 500; }

.empty { margin-top: 24px; padding: 40px 20px; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty p { margin: 0 0 14px; color: var(--muted); }
.empty .btn { flex: none; display: inline-flex; }

/* ---------- 頁尾 ---------- */
.foot { background: var(--navy); color: rgba(240, 228, 195, 0.85); }
.foot-inner { max-width: 1200px; margin: 0 auto; padding: clamp(40px, 5vw, 64px) var(--gutter); }
.foot-block h2 { margin: 0 0 6px; font-size: 1.125rem; color: var(--beige-hi); }
.foot-block p { margin: 0 0 4px; }
.foot-block + .foot-block { margin-top: 18px; }
.foot-meta { margin: 18px 0 0; font-size: 13px; color: rgba(240, 228, 195, 0.6); }
.foot-meta + .foot-meta { margin-top: 6px; }
.foot a { color: var(--beige-hi); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 560px) {
  .hero-panel { padding: 18px; }
  .hp-total { margin-bottom: 10px; }
  .hp-total b { font-size: 2.25rem; }
  .hp-stats { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
  .hp-stats li { flex-wrap: wrap; gap: 4px 8px; padding: 10px; border: 1px solid rgba(232, 219, 184, 0.14); border-radius: 12px; font-size: 13px; }
  .hp-stats b { margin-left: 0; width: 100%; font-size: 20px; }
  .deal { padding: 18px; }
  .cd-box { min-width: 0; flex: 1 1 0; }
  .deal-meta { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
