/* ================================================================
   《空境之上》2.8 · 主样式
================================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%; width: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: 15px;
  overflow: hidden; overscroll-behavior: none;
}
body { position: fixed; inset: 0; transition: background .3s, color .3s; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }
.hidden { display: none !important; }
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== 屏幕容器 ===== */
.screen { position: fixed; inset: 0; display: none; flex-direction: column; z-index: 10; }
.screen.active { display: flex; }

/* ===== 通用按钮 / 表单 ===== */
.btn {
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  letter-spacing: 2px; font-size: 14px; transition: background .2s, border-color .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: var(--accent); }
.btn:active { background: var(--accent-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:active { filter: brightness(.92); background: var(--accent); }
.btn-ghost { color: var(--accent); border-color: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; letter-spacing: 1px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row > .btn { flex: 1; }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 12px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 6px; }
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.6; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  outline: none; font-size: 15px; transition: border-color .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 72px; line-height: 1.6; font-size: 14px; }
.select { appearance: none; -webkit-appearance: none; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .input { flex: 1; }

/* ===== 密码门 ===== */
#gate-screen { z-index: 9999; background: var(--home-glow); align-items: center; justify-content: center; gap: 22px; padding: 24px; text-align: center; }
.gate-tag { font-size: 11px; letter-spacing: 4px; color: var(--text-muted); border: 1px solid var(--line); padding: 5px 14px; border-radius: 999px; }
.gate-title { font-family: var(--font-serif); font-size: 22px; letter-spacing: 8px; color: var(--accent); font-weight: 500; }
.gate-input { width: 240px; text-align: center; letter-spacing: 4px; }
.gate-err { font-size: 12px; color: var(--danger); height: 16px; letter-spacing: 2px; }

/* ===== 首页 ===== */
#home-screen { background: var(--home-glow); align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.home-stars { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.home-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--accent); opacity: 0; animation: twinkle ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 0; } 50% { opacity: .7; } }
.home-inner { position: relative; width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.home-tag { font-size: 11px; letter-spacing: 3px; color: var(--text-muted); border: 1px solid var(--line); padding: 4px 14px; border-radius: 999px; }
.home-title { font-family: var(--font-serif); font-size: 50px; letter-spacing: 12px; padding-left: 12px; color: var(--accent); font-weight: 600; line-height: 1.2; text-shadow: 0 0 30px var(--accent-soft); }
.home-sub { font-size: 11px; letter-spacing: 6px; color: var(--accent-2); }
.home-rule { width: 220px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.home-poem { font-family: var(--font-serif); font-size: 15px; line-height: 2.2; letter-spacing: 3px; color: var(--text-dim); }
.home-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.home-btns .btn { height: 50px; letter-spacing: 4px; }
.home-foot { display: flex; gap: 10px; justify-content: center; }
.home-credit { margin-top: -6px; font-size: 12px; letter-spacing: 3px; color: var(--text-muted); }

/* ===== 面板页（API / 建角） ===== */
.panel-screen { background: var(--bg); overflow-y: auto; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.panel { width: 100%; max-width: 460px; margin: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px 20px; box-shadow: var(--shadow); }
.panel-title { font-family: var(--font-serif); font-size: 20px; letter-spacing: 6px; color: var(--accent); text-align: center; }
.panel-sub { font-size: 11px; letter-spacing: 2px; color: var(--text-muted); text-align: center; margin: 6px 0 22px; }
.back-link { display: block; margin: 16px auto 0; background: none; border: none; color: var(--text-muted); font-size: 13px; letter-spacing: 2px; }
.back-link:hover { color: var(--accent); }

.notice { font-size: 12px; line-height: 1.7; padding: 10px 12px; border-radius: var(--radius-sm); margin-top: 12px; border: 1px solid var(--line); color: var(--text-dim); background: var(--accent-soft); }
.notice.ok { color: var(--ok); border-color: var(--ok); background: transparent; }
.notice.err { color: var(--danger); border-color: var(--danger); background: transparent; }
.notice.loading { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* 建角 */
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 20px; }
.steps i { width: 28px; height: 3px; border-radius: 2px; background: var(--surface-3); transition: background .3s; }
.steps i.on { background: var(--accent); }
.alloc-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.alloc-head b { font-family: var(--font-mono); font-size: 18px; color: var(--accent); }
.alloc-row { display: grid; grid-template-columns: 1fr 36px 44px 36px; gap: 8px; align-items: center; margin-bottom: 10px; }
.alloc-row .name { font-size: 13px; }
.alloc-row .name small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.alloc-row .val { text-align: center; font-family: var(--font-mono); font-size: 16px; color: var(--accent); }
.alloc-row .icon-btn { width: 36px; height: 36px; font-size: 18px; }
.preview-box { font-size: 13px; line-height: 1.9; color: var(--text-dim); background: var(--bg); border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--line); margin-bottom: 16px; }
.preview-box b { color: var(--text); font-weight: 500; }
.seg { display: flex; gap: 8px; }
.seg .btn { flex: 1; }
.seg .btn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ===== 游戏主界面 ===== */
#game-screen { background: var(--bg); }
.topbar {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-title { font-family: var(--font-serif); font-size: 16px; letter-spacing: 6px; color: var(--accent); font-weight: 600; }
.topbar-right { display: flex; gap: 6px; }
.dev-badge { font-size: 10px; letter-spacing: 2px; color: var(--on-accent); background: var(--accent-2); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px; }

.chips { flex-shrink: 0; display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; background: var(--bg); }
.chip { font-size: 11px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--text-dim); font-family: var(--font-mono); border: none; }
.chip b { color: var(--text); font-weight: 600; }
.chip.accent b { color: var(--accent); }
.chip.warn b { color: var(--danger); }
button.chip:hover { background: var(--surface-3); }

.story { flex: 1; overflow-y: auto; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.story-inner { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.welcome { text-align: center; padding: 18px 0 10px; }
.welcome h2 { font-family: var(--font-serif); font-size: 18px; letter-spacing: 6px; color: var(--accent); font-weight: 500; }
.welcome p { font-size: 12px; color: var(--text-muted); margin-top: 6px; letter-spacing: 1px; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }

.msg { animation: msg-in .28s ease; display: flex; flex-direction: column; gap: 10px; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.statusline { font-size: 11px; color: var(--text-muted); letter-spacing: .5px; font-family: var(--font-mono); }
.narrate { font-family: var(--font-serif); font-size: 15.5px; line-height: 1.95; color: var(--text); letter-spacing: .3px; word-break: break-word; }
.narrate p + p { margin-top: .8em; }
.narrate strong { color: var(--accent); font-weight: 600; }
.narrate .q { color: var(--accent); }
.player-msg { align-self: flex-end; max-width: 85%; font-size: 14px; line-height: 1.7; padding: 9px 13px; border-radius: 14px 14px 4px 14px; background: var(--surface-2); color: var(--text); white-space: pre-wrap; word-break: break-word; }
.event-msg { align-self: center; max-width: 92%; font-size: 12px; line-height: 1.7; padding: 7px 14px; border-radius: 999px; color: var(--text-dim); border: 1px dashed var(--line-strong); text-align: center; font-family: var(--font-mono); }
.check-line { font-size: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--line); color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--font-mono); }
.check-line .res { font-weight: 600; white-space: nowrap; }
.check-line .res.ok { color: var(--ok); }
.check-line .res.fail { color: var(--danger); }
.check-line .fix { color: var(--warn); font-size: 11px; }
.delta-line { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); line-height: 1.8; }
.delta-line .neg { color: var(--danger); }
.delta-line .pos { color: var(--ok); }
.delta-line .tag { color: var(--accent-2); }
.delta-line .warn { color: var(--warn); }
.settle-card { border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px; background: var(--accent-soft); }
.settle-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: 3px; color: var(--text-muted); margin-bottom: 10px; }
.settle-head b { font-family: var(--font-serif); font-size: 15px; color: var(--accent); letter-spacing: 2px; font-weight: 500; }
.settle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.settle-grid small { display: block; font-size: 10px; color: var(--text-muted); letter-spacing: 1px; }
.settle-grid b { font-family: var(--font-mono); font-size: 18px; color: var(--text); }
.settle-formula { font-size: 11px; color: var(--text-muted); margin-top: 10px; line-height: 1.7; font-family: var(--font-mono); }
.options { display: flex; flex-direction: column; gap: 7px; }
.opt { text-align: left; font-size: 14px; line-height: 1.6; padding: 10px 14px; border-radius: 12px; background: transparent; border: 1px solid var(--line); color: var(--text); display: flex; gap: 10px; align-items: baseline; transition: border-color .2s, background .2s; }
.opt .n { font-size: 11px; color: var(--accent); font-family: var(--font-mono); min-width: 14px; }
.opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt:disabled { opacity: .5; cursor: default; }
.barrage { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-family: var(--font-mono); }
.barrage-title { font-size: 10px; letter-spacing: 3px; color: var(--text-muted); margin-bottom: 6px; }
.barrage div { font-size: 12px; line-height: 1.9; color: var(--text-dim); }
.barrage em { font-style: normal; color: var(--accent-2); }
.error-msg { font-size: 13px; line-height: 1.7; color: var(--danger); border: 1px solid var(--danger); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; }
.retry-row { display: flex; gap: 8px; }

.typing { display: none; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); padding: 6px 16px; flex-shrink: 0; }
.typing.on { display: flex; }
.typing span.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite; }
.typing span.dot:nth-child(2) { animation-delay: .2s; }
.typing span.dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,80%,100% { transform: none; opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* 底部输入区 */
.dock { flex-shrink: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.dock-inner { max-width: 760px; margin: 0 auto; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.quick button { font-size: 12px; padding: 5px 12px; border-radius: 999px; white-space: nowrap; background: transparent; border: 1px solid var(--line); color: var(--text-dim); }
.quick button:hover { color: var(--accent); border-color: var(--accent); }
.input-row { display: flex; gap: 8px; align-items: flex-end; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 14px; transition: border-color .2s; }
.input-row:focus-within { border-color: var(--accent); }
.input-row textarea { flex: 1; border: none; outline: none; resize: none; background: transparent; color: var(--text); font-size: 15px; line-height: 1.5; padding: 6px 0; height: 34px; max-height: 120px; }
.input-row textarea::placeholder { color: var(--text-muted); }
.send-btn { height: 34px; padding: 0 16px; border-radius: 11px; border: none; background: var(--accent); color: var(--on-accent); font-size: 13px; letter-spacing: 2px; font-weight: 600; flex-shrink: 0; }
.send-btn:disabled { opacity: .45; }
.ctx-line { font-size: 10px; color: var(--text-muted); margin-top: 6px; display: flex; justify-content: space-between; font-family: var(--font-mono); }
.ctx-line.hot { color: var(--warn); }

/* ===== 左侧抽屉 ===== */
.drawer-mask { position: fixed; inset: 0; background: var(--overlay); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 86%; max-width: 340px; background: var(--surface); border-right: 1px solid var(--line); z-index: 91; transform: translateX(-102%); transition: transform .28s ease; overflow-y: auto; padding-top: env(safe-area-inset-top); box-shadow: var(--shadow); }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head b { font-family: var(--font-serif); letter-spacing: 4px; color: var(--accent); font-weight: 500; }
.sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sec-title { font-size: 11px; letter-spacing: 3px; color: var(--text-muted); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.char-name { font-family: var(--font-serif); font-size: 18px; color: var(--text); letter-spacing: 2px; }
.char-info { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.attr { display: grid; grid-template-columns: 36px 1fr 52px; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 8px; color: var(--text-dim); }
.attr .v { text-align: right; color: var(--text); font-family: var(--font-mono); }
.bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; transition: width .5s ease; }
.attr-tip { font-size: 11px; color: var(--text-muted); line-height: 1.7; margin-top: 4px; }
.free-points { margin-top: 10px; padding: 10px; border-radius: var(--radius-sm); border: 1px dashed var(--accent); font-size: 12px; color: var(--accent); display: flex; justify-content: space-between; align-items: center; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat b { display: block; font-family: var(--font-mono); font-size: 20px; color: var(--accent); }
.stat span { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-dim); }
.tag.skill { border-color: var(--accent-2); color: var(--accent-2); }
.tag.title { border-color: var(--accent); color: var(--accent); }
.tag.empty { opacity: .5; }
.menu-btn { width: 100%; padding: 13px 16px; background: none; border: none; border-bottom: 1px solid var(--line); color: var(--text-dim); font-size: 14px; letter-spacing: 2px; text-align: left; display: flex; gap: 12px; align-items: center; }
.menu-btn:hover { color: var(--accent); background: var(--accent-soft); }
.menu-btn .ico { width: 18px; text-align: center; }
.menu-btn .aside { margin-left: auto; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.term-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.term-grid button { padding: 12px 4px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); color: var(--text-dim); font-size: 12px; }
.term-grid button:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 底部抽屉面板（背包 / 记忆 / 存档 / 兑换） ===== */
.sheet-mask { position: fixed; inset: 0; background: var(--overlay); z-index: 120; display: none; align-items: flex-end; justify-content: center; }
.sheet-mask.open { display: flex; }
.sheet { width: 100%; max-width: 620px; max-height: 88vh; background: var(--surface); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: none; display: flex; flex-direction: column; animation: sheet-in .25s ease; box-shadow: var(--shadow); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-family: var(--font-serif); font-weight: 500; font-size: 17px; letter-spacing: 4px; color: var(--accent); }
.sheet-body { overflow-y: auto; padding: 14px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .sheet-mask { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); }
}

.tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--bg); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; height: 34px; border-radius: 9px; border: none; background: transparent; color: var(--text-dim); font-size: 13px; letter-spacing: 1px; }
.tabs button.on { background: var(--surface-3); color: var(--accent); font-weight: 600; }

/* 背包 */
.bag-note { font-size: 12px; line-height: 1.7; color: var(--text-muted); margin-bottom: 12px; }
.bag-list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.item-name { font-size: 14px; color: var(--text); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item-name .qty { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.item-desc { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.item-acts { display: flex; gap: 6px; align-items: center; }
.tier-dot { font-size: 10px; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; font-family: var(--font-mono); }
.tier-common { color: var(--tier-common); }
.tier-rare { color: var(--tier-rare); }
.tier-limited { color: var(--tier-limited); }
.empty-hint { text-align: center; color: var(--text-muted); font-size: 13px; padding: 26px 0; }

/* 存档位 */
.slot { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); margin-bottom: 8px; }
.slot-no { font-family: var(--font-mono); font-size: 18px; color: var(--accent); width: 30px; text-align: center; }
.slot-main { flex: 1; min-width: 0; }
.slot-name { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 3px; }
.slot.empty .slot-name { color: var(--text-muted); }
.slot-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.slot.auto { border-style: dashed; }
.io-row { display: flex; gap: 8px; margin-top: 14px; }
.io-row .btn { flex: 1; }

/* 记忆 */
.mem-stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.mem-block { margin-bottom: 14px; }
.mem-block h4 { font-size: 12px; letter-spacing: 2px; color: var(--text-dim); font-weight: 500; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.mem-summary { margin-bottom: 8px; }
.mem-summary .meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 4px; display: flex; justify-content: space-between; }
.mem-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.mem-list li { font-size: 13px; line-height: 1.6; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; }
.mem-list li .x { background: none; border: none; color: var(--text-muted); font-size: 14px; }
.mem-list li .x:hover { color: var(--danger); }

/* ===== 模态框 ===== */
.modal-mask { position: fixed; inset: 0; background: var(--overlay); z-index: 300; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal-mask.open { display: flex; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px 18px; box-shadow: var(--shadow); animation: sheet-in .2s ease; max-height: 86vh; overflow-y: auto; }
.modal h3 { font-family: var(--font-serif); font-weight: 500; font-size: 17px; letter-spacing: 3px; color: var(--accent); margin-bottom: 12px; }
.modal-body { font-size: 14px; line-height: 1.85; color: var(--text-dim); white-space: pre-wrap; }
.modal-body .input { margin-top: 10px; }

/* ===== 提示 / 加载 ===== */
.toasts { position: fixed; top: calc(62px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; width: 90%; max-width: 360px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-strong); font-size: 13px; color: var(--text); text-align: center; box-shadow: var(--shadow); animation: toast-in .25s ease, toast-out .3s ease 2.7s forwards; }
.toast.err { border-color: var(--danger); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; } }
.loading { position: fixed; inset: 0; z-index: 400; background: var(--overlay); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.loading.on { display: flex; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 12px; letter-spacing: 3px; color: var(--text-dim); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
