/* =============================================================================
   和モダン 統一標準 — kaikai.win (2026-11-11)
   -----------------------------------------------------------------------------
   一個檔案管全站觀感。載入順序：放喺 <head> 最尾，hub-ui.js 亦會將佢移到最後，
   確保壓得過頁面自己嘅 <style>。
   fortune 頁唔載入呢個檔（Bobby 要求保留原設計）。
   ============================================================================= */

/* ---------- 基礎色票 ---------- */
:root {
  --nh-paper: #F7F3EC;
  --nh-paper-2: #F0E9DC;
  --nh-card: #FFFDF8;
  --nh-ink: #1A1714;
  --nh-ink-2: #4A443B;
  --nh-muted: #8B8175;
  --nh-line: #E2D9CB;
  --nh-vermilion: #B3261E;
  --nh-copper: #94602F;
  --nh-matcha: #5C6B43;
  --nh-serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", "Songti SC", "STSong", serif;
}

/* ---------- 全站底色 / 文字 ---------- */
body {
  background-color: #F7F3EC !important;
  color: #1A1714 !important;
}

/* 標題明朝體 */
h1, h2, h3 {
  font-family: var(--nh-serif) !important;
  letter-spacing: -0.01em;
}
::selection { background: rgba(179, 38, 30, .16); }
:focus-visible { outline: 2px solid #B3261E; outline-offset: 2px; }

/* ---------- 通用 token 重映射（大部分頁面共用呢啲名） ---------- */
:root {
  --bg: #F7F3EC;
  --bg-2: #FFFDF8;
  --card: #FFFDF8;
  --card-2: #F6F1E8;
  --card2: #F6F1E8;
  --card3: #F0E9DC;
  --panel: #FFFDF8;
  --panel-2: #F6F1E8;
  --surface: #FFFDF8;
  --surface-2: #F6F1E8;
  --surface-solid: #FFFDF8;
  --sunk: #F0E9DC;
  --text: #1A1714;
  --txt: #1A1714;
  --txt-2: #4A443B;
  --ink: #1A1714;
  --ink-2: #4A443B;
  --ink-3: #8B8175;
  --ink-4: #A79C8C;
  --muted: #8B8175;
  --mut: #8B8175;
  --sub: #8B8175;
  --dim: #8B8175;
  --line: rgba(26, 23, 20, .10);
  --line-2: rgba(26, 23, 20, .18);
  --border: rgba(26, 23, 20, .12);
  --accent: #B3261E;
  --accent-2: #94602F;
  --green: #5C6B43;
  --red: #B3261E;
  --amber: #94602F;
  --orange: #94602F;
  --gold: #94602F;
}

/* ---------- 各頁專屬變數 ---------- */
/* 新聞 */
:root {
  --nw-bg: #F7F3EC; --nw-ink: #1A1714; --nw-ink-2: #4A443B; --nw-muted: #8B8175;
  --nw-line: #E2D9CB; --nw-line-2: #EDE5D8; --nw-accent: #B3261E; --nw-accent-2: #94602F;
  --nw-accent-soft: #F3E7DC; --nw-ok: #5C6B43; --nw-danger: #B3261E;
}
/* 翻新貨 */
:root {
  --rf-bg: #F7F3EC; --rf-ink: #1A1714; --rf-ink-2: #4A443B; --rf-muted: #8B8175;
  --rf-line: #E2D9CB; --rf-line-2: #EDE5D8; --rf-accent: #B3261E; --rf-accent-2: #94602F;
  --rf-accent-soft: #F3E7DC; --rf-ok: #5C6B43; --rf-danger: #B3261E;
  --rf-price: #B3261E; --rf-price-soft: #F3E7DC;
}
/* 隧道 */
:root {
  --p-line: #E2D9CB; --p-line-2: #D8CDBB; --p-surface: #FFFDF8; --p-surface-2: #F0E9DC;
  --p-ink: #1A1714; --p-ink-2: #4A443B; --p-ink-3: #8B8175;
  --p-accent: #B3261E; --p-focus: #B3261E;
  --p-green: #5C6B43; --p-amber: #94602F; --p-red: #B3261E;
}
/* 賽馬 */
:root {
  --aw-brand: #B3261E; --gold: #94602F; --gold-bright: #B3261E;
  --surface: rgba(255, 253, 248, .92);
}

/* ---------- 首頁：拆掉裝飾層嘅冷白 ---------- */
#bg, #glow, .bg-layer, .bg-gradient {
  background: #F7F3EC !important;
  background-image: none !important;
}

/* ---------- TV 直播（本身硬編碼深色，要轉和紙） ---------- */
html body {
  background-color: #F7F3EC !important;
  color: #1A1714 !important;
}
body .panel, body .card, body .tile, body .chan, body #player-wrap {
  background-color: #FFFDF8 !important;
  border-color: #E2D9CB !important;
  color: #1A1714 !important;
}

/* ---------- 輸入元件 ---------- */
input, select, textarea {
  background-color: #FFFDF8 !important;
  color: #1A1714 !important;
  border-color: rgba(26, 23, 20, .16) !important;
}
input::placeholder, textarea::placeholder { color: #A79C8C !important; }

/* ---------- 列印 ---------- */
@media print { body { background: #fff !important; color: #000 !important; } }

/* ---------- SPA 子頁容器（news / refurb 會自帶 #f5f5f7） ---------- */
#spa-body, #spa-host, #spa-nav {
  background-color: #F7F3EC !important;
}
#spa-body .card, #spa-body .item, #spa-body .news-item, #spa-body .row {
  background-color: #FFFDF8 !important;
  border-color: #E2D9CB !important;
}

/* =============================================================================
   2026-11-11 和モダン 素材層（OpenRouter flux-3-image-klein 生成）
   ============================================================================= */

/* 和紙纖維底紋 —— 用 fixed overlay 而唔係 body background：
   好多頁面嘅 `background:` shorthand（!important + 排後面）會清走 background-image。 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147482900;          /* 低過 #hub-back (…3000)，高過一般內容 */
  pointer-events: none;
  background: url("/shared/img/washi-tile.webp") repeat;
  background-size: 420px 420px;
  opacity: .55;
  mix-blend-mode: multiply;
}

/* 頁首插畫帶：21:9，右邊構圖，底部淡出融入和紙 */
.nh-band {
  display: block;
  width: 100%;
  height: 138px;
  margin: 0 0 4px;
  background-repeat: no-repeat;
  background-position: center right;
  background-size: cover;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 52%, rgba(0,0,0,.45) 84%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 52%, rgba(0,0,0,.45) 84%, transparent 100%);
}
@media (max-width: 640px) {
  .nh-band { height: 96px; background-position: 72% center; }
}

.nh-band--hub      { background-image: url("/shared/img/hub.webp"); }
.nh-band--news     { background-image: url("/shared/img/news.webp"); }
.nh-band--refurb   { background-image: url("/shared/img/refurb.webp"); }
.nh-band--bus      { background-image: url("/shared/img/bus.webp"); }
.nh-band--tunnel   { background-image: url("/shared/img/tunnel.webp"); }
.nh-band--stockai  { background-image: url("/shared/img/stockai.webp"); }
.nh-band--hkjc     { background-image: url("/shared/img/hkjc.webp"); }
.nh-band--tv       { background-image: url("/shared/img/tv.webp"); }
.nh-band--sushiro  { background-image: url("/shared/img/sushiro.webp"); }

/* 深色卡片上面嘅 banner 都要淡出得自然 */
@media print { .nh-band { display: none !important; } }

/* =============================================================================
   SPA 子頁 scoped token 覆寫（佢哋唔用 :root，token 掛喺自己 wrapper）
   ============================================================================= */

/* 巴士頁 .buswrap */
.buswrap {
  --bg: #F7F3EC;
  --bg-grad: linear-gradient(180deg, #F7F3EC 0%, #F0E9DC 100%);
  --card: #FFFDF8; --card2: #F6F1E8; --card3: #F0E9DC;
  --ink: #1A1714; --ink2: #4A443B; --sub: #8B8175; --muted: #A79C8C;
  --line: rgba(26, 23, 20, .10); --line2: rgba(26, 23, 20, .16);
  --accent: #B3261E; --accent-ink: #FFF8EC; --accent-soft: rgba(179, 38, 30, .10);
}

/* 壽司郎頁 .sw */
.sw {
  --bg: #F7F3EC; --panel: #FFFDF8; --ink: #1A1714; --mut: #8B8175;
  --line: #E2D9CB; --hair: #EDE5D8;
  --red: #B3261E; --gold: #94602F; --green: #5C6B43;
}

/* 新聞頁 */
:root {
  --nw-bg: #F7F3EC; --nw-surface: #FFFDF8; --nw-surface-2: #F6F1E8;
  --nw-ink: #1A1714; --nw-ink-2: #4A443B; --nw-sub: #8B8175; --nw-muted: #A79C8C;
  --nw-line: #E2D9CB; --nw-line-2: #EDE5D8;
  --nw-accent: #B3261E; --nw-accent-2: #94602F; --nw-accent-soft: #F3E7DC;
  --nw-ok: #5C6B43; --nw-danger: #B3261E;
}

/* 翻新貨頁 */
:root {
  --rf-bg: #F7F3EC; --rf-surface: #FFFDF8; --rf-surface-2: #F6F1E8;
  --rf-ink: #1A1714; --rf-ink-2: #4A443B; --rf-sub: #8B8175; --rf-muted: #A79C8C;
  --rf-line: #E2D9CB; --rf-line-2: #EDE5D8;
  --rf-accent: #B3261E; --rf-accent-2: #94602F; --rf-accent-soft: #F3E7DC;
  --rf-ok: #5C6B43; --rf-danger: #B3261E; --rf-price: #B3261E; --rf-price-soft: #F3E7DC;
}

/* 隧道頁 */
:root {
  --bg: #F7F3EC; --card: #FFFDF8; --text: #1A1714; --muted: #A79C8C;
  --border: #E2D9CB; --accent: #B3261E;
  --green: #5C6B43; --red: #B3261E; --amber: #94602F;
}

.nh-band--data { background-image: url("/shared/img/data.webp"); }
.nh-band--traffic { background-image: url("/shared/img/traffic.webp"); }
.nh-band--map { background-image: url("/shared/img/map.webp"); }
.nh-band--chips { background-image: url("/shared/img/chips.webp"); }
.nh-band--ae { background-image: url("/shared/img/ae.webp"); }
.nh-band--cctv { background-image: url("/shared/img/cctv.webp"); }
.nh-band--calendar { background-image: url("/shared/img/calendar.webp"); }
.nh-band--weather { background-image: url("/shared/img/weather.webp"); }
.nh-band--techdeal { background-image: url("/shared/img/techdeal.webp"); }
.nh-band--pvol2 { background-image: url("/shared/img/pvol2.webp"); }
.nh-band--7709 { background-image: url("/shared/img/7709.webp"); }
.nh-band--kyushu { background-image: url("/shared/img/kyushu.webp"); }
.nh-band--findtag { background-image: url("/shared/img/findtag.webp"); }
.nh-band--billrecord { background-image: url("/shared/img/billrecord.webp"); }
.nh-band--fleet { background-image: url("/shared/img/fleet.webp"); }
.nh-band--myroute { background-image: url("/shared/img/myroute.webp"); }
.nh-band--generic { background-image: url("/shared/img/generic.webp"); }
