  :root {
    --bg: #05070f;
    --ink: #f0f2fb;
    --dim: #a6aec9;
    --faint: #6d7593;
    --line: rgba(150, 165, 220, .14);
    --line-soft: rgba(150, 165, 220, .08);
    --panel: rgba(13, 17, 34, .7);
    --gold: #f0c674;
    --c-trivia: #64b5f6;   /* 網路趣聞・冷知識 */
    --c-odd:    #f48fb1;   /* 奇聞軼事 */
    --c-sci:    #4dd0e1;   /* 科學趣聞 */
    --c-learn:  #ffb74d;   /* 學習新知 */
    --c-tool:   #81c784;   /* 生活痛點小工具 */
    --c-fun:    #ba9df1;   /* 創意・娛樂 */
    --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
    --sans: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }
  ::selection { background: rgba(240, 198, 116, .28); }
  .sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

  /* ── 背景：預先柔化的極光團（只做 transform 動畫，不跑濾鏡） ── */
  #aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: .7; }
  .blob {
    position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--nc) 30%, transparent) 0%,
      color-mix(in srgb, var(--nc) 18%, transparent) 26%,
      color-mix(in srgb, var(--nc) 7%, transparent) 48%,
      transparent 70%);
    mix-blend-mode: screen; opacity: .15;
    animation: drift 84s ease-in-out infinite alternate;
    will-change: transform;
  }
  @keyframes drift {
    from { transform: translate3d(-3%, -2%, 0) scale(1); }
    to   { transform: translate3d(3%, 4%, 0) scale(1.16); }
  }
  #grid-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .3;
    background-image:
      linear-gradient(rgba(150, 165, 220, .05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(150, 165, 220, .05) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
    mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
  }

  .wrap { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 0 24px 80px; }

  /* ── 頁首 ─────────────────────────────────────────── */
  .site-head { padding: 52px 0 0; text-align: center; }
  /* 進場：預設可見，JS 在場時才先藏起來淡入（無 JS／動畫被凍結也讀得到內容） */
  .rise { transition: opacity .7s ease var(--rd, 0s), transform .7s cubic-bezier(.2,.8,.3,1) var(--rd, 0s); }
  body.preload .rise { opacity: 0; transform: translateY(14px); }
  .kicker {
    display: inline-flex; align-items: center; gap: 14px;
    font-family: var(--serif); font-size: 11.5px; color: var(--gold);
    letter-spacing: .42em; text-indent: .42em; margin-bottom: 16px;
  }
  .kicker::before, .kicker::after {
    content: ""; width: 42px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 198, 116, .55));
  }
  .kicker::after { background: linear-gradient(270deg, transparent, rgba(240, 198, 116, .55)); }
  h1 {
    font-family: var(--serif); font-weight: 700;
    font-size: clamp(36px, 6.4vw, 60px); letter-spacing: .2em; text-indent: .2em;
    background: linear-gradient(180deg, #ffffff 8%, #b9c4ee 96%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 30px rgba(140, 165, 255, .28));
  }
  .lede { margin-top: 14px; color: var(--dim); font-size: 15px; line-height: 1.9; }

  .stats {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 34px;
    margin-top: 22px;
  }
  .stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .stat b {
    font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.15;
    color: var(--gold); font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(240, 198, 116, .35);
  }
  .stat span { font-size: 11.5px; color: var(--faint); letter-spacing: .22em; text-indent: .22em; }

  /* ── 分頁列：星空／作品牆／觀測記錄 ───────────────── */
  .tabbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; justify-content: center; gap: 6px;
    margin: 26px auto 0; padding: 8px 0 6px;
    background: linear-gradient(180deg, var(--bg) 68%, rgba(5, 7, 15, 0));
  }
  .tab {
    font-family: inherit; font-size: 13.5px; letter-spacing: .14em; text-indent: .07em;
    color: var(--dim); cursor: pointer;
    padding: 9px 22px; border-radius: 999px;
    background: transparent; border: 1px solid transparent;
    transition: color .22s, border-color .22s, background .22s, box-shadow .22s;
  }
  .tab:hover { color: var(--ink); }
  .tab[aria-selected="true"] {
    color: var(--gold);
    background: rgba(22, 17, 6, .5);
    border-color: rgba(240, 198, 116, .4);
    box-shadow: 0 0 18px rgba(240, 198, 116, .12);
  }
  .tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  .panel { display: none; }
  .panel.on { display: block; animation: panelIn .3s ease; }
  @keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  /* ── 星空圖：每顆星＝一件作品 ─────────────────────── */
  /* 注意：skywrap 不設 z-index（不建立堆疊環境），懸浮卡才能疊在 hero 卡之上 */
  #skywrap {
    position: relative;
    width: 100vw; margin: 14px calc(50% - 50vw) 0;
    height: clamp(520px, 74vh, 820px);
    /* 兩道遮罩都定義在這裡，讓畫布（#sky）與暈影層（::after）共用同一組邊界；
       定義在子元素上的話 ::after 繼承不到。
       --sky-mask      短而軟：只收畫布殘影，星座要留在全不透明區內（6%–91%）。
       --sky-mask-soft 長而軟：給大面積色調層用，可以化得更開（18%–82%）。
       兩者都是 smoothstep 取樣，兩端斜率趨近 0，不會壓出馬赫帶。 */
    --sky-mask: linear-gradient(180deg,
      rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .02) 0.5%, rgba(0, 0, 0, .074) 1%, rgba(0, 0, 0, .156) 1.5%,
      rgba(0, 0, 0, .259) 2%, rgba(0, 0, 0, .376) 2.5%, rgba(0, 0, 0, .5) 3%, rgba(0, 0, 0, .624) 3.5%,
      rgba(0, 0, 0, .741) 4%, rgba(0, 0, 0, .844) 4.5%, rgba(0, 0, 0, .926) 5%, rgba(0, 0, 0, .98) 5.5%,
      #000 6%, #000 91%, rgba(0, 0, 0, .98) 91.75%, rgba(0, 0, 0, .926) 92.5%, rgba(0, 0, 0, .844) 93.25%,
      rgba(0, 0, 0, .741) 94%, rgba(0, 0, 0, .624) 94.75%, rgba(0, 0, 0, .5) 95.5%,
      rgba(0, 0, 0, .376) 96.25%, rgba(0, 0, 0, .259) 97%, rgba(0, 0, 0, .156) 97.75%,
      rgba(0, 0, 0, .074) 98.5%, rgba(0, 0, 0, .02) 99.25%, rgba(0, 0, 0, 0) 100%);
    --sky-mask-soft: linear-gradient(180deg,
      rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .02) 1.5%, rgba(0, 0, 0, .074) 3%, rgba(0, 0, 0, .156) 4.5%,
      rgba(0, 0, 0, .259) 6%, rgba(0, 0, 0, .376) 7.5%, rgba(0, 0, 0, .5) 9%, rgba(0, 0, 0, .624) 10.5%,
      rgba(0, 0, 0, .741) 12%, rgba(0, 0, 0, .844) 13.5%, rgba(0, 0, 0, .926) 15%,
      rgba(0, 0, 0, .98) 16.5%, #000 18%, #000 82%, rgba(0, 0, 0, .98) 83.5%, rgba(0, 0, 0, .926) 85%,
      rgba(0, 0, 0, .844) 86.5%, rgba(0, 0, 0, .741) 88%, rgba(0, 0, 0, .624) 89.5%, rgba(0, 0, 0, .5) 91%,
      rgba(0, 0, 0, .376) 92.5%, rgba(0, 0, 0, .259) 94%, rgba(0, 0, 0, .156) 95.5%,
      rgba(0, 0, 0, .074) 97%, rgba(0, 0, 0, .02) 98.5%, rgba(0, 0, 0, 0) 100%);
  }
  #sky {
    position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y;
    /* 上下邊界：原本是兩段式線性漸層，兩端的轉折點會在星塵上壓出馬赫帶——
       一條看得見的水平接縫。遮罩定義見 #skywrap；真正的濃度過渡交給
       app.js speckLayer() 裡的垂直衰減，在畫布內就把星塵化開，遮罩只收殘影。
       停止點與 layoutSky() 的 myT／myB 對齊，星座與星座名永遠在全不透明區內。 */
    -webkit-mask-image: var(--sky-mask);
    mask-image: var(--sky-mask);
  }
  .sky-hint {
    position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px;
    color: var(--faint); font-size: 11.5px; letter-spacing: .16em; text-indent: .16em;
    white-space: nowrap; pointer-events: none;
  }
  #sky-tip {
    position: absolute; left: 0; top: 0; z-index: 25;
    width: min(276px, 78vw);
    display: flex; gap: 11px; padding: 13px 15px; border-radius: 15px;
    background: var(--panel);
    border: 1px solid color-mix(in srgb, var(--cc, var(--gold)) 42%, transparent);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .5),
                0 0 26px color-mix(in srgb, var(--cc, var(--gold)) 14%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    opacity: 0; pointer-events: none;
    transition: opacity .16s ease;
  }
  #sky-tip.on { opacity: 1; }
  #sky-tip.tap { pointer-events: auto; }
  .t-emoji { font-size: 23px; line-height: 1.3; flex: none; }
  .t-main { min-width: 0; }
  .t-main b { display: block; font-size: 14px; line-height: 1.5; }
  .t-meta { display: block; font-size: 10.5px; color: var(--faint); letter-spacing: .06em; margin: 3px 0 5px; }
  .t-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 11.5px; color: var(--dim); line-height: 1.7;
  }
  .t-open { display: inline-block; margin-top: 7px; font-size: 11px; color: var(--gold); text-decoration: none; letter-spacing: .1em; }
  a.t-open:hover { color: #ffe9b8; }

  /* 掃描鈕：浮在星空右上，光束橫掃夜空、鎖定一顆隨機星 */
  .sky-btns {
    position: absolute; z-index: 25; top: 16px; right: max(20px, calc(50% - 596px));
    display: flex; gap: 8px;
  }
  #reshufBtn {
    font-family: inherit; font-size: 12.5px; letter-spacing: .14em; text-indent: .04em;
    cursor: pointer; color: var(--dim);
    padding: 9px 15px; border-radius: 999px;
    background: rgba(10, 13, 26, .5);
    border: 1px solid var(--line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: color .25s, border-color .25s, transform .25s;
  }
  #reshufBtn:hover { color: var(--ink); border-color: rgba(160, 175, 225, .5); transform: translateY(-1px); }
  #reshufBtn:focus-visible, #scanBtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  #scanBtn {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: inherit; font-size: 12.5px; letter-spacing: .18em; text-indent: .04em;
    cursor: pointer; color: var(--gold);
    padding: 9px 17px; border-radius: 999px;
    background: rgba(22, 17, 6, .48);
    border: 1px solid rgba(240, 198, 116, .45);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: color .25s, border-color .25s, box-shadow .25s, transform .25s;
  }
  #scanBtn::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
    background: var(--gold); box-shadow: 0 0 8px var(--gold);
    animation: radar 2.4s ease-out infinite;
  }
  @keyframes radar {
    0%   { box-shadow: 0 0 0 0 rgba(240, 198, 116, .5); }
    70%  { box-shadow: 0 0 0 10px rgba(240, 198, 116, 0); }
    100% { box-shadow: 0 0 0 0 rgba(240, 198, 116, 0); }
  }
  #scanBtn:hover {
    color: #ffe9b8; border-color: rgba(240, 198, 116, .85);
    box-shadow: 0 0 22px rgba(240, 198, 116, .3); transform: translateY(-1px);
  }
  #scanBtn.scanning {
    color: #ffe9b8; border-color: rgba(240, 198, 116, .9);
    box-shadow: 0 0 26px rgba(240, 198, 116, .42);
  }

  /* ── 今晚最亮的星（hero，疊在星空下緣） ───────────── */
  #hero { position: relative; z-index: 5; margin: -56px auto 0; max-width: 980px; }
  .h-card {
    position: relative; display: block; text-decoration: none; color: inherit;
    border-radius: 22px; padding: 26px 30px; overflow: hidden;
    background:
      radial-gradient(120% 150% at 6% -30%, color-mix(in srgb, var(--cc) 16%, transparent), transparent 58%),
      linear-gradient(160deg, rgba(20, 26, 50, .93), rgba(8, 11, 24, .96));
    border: 1px solid color-mix(in srgb, var(--cc) 32%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 22px 60px rgba(0, 0, 0, .45);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s, border-color .35s;
  }
  .h-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .07) 48%, transparent 58%);
    transform: translateX(-120%); transition: transform .9s ease;
  }
  .h-card:hover, .h-card:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--cc) 62%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 26px 70px rgba(0, 0, 0, .5),
                0 0 44px color-mix(in srgb, var(--cc) 18%, transparent);
  }
  .h-card:hover::after { transform: translateX(120%); }
  .h-kicker {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--serif); font-size: 11.5px; letter-spacing: .32em;
    color: var(--gold);
  }
  .h-kicker .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none;
    animation: pulse 2.6s ease-out infinite;
  }
  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(240, 198, 116, .5); }
    70%  { box-shadow: 0 0 0 9px rgba(240, 198, 116, 0); }
    100% { box-shadow: 0 0 0 0 rgba(240, 198, 116, 0); }
  }
  .h-kicker .h-date { margin-left: auto; color: var(--faint); letter-spacing: .16em; font-variant-numeric: tabular-nums; }
  .h-body { display: flex; align-items: center; gap: 26px; margin-top: 20px; }
  .h-emoji {
    flex: none; width: 92px; height: 92px; display: grid; place-items: center; font-size: 44px;
    border-radius: 26px;
    background: radial-gradient(circle at 36% 28%, color-mix(in srgb, var(--cc) 30%, transparent), rgba(10, 14, 32, .55) 74%);
    border: 1px solid color-mix(in srgb, var(--cc) 42%, transparent);
    box-shadow: 0 0 30px color-mix(in srgb, var(--cc) 20%, transparent), inset 0 0 20px rgba(0, 0, 0, .35);
    transition: transform .35s cubic-bezier(.2,.8,.3,1);
  }
  .h-card:hover .h-emoji { transform: scale(1.06) rotate(-3deg); }
  .h-main { min-width: 0; flex: 1; }
  .h-title {
    font-family: var(--serif); font-size: clamp(23px, 3.3vw, 31px); font-weight: 700;
    letter-spacing: .08em; margin: 8px 0;
    text-shadow: 0 0 26px color-mix(in srgb, var(--cc) 30%, transparent);
  }
  .h-desc {
    color: var(--dim); font-size: 14px; line-height: 1.95; max-width: 64ch;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  }
  .h-cta {
    flex: none; display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 999px;
    color: #241c06; font-weight: 700; font-size: 14px; letter-spacing: 2px;
    background: linear-gradient(135deg, #f6d795, var(--gold));
    box-shadow: 0 6px 22px rgba(240, 198, 116, .24);
    transition: transform .3s, box-shadow .3s;
  }
  .h-card:hover .h-cta { transform: translateX(3px); box-shadow: 0 10px 30px rgba(240, 198, 116, .4); }

  /* ── 控制列（吸頂）────────────────────────────────── */
  .bar {
    position: sticky; top: 50px; z-index: 30; margin-top: 22px; padding: 12px 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    background: linear-gradient(180deg, var(--bg) 62%, rgba(5, 7, 15, 0));
  }
  .bar::before {
    content: ""; position: absolute; inset: 8px -12px; border-radius: 18px; z-index: -1;
    background: var(--panel); border: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .search { position: relative; flex: 1 1 240px; min-width: 200px; display: flex; align-items: center; }
  .search .ico { position: absolute; left: 13px; font-size: 13px; opacity: .65; pointer-events: none; }
  #q {
    width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
    background: rgba(8, 11, 24, .6); border: 1px solid var(--line);
    border-radius: 999px; padding: 10px 44px 10px 36px;
    transition: border-color .25s, box-shadow .25s, background .25s;
  }
  #q::placeholder { color: var(--faint); }
  #q::-webkit-search-cancel-button { display: none; }
  #q:focus {
    outline: none; border-color: rgba(240, 198, 116, .55); background: rgba(10, 14, 30, .8);
    box-shadow: 0 0 0 3px rgba(240, 198, 116, .1);
  }
  .search kbd {
    position: absolute; right: 12px; font-family: var(--sans); font-size: 11px; color: var(--faint);
    border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; pointer-events: none;
  }
  #qx {
    position: absolute; right: 10px; display: none; cursor: pointer;
    width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(150, 165, 220, .14);
    color: var(--dim); font-size: 12px; font-family: inherit;
    transition: color .2s, background .2s;
  }
  #qx:hover { color: var(--ink); background: rgba(150, 165, 220, .26); }
  body.searching .search kbd { display: none; }
  body.searching #qx { display: block; }

  /* min-width:0 －flex item 預設 min-width:auto 會以 max-content 撐寬整列 */
  .chips { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
  /* 類別 chip＝星座圖例：標記是一顆四角星（不是圓點），件數是獨立的徽章，
     選取時該星座的顏色從左端暈進來、其餘的收斂到背景去。 */
  .chip {
    position: relative;
    font-family: inherit; font-size: 12.5px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    color: var(--dim);
    background: linear-gradient(160deg, rgba(19, 24, 46, .6), rgba(9, 12, 26, .6));
    border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 11px;
    transition: color .25s, border-color .25s, opacity .25s, box-shadow .25s, transform .2s;
  }
  /* 有選到某一類時，其餘的退到背景。.7 是對比的下限：--dim 疊在 --bg 上還有
     4.85:1，再低（.65 → 4.33:1）就跌破 4.5:1。退場只是輔助訊號，被選中的那顆
     另有邊框、外暈、色暈與實心件數徽章，不必靠壓暗其他人來凸顯。 */
  .chips.has-sel .chip:not([aria-pressed="true"]) { opacity: .7; }
  .chips.has-sel .chip:not([aria-pressed="true"]):hover { opacity: .95; }

  .chip .dot {
    width: 10px; height: 10px; flex: none; background: var(--cc, var(--gold));
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
    transition: filter .25s, transform .4s cubic-bezier(.2, .8, .3, 1);
  }
  /* 「全部」＝六個星座一起：標記畫成六色 conic */
  .chip.all .dot {
    background: conic-gradient(from -90deg,
      var(--c-trivia) 0 16.7%, var(--c-odd) 0 33.4%, var(--c-sci) 0 50%,
      var(--c-learn) 0 66.7%, var(--c-tool) 0 83.4%, var(--c-fun) 0 100%);
  }
  .chip .n {
    font-size: 10.5px; line-height: 1.6; color: var(--faint); font-variant-numeric: tabular-nums;
    padding: 1px 7px; border-radius: 999px; background: rgba(150, 165, 220, .1);
    transition: color .25s, background .25s;
  }
  .chip:hover {
    color: var(--ink); transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--cc, var(--gold)) 46%, transparent);
  }
  .chip:hover .dot { filter: drop-shadow(0 0 6px var(--cc, var(--gold))); }
  .chip:hover .n { color: var(--dim); background: rgba(150, 165, 220, .18); }

  .chip[aria-pressed="true"] {
    color: color-mix(in srgb, var(--cc, var(--gold)) 50%, var(--ink));
    border-color: color-mix(in srgb, var(--cc, var(--gold)) 62%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--cc, var(--gold)) 22%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  /* 顏色從標記那一端暈開，而不是整顆平鋪上色 */
  .chip[aria-pressed="true"]::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(120% 180% at 9% 50%,
      color-mix(in srgb, var(--cc, var(--gold)) 26%, transparent), transparent 62%);
  }
  .chip[aria-pressed="true"] .dot {
    transform: rotate(90deg) scale(1.16);
    filter: drop-shadow(0 0 8px var(--cc, var(--gold)));
  }
  .chip[aria-pressed="true"] .n {
    color: var(--bg); background: var(--cc, var(--gold)); font-weight: 600;
  }

  .tools { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
  .seg {
    display: inline-flex; padding: 3px; border-radius: 999px;
    border: 1px solid var(--line); background: rgba(10, 14, 30, .6);
  }
  .seg button {
    font-family: inherit; font-size: 12.5px; cursor: pointer;
    color: var(--dim); background: none; border: 0; padding: 6px 14px; border-radius: 999px;
    transition: color .25s, background .25s;
  }
  .seg button[aria-pressed="true"] {
    color: #241c06; font-weight: 700;
    background: linear-gradient(135deg, #f6d795, var(--gold));
  }
  .seg button:not([aria-pressed="true"]):hover { color: var(--ink); }
  #rand {
    font-family: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap;
    color: var(--gold); background: rgba(40, 32, 12, .38);
    border: 1px solid rgba(240, 198, 116, .42); border-radius: 999px; padding: 7px 14px;
    transition: color .25s, border-color .25s, box-shadow .25s, transform .25s;
  }
  #rand:hover {
    color: #ffe9b8; border-color: rgba(240, 198, 116, .8);
    box-shadow: 0 0 18px rgba(240, 198, 116, .26); transform: translateY(-1px);
  }

  .result {
    margin: 18px 0 -4px; font-size: 12.5px; color: var(--faint);
    display: flex; align-items: center; gap: 8px; min-height: 18px;
  }
  .result b { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 700; }

  /* ── 星軌卡片牆 ───────────────────────────────────── */
  #wall { position: relative; margin-top: 22px; padding-left: 30px; }
  #wall::before {
    content: ""; position: absolute; left: 5px; top: 12px; bottom: 30px; width: 1px;
    background: linear-gradient(180deg, transparent,
      rgba(240, 198, 116, .3) 4%, rgba(150, 165, 220, .16) 55%, transparent);
  }
  .group { position: relative; margin-bottom: 40px; }
  .g-head { position: relative; display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
  .g-head::before {
    content: "✦"; position: absolute; left: -31px; top: 50%; transform: translateY(-54%);
    font-size: 14px; line-height: 1; color: var(--cc, var(--gold));
    text-shadow: 0 0 12px color-mix(in srgb, var(--cc, var(--gold)) 80%, transparent);
  }
  .g-title {
    font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: .16em;
    color: var(--cc, var(--ink));
  }
  .g-n { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .g-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

  .g-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); }

  .card {
    position: relative; display: flex; flex-direction: column; gap: 9px;
    padding: 17px 18px 15px; border-radius: 16px; overflow: hidden;
    text-decoration: none; color: inherit;
    background: linear-gradient(160deg, rgba(19, 24, 46, .72), rgba(9, 12, 26, .72));
    border: 1px solid var(--line);
    transition: transform .3s cubic-bezier(.2,.8,.3,1), border-color .3s, box-shadow .3s, background .3s, opacity .5s ease;
    /* 進場：由 JS 掛上 .in（IntersectionObserver），--d 為序列延遲 */
    opacity: 0; transform: translateY(12px);
  }
  .card.in { opacity: 1; transform: none; transition-delay: var(--d, 0s); }
  .card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--cc, var(--gold));
    transform: scaleY(0); transition: transform .3s cubic-bezier(.2,.8,.3,1);
  }
  .card:hover, .card:focus-visible {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--cc, var(--gold)) 52%, transparent);
    background: linear-gradient(160deg,
      color-mix(in srgb, var(--cc) 9%, rgba(19, 24, 46, .8)), rgba(9, 12, 26, .8));
    box-shadow: 0 18px 44px rgba(0, 0, 0, .45),
                0 0 30px color-mix(in srgb, var(--cc, var(--gold)) 14%, transparent);
  }
  .card:hover::before, .card:focus-visible::before { transform: scaleY(1); }
  .c-top { display: flex; align-items: center; gap: 11px; }
  .c-emoji {
    flex: none; width: 42px; height: 42px; display: grid; place-items: center; font-size: 21px;
    border-radius: 13px;
    background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--cc) 26%, transparent), rgba(10, 14, 32, .5) 76%);
    border: 1px solid color-mix(in srgb, var(--cc) 34%, transparent);
    transition: transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s;
  }
  .card:hover .c-emoji {
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 0 20px color-mix(in srgb, var(--cc) 26%, transparent);
  }
  .c-date {
    margin-left: auto; font-size: 11.5px; color: var(--faint);
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .c-badge {
    font-size: 10px; letter-spacing: .16em; text-indent: .16em; white-space: nowrap;
    color: var(--gold); border: 1px solid rgba(240, 198, 116, .42);
    background: rgba(240, 198, 116, .08); border-radius: 999px; padding: 2px 8px;
  }
  .c-title { font-size: 16px; font-weight: 700; line-height: 1.5; transition: color .25s; }
  .card:hover .c-title, .card:focus-visible .c-title { color: var(--cc, var(--gold)); }
  .c-desc {
    font-size: 12.8px; color: var(--dim); line-height: 1.8;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .c-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 3px; }
  .c-tag {
    display: inline-block; font-size: 11px; padding: 2.5px 9px; border-radius: 999px; white-space: nowrap;
    color: var(--cc, var(--gold));
    border: 1px solid color-mix(in srgb, var(--cc, var(--gold)) 34%, transparent);
    background: color-mix(in srgb, var(--cc, var(--gold)) 8%, transparent);
  }
  .c-go {
    margin-left: auto; font-size: 12px; color: var(--faint);
    opacity: 0; transform: translateX(-4px);
    transition: opacity .25s, transform .25s, color .25s;
  }
  .card:hover .c-go, .card:focus-visible .c-go { opacity: 1; transform: none; color: var(--cc, var(--gold)); }
  .c-title mark, .c-desc mark {
    background: color-mix(in srgb, var(--gold) 28%, transparent);
    color: var(--ink); border-radius: 3px; padding: 0 2px;
  }
  /* 隨機挑中的落點高亮 */
  .card.flash { animation: flash 1.9s ease; }
  @keyframes flash {
    0%, 30% {
      border-color: color-mix(in srgb, var(--cc) 75%, transparent);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc) 22%, transparent),
                  0 18px 44px rgba(0, 0, 0, .45);
      transform: translateY(-4px);
    }
    100% { border-color: var(--line); box-shadow: none; transform: none; }
  }

  .empty { display: none; text-align: center; padding: 70px 0 40px; }
  body.no-result .empty { display: block; }
  body.no-result #wall { display: none; }
  .empty .e-ico { font-size: 40px; opacity: .55; }
  .empty p { margin-top: 12px; color: var(--dim); font-size: 14.5px; line-height: 1.9; }
  .empty button {
    margin-top: 16px; font-family: inherit; font-size: 13px; cursor: pointer;
    color: var(--gold); background: rgba(40, 32, 12, .38);
    border: 1px solid rgba(240, 198, 116, .42); border-radius: 999px; padding: 8px 18px;
    transition: color .2s, border-color .2s;
  }
  .empty button:hover { color: #ffe9b8; border-color: rgba(240, 198, 116, .8); }

  footer {
    margin-top: 56px; padding-top: 26px; text-align: center;
    border-top: 1px solid var(--line-soft);
    color: var(--faint); font-size: 12.5px; line-height: 2;
  }

  /* ── 降級與行動裝置 ───────────────────────────────── */
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .blob, .h-kicker .dot, .card.flash, #scanBtn::before { animation: none !important; }
    .card { opacity: 1; transform: none; }
    * { transition-duration: .01s !important; }
  }
  @media (max-width: 860px) {
    .tools { margin-left: 0; width: 100%; }
    #rand { margin-left: auto; }
  }
  @media (max-width: 560px) {
    .wrap { padding: 0 14px 60px; }
    .site-head { padding: 34px 0 0; }
    .stats { gap: 10px 22px; }
    .stat b { font-size: 25px; }
    #skywrap { height: clamp(560px, 78vh, 720px); margin-top: 10px; }
    .sky-hint { font-size: 10.5px; bottom: 44px; }
    .sky-btns { top: 10px; right: 12px; }
    #scanBtn, #reshufBtn { padding: 8px 13px; font-size: 12px; letter-spacing: .12em; }
    .tab { padding: 8px 14px; font-size: 12.5px; letter-spacing: .08em; }
    #hero { margin-top: -34px; }
    .h-card { padding: 20px 18px; border-radius: 18px; }
    .h-body { flex-direction: column; align-items: flex-start; gap: 16px; }
    .h-emoji { width: 66px; height: 66px; font-size: 32px; border-radius: 20px; }
    .h-cta { width: 100%; justify-content: center; }
    .bar { gap: 10px; padding: 10px 0; }
    .bar::before { inset: 6px -8px; border-radius: 14px; }
    .chips {
      flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
      scrollbar-width: none; -ms-overflow-style: none;
      /* 橫向捲動時右緣收掉，不要切一刀（左緣不收：清單一定從最左邊開始） */
      -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
      mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    }
    .chips::-webkit-scrollbar { display: none; }
    .search kbd { display: none; }
    #wall { padding-left: 20px; }
    #wall::before { left: 3px; }
    .g-head::before { left: -23px; font-size: 12px; }
    .g-grid { grid-template-columns: 1fr; }
  }
  /* ── 產量面板：以年月日 / 分類聚合 ── */
  /* 與上方「今晚最亮的星」卡片留出間隔——兩者原本緊貼在一起 */
  /* ── 觀測記錄 ──────────────────────────────────────
   * 視覺語彙跟星空／作品牆對齊：不用方塊熱力圖，改成「曝光板」——
   * 有作品的日子是一顆星，件數決定亮度、大小與暈開的範圍；分類則是
   * 「六星座光譜」，每條帶著該星座的顏色與一道緩慢掃過的流光。
   * 展開／進場統一由 JS 在切到本分頁時掛上 #activity.lit 觸發
   * （面板平時 display:none，量不到尺寸也看不到動畫）。 */
  #activity { max-width: 1240px; margin: clamp(20px, 2.6vw, 34px) auto 6px; padding: 0 24px; }

  /* 觀測數據：六張小卡 */
  .obs-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 10px; margin-bottom: 14px;
  }
  .obs-stat {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 14px 10px 12px; border-radius: 14px;
    background: linear-gradient(160deg, rgba(19, 24, 46, .62), rgba(9, 12, 26, .62));
    border: 1px solid var(--line); backdrop-filter: blur(10px);
    opacity: 0; transform: translateY(10px);
    transition: opacity .6s ease var(--d, 0s), transform .6s cubic-bezier(.2, .8, .3, 1) var(--d, 0s),
                border-color .3s, box-shadow .3s;
  }
  #activity.lit .obs-stat { opacity: 1; transform: none; }
  /* 卡片頂緣一道金色細光，呼應 hero 卡 */
  .obs-stat::before {
    content: ""; position: absolute; left: 18%; right: 18%; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 198, 116, .5), transparent);
  }
  .obs-stat:hover { border-color: rgba(240, 198, 116, .3); box-shadow: 0 0 24px rgba(240, 198, 116, .1); }
  .obs-stat b {
    font-family: var(--serif); font-size: clamp(22px, 3.4vw, 28px); font-weight: 700; line-height: 1.1;
    color: var(--gold); font-variant-numeric: tabular-nums;
    text-shadow: 0 0 18px rgba(240, 198, 116, .3);
  }
  .obs-stat .ol { font-size: 11px; color: var(--dim); letter-spacing: .16em; text-indent: .16em; }
  .obs-stat .os { font-size: 10.5px; color: var(--faint); letter-spacing: .06em; text-align: center; }
  /* 「最亮星座」那張改用該星座自己的顏色，接回六色調色盤 */
  .obs-stat.tinted::before { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cc) 60%, transparent), transparent); }
  .obs-stat.tinted b { color: var(--cc); text-shadow: 0 0 18px color-mix(in srgb, var(--cc) 40%, transparent); }
  .obs-stat.tinted .os { color: var(--dim); }
  .obs-stat.tinted:hover { border-color: color-mix(in srgb, var(--cc) 34%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--cc) 14%, transparent); }

  .act {
    position: relative;
    background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
    padding: 16px 18px 14px; backdrop-filter: blur(10px);
  }
  .act-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
  .act-head h2 {
    display: flex; align-items: baseline; gap: 7px;
    font-family: var(--serif); font-size: 14.5px; font-weight: 700; letter-spacing: .12em;
    color: var(--ink); white-space: nowrap;
  }
  .act-head .act-t { color: var(--gold); font-size: 13px; text-shadow: 0 0 12px rgba(240, 198, 116, .5); }
  .act-sum { flex: 1; font-size: 12.5px; color: var(--faint); letter-spacing: .01em; }
  .act-sum b { color: var(--dim); font-variant-numeric: tabular-nums; }
  .act-seg {
    position: relative; display: flex; gap: 4px;
    background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
    border-radius: 999px; padding: 3px;
  }
  /* 滑動指示器：跟 tabbar 同一套語彙 */
  .seg-ind {
    position: absolute; left: 3px; top: 3px; bottom: 3px; width: 0;
    border-radius: 999px; pointer-events: none; opacity: 0;
    background: rgba(240, 198, 116, .92);
    box-shadow: 0 0 16px rgba(240, 198, 116, .35);
    transition: transform .42s cubic-bezier(.2, .8, .3, 1), width .42s cubic-bezier(.2, .8, .3, 1), opacity .3s;
  }
  .seg-ind.ready { opacity: 1; }
  .act-seg button {
    position: relative; z-index: 1;
    font: inherit; font-size: 12px; color: var(--faint); background: none; border: none;
    padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: color .25s;
  }
  .act-seg button:hover { color: var(--dim); }
  .act-seg button[aria-pressed="true"] { color: var(--bg); font-weight: 600; }
  /* 指示器沒能就位時（JS 失效）退回舊的實心底 */
  .act-seg:not(.has-ind) button[aria-pressed="true"] { background: var(--gold); }
  /* overflow-x:auto 會讓 overflow-y 從 visible 變成 auto，星點放大與外暈會被上下緣
     裁掉。用上下留白換回空間，再用負 margin 抵銷、維持原本的版面節奏。 */
  .act-body { overflow-x: auto; overflow-y: hidden; padding: 12px 0; margin: -12px 0; }
  .act-view { display: none; } .act-view.on { display: block; }

  /* ── 曝光板：一格一天，有作品的日子是一顆星 ── */
  .cal-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
    opacity: 0; transform: translateX(-8px);
    transition: opacity .5s ease var(--d, 0s), transform .5s cubic-bezier(.2, .8, .3, 1) var(--d, 0s);
  }
  #activity.lit .cal-row { opacity: 1; transform: none; }
  .cal-lab { width: 62px; flex: none; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
  .cal-cells { display: grid; grid-template-columns: repeat(31, 1fr); gap: 3px; flex: 1; min-width: 420px; }
  .cal-c {
    aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%;
    background: rgba(150, 165, 220, .18);
    transform: scale(var(--s, .24)); cursor: default;
    transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s, background .18s;
  }
  .cal-c[data-n]:not([data-n="0"]) { cursor: pointer; }
  .cal-c[data-n="1"] { --s: .5;  background: rgba(240, 198, 116, .6);  box-shadow: 0 0 5px rgba(240, 198, 116, .3); }
  .cal-c[data-n="2"] { --s: .68; background: rgba(240, 198, 116, .82); box-shadow: 0 0 8px rgba(240, 198, 116, .42); }
  .cal-c[data-n="3"] { --s: .84; background: var(--gold);              box-shadow: 0 0 12px rgba(240, 198, 116, .58); }
  .cal-c[data-n="4"] {
    --s: 1; background: radial-gradient(circle at 50% 50%, #fff6de 0%, var(--gold) 62%, rgba(240, 198, 116, .7) 100%);
    box-shadow: 0 0 16px rgba(240, 198, 116, .75), 0 0 34px rgba(240, 198, 116, .28);
  }
  /* 亮星自己呼吸；--j 是每顆星的相位，整片不會同步閃 */
  .cal-c[data-n="3"], .cal-c[data-n="4"] {
    animation: starBreathe 3.6s ease-in-out infinite;
    animation-delay: calc(var(--j, 0) * -3.6s);
  }
  @keyframes starBreathe { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }
  .cal-c[data-n]:not([data-n="0"]):hover,
  .cal-c[data-n]:not([data-n="0"]):focus-visible {
    outline: none; animation: none; opacity: 1;
    transform: scale(calc(var(--s) * 1.5));
    background: radial-gradient(circle at 50% 50%, #fffdf6 0%, #ffe9b8 55%, var(--gold) 100%);
    box-shadow: 0 0 14px rgba(255, 246, 222, .9), 0 0 30px rgba(240, 198, 116, .5);
  }
  /* 每月小結：一條迷你長條＋件數 */
  .cal-mon { flex: none; width: 54px; display: flex; align-items: center; gap: 6px; }
  .cal-mon i {
    flex: 1; height: 3px; border-radius: 99px; width: 0;
    background: linear-gradient(90deg, rgba(240, 198, 116, .35), var(--gold));
    transition: width .8s cubic-bezier(.2, .8, .3, 1) var(--d, 0s);
  }
  #activity.lit .cal-mon i { width: var(--w, 0); }
  .cal-mon b { font-size: 11px; font-weight: 400; color: var(--dim); font-variant-numeric: tabular-nums; }
  .cal-axis { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
  .cal-axis .cal-lab { visibility: hidden; }
  .cal-ticks { display: grid; grid-template-columns: repeat(31, 1fr); gap: 3px; flex: 1; min-width: 420px;
    font-size: 9px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
  .cal-legend { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 11px; color: var(--faint); }
  .cal-legend i {
    width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none;
    background: rgba(240, 198, 116, .6);
  }
  .cal-legend i[data-n="2"] { background: rgba(240, 198, 116, .82); }
  .cal-legend i[data-n="3"] { background: var(--gold); }
  .cal-legend i[data-n="4"] { background: var(--gold); box-shadow: 0 0 9px rgba(240, 198, 116, .7); }
  .cal-legend em { font-style: normal; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line); }

  /* ── 光譜：六星座各一條 ── */
  .cat-row {
    display: grid; grid-template-columns: 148px 1fr 62px; align-items: center; gap: 12px; margin-bottom: 10px;
    opacity: 0; transform: translateY(6px);
    transition: opacity .5s ease var(--d, 0s), transform .5s cubic-bezier(.2, .8, .3, 1) var(--d, 0s);
  }
  #activity.lit .cat-row { opacity: 1; transform: none; }
  .cat-row button.nm {
    display: flex; align-items: baseline; gap: 8px;
    background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
    font: inherit; font-size: 12.5px; color: var(--dim); white-space: nowrap;
    transition: color .25s;
  }
  .cat-row .rk {
    font-family: var(--serif); font-size: 11px; color: var(--cc); opacity: .7;
    font-variant-numeric: tabular-nums;
  }
  .cat-row button.nm:hover { color: var(--ink); }
  .cat-row button.nm:hover .rk { opacity: 1; }
  .cat-row .track {
    position: relative; height: 10px; border-radius: 99px;
    background: rgba(255, 255, 255, .05); overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
  }
  /* .fill 是 .track 的子元素、不是 grid item，不會被 blockify；
     留在 display:inline 的話 width/height 一律無效，長條圖會整條不見。 */
  .cat-row .fill {
    display: block; position: relative; height: 100%; width: 0; border-radius: 99px;
    background: linear-gradient(90deg,
      color-mix(in srgb, var(--cc) 42%, transparent), var(--cc));
    box-shadow: 0 0 14px color-mix(in srgb, var(--cc) 45%, transparent);
    transition: width .9s cubic-bezier(.2, .8, .3, 1) var(--d, 0s);
  }
  #activity.lit .cat-row .fill { width: var(--w, 0); }
  /* 一道緩慢掃過的流光（只動 background-position） */
  .cat-row .fill::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(100deg, transparent 36%, rgba(255, 255, 255, .32) 50%, transparent 64%);
    background-size: 260% 100%;
    animation: specSweep 4.6s linear infinite; animation-delay: calc(var(--d, 0s) * 3);
  }
  @keyframes specSweep { from { background-position: 160% 0; } to { background-position: -60% 0; } }
  .cat-row:hover .fill { box-shadow: 0 0 22px color-mix(in srgb, var(--cc) 62%, transparent); }
  .cat-row .n {
    font-size: 12.5px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums;
    display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25;
  }
  .cat-row .n em { font-style: normal; font-size: 10px; color: var(--faint); }

  @media (max-width: 640px) {
    #activity { padding: 0 16px; }
    .obs-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .obs-stat { padding: 11px 6px 10px; border-radius: 12px; }
    .obs-stat .ol { letter-spacing: .1em; text-indent: .1em; }
    .cal-lab { width: 50px; font-size: 10px; }
    .cal-mon { width: 44px; }
    .act-sum { flex-basis: 100%; order: 3; }
    .cat-row { grid-template-columns: 112px 1fr 52px; gap: 9px; }
    .cat-row button.nm { font-size: 11.5px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .obs-stat, .cal-row, .cat-row, .cal-c, .cat-row .fill, .cal-mon i, .seg-ind { transition: none; }
    .cal-c[data-n="3"], .cal-c[data-n="4"], .cat-row .fill::after { animation: none; }
    .cal-c[data-n]:not([data-n="0"]):hover { transform: scale(var(--s)); }
  }

  /* ==========================================================================
   * 視覺升級（2026-09-02）：星塵背景、噪點、游標光暈、標題逐字流光、
   * tab 滑動指示器、hero 旋轉光環＋聚光、卡片 3D 傾斜＋高光、星空暈影
   * 動畫只用 transform / opacity / background-position；reduced-motion 全部靜止
   * ========================================================================== */

  /* ── 全頁星塵（兩層、各自漂移與呼吸） ── */
  #dust { position: fixed; inset: -10%; z-index: 0; pointer-events: none; }
  #dust::before, #dust::after {
    content: ""; position: absolute; inset: 0; background-repeat: repeat;
  }
  #dust::before {
    opacity: .55;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='720' height='720' fill='%23d6e2ff'><circle cx='430' cy='215' r='0.9' opacity='0.99'/><circle cx='484' cy='381' r='1.2' opacity='0.94'/><circle cx='54' cy='718' r='0.7' opacity='0.48'/><circle cx='715' cy='43' r='0.8' opacity='0.37'/><circle cx='52' cy='485' r='1.2' opacity='0.88'/><circle cx='534' cy='46' r='1.0' opacity='0.67'/><circle cx='147' cy='642' r='0.6' opacity='0.87'/><circle cx='105' cy='20' r='1.1' opacity='0.83'/><circle cx='622' cy='589' r='1.2' opacity='0.83'/><circle cx='26' cy='244' r='0.6' opacity='0.78'/><circle cx='276' cy='216' r='1.1' opacity='0.55'/><circle cx='630' cy='402' r='0.7' opacity='0.65'/><circle cx='413' cy='299' r='0.7' opacity='0.90'/><circle cx='433' cy='254' r='1.1' opacity='0.73'/><circle cx='288' cy='413' r='0.7' opacity='0.41'/><circle cx='426' cy='378' r='0.9' opacity='0.54'/><circle cx='325' cy='57' r='1.1' opacity='0.48'/><circle cx='87' cy='612' r='1.0' opacity='0.75'/><circle cx='671' cy='179' r='0.9' opacity='0.61'/><circle cx='455' cy='490' r='0.7' opacity='0.47'/><circle cx='444' cy='0' r='0.7' opacity='0.86'/><circle cx='552' cy='311' r='0.8' opacity='0.68'/><circle cx='183' cy='211' r='1.2' opacity='0.53'/><circle cx='428' cy='42' r='1.2' opacity='0.80'/><circle cx='323' cy='125' r='1.2' opacity='0.54'/><circle cx='159' cy='328' r='1.1' opacity='0.59'/><circle cx='1' cy='303' r='0.6' opacity='0.99'/><circle cx='200' cy='415' r='1.0' opacity='0.93'/><circle cx='519' cy='702' r='0.7' opacity='0.50'/><circle cx='357' cy='284' r='1.1' opacity='0.68'/><circle cx='680' cy='561' r='0.9' opacity='0.94'/><circle cx='280' cy='421' r='1.2' opacity='0.65'/><circle cx='243' cy='536' r='1.2' opacity='0.92'/><circle cx='130' cy='177' r='0.8' opacity='0.38'/><circle cx='98' cy='476' r='1.2' opacity='0.50'/><circle cx='398' cy='206' r='0.6' opacity='0.74'/><circle cx='463' cy='660' r='1.2' opacity='0.51'/><circle cx='490' cy='86' r='1.2' opacity='0.57'/><circle cx='225' cy='499' r='0.6' opacity='0.90'/><circle cx='256' cy='198' r='1.0' opacity='0.66'/><circle cx='400' cy='671' r='0.9' opacity='0.99'/><circle cx='54' cy='421' r='1.0' opacity='0.46'/><circle cx='438' cy='552' r='1.0' opacity='0.38'/><circle cx='645' cy='343' r='0.8' opacity='0.89'/><circle cx='544' cy='113' r='1.2' opacity='0.56'/><circle cx='70' cy='158' r='0.6' opacity='0.85'/></svg>");
    background-size: 720px 720px;
    animation: dustDrift 160s linear infinite;
  }
  #dust::after {
    opacity: .45;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1040' height='1040' fill='%23d6e2ff'><circle cx='797' cy='601' r='0.8' opacity='0.61'/><circle cx='848' cy='462' r='1.0' opacity='0.49'/><circle cx='167' cy='623' r='1.4' opacity='0.55'/><circle cx='684' cy='128' r='1.7' opacity='0.42'/><circle cx='1030' cy='145' r='1.1' opacity='0.41'/><circle cx='718' cy='455' r='1.5' opacity='0.37'/><circle cx='64' cy='0' r='0.9' opacity='0.67'/><circle cx='64' cy='1026' r='1.1' opacity='0.45'/><circle cx='221' cy='336' r='1.3' opacity='0.68'/><circle cx='1019' cy='738' r='1.5' opacity='0.45'/><circle cx='294' cy='825' r='1.6' opacity='0.67'/><circle cx='90' cy='755' r='1.6' opacity='0.39'/><circle cx='118' cy='331' r='1.0' opacity='0.52'/><circle cx='663' cy='579' r='1.7' opacity='0.70'/><circle cx='895' cy='528' r='0.9' opacity='0.77'/><circle cx='533' cy='550' r='1.7' opacity='0.99'/><circle cx='645' cy='717' r='1.8' opacity='0.56'/><circle cx='954' cy='519' r='1.8' opacity='0.97'/><circle cx='972' cy='901' r='1.4' opacity='0.37'/><circle cx='733' cy='86' r='1.5' opacity='0.37'/><circle cx='993' cy='13' r='1.7' opacity='0.90'/><circle cx='46' cy='456' r='0.9' opacity='0.69'/></svg>");
    background-size: 1040px 1040px;
    animation: dustBreathe 9s ease-in-out infinite alternate;
  }
  @keyframes dustDrift { to { transform: translate3d(-3%, 4%, 0); } }
  @keyframes dustBreathe { from { opacity: .22; } to { opacity: .6; } }

  /* ── 噪點膠片質感 ── */
  #grain {
    position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .045;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 160px 160px;
  }

  /* ── 游標光暈（只在精準指標裝置） ── */
  #torch {
    position: fixed; left: 0; top: 0; z-index: 1; pointer-events: none;
    width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(150, 175, 255, .17) 0%, rgba(150, 175, 255, .06) 38%, transparent 68%);
    mix-blend-mode: screen; opacity: 0; will-change: transform;
    transition: opacity .7s ease;
  }
  #torch.on { opacity: 1; }
  @media (pointer: coarse) { #torch { display: none; } }

  /* ── 標題：逐字進場＋流光 ── */
  h1 { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--ink); }
  h1 .ch {
    display: inline-block; color: transparent;
    background: linear-gradient(115deg, #ffffff 0%, #b9c4ee 28%, #fff3d0 48%, #f0c674 56%, #b9c4ee 72%, #ffffff 100%);
    background-size: 320% 100%; -webkit-background-clip: text; background-clip: text;
    animation: shimmer 8s linear infinite; animation-delay: calc(var(--i, 0) * -.42s);
    transition: opacity .8s ease calc(.1s + var(--i, 0) * .07s),
                transform .8s cubic-bezier(.2, .8, .3, 1) calc(.1s + var(--i, 0) * .07s);
  }
  body.preload h1 .ch { opacity: 0; transform: translateY(22px) rotate(5deg) scale(.92); }
  @keyframes shimmer { to { background-position: -320% 0; } }
  .kicker { position: relative; }
  .kicker::before, .kicker::after { animation: kickerLine 2.4s ease both; }
  @keyframes kickerLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }

  /* 統計數字：跑完時彈一下 */
  .stat b { position: relative; display: inline-block; }
  .stat b.lit { animation: statPop .55s cubic-bezier(.2, .9, .3, 1.4); }
  @keyframes statPop { 0% { transform: scale(1); } 40% { transform: scale(1.16); } 100% { transform: scale(1); } }
  .stat::after {
    content: ""; display: block; width: 26px; height: 1px; margin-top: 6px;
    background: linear-gradient(90deg, transparent, rgba(240, 198, 116, .55), transparent);
  }

  /* ── tab 滑動指示器：取代原本每顆 tab 自己的底色 ── */
  .tabbar { position: sticky; }
  .tab-ind {
    position: absolute; left: 0; top: 8px; bottom: 6px; width: 0;
    border-radius: 999px; pointer-events: none; opacity: 0;
    background: rgba(22, 17, 6, .55);
    border: 1px solid rgba(240, 198, 116, .42);
    box-shadow: 0 0 18px rgba(240, 198, 116, .14), inset 0 1px 0 rgba(255, 255, 255, .05);
    transition: transform .45s cubic-bezier(.2, .8, .3, 1), width .45s cubic-bezier(.2, .8, .3, 1), opacity .3s;
  }
  .tab-ind.ready { opacity: 1; }
  .tab { position: relative; z-index: 1; }
  .tabbar.has-ind .tab[aria-selected="true"] { background: transparent; border-color: transparent; box-shadow: none; }
  .panel.on { animation: panelIn .5s cubic-bezier(.2, .8, .3, 1); }
  @keyframes panelIn { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }

  /* ── 星空：暈影＋底緣氣層 ── */
  /* 這一層才是「上下各一條線」的真兇：它是一個蓋滿 skywrap 的矩形，
     而兩道漸層在矩形的上下邊界上 alpha 都還沒歸零，就被元素邊界直接切掉——
       上緣 暈影 alpha .154、下緣 暈影 .385 加上底緣氣層 .07，一次消失。
     rgba(5,7,15,.5) 與 --bg 同色，壓不暗背景本身，卻會壓暗底下的 #aurora 與
     #dust，所以看到的是「同一片星空，亮度突然差一階」的水平線。
     修法：① 兩道漸層都自己收到 0；② 整層再套 --sky-mask-soft 保底。 */
  #skywrap::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      /* 暈影原本是 transparent 58% → 實心 100% 的兩段式，起點 58% 是一個
         斜率轉折（0 → 0.0027/px），在大片天空上會浮出一圈淡淡的橢圓稜線。
         同樣改成 smoothstep 取樣，兩端斜率趨近 0。 */
      radial-gradient(72% 62% at 50% 44%,
        transparent 52%, rgba(5, 7, 15, .014) 56.8%, rgba(5, 7, 15, .052) 61.6%,
        rgba(5, 7, 15, .108) 66.4%, rgba(5, 7, 15, .176) 71.2%, rgba(5, 7, 15, .25) 76%,
        rgba(5, 7, 15, .324) 80.8%, rgba(5, 7, 15, .392) 85.6%, rgba(5, 7, 15, .448) 90.4%,
        rgba(5, 7, 15, .486) 95.2%, rgba(5, 7, 15, .5) 100%),
      linear-gradient(180deg,
        transparent 84%, rgba(90, 120, 220, .04) 91%,
        rgba(90, 120, 220, .05) 95%, rgba(90, 120, 220, 0) 100%);
    -webkit-mask-image: var(--sky-mask-soft);
    mask-image: var(--sky-mask-soft);
  }

  /* ── hero：旋轉光環邊框、滑鼠聚光、3D 傾斜 ── */
  @property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
  #hero { perspective: 1200px; }
  .h-card { --mx: 50%; --my: 50%; transform-style: preserve-3d; }
  .h-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
    background: conic-gradient(from var(--ang),
      transparent 0deg, transparent 200deg,
      color-mix(in srgb, var(--cc) 85%, #fff) 250deg, var(--gold) 268deg,
      transparent 300deg, transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: spinAng 7s linear infinite; opacity: .85;
  }
  @keyframes spinAng { to { --ang: 360deg; } }
  .h-body { position: relative; }
  .h-body::before {
    content: ""; position: absolute; inset: -26px -30px; pointer-events: none; border-radius: 22px;
    background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--cc) 14%, transparent), transparent 60%);
    opacity: 0; transition: opacity .35s;
  }
  .h-card:hover .h-body::before { opacity: 1; }
  .h-card.tilt {
    transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px);
    transition: transform .14s ease-out, box-shadow .35s, border-color .35s;
  }
  .h-emoji { animation: floaty 5.2s ease-in-out infinite; }
  @keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-2deg); } }
  .h-card:hover .h-emoji { animation: none; }
  .h-emoji::after {
    content: "✦"; position: absolute; right: -6px; top: -8px; font-size: 13px; line-height: 1;
    color: var(--gold); text-shadow: 0 0 10px var(--gold);
    animation: twinkle 2.8s ease-in-out infinite;
  }
  .h-emoji { position: relative; }
  @keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

  /* ── 卡片牆：玻璃、3D 傾斜、跟滑鼠的高光、更講究的進場 ── */
  .g-grid { perspective: 1000px; }
  .card {
    --mx: 50%; --my: 50%;
    opacity: 0; transform: translateY(18px) scale(.96);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  }
  .card::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background:
      radial-gradient(300px circle at var(--mx) var(--my), color-mix(in srgb, var(--cc, var(--gold)) 20%, transparent), transparent 58%),
      linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .05) 50%, transparent 60%);
    opacity: 0; transition: opacity .3s;
  }
  .card:hover::after, .card:focus-visible::after { opacity: 1; }
  .card.tilt {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px);
    transition: transform .12s ease-out, border-color .3s, box-shadow .3s, background .3s;
  }
  .card.in { transition-delay: var(--d, 0s); }
  .card.in.tilt { transition-delay: 0s; }
  .c-emoji { position: relative; overflow: hidden; }
  .c-emoji::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
    transform: translateX(-140%); transition: transform .7s ease;
  }
  .card:hover .c-emoji::after { transform: translateX(140%); }
  .g-head::before { animation: twinkle 3.4s ease-in-out infinite; }
  .g-rule {
    background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 9px);
    -webkit-mask-image: linear-gradient(90deg, #000, transparent); mask-image: linear-gradient(90deg, #000, transparent);
  }

  /* ── 控制列與籌碼的小亮點 ── */
  .chip[aria-pressed="true"] .dot { animation: twinkle 2.2s ease-in-out infinite; }
  #q:focus { box-shadow: 0 0 0 3px rgba(240, 198, 116, .12), 0 0 28px rgba(240, 198, 116, .12); }

  /* ── footer 星線 ── */
  footer { position: relative; }
  footer::before {
    content: "✦"; position: absolute; left: 50%; top: -9px; transform: translateX(-50%);
    padding: 0 12px; background: var(--bg); color: var(--gold); font-size: 12px;
    text-shadow: 0 0 12px rgba(240, 198, 116, .8);
  }

  /* ── 降級：所有新增動畫一律靜止 ── */
  @media (prefers-reduced-motion: reduce) {
    #dust::before, #dust::after, h1 .ch, .kicker::before, .kicker::after, .stat b.lit,
    .h-card::before, .h-emoji, .h-emoji::after, .g-head::before, .chip[aria-pressed="true"] .dot,
    .panel.on { animation: none !important; }
    #torch { display: none; }
    .card, .card.tilt, .h-card.tilt { transform: none !important; }
    .tab-ind { transition: none; }
    /* chip：抽掉位移與標記轉動，只留顏色狀態（放大保留，那是靜態的層級訊號） */
    .chip, .chip .dot { transition: none; }
    .chip:hover { transform: none; }
    .chip[aria-pressed="true"] .dot { transform: scale(1.16); }
  }
  @media (max-width: 560px) {
    #torch { display: none; }
    .card::after { display: none; }
  }

  /* ── 修正：吸頂列不再用實色黑底蓋掉背景特效，改半透明＋模糊 ── */
  .tabbar {
    background: rgba(5, 7, 15, .38);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-radius: 999px; padding-left: 6px; padding-right: 6px;
    width: max-content; max-width: 100%;
    -webkit-mask-image: none; mask-image: none;
  }
  .tab-ind { left: 6px; }
  .bar { background: transparent; }
  .bar::before { background: rgba(13, 17, 34, .42); }
  footer::before { background: transparent; text-shadow: 0 0 12px rgba(240, 198, 116, .8), 0 0 4px var(--bg), 0 0 4px var(--bg); }
