@font-face { font-family: "ZhTitle"; src: url("assets/fonts/title.ttf"); font-display: swap; }
@font-face { font-family: "ZhBody"; src: url("assets/fonts/body.ttf"); font-display: swap; }

:root {
  --ink: #262422;
  --ink-soft: #55504a;
  --muted: #8a837a;
  --num: #8b4a2b;
  --realm: #34506e;
  --line: #9fd0ee;
  --line-strong: #5aaee0;
  --card: rgba(255, 255, 255, .42);
  --card-border: rgba(60, 50, 40, .18);
  --t0: #8a6d1d; --t1: #2f6db5; --t2: #7a3fb0; --t3: #c2412d; --t4: #d08a00; --tn: #6b665f;
  --side-w: 210px;
  --top-h: 70px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #e9e6e0 url("assets/ui/bg.jpg") center / cover fixed no-repeat;
  color: var(--ink);
  font-family: "ZhBody", "Microsoft JhengHei UI", sans-serif;
  font-size: 15px;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }
b { color: var(--num); }

/* ---------------- 頂部 ---------------- */
#top {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h);
  display: flex; align-items: center; gap: 24px; padding: 0 22px;
  z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; white-space: nowrap; }
#top > * { flex-shrink: 0; }
#top .savebar { flex-shrink: 1; min-width: 0; }
.brand-main { font-family: "ZhTitle"; font-size: 44px; letter-spacing: 4px; text-shadow: 0 2px 0 rgba(255,255,255,.6); }
.brand-sub { font-family: "ZhTitle"; font-size: 18px; color: var(--ink-soft); }
.pills { display: flex; gap: 14px; }
.pill {
  display: flex; align-items: center; gap: 8px; height: 40px; min-width: 180px; padding: 0 34px 0 14px; white-space: nowrap;
  background: url("assets/ui/HuiHeiBiaoTi_di.png") center / 100% 100% no-repeat;
  color: #f2f0ea; font-size: 16px; letter-spacing: .5px;
}
.pill img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 0 3px rgba(120,200,255,.6)); }
.pill-ico { font-family: "ZhTitle"; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #6a6a6a; border: 1px solid #aaa; font-size: 14px; }
.savebar { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.dirty { color: #c0392b; font-weight: bold; white-space: nowrap; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* ---------------- 木框按鈕 ---------------- */
.wood {
  height: 48px; min-width: 132px; padding: 0 22px;
  border: 0; background: url("assets/ui/ZaoHua_button_TongYong1_normal.png") center / 100% 100% no-repeat;
  font-family: "ZhTitle"; font-size: 21px; letter-spacing: 6px; color: #2e1d0f;
  text-shadow: 0 1px 0 rgba(255,235,200,.5);
  transition: transform .08s, filter .15s;
}
.wood:hover:not(:disabled) { background-image: url("assets/ui/ZaoHua_button_TongYong1_hover.png"); }
.wood:active:not(:disabled) { background-image: url("assets/ui/ZaoHua_button_TongYong1_pre.png"); transform: translateY(1px); }
.wood:disabled { background-image: url("assets/ui/ZaoHua_button_TongYong_disabled.png"); color: #555; cursor: default; }
.wood.small { height: 38px; min-width: 96px; font-size: 17px; letter-spacing: 3px; padding: 0 14px; }
.wood.blue { background-image: url("assets/ui/ZaoHua_button_TongYong2_normal.png"); color: #fff; text-shadow: 0 1px 2px #123; }
.wood.blue:hover { background-image: url("assets/ui/ZaoHua_button_TongYong2_hover.png"); }
.wood.red { background-image: url("assets/ui/ZaoHua_button_TongYong3_normal.png"); color: #fff; text-shadow: 0 1px 2px #300; }
.wood.red:hover { background-image: url("assets/ui/ZaoHua_button_TongYong3_hover.png"); }
.mini {
  border: 1px solid rgba(90,70,50,.45); background: rgba(255,255,255,.55); border-radius: 3px;
  padding: 0 8px; height: 22px; font-size: 13px; color: var(--ink);
}
.mini:hover { background: #fff; }

/* ---------------- 下拉 / 輸入 ---------------- */
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none; height: 36px; padding: 0 34px 0 12px; min-width: 120px;
  background: rgba(255,255,255,.6); border: 1px solid rgba(60,50,40,.3); border-radius: 2px;
}
.select-wrap::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  background: url("assets/ui/DropdownArrow.png") center / contain no-repeat; pointer-events: none; opacity: .7;
}
#saveSelect { width: 340px; min-width: 0; max-width: 30vw; }
.savebar .select-wrap { min-width: 0; }
input.num {
  width: 110px; border: 0; border-bottom: 1px dashed rgba(139,74,43,.35); background: transparent;
  color: var(--num); font-size: 20px; text-align: center; padding: 2px 4px; outline: none;
}
input.num:focus { border-bottom: 1px solid var(--num); background: rgba(255,255,255,.5); }
input.num.inline { width: 90px; font-size: inherit; color: #fff; border-bottom-color: rgba(255,255,255,.5); padding: 0 2px; }
input.num.inline:focus { background: rgba(0,0,0,.25); }
input.num.big { font-size: 28px; width: 180px; color: #2a6e2a; border-bottom-color: rgba(40,110,40,.4); }
input.search {
  height: 36px; width: 220px; padding: 0 12px; background: rgba(255,255,255,.6);
  border: 1px solid rgba(60,50,40,.3); border-radius: 2px; outline: none;
}
input.search:focus { background: #fff; }
.hint { color: var(--muted); font-size: 13px; }
.hint.pad { padding: 4px 8px; margin: 6px 0 0; }

/* ---------------- 左側墨跡頁籤 ---------------- */
#side {
  position: fixed; top: calc(var(--top-h) + 30px); left: 0; width: var(--side-w);
  display: flex; flex-direction: column; gap: 8px; z-index: 4;
}
.tab {
  height: 82px; border: 0; padding: 0 0 6px 22px; text-align: left;
  background: url("assets/ui/ZhiBao_QieHuanBiaoQian1_normal.png") left center / 100% 100% no-repeat;
  font-family: "ZhTitle"; font-size: 24px; letter-spacing: 4px; color: #f4f1ea;
  transition: padding .15s;
}
.tab:hover { background-image: url("assets/ui/ZhiBao_QieHuanBiaoQian1_hover.png"); padding-left: 28px; }
.tab.active { background-image: url("assets/ui/ZhiBao_QieHuanBiaoQian_normal.png"); color: #2a1c0e; padding-left: 28px; }

/* ---------------- 主區 ---------------- */
#main {
  position: fixed; top: var(--top-h); left: calc(var(--side-w) + 10px); right: 0; bottom: 0;
  overflow: auto; padding: 18px 26px 26px 10px;
}
.page { display: none; }
.page.show { display: block; animation: fade .2s; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 3px;
  padding: 16px 20px; box-shadow: 0 2px 10px rgba(80,60,40,.06);
  backdrop-filter: blur(1px);
}
.empty-box { margin: 18vh auto 0; text-align: center; color: var(--ink-soft); }
.title-ink { font-family: "ZhTitle"; font-size: 40px; margin-bottom: 10px; color: var(--ink); }

/* 裝飾標題 ——◆ 角色屬性 ◆—— */
.deco-title { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.deco-title::before, .deco-title::after {
  content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, #3a3633 30%, #3a3633 70%, transparent);
}
.deco-title span { font-family: "ZhTitle"; font-size: 34px; letter-spacing: 8px; position: relative; padding: 0 18px; }
.deco-title span::before, .deco-title span::after {
  content: "◆"; position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px;
}
.deco-title span::before { left: -2px; } .deco-title span::after { right: -6px; }
.deco-title.small span { font-size: 24px; letter-spacing: 5px; }
.deco-title.small { margin-bottom: 8px; }
.deco-title.small::before, .deco-title.small::after { max-width: 40px; }

/* ---------------- 角色屬性 ---------------- */
.attr-layout { display: grid; grid-template-columns: minmax(560px, 640px) minmax(300px, 380px); gap: 22px; align-items: start; }
.role-card { padding: 16px 30px 22px; }
.role-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.role-name { font-family: "ZhTitle"; font-size: 40px; letter-spacing: 3px; }
.realm select { font-family: "ZhTitle"; font-size: 24px; color: var(--realm); height: 44px; background: transparent; border: 0; border-bottom: 1px dashed rgba(52,80,110,.4); min-width: 190px; }
.bar { position: relative; height: 30px; margin: 6px 0; background: url("assets/ui/BeiBao_XueTiaoDi.png") center / 100% 100% no-repeat; }
.bar .bar-fill { position: absolute; left: 0; top: 2px; bottom: 2px; width: 0; transition: width .35s;
  background: url("assets/ui/BeiBao_XueTiao.png") left center / auto 100% no-repeat; }
.bar.exp { background-image: url("assets/ui/BeiBao_JingYanTiao_di.png"); }
.bar.exp .bar-fill { background-image: url("assets/ui/BeiBao_JingYanTiao.png"); }
.bar .bar-text { position: absolute; inset: 0; display: flex; align-items: center; gap: 4px; padding-left: 18px;
  color: #fff; font-size: 16px; text-shadow: 0 0 2px #000, 0 0 4px #000; }
.bar .bar-text.center { justify-content: center; padding: 0; }
.bar .mini { margin-left: 10px; height: 20px; font-size: 12px; text-shadow: none; }
.bar.wide { width: 640px; margin: 8px auto; }

.radar-box { position: relative; width: 280px; height: 280px; margin: 52px auto 46px; }
.radar-bg { width: 100%; height: 100%; opacity: .95; }
.radar-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.radar-svg polygon { fill: rgba(70,120,170,.55); stroke: #cfe9ff; stroke-width: 1.5; transition: all .3s; }
.radar-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: "ZhTitle";
  font-size: 22px; color: #fff; text-shadow: 0 0 4px #234; pointer-events: none; }
.radar-label { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.radar-label span { font-family: "ZhTitle"; font-size: 24px; }
.radar-label input.num { width: 64px; font-size: 22px; padding: 0; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 4px; padding: 10px 6px 0;
  border-top: 2px solid rgba(40,40,40,.65); }
.stat { display: grid; grid-template-columns: 64px 1fr; align-items: center; min-height: 48px; }
.stat label { font-family: "ZhTitle"; font-size: 23px; }
.stat .val { display: flex; flex-direction: column; align-items: center; }
.stat .calc { font-size: 12px; color: var(--muted); height: 14px; }
.stat input.num { width: 130px; font-size: 24px; }

.attr-right { display: flex; flex-direction: column; gap: 16px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.kv label { font-family: "ZhTitle"; font-size: 20px; }
.kv input.num { width: 160px; }
.kv-list .kv { border-bottom: 1px solid rgba(0,0,0,.05); }
.kv .sub { font-size: 12px; color: var(--muted); font-family: "ZhBody"; margin-left: 4px; }
.note p { margin: 4px 0; font-size: 13px; color: var(--ink-soft); }

/* ---------------- 至寶 ---------------- */
.sub-layout { display: grid; grid-template-columns: 170px 1fr; gap: 14px; }
.subnav { display: flex; flex-direction: column; gap: 8px; }
.subtab { height: 62px; border: 0; padding-left: 14px; text-align: left;
  background: url("assets/ui/ZhiBao_QieHuanBiaoQian1_normal.png") left center / 100% 100% no-repeat;
  font-family: "ZhTitle"; font-size: 19px; letter-spacing: 2px; color: #f4f1ea; }
.subtab:hover { background-image: url("assets/ui/ZhiBao_QieHuanBiaoQian1_hover.png"); }
.subtab.active { background-image: url("assets/ui/ZhiBao_QieHuanBiaoQian_normal.png"); color: #2a1c0e; }
.subpage { display: none; } .subpage.show { display: block; }
.talent-line { font-size: 14px; color: var(--ink-soft); margin: 0 0 4px; }
.talent-line .tag { display: inline-block; margin: 2px 4px; padding: 1px 10px; border-radius: 10px;
  background: rgba(52,80,110,.12); color: var(--realm); }
.tree-wrap { width: 100%; aspect-ratio: 1100 / 860; max-height: calc(100vh - 230px); position: relative; }
.tree-stage { position: absolute; left: 50%; top: 0; height: 100%; aspect-ratio: 1100 / 860; transform: translateX(-50%); max-width: 100%; }
#treeSvg { position: absolute; inset: 0; width: 100%; height: 100%; }
#treeSvg .ring { fill: none; stroke: var(--line); stroke-width: 2; opacity: .7; }
#treeSvg .ring.dot { stroke-dasharray: 2 6; stroke: #bbb; }
#treeSvg .spoke { stroke: var(--line); stroke-width: 3; opacity: .85; }
#treeSvg .link { stroke: var(--line); stroke-width: 2.5; fill: none; }
#treeSvg .link.on { stroke: var(--line-strong); stroke-width: 4; filter: drop-shadow(0 0 3px #bfe6ff); }
.node { position: absolute; transform: translate(-50%, -50%); width: 6.4%; aspect-ratio: 1; cursor: pointer; }
.node .disc { position: absolute; inset: 0; background: url("assets/ui/ZhiBao_TianFu2_disabled.png") center / contain no-repeat; transition: transform .12s; }
.node.on .disc { background-image: url("assets/ui/ZhiBao_TianFu2_normal.png"); }
.node .star { position: absolute; inset: 22%; background: url("assets/ui/TianFu_icon.png") center / contain no-repeat; opacity: 0; }
.node.on .star { opacity: 1; filter: drop-shadow(0 0 4px #bfe6ff); }
.node:hover .disc { transform: scale(1.08); }
.node.on::after { content: ""; position: absolute; inset: -20%; background: url("assets/ui/ZhiBao_TianFu2_hover.png") center / contain no-repeat; opacity: 0; transition: opacity .2s; pointer-events: none; }
.node.on:hover::after { opacity: .9; }
.node.root { width: 9.4%; }
.node.root .disc { background-image: url("assets/ui/ZhiBao_TianFu1_normal.png"); inset: -6%; }
.node.root .star { opacity: 1; inset: 25%; }
.node .label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; white-space: nowrap;
  font-size: 15px; font-weight: bold; color: #1f1f1f;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 0 4px #fff; }
.node:not(.on) .label { color: #7a7570; }
.tree-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 6px; }
.tree-actions .hint { margin-right: auto; }

.orb-wrap { position: relative; width: min(520px, 52vh); aspect-ratio: 1; margin: 10px auto 0; }
.orb { width: 100%; height: 100%; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) scale(1.01); } }
.orb-text { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); white-space: nowrap;
  font-family: "ZhTitle"; font-size: 26px; color: #1d2a3a; text-shadow: 0 0 6px #fff, 0 0 10px #fff; }
.orb-realm { text-align: center; margin-top: 8px; }
.orb-realm span { display: inline-block; padding: 6px 60px; background: url("assets/ui/HuiHeiBiaoTi_di.png") center / 100% 100% no-repeat;
  font-family: "ZhTitle"; font-size: 26px; color: #f0f4ff; letter-spacing: 4px; }
.center-row { display: flex; justify-content: center; margin-top: 18px; }

/* ---------------- 丹田 ---------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.list-card { display: flex; flex-direction: column; height: calc(100vh - 150px); padding-bottom: 10px; }
.list-head { display: flex; align-items: center; gap: 14px; }
.list-head .deco-title { margin: 0; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.chip { border: 1px solid rgba(60,50,40,.25); background: rgba(255,255,255,.5); padding: 2px 12px; border-radius: 14px; font-size: 13px; color: var(--ink-soft); }
.chip:hover { background: #fff; }
.chip.on { background: #2f2c29; color: #f4efe6; border-color: #2f2c29; }
.am-list { overflow: auto; flex: 1; padding-right: 4px; }
.am-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06); }
.am-row:hover { background: rgba(255,255,255,.55); }
.am-name { font-size: 17px; font-weight: bold; }
.am-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.am-eff { font-size: 12px; color: var(--ink-soft); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.seal { font-family: "ZhTitle"; color: #b03a2e; border: 2px solid #b03a2e; padding: 0 6px; border-radius: 3px; transform: rotate(-6deg); font-size: 15px; opacity: .85; }
.del { width: 30px; height: 30px; border: 0; background: url("assets/ui/GuanBi_min_button_normal.png") center / contain no-repeat; opacity: .6; }
.del:hover { background-image: url("assets/ui/GuanBi_min_button_hover.png"); opacity: 1; }

.icon { position: relative; width: 52px; height: 52px; border-radius: 6px; background: rgba(40,36,32,.82);
  border: 2px solid var(--tc, var(--tn)); display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0,0,0,.6); }
.icon img { width: 90%; height: 90%; object-fit: contain; }
.icon .ph { font-family: "ZhTitle"; font-size: 22px; color: var(--tc, #ddd); }
.t0 { --tc: var(--t0); } .t1 { --tc: var(--t1); } .t2 { --tc: var(--t2); } .t3 { --tc: var(--t3); } .t4 { --tc: var(--t4); }
.gname.t0 { color: var(--t0); } .gname.t1 { color: var(--t1); } .gname.t2 { color: var(--t2); } .gname.t3 { color: var(--t3); } .gname.t4 { color: var(--t4); }
.el { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  font-family: "ZhTitle"; font-size: 13px; color: #fff; background: var(--ec, #777); }
.e0 { --ec: #8a857e; } .e1 { --ec: #c9a227; } .e2 { --ec: #2f7fc1; } .e3 { --ec: #3d8b3d; } .e4 { --ec: #d0482b; }
.e5 { --ec: #9a6b33; } .e6 { --ec: #4fb3c8; } .e7 { --ec: #4aa58f; } .e8 { --ec: #8458c7; }

/* ---------------- 物品 / 裝備 ---------------- */
.bag-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.bag-card { display: flex; flex-direction: column; height: calc(100vh - 120px); }
.equip-col { display: flex; flex-direction: column; gap: 14px; }
.equip-col .bag-card { height: calc(100vh - 480px); min-height: 260px; }
.grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; align-content: start; padding: 4px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 6px; background: rgba(40,36,32,.82);
  border: 2px solid var(--tc, var(--tn)); display: grid; place-items: center; cursor: pointer;
  box-shadow: inset 0 0 12px rgba(0,0,0,.6); transition: transform .1s; }
.cell:hover { transform: translateY(-2px); }
.cell.sel { outline: 3px solid #f2c94c; outline-offset: 1px; }
.cell img { width: 82%; height: 82%; object-fit: contain; }
.cell .ph { font-family: "ZhTitle"; font-size: 26px; color: var(--tc, #ddd); }
.cell .cnt { position: absolute; right: 4px; bottom: 2px; font-size: 13px; color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; }
.cell .eq { position: absolute; left: 3px; top: 2px; font-family: "ZhTitle"; font-size: 12px; color: #f2c94c; text-shadow: 0 0 2px #000; }
.cell .el { position: absolute; right: 2px; top: 2px; min-width: 16px; height: 16px; font-size: 11px; }
.cell .name { position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font-size: 11px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid.named { row-gap: 26px; }

.detail { position: sticky; top: 0; min-height: 300px; }
.detail .big { display: flex; gap: 14px; align-items: center; }
.detail .big .icon { width: 84px; height: 84px; }
.detail h3 { margin: 0 0 4px; font-size: 22px; }
.detail .meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); align-items: center; }
.detail .desc { margin: 14px 0; font-size: 14px; line-height: 1.7; color: var(--ink-soft); white-space: pre-wrap; }
.detail .eff { color: #2d6b3b; }
.detail .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.detail .empty { color: var(--muted); text-align: center; margin-top: 100px; }

.slot-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.slot-group h4 { margin: 0 0 8px; font-family: "ZhTitle"; font-size: 18px; font-weight: normal; }
.slot-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.slot .cell { width: 64px; }
.slot .cell.emptyslot { background: rgba(255,255,255,.35); border: 2px dashed rgba(60,50,40,.25); box-shadow: none; cursor: default; }
.slot small { font-size: 11px; color: var(--muted); max-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 煉製天賦 ---------------- */
.side-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.side-col { position: relative; padding: 10px 0 12px; }
.side-col h3 { text-align: center; margin: 0 0 4px; font-family: "ZhTitle"; font-size: 28px; font-weight: normal; letter-spacing: 4px; }
.side-exp { text-align: center; margin-bottom: 8px; font-size: 14px; color: var(--ink-soft); }
.side-exp input.num { width: 130px; font-size: 18px; }
.side-tree { position: relative; height: calc(100vh - 270px); min-height: 520px; }
.side-tree .trunk { position: absolute; left: 50%; top: 40px; bottom: 30px; width: 4px; transform: translateX(-50%); background: #c9c7c3; border-radius: 2px; }
.side-tree .trunk-on { position: absolute; left: 50%; top: 40px; width: 4px; transform: translateX(-50%); background: var(--line-strong); box-shadow: 0 0 6px #bfe6ff; border-radius: 2px; transition: height .3s; }
.lvnode { position: absolute; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; cursor: pointer; z-index: 2; }
.lvnode .exp-pill { min-width: 84px; padding: 2px 14px; text-align: center; font-size: 14px; color: #fff; border-radius: 12px;
  background: #b9b6b2; border: 2px solid #e8e6e2; }
.lvnode.reached .exp-pill { background: #2d5b86; border-color: #bfe6ff; box-shadow: 0 0 8px rgba(120,190,240,.8); }
.lvnode .lv-name { font-family: "ZhTitle"; font-size: 22px; color: #7c7873; margin-top: 2px;
  text-shadow: -1px -1px 0 #fff, 1px 1px 0 #fff, 0 0 4px #fff; }
.lvnode.reached .lv-name { color: #1d1b19; }
.lvnode.current .lv-name::after { content: " ◀"; color: #c0392b; font-size: 14px; }
.lvnode:hover .exp-pill { filter: brightness(1.15); }
.lvnode.root .exp-pill { display: none; }
.lvnode.root .disc { width: 64px; height: 64px; background: url("assets/ui/ZhiBao_TianFu2_normal.png") center / contain no-repeat; position: relative; }
.lvnode.root .disc::after { content: ""; position: absolute; inset: 22%; background: url("assets/ui/TianFu_icon.png") center / contain no-repeat; }
.tnode { position: absolute; transform: translate(-50%, -50%); width: 60px; height: 60px; cursor: pointer; z-index: 2; }
.tnode .disc { position: absolute; inset: 0; background: url("assets/ui/ZhiBao_TianFu2_disabled.png") center / contain no-repeat; transition: transform .12s; }
.tnode.on .disc { background-image: url("assets/ui/ZhiBao_TianFu2_normal.png"); }
.tnode.on .disc::after { content: ""; position: absolute; inset: 22%; background: url("assets/ui/TianFu_icon.png") center / contain no-repeat; }
.tnode:hover .disc { transform: scale(1.08); }
.tnode .label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; font-weight: bold; font-size: 14px;
  color: #7a7570; text-shadow: -1px -1px 0 #fff, 1px 1px 0 #fff, 0 0 4px #fff; }
.tnode.on .label { color: #1d1b19; }
.side-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.side-svg path { fill: none; stroke: #cfccc8; stroke-width: 3; }
.side-svg path.on { stroke: var(--line-strong); filter: drop-shadow(0 0 3px #bfe6ff); }

/* ---------------- 選擇視窗 ---------------- */
.modal { position: fixed; inset: 0; background: rgba(20,18,16,.45); display: grid; place-items: center; z-index: 20; animation: fade .15s; }
.scroll { position: relative; width: min(1180px, 94vw); aspect-ratio: 2048 / 1143; max-height: 92vh;
  background: url("assets/ui/ZaoHua_TongYong_popup.png") center / 100% 100% no-repeat; }
.scroll-inner { position: absolute; left: 17.5%; right: 5%; top: 7%; bottom: 7%; display: flex; flex-direction: column; }
.scroll .close { position: absolute; right: 2.2%; top: 3%; width: 40px; height: 42px; border: 0; z-index: 2;
  background: url("assets/ui/GuanBi_min_button_normal.png") center / contain no-repeat; }
.scroll .close:hover { background-image: url("assets/ui/GuanBi_min_button_hover.png"); }
.picker-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.picker-bar .select-wrap select { min-width: 110px; }
.count-box { margin-left: auto; font-family: "ZhTitle"; font-size: 18px; display: flex; align-items: center; gap: 4px; }
.count-box input.num { width: 110px; }
.picker-list { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; align-content: start; padding: 2px 4px; }
.prow { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent; background: rgba(255,255,255,.35); }
.prow:hover { background: rgba(255,255,255,.8); }
.prow.sel { border-color: #c9962c; background: rgba(255,236,190,.75); box-shadow: inset 0 0 0 1px #f2c94c; }
.prow .icon { width: 46px; height: 46px; }
.prow .pn { font-weight: bold; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pm { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.picker-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 8px; }
.picker-foot .hint { margin-right: auto; }

/* ---------------- 提示 ---------------- */
#tooltip { position: fixed; z-index: 30; max-width: 320px; pointer-events: none; padding: 10px 14px;
  background: rgba(30,28,26,.92); color: #f2efe8; border: 1px solid #6d6457; border-radius: 4px; font-size: 13px; line-height: 1.6; }
#tooltip h4 { margin: 0 0 4px; font-family: "ZhTitle"; font-size: 18px; font-weight: normal; color: #f2c94c; }
#toasts { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 40; pointer-events: none; }
.toast { min-width: 260px; padding: 10px 50px; text-align: center; color: #fff; font-size: 15px;
  background: url("assets/ui/HuiHeiBiaoTi_di.png") center / 100% 100% no-repeat; animation: toast 3.2s forwards; }
.toast.err { color: #ffb3a7; }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(60,50,40,.3); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 背包篩選 ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px; }
.filters .select-wrap select { height: 32px; min-width: 120px; font-size: 13px; }
.chk { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.count-line { font-size: 12px; color: var(--muted); margin: 0 0 4px 4px; }
.cell .eq.craft { color: #7fd1ff; }

/* ---------------- 煉器編輯 ---------------- */
.detail { max-height: calc(100vh - 110px); overflow: auto; }
.craft { margin-top: 14px; padding-top: 10px; border-top: 2px solid rgba(40,40,40,.55); }
.craft-title { font-family: "ZhTitle"; font-size: 22px; margin-bottom: 6px; }
.craft .kv label { font-size: 18px; }
.craft .kv .select-wrap select { min-width: 160px; height: 32px; }
input.txt { width: 170px; height: 32px; padding: 0 8px; border: 1px solid rgba(60,50,40,.3); background: rgba(255,255,255,.6); outline: none; }
input.txt:focus { background: #fff; }
.craft-sub { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; font-family: "ZhTitle"; font-size: 18px; }
.rune-list { display: flex; flex-direction: column; gap: 4px; }
.rune-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px;
  background: rgba(255,255,255,.45); border: 1px solid rgba(60,50,40,.12); border-radius: 3px; }
.rune-row .gname { font-weight: bold; }
.rune-row .rtype { font-size: 11px; color: #fff; background: #6d655c; padding: 0 6px; border-radius: 8px; margin-left: 4px; }
.rune-row .rdes { font-size: 12px; color: var(--ink-soft); }
.rune-row .del { width: 24px; height: 24px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 24px; height: 24px; border: 1px solid rgba(60,50,40,.35); background: rgba(255,255,255,.7); border-radius: 3px; padding: 0; }
.stepper button:hover { background: #fff; }
.stepper span { min-width: 38px; text-align: center; font-size: 13px; color: var(--num); }
.craft-note { margin-top: 14px; line-height: 1.7; }
.wood.blue:disabled { background-image: url("assets/ui/ZaoHua_button_TongYong_disabled.png"); color: #555; text-shadow: none; }

/* ---------------- 網頁版 / Python 版切換 ---------------- */
body.web-mode .server-only, body.server-mode .web-only, body:not(.web-mode):not(.server-mode) .web-only { display: none !important; }
.empty-box.web-only { max-width: 760px; padding: 24px 34px; background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; }
.empty-box p { line-height: 1.8; }
.path-box { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 14px 0 4px; }
.path-box code { background: rgba(40,36,32,.85); color: #f2efe6; padding: 6px 12px; border-radius: 3px; font-size: 13px; user-select: all; }
.steps { text-align: left; margin: 16px auto 8px; max-width: 600px; line-height: 1.9; color: var(--ink-soft); }
.steps code { background: rgba(0,0,0,.07); padding: 0 5px; border-radius: 2px; }
body.dragging::after { content: "放開以開啟存檔"; position: fixed; inset: 12px; border: 3px dashed #c9962c; border-radius: 8px;
  background: rgba(255,240,200,.55); display: grid; place-items: center; font-family: "ZhTitle"; font-size: 40px; color: #6b4a12; z-index: 50; pointer-events: none; }
.brand-main { letter-spacing: 2px; font-size: 40px; }
.savebar .wood { white-space: nowrap; }
#top { gap: 18px; }
.pill { min-width: 150px; }
