:root{
  --bg:#14161c; --panel:#1d212b; --panel2:#232836; --line:#2f3646;
  --txt:#e7ecf5; --dim:#98a2b3; --accent:#c9a227; --ok:#3fa16a; --bad:#d9564a;
  --radius:12px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--txt);font:15px/1.55 -apple-system,"PingFang SC","Microsoft YaHei",system-ui,sans-serif}
#app{max-width:1100px;margin:0 auto;padding:14px 14px 90px}
h1,h2,h3{margin:0 0 10px;font-weight:650}
h1{font-size:20px}h2{font-size:17px}h3{font-size:15px}
button{font:inherit;color:inherit;background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:8px 12px;min-height:38px;cursor:pointer}
button:hover{border-color:#46506a}
button.primary{background:var(--accent);color:#1b1600;border-color:#a5821f;font-weight:650}
button.ghost{background:transparent}
button.danger{color:#ffb4ab;border-color:#5a2d2a}
input,select,textarea{font:inherit;color:inherit;background:#11141a;border:1px solid var(--line);border-radius:9px;padding:8px 10px;width:100%;min-height:38px}
textarea{min-height:80px;resize:vertical}
label{display:block;font-size:13px;color:var(--dim);margin:0 0 4px}
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:14px;margin:0 0 12px}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row>*{flex:1 1 180px;min-width:0}
.grid{display:grid;gap:10px}
.muted{color:var(--dim);font-size:13px}
.small{font-size:12.5px}
.topbar{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-bottom:12px}
.topbar .grow{flex:1}
.pill{display:inline-block;padding:2px 8px;border-radius:99px;background:#2b3142;font-size:12px;color:var(--dim)}
.chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:99px;border:1px solid var(--line);background:var(--panel2);cursor:pointer;user-select:none;min-height:38px}
.chip.on{border-color:var(--accent);background:#332b12;color:#ffdf8a}
.pips{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0}
.pip{width:34px;height:34px;border-radius:10px;border:1px solid var(--line);background:#10131a;display:flex;align-items:center;justify-content:center;color:#5b6478;cursor:pointer;touch-action:manipulation}
.pip.hp{background:#261515;border-color:#4a2424}
.pip.stress{background:#221a31;border-color:#3b2f55}
.pip.armor{background:#151d30;border-color:#2a3a5c}
.pip.hope{background:#272112;border-color:#4a3f1c}
.pip.on.hp{background:#4a1d1d;border-color:#ff8a7a;color:#ffb4ab}
.pip.on.stress{background:#33234a;border-color:#c0a9ff;color:#d6c6ff}
.pip.on.armor{background:#1f2a4a;border-color:#a9b6ff;color:#c6d2ff}
.pip.on.hope{background:#3a3115;border-color:#ffd76a;color:#ffdf8a}
.pip.scar{border-style:dashed;border-color:#7a3b36;color:#ff6b6b;background:#1b1212}
.em{color:#ffd76a;font-weight:700}
i{color:inherit;opacity:.95}
.tabs a{padding:8px 10px;border-radius:9px;border:1px solid var(--line);background:var(--panel2);color:inherit;text-decoration:none;white-space:nowrap;font-size:14px}
.tabs a:hover{border-color:#46506a}
.hope{display:flex;flex-wrap:wrap;gap:6px}
.hope .pip.on{background:var(--accent);border-color:#ffe08a}
.stat{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px dashed #262c3a}
.stat:last-child{border-bottom:0}
.stat b{font-weight:650}
.tabs{display:flex;gap:8px;margin:0 0 12px;overflow:auto}
.tabs button{white-space:nowrap}
.tabs button.on{background:var(--accent);color:#1b1600;border-color:#a5821f}
.list-item{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid #262c3a}
.list-item:last-child{border-bottom:0}
.dcard{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin:6px 0}
.dcard .t{display:flex;justify-content:space-between;gap:8px}
.dcard .t b{cursor:pointer}
.dcard .t b:hover{color:var(--accent)}
.hint{padding:8px 10px;border-left:3px solid var(--accent);background:#241f10;border-radius:6px;font-size:13px;margin:8px 0}
.warn{border-left-color:var(--bad);background:#2a1614}
.toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);background:#000c;padding:9px 14px;border-radius:10px;opacity:0;pointer-events:none;transition:.2s;z-index:50;max-width:90vw}
.toast.show{opacity:1}
.modal{position:fixed;inset:0;background:#000a;display:flex;align-items:flex-end;justify-content:center;z-index:40}
@media(min-width:700px){.modal{align-items:center}}
.modal .sheet{background:var(--panel);border-radius:16px 16px 0 0;max-width:640px;width:100%;max-height:86vh;overflow:auto;padding:16px}
@media(min-width:700px){.modal .sheet{border-radius:16px;max-height:80vh}}
.mono{font-family:ui-monospace,Consolas,monospace}
.tag{font-size:11.5px;padding:1px 7px;border-radius:99px;background:#2b3142;color:var(--dim)}
.divider{height:1px;background:#262c3a;margin:12px 0}
.sticky{position:sticky;bottom:0;background:linear-gradient(180deg,#14161c00,#14161c 30%);padding:12px 0 6px;display:flex;gap:10px}
.sticky button{flex:1}
@media(max-width:520px){.row>*{flex-basis:100%}}

/* 属性卡 */
.attr{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:8px}
.attr-head{display:flex;justify-content:space-between;align-items:center;font-size:14px}
.attr-row{display:flex;gap:6px;align-items:center;margin-top:6px}
.attr-row button{min-height:32px;padding:4px 10px}
.attr-val{flex:1;text-align:center;font-weight:700;font-size:17px}
.attr-row input{width:64px;min-height:32px}
/* 升级格子 */
.box-row{display:flex;gap:10px;align-items:center;margin:10px 0}
.box-label{flex:1;font-size:13.5px;color:var(--dim);line-height:1.35}
.boxes{display:flex;gap:8px;flex-shrink:0}
.box{width:30px;height:30px;border-radius:6px;border:1px solid var(--line);background:#10131a;display:flex;align-items:center;justify-content:center;color:#1b1600;font-weight:700;cursor:pointer;user-select:none}
.box.on{background:var(--accent);border-color:#a5821f}
/* 特性块 */
.feat{margin:8px 0}
.feat-name{color:#ffd76a;font-weight:700;font-size:13.5px}
.feat-body{color:var(--dim);font-size:13px;margin-top:2px;white-space:pre-wrap;line-height:1.55}
