/*
Theme Name: dream.private
Theme URI: https://example.com/dream
Author: Luna
Description: 黑底 IG 風格的夢女自介與夢角檔案主題。首頁為 IG 個人檔案版面，角色以九宮格呈現，點擊原地彈出浮層；限動精選圓圈可展開關於我 / 交流守則 / 社群連結。
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: dream
*/

:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #101012;
  --surface-2: #17171b;
  --line: #26262a;
  --line-strong: #3a3a40;
  --text: #f3f1ed;
  --muted: #a2a0a2;
  --dim: #6f6d72;
  --accent: #c9a4ff;
  --accent-soft: rgba(201, 164, 255, 0.16);
  --radius: 14px;
  --max: 720px;
  --serif: "Playfair Display", "Noto Serif TC", serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -5%, rgba(201, 164, 255, 0.12), transparent 40%),
    linear-gradient(180deg, #030303, var(--bg) 40%, #080808);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

img { max-width: 100%; display: block; }

.phone {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 120px;
}

/* 頂列 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  backdrop-filter: blur(18px);
  background: rgba(5, 5, 5, .72);
  border-bottom: 1px solid var(--line);
  margin: 0 -16px 0;
  padding: 0 18px;
}
.topbar .brand { font-family: var(--serif); font-size: 22px; }
.topbar .row { display: flex; gap: 18px; color: var(--muted); }
.topbar svg { width: 24px; height: 24px; }

/* profile */
.profile { display: flex; gap: 22px; align-items: center; padding: 26px 4px 8px; }
.avatar {
  width: 92px; height: 92px; border-radius: 50%; flex: none;
  padding: 3px;
  background: conic-gradient(from 140deg, var(--accent), #ff9ec7, #ffd27a, var(--accent));
}
.avatar > div {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #26262e, #0c0c0e);
  display: grid; place-items: center; color: var(--muted);
  border: 3px solid var(--bg);
  overflow: hidden;
}
.avatar > div > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar svg { width: 38%; height: 38%; }
.stats { flex: 1; display: flex; justify-content: space-around; text-align: center; }
.stats b { display: block; font-family: var(--serif); font-size: 22px; }
.stats span { font-size: 12.5px; color: var(--muted); }

.idblock { padding: 4px 4px 0; }
.idblock .name { font-family: var(--serif); font-size: 20px; }
.idblock .handle { color: var(--dim); font-size: 13.5px; margin-top: 2px; }
.bio { padding: 10px 4px 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.bio .disp { color: var(--text); font-family: var(--serif); font-size: 16px; }
.bio .link { color: var(--accent); }

/* 動作鈕 */
.actions { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; padding: 16px 4px 4px; }
.btn {
  height: 40px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); font: 600 14px var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: #1a1030; border-color: var(--accent); }
.btn.following { background: transparent; color: var(--text); }
.btn.icon svg { width: 20px; height: 20px; }

/* 限動精選 */
.stories { display: flex; gap: 18px; overflow-x: auto; padding: 22px 4px 6px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; text-align: center; font-size: 12px; color: var(--muted); cursor: pointer; background: none; border: 0; font-family: var(--sans); }
.story .ring {
  display: block; box-sizing: border-box;
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 6px;
  padding: 2px; background: linear-gradient(135deg, var(--accent), #ff9ec7);
  transition: transform .12s ease;
}
.story:active .ring { transform: scale(.93); }
.story .ring > span {
  display: grid; box-sizing: border-box;
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--surface-2); place-items: center; border: 2px solid var(--bg);
}
.story svg { width: 26px; height: 26px; color: var(--text); }

/* tab 列 */
.tabs { display: flex; gap: 8px; padding: 18px 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 34px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  font: 500 13px var(--sans); cursor: pointer; white-space: nowrap;
  transition: all .18s ease;
}
.tab.active { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }

/* 搜尋框（點底部導覽「搜尋」開啟，即時過濾九宮格，與狀態 tab 疊加）*/
.searchbar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 4px 6px; padding: 0 12px; height: 42px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface-2);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbar-icon { display: grid; place-items: center; color: var(--muted); flex: none; }
.searchbar-icon svg { width: 18px; height: 18px; }
.searchbar-input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0;
  color: var(--text); font: 400 15px var(--sans);
}
.searchbar-input::placeholder { color: var(--muted); }
.searchbar-clear {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px;
  border: 0; border-radius: 50%; background: var(--surface); color: var(--muted);
  cursor: pointer; transition: color .18s ease, background .18s ease;
}
.searchbar-clear:hover { color: var(--text); background: var(--line-strong); }
.searchbar-clear svg { width: 14px; height: 14px; }
/* 搜尋框開關：hidden 屬性控制存在（要蓋過上面的 display:flex），.open 控制展開動畫 */
.searchbar[hidden] { display: none; }
.searchbar { opacity: 0; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, border-color .18s ease, box-shadow .18s ease; }
.searchbar.open { opacity: 1; transform: none; }

/* 浮層載入骨架（2C：取代純文字「載入中…」，reduced-motion 下自動變靜態）*/
.lb-skeleton { width: 100%; }
.lb-skeleton-hero {
  aspect-ratio: 4 / 5; border-radius: 18px 18px 0 0;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--line-strong) 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: dream-shimmer 1.2s ease-in-out infinite;
}
.lb-skeleton-body { padding: 20px; display: grid; gap: 12px; }
.lb-skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--line-strong) 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: dream-shimmer 1.2s ease-in-out infinite;
}
.lb-skeleton-line.w40 { width: 40%; }
.lb-skeleton-line.w60 { width: 60%; }
.lb-skeleton-line.w70 { width: 70%; }
.lb-skeleton-line.w80 { width: 80%; }
@keyframes dream-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 九宮格依序淡入（2C 微互動；.cell-enter/.cell-in 只由 JS 加，無 JS 時格子照常顯示）*/
.cell-enter { opacity: 0; transform: translateY(8px); }
.cell-in {
  opacity: 1; transform: none;
  transition: opacity .35s ease var(--stagger, 0ms), transform .35s ease var(--stagger, 0ms);
}

/* 限動展開淡入用的 keyframe（先前被移除，補回）*/
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 九宮格 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cell {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 25%, var(--c, var(--accent-soft)), transparent 60%),
    var(--surface);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .12s ease, border-color .2s ease;
}
.cell:active { transform: scale(.97); }
.cell:hover { border-color: var(--cc, var(--accent)); }
.cell .ph {
  width: 46%; height: 46%; border-radius: 12px;
  background: linear-gradient(145deg, var(--cc, var(--accent)), transparent);
  opacity: .5;
}
.cell .cell-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cell .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 10px 8px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .72), transparent);
  font-family: var(--serif); font-size: 13.5px; line-height: 1.2;
}
.cell .cap small { display: block; color: var(--muted); font-family: var(--sans); font-size: 11px; margin-top: 2px; }

.grid-empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* 空狀態提示 */
.empty-hint { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* 浮層 */
.no-scroll { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 20px; background: rgba(3, 3, 4, .72); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .2s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lightbox-backdrop { position: absolute; inset: 0; }
.lightbox-panel {
  position: relative; z-index: 1;
  width: min(440px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px;
  transform: translateY(16px) scale(.98); transition: transform .22s ease; scrollbar-width: none;
}
.lightbox.open .lightbox-panel { transform: none; }
.lightbox-panel::-webkit-scrollbar { display: none; }
.lightbox-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; z-index: 3;
}
.lightbox-close svg { width: 18px; height: 18px; }
.lightbox-loading { padding: 60px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* 角色詳情（單頁 single-character.php 與浮層 fetch 進來的內容共用）*/
.detail-hero {
  aspect-ratio: 4/5; overflow: hidden; position: relative;
  background: radial-gradient(circle at 50% 35%, var(--accent-soft), transparent 60%), var(--surface-2);
  display: grid; place-items: center;
}
.lightbox-content .detail-hero { border-radius: 18px 18px 0 0; }
.detail-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-hero .ph { width: 40%; height: 40%; border-radius: 16px; background: linear-gradient(145deg, var(--accent), transparent); opacity: .5; }
.detail-body { padding: 18px 20px 22px; }
.detail-eyebrow { color: var(--accent); font-family: var(--serif); font-size: 14px; }
.detail-name { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 4px 0 16px; }
.meta { display: grid; gap: 8px; margin-bottom: 16px; }
.meta div { display: grid; grid-template-columns: 56px 1fr; gap: 10px; font-size: 14px; }
.meta dt { color: var(--text); margin: 0; }
.meta dd { color: var(--muted); margin: 0; }
.detail-block { margin-bottom: 16px; }
.detail-block h2 { font-family: var(--serif); font-weight: 400; font-size: 17px; margin: 0 0 8px; color: var(--text); }
.boundaries { margin: 0; padding-left: 1.2em; }
.boundaries li, .detail-content { color: var(--muted); font-size: 14px; line-height: 1.8; }
.detail-content p { margin: 0 0 10px; }
.detail-actions { margin-top: 18px; }
.detail-actions .btn { width: 100%; text-decoration: none; }

/* 看作品 / 夢主 / 夢角 等關聯按鈕：與上方內容拉開，多顆時直向堆疊留間距 */
.detail-works {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-works .btn { width: 100%; text-decoration: none; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tagrow span {
  font-size: 12px; color: var(--accent); padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--accent-soft); background: var(--accent-soft);
}

/* ── 催眠麥克風官方角色卡（char-card；en_name 有填時套用）──
   還原官方卡版面到深色主題：名字/標籤走重點色，橫線分隔各區塊。 */
.char-card .detail-body { padding: 20px 20px 24px; }

/* 名字區：grid 精準定位，解決圖二飄掉的問題
   格局：            [MC NAME 標籤]
        [本名] ／ [外文名]
        [羅馬拼音]    [片假名]                                       */
.char-card .cc-names {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas:
    ".      .      enlabel"
    "jp     slash  en"
    "romaji .      kana";
  column-gap: 12px; align-items: baseline;
  color: #fff;
}
.char-card .cc-en-label { grid-area: enlabel; align-self: end;
  font: 700 12px/1 var(--sans); letter-spacing: .12em; margin-bottom: 2px; }
.char-card .cc-jp { grid-area: jp; font: 700 30px/1.05 var(--sans); letter-spacing: .04em; }
.char-card .cc-slash { grid-area: slash; font: 300 30px/1 var(--sans); opacity: .75; }
.char-card .cc-en { grid-area: en; font: 700 30px/1.05 var(--sans); word-break: break-word; }
.char-card .cc-romaji { grid-area: romaji; font: 700 12.5px/1.2 var(--sans); letter-spacing: .08em; margin-top: 4px; }
.char-card .cc-kana { grid-area: kana; font: 400 14px/1.2 var(--sans); margin-top: 4px; }

/* 區塊分隔線 */
.char-card .cc-rule { border: 0; border-top: 2px solid #fff; opacity: .85; margin: 16px 0; }

/* CV */
.char-card .cc-cv { margin: 0; color: #fff; font: 700 22px/1.2 var(--sans); letter-spacing: .02em; }

/* 標語 */
.char-card .cc-quote { color: #fff; }
.char-card .cc-quote-jp { margin: 0 0 8px; font: 700 18px/1.5 var(--sans); }
.char-card .cc-quote-cn { margin: 0 0 8px; font: 700 16px/1.45 var(--sans); }
.char-card .cc-quote-en { margin: 0; font: 700 14px/1.6 var(--sans); }

/* 催眠能力：標籤 —— 值 */
.char-card .cc-ability { margin: 0; display: flex; align-items: center; gap: 14px;
  color: #fff; font-family: var(--sans); }
.char-card .cc-ability-label { font-weight: 700; font-size: 15px; letter-spacing: .06em; flex: none; }
.char-card .cc-ability-dash { width: 34px; height: 2px; background: #fff; flex: none; }
.char-card .cc-ability-val { font-weight: 700; font-size: 16px; }

/* 基本資料：兩欄，每列「標籤 —— 值」。
   key 欄固定寬 → 各列的值對齊在同一直線；標籤越長，中間橫線越短（flex 填滿剩餘） */
.char-card .cc-spec { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0; }
.char-card .cc-spec-item {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  align-items: center;
  column-gap: 14px;
  color: #fff;
  font-family: var(--sans);
}
.char-card .cc-spec-key { display: flex; align-items: center; gap: 10px; min-width: 0; }
.char-card .cc-spec-full { grid-column: 1 / -1; }
.char-card .cc-spec-label { margin: 0; font-weight: 700; font-size: 15px; white-space: nowrap; flex: none; }
.char-card .cc-spec-rule { flex: 1 1 auto; min-width: 8px; height: 2px; background: #fff; opacity: .85; }
.char-card .cc-spec-val { margin: 0; font-weight: 400; font-size: 15px; white-space: nowrap; }
.char-card .cc-spec-full .cc-spec-val { white-space: normal; }

/* 介紹內文 */
.char-card .cc-intro { color: var(--text); font-size: 14.5px; line-height: 1.9; }
.char-card .cc-intro p { margin: 0 0 10px; }

/* 底部導覽 */
.bottomnav {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40;
  width: min(var(--max), calc(100% - 32px));
  display: flex; justify-content: space-around; align-items: center;
  height: 60px; padding: 0 8px;
  background: rgba(18, 18, 22, .82); backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
}
.bottomnav a { color: var(--muted); display: grid; place-items: center; gap: 3px; font-size: 10px; cursor: pointer; transition: color .18s ease; }
.bottomnav a.on, .bottomnav a:active { color: var(--accent); }
.bottomnav svg { width: 23px; height: 23px; }

/* 展開面板（限動圓圈點擊往下展開） */
.expando { padding: 8px 4px 4px; }
.expando[hidden] { display: none; }
.expando.open { animation: fade .2s ease; }
.expando .panel {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 18px 18px 20px; background: var(--surface); margin-bottom: 10px;
}
.expando h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 12px; }
.expando p, .expando li { color: var(--muted); font-size: 14px; line-height: 1.85; }
.expando ul { margin: 0; padding-left: 1.2em; }

/* 社群卡片 */
.social-list { display: grid; gap: 8px; }
/* 整張卡片套色碼柔光（與角色格子同款）：顏色從左側暈開、融進背景。
   未設色碼時 var(--si-color) fallback 成 transparent，柔光與外框都自動消失，維持乾淨底。 */
.social-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid color-mix(in srgb, var(--si-color, transparent) 32%, var(--line-strong));
  border-radius: 12px; padding: 12px 14px;
  background:
    radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--si-color, transparent) 24%, transparent), transparent 60%),
    var(--surface-2);
}
.social-item .si-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--si-color, var(--accent)); flex: none; overflow: hidden; }
.social-item .si-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
/* 沒圖示時的預設 SVG 描邊跟著色碼走 */
.social-item .si-icon.has-color svg { stroke: var(--si-color); }
.social-item .si-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.social-item .si-label { font-family: var(--serif); font-size: 15px; }
.social-item .si-handle { color: var(--muted); font-size: 12.5px; }

/* 頂列圖示鈕 */
.iconbtn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 8px; transition: color .18s ease;
}
.iconbtn:hover, .iconbtn:focus-visible { color: var(--text); outline: 0; }
.iconbtn svg { width: 24px; height: 24px; }

/* 文章列表 fallback（story / artwork / 搜尋等一般 loop 落點） */
.fallback-list { display: grid; gap: 12px; padding: 12px 4px 4px; }
.fallback-item {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 16px 18px; background: var(--surface);
}
.fallback-item h2 { font-family: var(--serif); font-weight: 400; font-size: 19px; margin: 0 0 6px; }
.fallback-item h2 a:hover { color: var(--accent); }
.fallback-excerpt { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }
.fallback-pager { display: flex; justify-content: space-between; gap: 10px; padding: 16px 4px 4px; }
.fallback-pager a { color: var(--accent); font-size: 14px; }

/* ── 作品系統（故事 story + 塗鴉 artwork）────────────────────────── */

/* 關聯 chips：角色 / 配對。可能是 <a>（連作品中心）或 <span>（無連結）。
   沿用 .tagrow 風格，配對用愛心前綴、色調略區隔。 */
.rel-row { margin: 12px 0 4px; }
.rel-chip {
  display: inline-block; font-size: 12px; text-decoration: none;
  padding: 3px 10px; border-radius: 6px; line-height: 1.6;
  color: var(--accent); border: 1px solid var(--accent-soft); background: var(--accent-soft);
}
a.rel-chip:hover { border-color: var(--accent); }
.rel-chip.rel-group { color: #ffb8d9; border-color: rgba(255, 132, 186, .28); background: rgba(255, 132, 186, .12); }
a.rel-chip.rel-group:hover { border-color: #ff84ba; }

/* 角色頁「看作品」按鈕（獨立區塊，浮層內也保留） */
.char-works { margin-top: 16px; }
.char-works .btn { width: 100%; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
.char-works .btn svg { width: 17px; height: 17px; }

/* 作品中心頁 */
.works-page { padding: 8px 0 8px; }
.works-head { padding: 6px 4px 2px; }
.works-title { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 6px; }
.works-intro { color: var(--muted); font-size: 14px; line-height: 1.8; }
.works-intro p { margin: 0 0 8px; }

/* type tab 沿用 .tabs/.tab。分組切換（依角色 / 依配對） */
.works-groupby { display: flex; gap: 8px; padding: 4px 4px 14px; }
.groupby-btn {
  flex: none; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  font: 600 13px var(--sans); cursor: pointer; white-space: nowrap;
}
.groupby-btn.active { background: var(--accent); color: #1a1030; border-color: var(--accent); }

/* 分組區塊：每個角色/配對一段 */
.works-section { margin: 0 0 26px; scroll-margin-top: 16px; }
.works-back { margin: 16px 4px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.works-back a { color: var(--muted); font-size: 13px; text-decoration: none; }
.works-back a:hover { color: var(--accent); }
.works-section-head {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0 4px;
  font-family: var(--serif); font-weight: 400; font-size: 18px; color: var(--text);
}
.works-count {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px;
}

/* 故事依 story_type 分小組（主線/番外/日常/慶祝/其他） */
.story-type-group { margin-top: 14px; }
.story-type-group:first-child { margin-top: 6px; }
.story-type-head {
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  color: var(--accent); letter-spacing: .08em;
  margin: 0 4px 8px; padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

/* 塗鴉九宮格沿用 .grid；故事卡片流 */
.story-flow { display: grid; gap: 12px; padding: 0 4px; }

/* 故事卡片：封面（左）+ 內文（右），沿用深色卡片風 */
.story-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; text-decoration: none; color: inherit;
}
.story-card:active { transform: scale(.99); }
.story-card:hover { border-color: var(--accent); }
.story-card-cover { position: relative; background: var(--surface-2); min-height: 96px; }
.story-card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-card-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; }
.story-card-cover .ph::after {
  content: ""; width: 40%; height: 40%; border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), transparent); opacity: .4;
}
.story-card-body { padding: 12px 14px 12px 0; align-self: center; min-width: 0; }
.story-card-title { font-family: var(--serif); font-weight: 400; font-size: 17px; margin: 0 0 6px; color: var(--text); }
.story-card-excerpt {
  color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 作品卡在九宮格內的說明字（塗鴉） */
.work-card.art-card .cap { font-family: var(--sans); }

/* 塗鴉單篇 / 浮層：大圖為主 */
.art-hero { aspect-ratio: auto; max-height: 78vh; background: var(--surface-2); }
.art-hero img { position: relative; inset: auto; width: 100%; height: auto; max-height: 78vh; object-fit: contain; display: block; }
.lightbox-content .art-hero { border-radius: 18px 18px 0 0; }
.art-title { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 4px 0 4px; }
.art-date, .story-date { color: var(--muted); font-size: 12.5px; margin: 0 0 4px; font-family: var(--sans); }
.art-note { margin-top: 12px; }

/* 故事單篇：整頁閱讀 */
.story-title { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 6px 0 4px; }
.story-content { margin-top: 14px; }
.story-content p { margin: 0 0 14px; }
.story-content h2, .story-content h3 { font-family: var(--serif); font-weight: 400; color: var(--text); margin: 20px 0 10px; }

/* 首頁分區九宮格（夢主等，比照夢角另起一區） */
.grid-section { margin-top: 26px; }
.section-head {
  font-family: var(--serif); font-weight: 400; font-size: 18px;
  color: var(--text); margin: 0 0 12px; padding: 0 4px;
}

/* 夢主頁：關聯夢角九宮格（浮層與整頁共用；比照首頁 .grid 但間距略收） */
.dreamer-chars { margin-top: 4px; }
.dreamer-chars-block h2 { font-family: var(--serif); font-weight: 400; font-size: 17px; margin: 0 0 8px; color: var(--text); }

/* 官方卡版「關係定位」：標籤 值 橫排（比照 .cc-ability） */
.char-card .cc-relation { margin: 0; display: flex; align-items: baseline; gap: 14px;
  color: #fff; font-family: var(--sans); flex-wrap: wrap; }
.char-card .cc-relation-label { font-weight: 700; font-size: 15px; letter-spacing: .04em; flex: none; }
.char-card .cc-relation-val { font-weight: 400; font-size: 15px; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
