/* ===== 別讓他知道 ===== */
/* 配色跟著章節走：深夜暗色（序章～第二章）→ 紫到玫瑰（第三、四章）→ 粉金暖黃（第五章～結局） */
:root {
  --bg: #0d0e22; --bg2: #1b1c40; --card: rgba(255,255,255,.055); --card2: rgba(255,255,255,.09); --line: rgba(255,255,255,.12);
  --ink: #efeeff; --muted: #a6a3cc; --accent: #ff5d8f; --accent2: #7c8bff; --warn: #ff4d6d; --ok: #5fe3a1; --gold: #f2c879;
  --r: 18px; --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; --serif: "Noto Serif TC", "Songti TC", serif;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}
body[data-ch="3"] { --bg: #170f2b; --bg2: #2d1850; --accent: #ff6fae; --accent2: #b06cff; }
body[data-ch="4"] { --bg: #241130; --bg2: #461a45; --accent: #ff7aa8; --accent2: #ff9a8b; }
body[data-ch="5"], body[data-ch="6"], body[data-scr="end"] { --bg: #34192a; --bg2: #5e2c3d; --card: rgba(255,240,220,.07); --card2: rgba(255,240,220,.12); --line: rgba(255,225,190,.2); --ink: #fff4ea; --muted: #e8cdbd; --accent: #ffb3c7; --accent2: #f2c879; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { background: #0d0e22; }
body { min-height: 100vh; background: var(--bg) radial-gradient(130% 70vh at 50% -10%, var(--bg2), var(--bg)) no-repeat; color: var(--ink); font: 16px/1.7 var(--sans); transition: background-color .8s; -webkit-tap-highlight-color: transparent; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.35), transparent), radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,.25), transparent), radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.2), transparent), radial-gradient(1px 1px at 35% 80%, rgba(255,255,255,.2), transparent); opacity: .6; z-index: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: .06em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }
.sd-hide { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 99; color: var(--muted); }
.scr { display: none; position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 16px 16px 90px; }
.scr.on { display: block; animation: fadein .4s; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

.btn { border: 0; border-radius: 999px; padding: 10px 20px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ffb36b)); color: #2a0f1c; font-weight: 700; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .1s, opacity .2s, filter .2s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--card2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.on { outline: 3px solid var(--accent2); }
.btn.big { padding: 14px 24px; font-size: 17px; width: 100%; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 4px 0; }
.ib { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; width: 38px; height: 38px; position: relative; }
.ib[data-n]::after { content: attr(data-n); position: absolute; top: -6px; right: -6px; background: var(--warn); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 5px; }

/* 美術 */
.art { display: block; width: 100%; height: auto; }
.art.photo { border-radius: 12px; box-shadow: var(--shadow); }
.art.scene { border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.avatar { position: relative; display: inline-block; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.avatar .art, .avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* 標題 */
#title { text-align: center; padding-top: 18px; }
.t-art { max-width: 520px; margin: 0 auto; }
.t-notif { position: relative; width: 240px; margin: -46px auto 0; background: rgba(255,255,255,.95); color: #222; border-radius: 16px; padding: 8px 12px; text-align: left; font-size: 13px; line-height: 1.45; box-shadow: 0 12px 30px rgba(0,0,0,.45); animation: buzz 3.2s infinite; }
.t-notif b { color: #06c755; font-size: 11px; }
.t-notif p { margin: 2px 0 0; }
.t-notif small { position: absolute; right: 10px; top: 8px; color: #888; font-size: 10px; }
@keyframes buzz { 0%, 86%, 100% { transform: rotate(0); } 88% { transform: rotate(-3deg); } 90% { transform: rotate(3deg); } 92% { transform: rotate(-2deg); } 94% { transform: rotate(1deg); } }
h1 { font-size: 46px; margin: 18px 0 0; font-weight: 900; letter-spacing: .14em; background: linear-gradient(90deg, #ff8fb4, #ffd3a1 50%, #b9a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 40px rgba(255,143,180,.25); }
.t-sub { font-size: 17px; margin: 2px 0 12px; font-family: var(--serif); }
.t-cast { display: flex; justify-content: center; gap: 14px; margin: 8px 0; }
.t-cast figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.t-cast .avatar { width: 58px; height: 58px; }
.t-meta { color: var(--muted); font-size: 13px; }
.t-btns { display: grid; gap: 10px; max-width: 360px; margin: 18px auto; }
.t-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 房間 */
.code-row { display: flex; gap: 8px; }
.code-row input, .pz-in input, .chat-in input { flex: 1; min-width: 0; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.pz-in input:focus, .code-row input:focus { outline: 2px solid var(--accent); }
.room-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 6px 0; }
.room-item em { margin-left: auto; color: var(--muted); font-style: normal; }
.code { color: var(--accent); letter-spacing: .15em; }
.w-members, .w-seats { display: grid; gap: 8px; }
.wm, .ws { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; text-align: left; }
.wm.host b::before { content: '👑 '; }
.wm.empty { opacity: .5; }
.wm span, .ws small { color: var(--muted); font-size: 13px; }
.ws.on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
.ws:disabled { opacity: .5; }
.w-mole { margin-top: 12px; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 4px; }
.w-mole small { color: var(--muted); }

/* HUD */
.hud { position: sticky; top: 0; z-index: 10; margin: -16px -16px 10px; padding: 10px 16px 8px; background: linear-gradient(var(--bg) 72%, transparent); backdrop-filter: blur(8px); }
.h-top { display: flex; align-items: center; gap: 8px; }
#hCh { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--serif); }
#hCh b { color: var(--accent); margin-right: 6px; }
.h-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.shower { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.s-bar { flex: 1; height: 8px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.s-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6cb6ff, #ff8fb4); transition: width 1s linear; box-shadow: 0 0 12px #6cb6ff; }
#hStage { font-size: 12px; color: var(--muted); white-space: nowrap; }
.party { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.party span { font-size: 12px; background: var(--card2); border-radius: 99px; padding: 1px 8px; }
.party span small { margin-left: 4px; color: var(--muted); }
.party span.off { opacity: .4; }

.goals { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 10px; }
.g-h { font-weight: 700; margin-bottom: 4px; }
.g-i { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 3px 0; }
.g-i.done { opacity: .5; }
.g-i small { font-size: 12px; }

.role-tabs { display: flex; gap: 6px; overflow-x: auto; }
.rtab { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 8px 6px; white-space: nowrap; position: relative; }
.rtab.on { background: color-mix(in srgb, var(--c) 30%, transparent); border-color: var(--c); font-weight: 700; }
.rtab em, .atab em { position: absolute; top: -4px; right: -2px; background: var(--warn); color: #fff; border-radius: 99px; font-size: 11px; font-style: normal; padding: 0 6px; }
.atab em { width: 9px; height: 9px; padding: 0; top: 4px; right: 8px; }
.role-info { font-size: 13px; margin: 8px 2px; display: flex; gap: 8px; align-items: center; }
.role-info .avatar { width: 34px; height: 34px; }
.app-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.atab { flex: 1; min-width: 62px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; position: relative; transition: background .2s; }
.atab span { font-size: 22px; line-height: 1.2; }
.atab small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.atab.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }
.atab.on small { color: var(--ink); }
.atab.locked { opacity: .5; }

/* App 外觀 */
.app-view { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.app-view > * { min-width: 0; overflow-wrap: anywhere; }
.app-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; font-weight: 700; color: #fff; }
.app-head span { font-size: 20px; }
.app-head small { margin-left: auto; font-weight: 400; opacity: .85; font-size: 12px; }
.skin-room .app-head { background: linear-gradient(90deg, #6d4683, #3e5f8a); }
.skin-home .app-head { background: linear-gradient(90deg, #2b3157, #4a5490); }
.skin-album .app-head { background: linear-gradient(90deg, #ff9a8b, #ff6a88); }
.skin-memo .app-head { background: #f6d365; color: #3a3220; }
.skin-mine .app-head { background: linear-gradient(90deg, #ff7aa8, #b88cff); }
.skin-web .app-head { background: #fff; color: #333; }
.skin-web .app-head b { background: linear-gradient(90deg, #4285f4 0 25%, #ea4335 25% 50%, #fbbc05 50% 75%, #34a853 75%); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 18px; }
.skin-pc .app-head, .skin-mail .app-head, .skin-bank .app-head, .skin-map .app-head, .skin-inv .app-head, .skin-note .app-head { background: linear-gradient(90deg, #1f6f6a, #2fb5a7); }
.skin-memo .doc { background: rgba(255,244,200,.08); }
.skin-mail .doc, .skin-bank .doc, .skin-map .doc, .skin-inv .doc, .skin-note .doc, .skin-pc .doc { border-radius: 10px; border-top: 22px solid rgba(255,255,255,.08); position: relative; }
.skin-mail .doc::before, .skin-bank .doc::before, .skin-map .doc::before, .skin-inv .doc::before, .skin-note .doc::before, .skin-pc .doc::before { content: '● ● ●'; position: absolute; top: -19px; left: 10px; font-size: 9px; letter-spacing: 2px; color: #ff6b6b; text-shadow: 13px 0 #ffd166, 26px 0 #06d6a0; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.doc.new { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(0,0,0,.15); }
.doc h4 { margin: 0 0 8px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.doc h4 em { font-style: normal; font-size: 10px; background: var(--accent); color: #1a0d1a; border-radius: 99px; padding: 0 6px; }
.doc p { margin: 6px 0; }
.doc .art { margin: 6px 0; }
.solved-list { color: var(--muted); font-size: 13px; text-align: center; }

/* 謎題 */
.pz { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent2) 12%, transparent)); border: 1px solid var(--accent); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.pz h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pz p { margin: 4px 0; }
.pz-in { display: flex; gap: 8px; margin-top: 8px; }
.pz-msg { color: var(--warn); min-height: 1.2em; white-space: pre-line; font-size: 14px; }
.hints { background: rgba(0,0,0,.22); border-radius: 12px; padding: 6px 10px; font-size: 14px; }
.lv { margin-left: auto; font-size: 11px; font-weight: 400; border-radius: 99px; padding: 0 8px; background: rgba(255,255,255,.12); white-space: nowrap; }
.lv.mp { margin-left: 0; background: rgba(124,139,255,.35); }
.lv.mp + .lv { margin-left: auto; }
.g-i .lv { margin-left: 0; }
.lv8 { background: rgba(255,140,80,.3); }
.lv9, .lv10 { background: rgba(255,60,90,.45); }
.order { padding-left: 22px; margin: 8px 0; display: grid; gap: 6px; }
.order li { background: rgba(0,0,0,.22); border-radius: 10px; padding: 6px 8px; }
.order li > span:first-child { display: block; font-size: 14px; }
.o-btn { display: flex; gap: 6px; justify-content: flex-end; }
.o-btn button { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; width: 40px; }
.o-btn button:disabled { opacity: .3; }
.opts { display: grid; gap: 6px; margin: 8px 0; }
.opts.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opt { text-align: left; background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; gap: 8px; align-items: baseline; font-size: 14px; transition: background .15s, border-color .15s; }
.opt b { color: var(--accent); flex: none; }
.opt:hover { border-color: var(--accent); }
.opt.on { background: color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
.wheels { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 2px; background: linear-gradient(#1b1b24, #3a3a4a 50%, #1b1b24); border: 2px solid var(--c); border-radius: 14px; padding: 6px 10px; min-width: 64px; }
.wheel b { font-size: 34px; font-family: ui-monospace, Menlo, monospace; color: #fff; line-height: 1.1; }
.wheel button { background: rgba(255,255,255,.1); border: 0; border-radius: 8px; width: 40px; height: 26px; color: #fff; }
.wheel .w-sp { height: 26px; }
.wheel small { font-size: 11px; color: var(--c); }
.wheel:not(.mine) { opacity: .8; }
.parts { display: grid; gap: 8px; margin: 8px 0; }
.part { background: rgba(0,0,0,.2); border-radius: 12px; padding: 8px 10px; }
.pt-h { font-size: 14px; font-weight: 700; border-left: 4px solid var(--c); padding-left: 8px; }
.urgent { position: sticky; top: 92px; z-index: 9; margin-bottom: 10px; }
.urgent-pz { border-color: var(--warn); animation: alarm 1.6s infinite; text-align: center; }
.urgent-pz h4 { justify-content: center; }
.urgent-pz.cue { background: linear-gradient(160deg, rgba(255,77,109,.5), rgba(255,160,80,.35)); animation: alarm .4s infinite; }
.cue-t { font-size: 24px; font-weight: 900; }
.wait-t { font-size: 18px; letter-spacing: .2em; color: var(--muted); }
@keyframes alarm { 50% { box-shadow: 0 0 0 4px rgba(255,77,109,.5), var(--shadow); } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* 線索裡的小元件 */
.ph { position: relative; border-radius: 12px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; text-align: center; overflow: hidden; box-shadow: inset 0 0 40px rgba(0,0,0,.25); }
.ph::after { content: ''; position: absolute; inset: 0; background: linear-gradient(130deg, rgba(255,255,255,.18), transparent 40%); pointer-events: none; }
.ph-e { font-size: 46px; line-height: 1.1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
.ph-l { font-size: 12px; color: rgba(255,255,255,.9); background: rgba(0,0,0,.3); border-radius: 99px; padding: 0 8px; margin-top: 4px; }
.ph-x { font-size: 13px; margin-top: 8px; background: rgba(0,0,0,.4); border-radius: 10px; padding: 6px 10px; color: #fff; }
.ph-x.sepia { background: rgba(60,40,20,.6); color: #fff3df; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid3 .ph { min-height: 80px; }
.grid3 .ph-e { font-size: 28px; }
.lock { text-align: center; display: grid; gap: 8px; padding: 10px; border-radius: 26px; background: linear-gradient(180deg, #1c2050, #0d0f26); }
.lk-time { font-size: 58px; font-weight: 200; line-height: 1; letter-spacing: .02em; }
.lk-date { color: var(--muted); font-size: 13px; }
.notif { text-align: left; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); border-radius: 16px; padding: 8px 12px; }
.notif b { font-size: 12px; color: #7ee2a8; }
.notif p { margin: 2px 0; }
.notif small { color: var(--muted); font-size: 11px; }
.appgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.appgrid span { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); }
.appgrid b { font-size: 26px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.1); }
.chat { display: grid; gap: 5px; }
.c-day { text-align: center; font-size: 11px; color: #f4f6ff; margin: 6px auto 2px; background: rgba(0,0,0,.25); border-radius: 99px; padding: 0 10px; }
.c-row { display: flex; align-items: flex-end; gap: 6px; }
.c-row.me { flex-direction: row-reverse; }
.c-b { max-width: 78%; padding: 7px 11px; border-radius: 18px; background: #fff; color: #222; font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.c-row.them .c-b { border-top-left-radius: 4px; }
.c-row.me .c-b { background: #06c755; color: #04210f; border-top-right-radius: 4px; }
.c-t { font-size: 10px; color: #3c4e78; }
.clist { display: grid; gap: 4px; }
.ci { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.55); }
.ci > span { font-size: 22px; width: 40px; height: 40px; display: grid; place-items: center; background: #fff; border-radius: 50%; }
.ci small { display: block; color: #3c4e78; font-size: 12px; }
.mail { border-radius: 12px; background: rgba(255,255,255,.05); }
.m-h { display: flex; flex-direction: column; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.m-h span { font-size: 12px; color: var(--muted); }
.m-b { padding: 8px 10px; font-size: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 400; }
.tbl tbody tr:hover { background: rgba(255,255,255,.04); }
.tbl tr.tiny td { font-size: 9px; opacity: .55; cursor: pointer; }
.post { border-radius: 16px; background: rgba(255,255,255,.04); padding: 8px; margin-top: 12px; border: 1px solid var(--line); }
.p-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; font-size: 14px; }
.p-h small { color: var(--muted); font-size: 12px; margin-left: auto; }
.p-h em { font-size: 11px; font-style: normal; color: var(--accent); }
.p-av, .pf-av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #dd2a7b; }
.pf-av { width: 60px; height: 60px; font-size: 30px; flex: none; }
.p-c { font-size: 14px; margin-top: 6px; }
.p-cm { font-size: 13px; color: var(--muted); }
.p-cm p { margin: 2px 0; }
.tag { color: #8fb8ff; }
.prof { display: flex; gap: 14px; align-items: center; }
.prof small { display: block; color: var(--muted); }
.prof p { margin: 4px 0; font-size: 14px; }
.pf-n { font-size: 12px; color: var(--muted); }
.memo { background: #fff8d9; color: #3a3220; border-radius: 12px; padding: 8px 12px; background-image: repeating-linear-gradient(transparent 0 27px, rgba(160,130,60,.18) 27px 28px); }
.memo p { margin: 4px 0; font-size: 14px; }
.sticky { background: #ffe873; color: #3a3220; padding: 14px; border-radius: 4px; transform: rotate(-2deg); box-shadow: 4px 6px 16px rgba(0,0,0,.35); font-size: 15px; }
.win { border-radius: 12px; overflow: hidden; background: #1e2433; border: 1px solid rgba(255,255,255,.12); }
.win-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #2c3346; font-size: 12px; color: #c8cfe6; }
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; }
.win-bar i:nth-child(2) { background: #ffd166; }
.win-bar i:nth-child(3) { background: #06d6a0; }
.win-bar span { margin-left: 6px; }
.win-b { padding: 10px 12px; }
.big-code { font-size: 22px; letter-spacing: .12em; }
.tail { filter: blur(1px); }
.kb { display: grid; gap: 4px; font-size: 12px; }
.kb div { display: flex; gap: 3px; flex-wrap: wrap; }
.kb span { min-width: 38px; background: #2c3346; border-radius: 6px; padding: 2px 4px; text-align: center; box-shadow: 0 2px 0 #11151f; color: #e6ebff; }
.kb span b { display: block; font-size: 10px; color: #9fb0d8; font-weight: 400; text-align: left; }
.kb .space { min-width: 200px; }
.door { display: inline-block; background: #6b4a2b; color: #f6e3c4; padding: 0 6px; border-radius: 4px; margin-left: 4px; }
.mirror { display: inline-block; transform: scaleX(-1); font-weight: 700; letter-spacing: .1em; }
.steps { display: flex; gap: 6px; font-size: 26px; margin: 4px 0 10px; flex-wrap: wrap; }
.steps span { background: rgba(255,255,255,.1); border-radius: 10px; padding: 2px 6px; }
.score b { display: block; }
.circle { color: #ff4d4d; border: 2px solid #ff4d4d; border-radius: 50%; padding: 0 6px; }
.morse { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; margin-top: 8px; font-size: 14px; }
.morse span { background: rgba(0,0,0,.25); border-radius: 8px; padding: 2px 6px; letter-spacing: .15em; }
.morse b { margin-right: 6px; letter-spacing: 0; color: var(--accent); }
.elders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.elder { background: linear-gradient(160deg, #fff3b0, #ffd1dc); color: #4a2a22; border-radius: 10px; padding: 8px 6px; text-align: center; font-family: var(--serif); box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.elder .e-i { font-size: 26px; }
.elder p { margin: 2px 0; font-size: 13px; font-weight: 700; }
.elder small { font-size: 11px; color: #8a5a4a; font-family: var(--sans); }
.red { color: #e3222b; font-size: 1.15em; }
.towels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.towels span { background: var(--c); color: #1a2440; border-radius: 12px; padding: 10px; font-weight: 700; display: flex; gap: 8px; align-items: center; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
.towels b { font-size: 24px; }
.voice { background: #06c755; color: #04210f; border-radius: 18px; padding: 6px 14px; display: inline-block; font-weight: 700; letter-spacing: .05em; }

/* 終章 */
.finale { display: grid; gap: 12px; }
.fin-h { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.fin-h h2 { margin: 0; font-size: 30px; }
.fin-h.on h2 { color: var(--warn); font-variant-numeric: tabular-nums; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.tasks { display: grid; gap: 10px; }
.task { background: var(--card); border: 1px solid var(--c); border-radius: var(--r); padding: 12px; }
.task.done { opacity: .6; }
.task p { margin: 0 0 8px; }
.task p small { color: var(--c); margin-right: 4px; }
.task .ok { color: var(--ok); }
.sl { display: flex; gap: 10px; align-items: center; }
.sl input { flex: 1; }
.pk { display: grid; gap: 6px; }
.phone-ghost { position: relative; height: 90px; display: grid; place-items: center; }
.phone-ghost i { position: absolute; width: 40px; height: 70px; border: 2px dashed var(--muted); border-radius: 8px; }
.phone-ghost b { font-size: 52px; transition: transform .1s; }

/* 結局 */
.end-box { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 16px; box-shadow: var(--shadow); }
.end-box h2 { font-size: 30px; margin: 0 0 4px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stats div { background: rgba(0,0,0,.18); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; }
.stats b { font-size: 18px; }
.stats small { color: var(--muted); font-size: 12px; }
.end-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.end-list span { background: rgba(0,0,0,.2); border-radius: 99px; padding: 3px 10px; font-size: 13px; color: var(--muted); }
.end-list span.got { color: var(--ink); border: 1px solid var(--accent); }

/* 章節標題卡 */
.ch-card { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(0,0,0,.55), rgba(0,0,0,.85)); }
.ch-card div { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.ch-card span { font-size: 54px; }
.ch-card small { font-family: var(--serif); color: var(--accent); letter-spacing: .4em; font-size: 15px; }
.ch-card b { font-family: var(--serif); font-size: 34px; letter-spacing: .12em; color: #fff; }
.ch-card.go { animation: card 2.6s forwards; }
.ch-card.go div { animation: cardin 2.6s forwards; }
@keyframes card { 0% { opacity: 0; } 12%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cardin { 0% { transform: translateY(14px) scale(.96); } 20%, 100% { transform: none; } }

/* 對話框 */
.say { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.65) 30%); cursor: pointer; }
.say-in { max-width: 720px; margin: 0 auto; background: rgba(20,18,40,.96); border: 1px solid var(--c); border-radius: 20px; padding: 12px 16px 8px; min-height: 100px; box-shadow: 0 10px 40px rgba(0,0,0,.5); display: flex; gap: 12px; align-items: flex-start; }
.say-av:empty { display: none; }
.say-av .avatar { width: 64px; height: 64px; box-shadow: 0 0 0 3px var(--c); }
.say-tx { flex: 1; min-width: 0; }
.say.sys .say-in { border-color: var(--line); font-style: italic; }
.say b { color: var(--c); font-size: 14px; }
.say p { margin: 4px 0; font-size: 17px; color: #fff; }
.say small { display: block; text-align: right; color: var(--muted); font-size: 11px; }
#saySkip { position: absolute; right: 22px; top: -10px; background: rgba(0,0,0,.6); border-radius: 99px; padding: 2px 10px; text-decoration: none; font-size: 13px; }

/* 聊天 */
.chat-box { position: fixed; right: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); max-height: 70vh; z-index: 30; background: rgba(20,18,40,.97); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; padding: 10px; gap: 8px; }
.chat-h { display: flex; justify-content: space-between; align-items: center; }
.chat-log { flex: 1; overflow-y: auto; min-height: 120px; font-size: 14px; }
.chat-log p { margin: 4px 0; }
.chat-log p b { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.chat-log p.me { text-align: right; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; }
.chat-quick button { white-space: nowrap; background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; font-size: 12px; }
.chat-in { display: flex; gap: 6px; }

/* 彈窗 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5,4,15,.7); display: grid; place-items: center; padding: 16px; }
.m-card { width: min(460px, 100%); max-height: 86vh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.m-card h3 { margin: 0 0 8px; }
.m-btns, .v-opts { display: grid; gap: 8px; margin-top: 12px; }
.modal.mole .m-card { border-color: #f2c879; }
.mole-n { margin: 0 0 6px; }
.how ul { padding-left: 20px; }
.how p, .how li { font-size: 14px; }

.toasts { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 6px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: rgba(20,18,40,.96); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; transition: opacity .4s, transform .4s; box-shadow: var(--shadow); }
.toast.good { border-color: var(--ok); }
.toast.bad { border-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(-8px); }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.fx i { position: absolute; bottom: 30%; font-style: normal; font-size: 24px; animation: fly 1.5s ease-out forwards; }
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(40deg); opacity: 0; } }

@media (max-width: 420px) {
  h1 { font-size: 38px; }
  .atab { min-width: 56px; }
  .say p { font-size: 16px; }
  .say-av .avatar { width: 48px; height: 48px; }
  .elders { grid-template-columns: repeat(2, 1fr); }
}
.pf-av .avatar, .p-av .avatar { width: 100%; height: 100%; box-shadow: none; }
.pf-av:has(.avatar), .p-av:has(.avatar) { overflow: hidden; }

/* ===== LIME（仿 LINE） ===== */
.skin-lime .app-head { background: #fff; color: #111; }
.skin-lime .app-head b { color: #06c755; font-size: 19px; font-weight: 900; letter-spacing: .02em; }
.skin-lime .app-head small { color: #777; }
.skin-lime .doc { background: #fff; color: #111; border: 0; padding: 0; overflow: hidden; border-radius: 16px; }
.skin-lime .doc.new { box-shadow: 0 0 0 2px var(--accent); }
.skin-lime .doc h4 { margin: 0; padding: 10px 14px; background: #fff; color: #111; border-bottom: 1px solid #eee; font-size: 15px; }
.skin-lime .doc h4::before { content: '‹'; font-size: 24px; line-height: 0; margin-right: 2px; color: #333; }
.skin-lime .doc h4::after { content: '🔍  📞  ☰'; margin-left: auto; font-size: 13px; letter-spacing: 2px; opacity: .55; }
.skin-lime .doc-b { padding: 0; }
.skin-lime .doc-b > .muted, .skin-lime .doc-b > p { padding: 6px 14px; color: #666; margin: 0; }
.lchat { background: #7494c0; padding: 10px 10px 12px; display: grid; gap: 6px; }
.l-day { text-align: center; }
.l-day span { display: inline-block; font-size: 11px; color: #fff; background: rgba(0,0,0,.18); border-radius: 99px; padding: 1px 10px; }
.l-row { display: flex; align-items: flex-end; gap: 5px; }
.l-row.me { justify-content: flex-end; }
.l-row .avatar.l-av { width: 34px; height: 34px; align-self: flex-start; box-shadow: none; }
.l-av-sp { width: 34px; flex: none; }
.l-b { max-width: 70%; padding: 7px 11px; border-radius: 18px; background: #fff; color: #111; font-size: 14px; line-height: 1.5; word-break: break-word; }
.l-row.them .l-b { border-top-left-radius: 4px; }
.l-row.me .l-b { background: #8de055; border-top-right-radius: 4px; }
.l-t { font-size: 10px; color: rgba(255,255,255,.9); line-height: 1.3; text-align: right; flex: none; }
.l-row.them .l-t { text-align: left; }
.l-input { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-top: 1px solid #e5e5e5; color: #777; font-size: 16px; }
.l-input i { flex: 1; font-style: normal; background: #f2f2f2; border-radius: 99px; padding: 4px 12px; font-size: 13px; color: #aaa; }
.llist { background: #fff; color: #111; }
.ll-search { margin: 8px 12px; background: #f2f2f2; border-radius: 10px; padding: 5px 10px; color: #999; font-size: 13px; }
.ll-i { display: flex; gap: 10px; align-items: center; padding: 8px 14px; }
.ll-av { width: 46px; height: 46px; border-radius: 50%; background: #eef2f7; display: grid; place-items: center; font-size: 22px; flex: none; overflow: hidden; }
.ll-av .avatar { width: 100%; height: 100%; box-shadow: none; }
.ll-i > div { flex: 1; min-width: 0; }
.ll-i b { display: block; font-size: 15px; }
.ll-i small { display: block; color: #888; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ll-i em { font-style: normal; font-size: 11px; color: #aaa; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ll-i em i { font-style: normal; background: #06c755; color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; }
.lprof { position: relative; text-align: center; background: #2b2d33; color: #fff; padding: 0 14px 12px; }
.lp-cover { height: 90px; margin: 0 -14px; background: linear-gradient(135deg, #8ec5fc, #e0c3fc); }
.lp-av { display: inline-grid; place-items: center; width: 84px; height: 84px; margin-top: -42px; border-radius: 50%; overflow: hidden; border: 3px solid #2b2d33; background: #ddd; font-size: 40px; }
.lp-av .avatar { width: 100%; height: 100%; box-shadow: none; }
.lprof > b { display: block; font-size: 19px; margin-top: 4px; }
.lprof > p { font-size: 13px; color: #ccc; margin: 4px 0 10px; }
.lp-btns { display: flex; justify-content: center; gap: 26px; font-size: 11px; color: #ddd; }
.lp-btns span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lp-btns i { font-style: normal; font-size: 20px; }
.skin-lime .lprof + .lchat { border-top: 0; }

/* ===== InstaGlam（仿 Instagram） ===== */
.skin-ig .app-head { background: #000; color: #fff; border: 1px solid #262626; }
.skin-ig .app-head b { font-family: "Grand Hotel", cursive; font-weight: 400; font-size: 28px; line-height: 1; }
.skin-ig .app-head small { color: #a8a8a8; }
.skin-ig .app-head::after { content: '♡  ✉'; font-size: 18px; letter-spacing: 6px; margin-left: 8px; }
.skin-ig .doc { background: #000; color: #f5f5f5; border: 1px solid #262626; border-radius: 14px; padding: 12px; }
.skin-ig .doc.new { border-color: var(--accent); }
.skin-ig .doc h4 { color: #f5f5f5; }
.skin-ig .doc .muted { color: #a8a8a8; }
.ig-av, .ip-av { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: #262626; flex: none; padding: 2px; background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5); }
.ig-av { width: 34px; height: 34px; font-size: 16px; }
.ig-av .avatar, .ip-av .avatar { width: 100%; height: 100%; box-shadow: 0 0 0 2px #000; }
.iprof { padding-bottom: 4px; }
.ip-top { display: flex; align-items: center; gap: 18px; }
.ip-av { width: 86px; height: 86px; font-size: 40px; padding: 3px; }
.ip-st { flex: 1; display: flex; justify-content: space-around; text-align: center; }
.ip-st span { display: flex; flex-direction: column; font-size: 13px; color: #f5f5f5; }
.ip-st b { font-size: 17px; }
.ip-name { display: block; margin-top: 10px; font-size: 14px; }
.ip-bio { margin: 2px 0 10px; font-size: 14px; }
.ip-btns { display: flex; gap: 6px; }
.ip-btns span { flex: 1; text-align: center; background: #363636; border-radius: 8px; padding: 6px; font-size: 13px; font-weight: 700; }
.ip-btns span.blue { background: #0095f6; }
.ip-btns span:last-child { flex: 0 0 34px; }
.ip-hl { display: flex; gap: 16px; margin: 12px 0 8px; overflow-x: auto; }
.ip-hl span { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: #f5f5f5; gap: 4px; }
.ip-hl i { font-style: normal; width: 58px; height: 58px; border-radius: 50%; border: 1px solid #555; display: grid; place-items: center; font-size: 24px; background: #121212; }
.ip-tabs { display: flex; border-top: 1px solid #262626; margin: 0 -12px; }
.ip-tabs span { flex: 1; text-align: center; padding: 8px; color: #737373; font-size: 18px; }
.ip-tabs span.on { color: #f5f5f5; box-shadow: inset 0 1px 0 #f5f5f5; }
.ipost { margin: 12px -12px 0; border-top: 1px solid #262626; padding-top: 10px; }
.ipo-h { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px; font-size: 14px; }
.ipo-h em { font-style: normal; font-size: 12px; }
.ipo-h i { margin-left: auto; font-style: normal; color: #f5f5f5; }
.ipo-img .ph, .ipo-img .art { border-radius: 0; box-shadow: none; width: 100%; }
.ipo-img .ph { aspect-ratio: 1 / 1; min-height: 0; }
.ipo-img .ph-e { font-size: 72px; }
.ipo-act { display: flex; gap: 14px; padding: 10px 12px 4px; color: #f5f5f5; }
.ipo-act svg { width: 25px; height: 25px; }
.ipo-act span { flex: 1; }
.ipo-likes { margin: 2px 12px; font-size: 14px; font-weight: 700; }
.ipo-cap, .ipo-cm { margin: 2px 12px; font-size: 14px; }
.ipo-more { margin: 4px 12px 2px; font-size: 13px; color: #a8a8a8; }
.ipo-date { margin: 4px 12px 0; font-size: 11px; color: #a8a8a8; }
.istory { position: relative; margin: 12px auto 0; max-width: 320px; border-radius: 14px; overflow: hidden; background: #111; padding: 52px 0 70px; }
.is-bar { position: absolute; top: 8px; left: 8px; right: 8px; height: 2px; background: rgba(255,255,255,.35); border-radius: 2px; z-index: 2; }
.is-bar i { display: block; width: 60%; height: 100%; background: #fff; }
.is-h { position: absolute; top: 16px; left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; z-index: 2; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.is-h .ig-av { width: 30px; height: 30px; }
.is-h small { color: rgba(255,255,255,.75); }
.is-img .ph, .is-img .art { border-radius: 0; box-shadow: none; }
.is-img .ph { min-height: 260px; }
.is-cap { position: absolute; left: 12px; right: 12px; bottom: 14px; margin: 0; padding: 8px 10px; background: rgba(0,0,0,.55); border-radius: 10px; font-size: 13px; z-index: 2; }
.doc h4 em { white-space: nowrap; flex: none; }
.skin-lime .doc h4 { flex-wrap: nowrap; }
.skin-lime .doc h4::after { flex: none; }
