/* 2026-11-18 介面重做「夜幕金紫」：底#110d18、金#e3bb60＝主按鈕/標題、紫#bf9af5＝第二主色、粉水晶#f27bbd＝菱形點綴
   (舊色票：bg #15171b / card #1f2329 / jade 主按鈕；備份在 scratchpad backup_remote_web) */
:root {
  --bg: #110d18;
  --bg2: #150f1d;
  --card: #1a1524;
  --card2: #231c30;
  --inset: #140f1c;
  --line: #33293f;
  --line2: #43374f;
  --text: #f2ecf5;
  --muted: #aba1b8;
  --dim: #8a8097;
  --gold: #e3bb60;
  --gold-ink: #1d1606;
  --gold-soft: rgba(227,187,96,.13);
  --gold-line: rgba(227,187,96,.42);
  --pur: #bf9af5;
  --pur-soft: rgba(191,154,245,.15);
  --pur-line: rgba(191,154,245,.42);
  --gem: #f27bbd;
  --jade: #4cbc8f;
  --jade-ink: #0a1f16;
  --jade-soft: rgba(76,188,143,.14);
  --hp: #dc5a4e;
  --mp: #6f8ff0;
  --danger: #d4574a;
  --red-soft: rgba(224,106,85,.14);
  --warn-bg: #221a1f;
  --warn-line: rgba(236,199,119,.30);
  --warn-text: #ecc777;
  --shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 20px rgba(0,0,0,.30);
}
* { box-sizing: border-box; }
/* 有 display 設定的元件(.dead 是 flex)會蓋掉瀏覽器預設的 [hidden]，這條讓「隱藏」永遠優先 */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
main { max-width: 480px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px 32px; }
.view { display: flex; flex-direction: column; gap: 14px; }
.view[hidden] { display: none; }
h1 { margin: 0; font-size: 24px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.grow { flex-grow: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }

.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 24px; }
.logo { width: 60px; height: 60px; border-radius: 16px; background: var(--card); border: 1px solid var(--warn-line); display: flex; align-items: center; justify-content: center; color: var(--gold); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.slim { padding: 12px 14px; gap: 8px; }
.steps { gap: 18px; }
.step { display: flex; gap: 12px; }
.step .num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 13px; background: var(--gold); color: #1b1508; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.step .grow { display: flex; flex-direction: column; gap: 8px; }
input { width: 100%; min-height: 52px; padding: 0 14px; background: var(--bg); border: 1px solid var(--warn-line); border-radius: 12px; color: var(--text); font: inherit; font-size: 26px; font-weight: 700; letter-spacing: 10px; text-align: center; }
input.small-input { min-height: 44px; font-size: 15px; font-weight: 400; letter-spacing: 0; text-align: left; border-color: var(--line); }
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.notes { margin: 0; padding-left: 18px; line-height: 1.7; }

.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--jade); border-color: var(--jade); color: var(--jade-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--warn-line); color: var(--gold); }
.btn.big { min-height: 56px; font-size: 18px; }
.btn.small { min-height: 40px; padding: 0 10px; font-size: 14px; flex-grow: 1; }
.btn:disabled, .tile:disabled, .hunt:disabled { opacity: .45; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--gold); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.link { align-self: flex-start; min-height: 44px; background: none; border: none; color: var(--gold); font: inherit; font-size: 15px; padding: 0; cursor: pointer; }
/* 返回鍵固定在畫面頂端：頁面很長時不用捲回最上面才按得到
   2026-10-24 改成每一頁的返回鍵都固定(.view > .link)；iPhone 加到主畫面時狀態列是透明的，
   停在 top:0 會躲到時間/瀏海底下按不到 → 停在 safe-area 下面，上面再墊一塊底色擋住捲上去的內容 */
.view > .link { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; align-self: stretch; margin: 0 -16px; padding: 0 16px; text-align: left; background: var(--bg); box-shadow: 0 8px 12px -8px rgba(0,0,0,.6); }
.view > .link::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: env(safe-area-inset-top, 0px); background: var(--bg); }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.allbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.allbar .btn.small { flex: 1 1 40%; }
.accounts { display: flex; flex-direction: column; gap: 6px; }
.acc { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.acc .bad { color: var(--warn-text); }
.chars { display: flex; flex-direction: column; gap: 10px; }
.char { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: left; color: var(--text); font: inherit; cursor: pointer; width: 100%; }
.char.off { background: #1a1d22; border-style: dashed; color: #8f8a7f; cursor: default; }
.char .head { display: flex; align-items: center; gap: 12px; }
.char .av { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--gold); }
/* 2026-10-28 頭像格＝職業字＋職業底色；隊長金框＋「長」、跟隨中＋「跟」 */
.char .av { position: relative; font-weight: 700; border: 2px solid transparent; }
/* 2026-11-18 使用者拍板：騎士藍、法師金、王族紅(原本 王金/騎紅/法藍) */
.char .av.k-crown { background: #3a2220; color: #f08a74; }
.char .av.k-knight { background: #1f2a40; color: #8fb6f2; }
.char .av.k-elf { background: #1d3527; color: #7fd6a2; }
.char .av.k-wiz { background: #3a3218; color: #f0cf6a; }
.char .av.k-dark { background: #2e2238; color: #c49af0; }
.char .av.k-dk { background: #3a2a1c; color: #eaa66a; }
.char .av.k-ill { background: #1c3236; color: #7fd2d8; }
.char .av.k-war { background: #33302b; color: #d8cfbf; }
.char.off .av { opacity: .55; }
.char .av.lead { border-color: var(--gold); }
.char .av-tag { position: absolute; right: -6px; bottom: -6px; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; background: var(--gold); color: #1b1508; font-size: 11px; line-height: 18px; text-align: center; }
.char .av-tag.fol { background: var(--card2); color: var(--muted); border: 1px solid var(--line); line-height: 16px; }
.char .nm { font-size: 17px; font-weight: 700; }
.chip { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--line); color: var(--text); white-space: nowrap; }
.chip.on { background: var(--jade); color: var(--jade-ink); }
.chip.dead { background: var(--danger); color: #fff; }

.bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar .lbl { width: 22px; }
.bar .val { min-width: 76px; text-align: right; }
.track { flex-grow: 1; height: 8px; background: #2c3138; border-radius: 4px; overflow: hidden; }
.fill { height: 8px; width: 0; }
.fill.hp { background: var(--hp); }
.fill.mp { background: var(--mp); }
.title { font-size: 22px; font-weight: 700; }

.hunt { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 14px 20px; border-radius: 16px; border: 1px solid var(--jade); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hunt.on { background: var(--jade); color: var(--jade-ink); }
.hunt > span { display: flex; flex-direction: column; gap: 2px; }
.hunt-title { font-size: 21px; font-weight: 700; }
.hunt-sub { font-size: 13px; opacity: .85; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 64px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.stats { gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: #1b1e23; border-radius: 10px; }
.stat b { font-size: 18px; }
.btn.small.grow0 { flex-grow: 0; min-height: 34px; font-size: 13px; }
.up { color: #7fd6ae; }
.down { color: #e38b7a; }
.items { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); }
.items b { color: var(--text); }
.events { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.events .t { color: #8f8a7f; margin-right: 10px; }

.warn { padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: 14px; }
.dead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #2b1a17; border: 1px solid var(--danger); }
.manage summary { cursor: pointer; padding: 8px 0; }
.bind { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: 448px; margin: 0 auto; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: 14px; line-height: 1.5; white-space: pre-line; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.toast.ok { background: #16261f; border-color: var(--jade); color: #bfe8d6; }

/* 2026-11-18 付費鎖定(沒有遠端雲端遙控)：跟「暫時不能按」的灰色分開；保留原色調暗＋右上角金色標籤，點了跳說明 */
.tile.paid-lock, .hunt.paid-lock { position: relative; opacity: .78; border-color: var(--gold-line); border-style: dashed; cursor: pointer; }
.tile.paid-lock { padding-right: 70px; }
.tile.paid-lock > b, .hunt.paid-lock .hunt-title { color: var(--muted); }
.tile.paid-lock .small, .hunt.paid-lock .hunt-sub { color: var(--gold); opacity: 1; }
.tile.paid-lock::after, .hunt.paid-lock::after { content: "🔒遙控"; position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 999px; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold); font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.hunt.paid-lock::after { top: 50%; right: 14px; transform: translateY(-50%); }
.pl-mask { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8,5,12,.72); }
.pl-box { width: 100%; max-width: 360px; padding: 20px 18px 16px; border-radius: 16px; background: var(--card2); border: 1px solid var(--gold-line); box-shadow: 0 12px 36px rgba(0,0,0,.5); color: var(--text); }
.pl-box h3 { margin: 0 0 10px; font-size: 18px; color: var(--gold); }
.pl-box p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.pl-box ul { margin: 0 0 12px; padding-left: 20px; font-size: 15px; line-height: 1.75; }
.pl-box .btn { width: 100%; margin-top: 4px; }

/* 補給設定 */
.radio, .check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; flex-wrap: wrap; }
.radio input, .check input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--jade); }
.indent { padding-left: 28px; display: flex; flex-direction: column; gap: 6px; }
.row.wrap { flex-wrap: wrap; flex-direction: row; align-items: center; }
select { width: 100%; min-height: 42px; padding: 0 10px; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; }
.row select { width: auto; flex-grow: 1; }
input.num { width: 96px; min-height: 40px; padding: 0 8px; font-size: 15px; font-weight: 400; letter-spacing: 0; text-align: right; border-color: var(--line); }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.li:first-child { border-top: none; }
.li .nm { flex-grow: 1; min-width: 0; }
.li .nm .muted { display: block; font-size: 12px; }
.li input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--jade); flex-shrink: 0; }
.li.off { opacity: .55; }
.li.taken .nm > :not(.tag) { opacity: .55; }

/* 2026-09-26｜回程順位、清單篩選、動態與紀錄排版 */
/* 2026-09-30｜清單改版：數量列、挑選清單、背包整理三段切換 */
.chip.idle { background: #5a4a26; color: #f0d9a0; }
input.search { min-height: 42px; font-size: 15px; font-weight: 400; letter-spacing: 0; text-align: left; border-color: var(--line); }
.picker { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #1b1e23; border: 1px solid var(--line); border-radius: 10px; }
.picker .list { max-height: 320px; overflow-y: auto; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 4px; background: none; border: none; border-top: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.opt:first-child { border-top: none; }
.li.qty, .li.bag { flex-direction: column; align-items: stretch; gap: 6px; }
.qtyctl, .bagctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qtyctl input.num { width: 110px; }
.qtyctl .btn.small.grow0 { min-height: 36px; padding: 0 10px; }
.qtyctl .rm { margin-left: auto; color: #e38b7a; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segb { min-height: 36px; padding: 0 12px; background: var(--card2); color: var(--muted); border: none; border-left: 1px solid var(--line); font: inherit; font-size: 14px; cursor: pointer; }
.segb:first-child { border-left: none; }
.segb:disabled { opacity: .35; cursor: default; }
.segb.on.m0 { background: #3a3f47; color: var(--text); font-weight: 700; }
.segb.on.m1 { background: #1f3a5f; color: #b5d0f5; font-weight: 700; }
.segb.on.m2 { background: #5a4a26; color: #f0d9a0; font-weight: 700; }
/* 2026-10-19 存角色倉庫(紫)、從倉庫領出(綠) */
.segb.on.m3 { background: #3a3346; color: #d4c8ea; font-weight: 700; }
.segb.on.m4 { background: #1d4a38; color: #a8e6ca; font-weight: 700; }
/* 2026-10-29 存血盟倉庫(青) */
.segb.on.m6 { background: #1d434a; color: #a8dce6; font-weight: 700; }
.qtyctl select.src { width: auto; min-height: 36px; font-size: 14px; }
.keepw { display: flex; align-items: center; gap: 6px; }
.keepw input.num { width: 96px; }
.btn.warn-ghost { background: transparent; border-color: #5a2620; color: #e38b7a; }
.row.potrow { flex-wrap: nowrap; gap: 6px; }
.potrow select { flex: 1 1 auto; min-width: 0; }
.potrow input.num { width: 84px; flex-shrink: 0; }
.potrow .btn.small.grow0 { flex-shrink: 0; padding: 0 8px; }
#s-pots { gap: 8px; }
.route { display: flex; flex-direction: column; gap: 10px; }
.slot { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: #1b1e23; border: 1px solid var(--line); border-radius: 10px; }
/* 2026-10-24 獵場順序：每個順位右上角 ▲ ▼ 移除 */
.slot-ctl { gap: 6px; flex-shrink: 0; }
.slot-ctl .btn.small.grow0 { min-height: 36px; padding: 0 12px; }
.slot-ctl .rm { color: #e38b7a; }
.check.nowrap { flex-wrap: nowrap; align-items: flex-start; padding: 8px 0; line-height: 1.5; }
.check.nowrap input { margin-top: 2px; flex-shrink: 0; }
.filt { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filt .check { min-height: 32px; font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.6; padding: 0 7px; border-radius: 999px; background: var(--line); color: var(--text); white-space: nowrap; }
.tag.tg-dead { background: #5a2620; color: #f6c2b6; }
.tag.tg-lv { background: #1d4a38; color: #a8e6ca; }
.tag.tg-sup { background: #1f3a5f; color: #b5d0f5; }
.tag.tg-hunt { background: #3d4a1f; color: #d6e8a8; }
.tag.tg-warn { background: #5a4a26; color: #f0d9a0; }
.tag.tg-move { background: #3a3346; color: #d4c8ea; }
/* 2026-11-06 背包整理：「留」比購買／倉庫補到的少 */
.bagwarn { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; color: #e38b7a; }
.li .nm .tag { margin-left: 6px; vertical-align: 1px; }

.evlist { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: none; }
.ev .t { font-size: 12px; color: #8f8a7f; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev .x { font-size: 13px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.ev summary { cursor: pointer; }
.ev .sub { color: var(--muted); padding-left: 12px; }

.kvlist { display: flex; flex-direction: column; }
.kv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kv:first-child { border-top: none; }
.kv .k { font-weight: 700; color: var(--text); }
.kv .k .amt { display: block; font-size: 12px; margin-top: 2px; }
.kv .v { display: flex; flex-direction: column; gap: 2px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }

/* 2026-10-05 雲端掛機(類名一律 cl- 前綴，避開 hunt/dead/warn 既有元件) */
.chip.cl-cloud { background: var(--mp); color: #fff; margin-right: 6px; }
.cl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #17212f; border: 1px solid var(--mp); }
.cl-bar b { color: #cfe0fb; }

/* 2026-10-05 伺服器輔助(雲端掛機第2階段；類名 as- 前綴) */
.as-hprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.as-hprow:first-child { border-top: none; }
.as-hprow select.act { flex: 1 1 100%; min-width: 0; }
.as-hprow input.num { width: 96px; }
.as-hprow .btn.small.grow0 { min-height: 36px; padding: 0 10px; }
.as-hprow .rm { margin-left: auto; color: #e38b7a; }
#a-poly-item, #a-poly-name { flex: 1 1 100%; min-width: 0; }

/* 2026-10-15 紀錄頁(類名 lg- 前綴)／清單效期提醒／綁定列的效期 */
.acc .warnc { color: var(--warn-text); }
.bind > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bind .bad { color: #e38b7a; }
.lg-tabs { display: flex; gap: 6px; }
.lg-tab { flex: 1 1 0; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.lg-tab.on { background: var(--jade); border-color: var(--jade); color: var(--jade-ink); }
.lg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.lg-chip.on { background: var(--line); color: var(--text); font-weight: 700; }
.lg-sum { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.lg-sum::-webkit-details-marker { display: none; }
.lg-det[open] .lg-sum { margin-bottom: 6px; }
.lg-gold { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 6px 74px; font-size: 13px; color: var(--muted); }
.lg-grow { display: flex; justify-content: space-between; gap: 8px; }
.lg-flow { padding: 8px 0; border-top: 1px solid var(--line); }
.lg-flow:first-child { border-top: none; }
.lg-flow summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.lg-flow summary::-webkit-details-marker { display: none; }
.lg-fn { font-size: 14px; font-weight: 700; }
.lg-fsub { overflow-wrap: anywhere; }

/* 2026-10-20 角色群組(gp- 前綴)：清單上的群組標題(點一下收合)、群組管理頁 */
.gp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 6px 2px; margin-top: 4px; background: none; border: none; border-bottom: 1px solid var(--warn-line); color: var(--gold); font: inherit; font-size: 15px; font-weight: 700; text-align: left; cursor: pointer; }
.gp-head .muted { font-weight: 400; }
.gp-arrow { display: inline-block; width: 16px; color: var(--muted); }
.gp-lbl { white-space: nowrap; flex-shrink: 0; }
.allbar.gp-bar { flex-wrap: nowrap; gap: 6px; }
.allbar.gp-bar .btn.small { flex: 1 1 0; min-height: 36px; padding: 0 4px; font-size: 13px; }
#g-add { white-space: nowrap; flex-shrink: 0; }

/* 2026-10-30 清單勾選：頭像格當勾選框、勾選說明列、名字後面的長/跟標籤與帳號 */
.warnc { color: var(--warn-text); }
.char .av.cb { cursor: pointer; }
.char .av.cb::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--muted); background: var(--card); }
.char .av.cb.on { background: var(--gold); color: #1b1508; font-size: 22px; border-color: var(--gold); }
.char .av.cb.on::after { display: none; }
.char .av.cb:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.linkbtn { min-height: 32px; padding: 0 4px; background: none; border: none; color: var(--gold); font: inherit; cursor: pointer; white-space: nowrap; }
.char .nm-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: var(--gold); color: #1b1508; font-size: 11px; line-height: 18px; vertical-align: 2px; }
.char .nm-tag.fol { background: var(--card2); color: var(--muted); border: 1px solid var(--line); line-height: 16px; }
.char .nm-acc { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.gp-row { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.gp-row:first-child { border-top: none; }
.gp-row input.small-input { flex: 1 1 auto; min-width: 0; min-height: 40px; }
.gp-row .btn.small.grow0 { flex-shrink: 0; padding: 0 10px; }
.gp-row .rm { color: #e38b7a; }
.gp-crow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.gp-crow:first-child { border-top: none; }
.gp-crow select { width: auto; flex: 0 0 44%; min-width: 0; }

/* 2026-10-05 雲端上線(第3階段)：清單上未上線角色的那一列 */
.cl-up { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cl-up .btn { flex-shrink: 0; }

/* 2026-10-16 聊天室(cr- 前綴)：輸入框黏在畫面底部，訊息一句一行
   2026-10-18 頻道頁籤搬進底部黏住的 cr-box(輸入框上方)，訊息多時不用捲回頂端切換 */
.cr-tabs { display: flex; gap: 6px; }
.cr-tab { position: relative; flex: 1 1 0; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.cr-tab.on { background: var(--jade); border-color: var(--jade); color: var(--jade-ink); }
.cr-dot { position: absolute; top: 6px; right: 10px; width: 8px; height: 8px; border-radius: 4px; background: var(--hp); }
.cr-list { gap: 0; min-height: 40vh; }
.cr-line { padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.cr-line:first-child { border-top: none; }
.cr-t { color: #8f8a7f; font-size: 12px; margin-right: 8px; }
.cr-nm { background: none; border: none; padding: 0; margin-right: 6px; font: inherit; font-weight: 700; cursor: pointer; }
.cr-nm.w1 { color: var(--gold); }
.cr-nm.w2 { color: #7fd6ae; }
.cr-nm.w3, .cr-nm.w4 { color: #d4c8ea; }
.cr-dir { color: var(--muted); font-size: 12px; margin-right: 4px; }
.cr-sys { color: var(--warn-text); }
.cr-box { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -8px 12px -8px rgba(0,0,0,.6); }
.cr-box .row { flex-wrap: nowrap; }
.cr-lbl { flex-shrink: 0; }
.cr-send { min-height: 44px; flex-shrink: 0; }

/* 2026-10-25 補給設定分頁籤、儲存列黏在底部、刪除(紅)、批次、折疊區、預覽可收合 */
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); margin-bottom: -10px; background: var(--bg); box-shadow: 0 -8px 12px -8px rgba(0,0,0,.6); }
.segb.on.m5 { background: #5a2620; color: #f6c2b6; font-weight: 700; }
.row.bulk { flex-wrap: nowrap; }
.row.bulk select { min-width: 0; }
.row.bulk .btn.small.grow0 { flex-shrink: 0; min-height: 40px; white-space: nowrap; }
.stuck summary { cursor: pointer; padding: 6px 0; }
.stuck .li { padding: 6px 0; }
.pv summary.pv-sum { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.pv summary.pv-sum::-webkit-details-marker { display: none; }
.pv summary.pv-sum .bold::after { content: " ▸"; color: var(--muted); }
.pv[open] summary.pv-sum .bold::after { content: " ▾"; }
.pv[open] summary.pv-sum { margin-bottom: 4px; }
#o-fill { align-self: flex-start; }

/* ════════════════════════════════════════════════════════════════════
   2026-11-18 介面重做「夜幕金紫」：放最後面，蓋過上面的舊樣式
   主按鈕＝金、第二主色＝紫、狀態綠/紅/黃改成「彩色字＋淡底」，卡片加層次陰影
   ════════════════════════════════════════════════════════════════════ */
html { background: var(--bg); }
body {
  min-height: 100vh;
  background: radial-gradient(130% 420px at 50% 0, rgba(150,100,225,.22), rgba(150,100,225,0) 100%) no-repeat,
              radial-gradient(90% 300px at 100% 100%, rgba(224,184,94,.06), rgba(224,184,94,0) 100%) no-repeat,
              var(--bg);
}
h1 { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.title { font-weight: 800; }

/* 卡片 */
.card { border-radius: 16px; box-shadow: var(--shadow); }
.card.slim { border-radius: 14px; }
.manage.card summary { padding: 4px 0; }
.manage.card[open] summary { margin-bottom: 4px; }

/* 按鈕 */
.btn { transition: transform .06s, filter .15s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #ecc874, var(--gold)); border-color: var(--gold); color: var(--gold-ink); font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.ghost { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.btn.warn-ghost { border-color: rgba(224,106,85,.45); color: #ef8f7c; }
.icon-btn { background: var(--card); border-color: var(--line); color: var(--gold); box-shadow: var(--shadow); }
.link, .linkbtn { color: var(--gold); }
/* 頂端返回列半透明＋模糊：不會把上方紫光暈切成一條深色帶 */
.view > .link { background: rgba(17,13,24,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.view > .link::before { background: rgba(17,13,24,.72); }

/* 輸入框 */
input { background: var(--inset); border-color: var(--gold-line); }
input.small-input, input.num, input.search { background: var(--inset); border-color: var(--line); }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
select { background: var(--card2); border-color: var(--line); }
.radio input, .check input, .li input[type=checkbox] { accent-color: var(--gold); }

/* 狀態標籤：彩色字＋淡底(不再整塊實心) */
.chip { background: rgba(255,255,255,.06); color: var(--muted); font-weight: 800; }
.chip.on { background: var(--jade-soft); color: var(--jade); }
.chip.dead { background: var(--red-soft); color: #ef7d68; }
.chip.idle { background: rgba(236,199,119,.12); color: var(--warn-text); }
.chip.cl-cloud { background: var(--pur-soft); color: var(--pur); }

/* 提示框 */
.warn { background: rgba(236,199,119,.08); border-color: var(--warn-line); border-radius: 12px; }
.dead { background: rgba(224,106,85,.10); border-color: rgba(224,106,85,.5); border-radius: 14px; }
.toast { background: #251c24; border-color: var(--warn-line); }
.toast.ok { background: #12221c; border-color: rgba(76,188,143,.55); color: #bfe8d6; }
.cl-bar { background: var(--pur-soft); border-color: var(--pur-line); border-radius: 14px; }
.cl-bar b { color: #dccbfa; }

/* 角色清單 */
.top .row { gap: 8px; }
.accounts .acc { padding: 9px 12px; border-radius: 12px; background: rgba(236,199,119,.08); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: 13px; }
.accounts .acc.acc-mk { background: var(--card); border-color: var(--line); color: var(--text); }
.allcard { gap: 10px; padding: 14px; }
.allcard #list-allcap { font-size: 15px; }
.allcard #list-allcap.warnc { color: var(--warn-text); }
.allbar, .allbar.gp-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.allbar .btn.small, .allbar.gp-bar .btn.small { min-height: 46px; padding: 0 2px; border-radius: 12px; background: var(--card2); font-size: 12px; font-weight: 700; line-height: 1.25; }
.allcard .allbar .btn.small { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; letter-spacing: -.3px; white-space: nowrap; }
/* 不能用 background 簡寫：會把下面各按鈕的 background-image 蓋掉 */
.allcard .allbar .btn.small::before { content: ""; width: 18px; height: 18px; background-position: center; background-size: 18px 18px; background-repeat: no-repeat; }
.allbar [data-all="hunt_on"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234cbc8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 5l12 7-12 7z'/%3E%3C/svg%3E"); }
.allbar [data-all="hunt_off"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aba1b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3C/svg%3E"); }
.allbar [data-all="town"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3bb60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E"); }
.allbar [data-all="resupply"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3bb60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l-1 13H7z'/%3E%3Cpath d='M9 7a3 3 0 0 1 6 0'/%3E%3C/svg%3E"); }
.allbar [data-all="cloud_on"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bf9af5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18a4 4 0 0 1-.5-8A6 6 0 0 1 18 9a4.5 4.5 0 0 1-.5 9z'/%3E%3C/svg%3E"); }
select.sortsel { width: auto; flex: 0 1 auto; min-width: 0; max-width: 72%; min-height: 36px; padding: 0 10px; border-radius: 999px; background: var(--card); font-size: 13px; }
.row.between .linkbtn { font-size: 14px; }

.char { border-radius: 16px; box-shadow: var(--shadow); gap: 12px; }
.char:active { transform: translateY(1px); }
.char.off { background: transparent; border-color: var(--line); color: var(--dim); box-shadow: none; }
.char .av { width: 46px; height: 46px; border-radius: 13px; font-size: 19px; font-weight: 800; }
.char .av.cb::after { border-color: var(--muted); background: var(--card); }
.char .av.cb.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); box-shadow: 0 0 12px rgba(227,187,96,.35); }
.char .av.lead { border-color: var(--gold); }
.char .av-tag, .char .nm-tag { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.char .nm { font-weight: 800; }
.track { background: #2b2338; height: 6px; border-radius: 3px; }
.fill { height: 6px; border-radius: 3px; }
.cl-up { padding-top: 10px; border-top: 1px solid var(--line); }
.cl-up .btn { background: var(--jade); border-color: var(--jade); color: var(--jade-ink); font-weight: 800; }

/* 群組標題：金字＋粉紫菱形 */
.gp-head { border-bottom: none; color: var(--gold); font-weight: 800; padding: 8px 2px 2px; }
.gp-head > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.gp-head > span:first-child::before, .gem { content: ""; display: inline-block; width: 7px; height: 7px; flex-shrink: 0; transform: rotate(45deg); background: linear-gradient(135deg, var(--gem), var(--pur)); box-shadow: 0 0 8px var(--gem); }
.gp-arrow { width: 12px; }

/* 單隻面板／各設定頁 */
.hunt { border-radius: 16px; box-shadow: var(--shadow); }
.hunt.on { background: linear-gradient(180deg, #5bcb9d, var(--jade)); }
.tile { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); transition: transform .06s; }
.tile:active:not(:disabled) { transform: translateY(1px); }
.stat, .picker, .slot { background: var(--inset); }
.stat { border: 1px solid var(--line); }
.char.off, .li, .ev, .kv, .lg-flow, .gp-row, .gp-crow, .bind, .as-hprow, .cr-line { border-color: var(--line); }
.segb { background: var(--card2); }
.segb.on.m0 { background: #3a3148; }
.step .num { background: var(--gold); color: var(--gold-ink); font-weight: 800; }
.lg-tab, .cr-tab { background: var(--card); }
.lg-tab.on, .cr-tab.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.lg-chip.on { background: var(--pur-soft); border-color: var(--pur-line); color: var(--pur); }
.cr-nm.w3, .cr-nm.w4 { color: #e3c8f5; }
.cr-box, .savebar { background: var(--bg); }
.events .t, .ev .t, .cr-t { color: var(--dim); }

/* ── 起始畫面(v-pair 三頁) ── */
.pr-pane { display: flex; flex-direction: column; gap: 16px; }
#pr-home { min-height: calc(100vh - 52px); min-height: calc(100svh - 52px); gap: 18px; }
#pr-home .brand { padding-top: 8px; gap: 6px; }
.brand-logo { display: block; width: 210px; height: auto; max-width: 62vw; mix-blend-mode: lighten; }
.pr-div { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.pr-div i { flex-grow: 1; height: 1px; background: linear-gradient(90deg, rgba(0,0,0,0), var(--gold-line)); }
.pr-div i:last-child { background: linear-gradient(90deg, var(--gold-line), rgba(0,0,0,0)); }
.pr-choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--gold-soft), 0 10px 24px rgba(0,0,0,.4); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .06s, border-color .15s; }
.pr-choice:active { transform: translateY(1px); border-color: var(--gold-line); }
.pr-ic { width: 54px; height: 54px; flex-shrink: 0; border-radius: 15px; display: flex; align-items: center; justify-content: center; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold); }
.pr-txt { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pr-t { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; }
.pr-d { font-size: 13px; line-height: 1.55; color: var(--muted); }
.pr-arr { flex-shrink: 0; color: var(--muted); }
.pill { display: inline-block; align-self: flex-start; font-size: 11px; font-weight: 700; line-height: 1.6; padding: 1px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); white-space: nowrap; }
.pill.pur, .pr-choice.pur .pill { background: var(--pur-soft); color: var(--pur); }
.pr-choice.pur { box-shadow: inset 0 1px 0 var(--pur-soft), 0 10px 24px rgba(0,0,0,.4); }
.pr-choice.pur:active { border-color: var(--pur-line); }
.pr-choice.pur .pr-ic { background: var(--pur-soft); border-color: var(--pur-line); color: var(--pur); }
#pair-back { min-height: 48px; border-radius: 14px; }
.pr-pane > .link { align-self: flex-start; }
.pr-head { display: flex; flex-direction: column; gap: 6px; }
.pr-prog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pr-prog > div { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.pr-prog i { height: 4px; border-radius: 2px; background: var(--line); transition: background .2s; }
.pr-prog .on { color: var(--gold); font-weight: 700; }
.pr-prog .on i { background: var(--gold); }
.card.step { flex-direction: row; gap: 14px; }
.card.step.hi { border-color: var(--gold-line); }
.step .num { width: 28px; height: 28px; border-radius: 14px; }
.step .grow { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step .grow p { line-height: 1.6; font-size: 14px; }
.pr-tip { padding: 8px 10px; border-radius: 10px; background: var(--card2); color: var(--muted); font-size: 13px !important; }
.pr-tip b { color: var(--text); }
.pr-step3 { padding: 0 16px; }
.pr-step3 .num { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.pr-step3 p { font-size: 14px; line-height: 1.6; }
.pr-notes summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 2px 0; }
.pr-notes .notes { margin-top: 6px; }
.pw-in { min-height: 50px; font-size: 16px; font-weight: 400; letter-spacing: 0; text-align: left; border-color: var(--line); }
.pw-eye-wrap { position: relative; }
.pw-eye-wrap .pw-in { padding-right: 50px; }
.pw-eye { position: absolute; right: 3px; top: 3px; width: 44px; height: 44px; border: none; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pw-eye.on { color: var(--gold); }
.pw-pw2 { display: flex; flex-direction: column; gap: 8px; }
/* 2026-11-18 外語玩家提示(用瀏覽器翻譯網頁) */
.lang-tip { align-self: center; max-width: 100%; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 12px; color: var(--muted); }
.lang-tip summary { cursor: pointer; text-align: center; color: var(--pur); font-weight: 700; }
.lang-tip[open] summary { margin-bottom: 6px; }
.lang-tip p { margin: 6px 0 0; line-height: 1.55; }
