/* ============================================================
   问道 · 长生
   ============================================================ */

:root {
  --r-lg: 18px;
  --r: 13px;
  --r-sm: 9px;
  --font-ui: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-serif: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", "SimSun", serif;
  --font-read: "Songti SC", "SimSun", "STSong", serif;
  --read-size: 17px;
  --read-lh: 2.0;
  --font-num: "Georgia", "Times New Roman", serif;
  --shadow: 0 10px 34px rgba(0, 0, 0, .32);
}

[data-theme="ink"] {
  --bg: #0E1512; --bg-2: #111A16; --card: #16211C; --card-2: #1B2822;
  --line: #24332C; --line-2: #2E4139;
  --text: #D6E0D9; --text-dim: #90A498; --text-faint: #5F7268;
  --accent: #7FD1AE; --accent-2: #4E8F76; --gold: #C9A961;
  --danger: #D9736A; --warn: #D9A05B; --glow: rgba(127, 209, 174, .16);
}

[data-theme="void"] {
  --bg: #060808; --bg-2: #0A0D0C; --card: #0E1211; --card-2: #131918;
  --line: #1C2422; --line-2: #27312E;
  --text: #C9D2CC; --text-dim: #808E86; --text-faint: #4F5D57;
  --accent: #6FBF9C; --accent-2: #3F7F68; --gold: #B99A55;
  --danger: #C96A62; --warn: #C89052; --glow: rgba(111, 191, 156, .14);
}

[data-theme="bamboo"] {
  --bg: #EDF2EC; --bg-2: #E4EBE4; --card: #FFFFFF; --card-2: #F6FAF5;
  --line: #D5E0D4; --line-2: #C2D2C1;
  --text: #22302A; --text-dim: #5B6F64; --text-faint: #8B9C92;
  --accent: #3E7A63; --accent-2: #2E5E4B; --gold: #9A7B35;
  --danger: #B4544A; --warn: #A8722F; --glow: rgba(62, 122, 99, .12);
  --shadow: 0 8px 24px rgba(34, 48, 42, .10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  overflow: hidden;
  transition: background .25s, color .25s;
}

[data-theme="ink"] body {
  background: radial-gradient(1200px 620px at 50% -10%, rgba(127, 209, 174, .05), transparent 70%), var(--bg);
}
[data-theme="void"] body {
  background: radial-gradient(900px 520px at 50% -20%, rgba(111, 191, 156, .045), transparent 70%), var(--bg);
}

#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* ---------------- 开局 ---------------- */

#screen-create { overflow-y: auto; padding: 0 16px calc(40px + env(safe-area-inset-bottom)); }
#screen-auth, #screen-library, #screen-key {
  overflow-y: auto; padding: 0 16px calc(36px + env(safe-area-inset-bottom));
}
.create-wrap { width: 100%; max-width: 620px; margin: 0 auto; padding-top: max(38px, env(safe-area-inset-top)); }
.lib-wrap { max-width: 560px; }

/* 书库 */
.lib-top { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }
.lib-wrap .brand { margin-bottom: 20px; }
.save-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.save-row .sr-main { flex: 1; min-width: 0; }
.save-row .sr-name {
  font-family: var(--font-serif); font-size: 16px; letter-spacing: .06em; color: var(--text);
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
}
.save-row .sr-realm { font-size: 11.5px; color: var(--gold); letter-spacing: .1em; }
.save-row .sr-meta { font-size: 12px; color: var(--text-faint); margin-top: 5px; letter-spacing: .03em; }
.save-row .sr-btns { display: flex; gap: 6px; flex: 0 0 auto; }

.brand { text-align: center; margin-bottom: 28px; }
.brand-sub { font-size: 11px; letter-spacing: .34em; color: var(--text-faint); margin-bottom: 14px; }
.brand h1 {
  font-family: var(--font-serif); font-size: 56px; font-weight: 400; letter-spacing: .3em;
  margin: 0 0 12px; color: var(--text); text-indent: .3em;
}
.brand-desc { color: var(--text-dim); font-family: var(--font-serif); font-size: 15px; letter-spacing: .1em; margin: 0; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px;
}
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-hd h2 {
  font-family: var(--font-serif); font-size: 17px; font-weight: 400;
  letter-spacing: .16em; margin: 0; color: var(--gold);
}

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label {
  display: block; font-size: 11.5px; letter-spacing: .18em;
  color: var(--text-faint); margin-bottom: 7px;
}
.field-label { margin-top: 0; }

.hint { font-size: 12.5px; color: var(--text-dim); line-height: 1.75; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text); font-family: inherit;
  font-size: 15px; padding: 10px 12px; outline: none;
  transition: border-color .18s, box-shadow .18s; appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--glow);
}
textarea { resize: vertical; line-height: 1.8; }

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%),
                    linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
option { background: var(--bg-2); color: var(--text); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text-dim); font-size: 14px;
  cursor: pointer; transition: all .18s; user-select: none;
}
.chip:hover { border-color: var(--accent-2); color: var(--text); }
.chip.on { background: var(--glow); border-color: var(--accent); color: var(--accent); }
.chip.small { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.chip.gold { border-color: rgba(201, 169, 97, .5); color: var(--gold); }
.chip:disabled { opacity: .35; cursor: default; }

.slider-row { margin-bottom: 16px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; margin-bottom: 6px; color: var(--text-dim); }
.slider-head b { color: var(--accent); font-weight: 500; }

input[type="range"] { -webkit-appearance: none; width: 100%; height: 3px; border-radius: 2px; background: var(--line-2); outline: none; margin: 8px 0; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent-2); cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  font-family: inherit; font-size: 14.5px; padding: 10px 18px;
  border-radius: var(--r-sm); cursor: pointer; transition: all .18s; user-select: none;
}
.btn:hover { border-color: var(--accent-2); background: var(--card-2); }
.btn:active { transform: scale(.985); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent; color: #0A1410; font-weight: 600; letter-spacing: .08em;
}
[data-theme="bamboo"] .btn.primary { color: #F4F9F5; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); padding: 5px 9px; font-size: 13px; }
.btn.ghost:hover { color: var(--accent); background: var(--glow); }
.btn.danger { color: var(--danger); border-color: rgba(217, 115, 106, .35); }
.btn.block { width: 100%; padding: 15px; font-size: 15.5px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.rowbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.result-actions { display: flex; gap: 9px; align-items: center; }

/* ---------------- 主界面 ---------------- */

.game-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .game-layout { grid-template-columns: minmax(0, 1fr) 400px; } }

.game-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }

.hud {
  flex: 0 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, var(--bg-2), transparent);
  border-bottom: 1px solid var(--line);
}
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.hud-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; }
.hud-name h2 {
  font-family: var(--font-serif); font-size: 19px; font-weight: 400;
  letter-spacing: .08em; margin: 0; white-space: nowrap;
}
.hud-realm {
  font-size: 12px; color: var(--gold); border: 1px solid rgba(201, 169, 97, .3);
  border-radius: 999px; padding: 1px 9px; white-space: nowrap; flex: 0 0 auto;
}
.hud-loc {
  font-size: 11.5px; color: var(--text-faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 34vw;
}
.hud-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-dim); flex: 0 0 auto; }
.hud-stats b { color: var(--text); font-family: var(--font-num); font-weight: 500; font-size: 13px; }
.low, .hud-stats .low, b.low { color: var(--danger) !important; }

.bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .55s cubic-bezier(.2, .8, .3, 1);
}
.bar-fill.gold { background: linear-gradient(90deg, #8E7434, var(--gold)); }
.bar-fill.red { background: linear-gradient(90deg, #7A342E, var(--danger)); }
.bar-meta {
  display: flex; justify-content: space-between; font-size: 10.5px;
  color: var(--text-faint); margin-top: 5px; letter-spacing: .05em; font-family: var(--font-num);
}
.decay-note {
  margin-top: 7px; font-size: 11.5px; color: var(--warn);
  font-family: var(--font-serif); letter-spacing: .08em; opacity: .85;
}

/* 舞台 */

.stage { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px 16px 30px; overscroll-behavior: contain; }
.stage-inner { max-width: 700px; margin: 0 auto; }

.scene-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--text-faint); font-size: 11.5px; letter-spacing: .18em; }
.scene-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

.narr {
  font-family: var(--font-read); font-size: var(--read-size); line-height: var(--read-lh);
  color: var(--text); letter-spacing: .02em; white-space: pre-wrap; word-break: break-word;
}
.narr + .narr { margin-top: 18px; }
.narr.dim { color: var(--text-dim); font-size: calc(var(--read-size) - 1.5px); }

.sysline {
  font-size: 12px; color: var(--accent); letter-spacing: .12em; margin: 16px 0;
  display: flex; align-items: center; gap: 10px;
}
.sysline::before, .sysline::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.thinking-head { font-size: 12px; letter-spacing: .2em; color: var(--text-faint); margin-bottom: 14px; }

/* 草稿 */

.draft-card {
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  padding: 16px 16px 14px; position: relative; overflow: hidden;
}
.draft-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
}
.draft-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.draft-tag {
  font-size: 10.5px; letter-spacing: .2em; color: var(--gold);
  border: 1px solid rgba(201, 169, 97, .4); border-radius: 4px; padding: 1px 7px;
}
.draft-yrs { margin-left: auto; font-family: var(--font-num); font-size: 13px; color: var(--text-dim); }

.warn-banner {
  background: rgba(217, 160, 91, .1); border: 1px solid rgba(217, 160, 91, .3);
  color: var(--warn); font-size: 12.5px; line-height: 1.7;
  border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 12px;
}

.draft-text {
  font-family: var(--font-read);
  font-size: var(--read-size);
  line-height: var(--read-lh);
  letter-spacing: .02em;
  min-height: 200px;
}
.draft-sum { font-size: 13px; }
.draft-sum-view { color: var(--text-dim); font-size: 12.5px; line-height: 1.7; }

.eff-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.eff-chip {
  font-size: 11.5px; font-family: var(--font-num); color: var(--text-dim);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px;
}
.eff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.eff-cell { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-faint); letter-spacing: .1em; }
.eff-cell input { padding: 7px 9px; font-size: 13.5px; font-family: var(--font-num); }

.draft-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* 输入区 */

.composer {
  flex: 0 0 auto; border-top: 1px solid var(--line);
  background: var(--bg-2); padding: 10px 12px 8px;
}
.composer-inner { max-width: 760px; margin: 0 auto; }
.composer-box { display: flex; gap: 8px; align-items: flex-end; }
.composer-input {
  flex: 1; min-height: 42px; max-height: 120px; resize: none;
  padding: 10px 12px; font-size: 14.5px; line-height: 1.55;
  border-radius: var(--r); overflow-y: auto;
}
.send-btn { flex: 0 0 auto; height: 42px; padding: 0 18px; }

.quick-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick-row .chip { background: transparent; border-color: var(--line); }

.act-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.act-btn {
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
  font-family: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 8px;
  cursor: pointer; transition: all .16s; white-space: nowrap; max-width: 46vw;
  overflow: hidden; text-overflow: ellipsis;
}
.act-btn:hover:not(:disabled) { border-color: var(--accent-2); color: var(--text); background: var(--card); }
.act-btn:disabled { opacity: .32; cursor: default; }
.act-btn.go {
  color: var(--accent); border-color: var(--accent-2); background: var(--glow);
  font-weight: 600; letter-spacing: .18em; padding: 5px 18px;
}
.act-btn.go:hover:not(:disabled) { background: var(--accent-2); color: #0A1410; }
.act-btn.gold { color: var(--gold); border-color: rgba(201, 169, 97, .45); }
.act-btn.warn { color: var(--warn); border-color: rgba(217, 160, 91, .4); }

/* 底部标签 */

.tabbar {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line); background: var(--bg-2);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 0 6px; background: none; border: none; color: var(--text-faint);
  font-family: inherit; font-size: 10.5px; letter-spacing: .08em; cursor: pointer;
}
.tabbar button .ti { font-size: 15px; line-height: 1.2; }
.tabbar button.on { color: var(--accent); }
@media (min-width: 1080px) { .tabbar { display: none; } }

/* ---------------- 面板 ---------------- */

.panel { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border-left: 1px solid var(--line); }

@media (max-width: 1079px) {
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; height: 88dvh; z-index: 60;
    border-left: none; border-top: 1px solid var(--line-2);
    border-radius: 20px 20px 0 0; box-shadow: 0 -18px 50px rgba(0, 0, 0, .45);
    transform: translateY(101%); transition: transform .3s cubic-bezier(.2, .8, .3, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .panel.open { transform: translateY(0); }
}

.panel-grip { display: none; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 9px auto 2px; flex: 0 0 auto; }
@media (max-width: 1079px) { .panel-grip { display: block; cursor: pointer; } }

.panel-tabs { flex: 0 0 auto; display: flex; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.panel-tabs button {
  flex: 1; background: none; border: none; color: var(--text-faint);
  font-family: inherit; font-size: 12.5px; letter-spacing: .08em; padding: 8px 2px;
  border-radius: var(--r-sm); cursor: pointer; white-space: nowrap;
}
.panel-tabs button.on { color: var(--accent); background: var(--glow); }

.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 30px; overscroll-behavior: contain; }

.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 55;
  opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px);
}
.scrim.show { opacity: 1; pointer-events: auto; }

.sec { margin-bottom: 20px; }
.sec-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec-hd h3 {
  font-family: var(--font-serif); font-size: 14px; font-weight: 400;
  letter-spacing: .16em; color: var(--text-dim); margin: 0;
}

.meta-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); color: var(--text-dim); }
.meta-line:last-child { border-bottom: none; }
.meta-line b { color: var(--text); font-weight: 500; font-family: var(--font-num); }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; }
.stat-box .k { font-size: 11px; color: var(--text-faint); letter-spacing: .12em; }
.stat-box .v { font-size: 18px; font-family: var(--font-num); color: var(--text); }
.stat-box .v.sm { font-size: 14px; }
.stat-box .v small { font-size: 11px; color: var(--text-faint); }

/* 认知行 */

.know-row {
  display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px;
  border-radius: 7px; cursor: pointer; transition: background .15s;
}
.know-row:hover { background: var(--card); }
.know-row.dim { opacity: .45; }
.know-lv {
  flex: 0 0 auto; font-family: var(--font-num); font-size: 10.5px; color: var(--accent);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; line-height: 1.7;
}
.know-claim { flex: 1; font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.know-year { flex: 0 0 auto; font-family: var(--font-num); font-size: 10.5px; color: var(--text-faint); }

/* 地区卡 */

.ring-label {
  font-family: var(--font-serif); font-size: 12px; letter-spacing: .2em;
  color: var(--text-faint); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px;
}
.ring-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

.region-card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .16s, transform .16s;
}
.region-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.region-card.at { border-color: var(--accent-2); background: linear-gradient(180deg, var(--glow), var(--card)); }
.region-card.unknown { opacity: .45; border-style: dashed; }

.rc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.rc-name { font-size: 14px; color: var(--text); }
.rc-mark {
  font-size: 10.5px; padding: 0 6px; border-radius: 4px; line-height: 1.7;
  border: 1px solid currentColor; color: var(--text-faint);
}
.rc-days { margin-left: auto; font-family: var(--font-num); font-size: 11.5px; color: var(--text-faint); }
.rc-desc { font-size: 12px; color: var(--text-faint); line-height: 1.6; }
.rc-meta { font-size: 10.5px; color: var(--text-faint); opacity: .7; margin-top: 4px; letter-spacing: .06em; }

.region-card.st-ruined { background: var(--bg-2); border-style: dashed; }
.region-card.st-ruined .rc-name { color: var(--text-faint); text-decoration: line-through; }
.region-card.st-ruined .rc-mark { color: var(--text-faint); }
.region-card.st-occupied { border-color: rgba(217, 115, 106, .45); }
.region-card.st-occupied .rc-mark { color: var(--danger); }
.region-card.st-occupied .rc-name { color: var(--danger); }
.region-card.st-deadqi { opacity: .6; }
.region-card.st-deadqi .rc-mark { color: var(--warn); }
.region-card.st-sealed { border-style: dashed; }
.region-card.st-sealed .rc-mark { color: var(--warn); }
.region-card.st-contested { border-color: var(--gold); }
.region-card.st-contested .rc-mark { color: var(--gold); }

/* 人物 */

.person {
  display: flex; gap: 11px; padding: 11px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--card); margin-bottom: 8px;
  cursor: pointer; transition: border-color .16s;
}
.person:hover { border-color: var(--line-2); }
.person.dead { opacity: .45; }
.avatar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 16px;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--accent-2);
}
.person-main { flex: 1; min-width: 0; }
.person-name { display: flex; align-items: baseline; gap: 6px; font-size: 14px; margin-bottom: 2px; flex-wrap: wrap; }
.person-name b { font-weight: 500; }
.person-name .tag {
  font-size: 10px; color: var(--text-faint); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 0 5px; line-height: 1.6;
}
.person-name .tag.bad { color: var(--danger); border-color: rgba(217, 115, 106, .4); }
.person-desc {
  font-size: 11.5px; color: var(--text-faint); line-height: 1.55;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rel-line { display: flex; gap: 9px; font-size: 11px; color: var(--text-faint); margin-top: 5px; font-family: var(--font-num); flex-wrap: wrap; }
.rel-line .dot { color: var(--accent-2); }
.unaware { color: var(--warn); }

/* 行囊 */

.item-card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .16s;
}
.item-card:hover { border-color: var(--line-2); }
.ic-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ic-name { font-size: 14px; color: var(--text); }
.ic-grade {
  font-size: 10px; color: var(--gold); border: 1px solid rgba(201, 169, 97, .4);
  border-radius: 4px; padding: 0 5px; line-height: 1.6;
}
.ic-kind { font-size: 10px; color: var(--text-faint); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; line-height: 1.6; }
.ic-qty { font-family: var(--font-num); font-size: 11px; color: var(--text-faint); }
.ic-dot {
  margin-left: auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px rgba(201, 169, 97, .5);
}
.ic-desc { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; line-height: 1.6; }
.ic-mem {
  font-family: var(--font-serif); font-size: 12.5px; color: var(--text-dim);
  margin-top: 6px; padding-left: 9px; border-left: 2px solid var(--line-2);
  line-height: 1.8;
}

/* 外貌 */

.slider-head b { font-family: var(--font-num); }

.person.self {
  border-color: rgba(201, 169, 97, .5);
  background: linear-gradient(180deg, rgba(201, 169, 97, .10), var(--card));
}
.person.self .avatar {
  border-color: rgba(201, 169, 97, .55);
  color: var(--gold);
}
.person-name .tag.gold { color: var(--gold); border-color: rgba(201, 169, 97, .45); }

/* 经历条目 */
.ms-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px dashed var(--line);
  font-size: 12.5px; color: var(--text-dim);
}
.ms-row:last-child { border-bottom: none; }
.ms-age {
  flex: 0 0 auto; font-family: var(--font-num); font-size: 11px;
  color: var(--gold); opacity: .85; min-width: 36px;
}
.ms-text { flex: 1; }

.person-now {
  font-size: 11.5px; line-height: 1.6; color: var(--text-dim);
  margin-top: 3px; opacity: .9;
}

/* 文风卡片 */
.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.style-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); color: var(--text-dim); font-family: inherit;
  cursor: pointer; transition: all .16s; text-align: left;
}
.style-card b { font-size: 13.5px; font-weight: 500; color: var(--text); }
.style-card span { font-size: 11px; color: var(--text-faint); }
.style-card:hover { border-color: var(--accent-2); }
.style-card.on { border-color: var(--accent); background: var(--glow); }
.style-card.on b { color: var(--accent); }

.btn.small { padding: 4px 12px; font-size: 12.5px; }

.promote-card {
  border: 1px solid rgba(201, 169, 97, .45);
  background: linear-gradient(180deg, rgba(201, 169, 97, .10), transparent);
  border-radius: var(--r); padding: 10px 12px; margin-bottom: 16px;
}
.promote-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.promote-row + .promote-row { margin-top: 8px; }
.promote-text {
  flex: 1; min-width: 180px; font-size: 12.5px; line-height: 1.6;
  color: var(--text-dim);
}

/* 秘境 / 丹房卡片 */
.rift-card {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; margin-bottom: 10px; background: var(--card);
}
.rift-hd { display: flex; align-items: center; gap: 8px; }
.rift-hd b { font-size: 13.5px; color: var(--text); font-weight: 500; }

.unk-card {
  border: 1px dashed var(--line); border-radius: var(--r);
  padding: 10px 12px; margin-top: 12px; background: rgba(255,255,255,.015);
}

.act-btn.hook { border-color: rgba(201,169,97,.35); color: var(--gold); }

/* 卷头 */
.vol-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 10px; margin: 14px 0 8px;
  border-bottom: 1px solid var(--line); cursor: pointer;
  user-select: none;
}
.vol-head:hover { background: rgba(255,255,255,.02); }
.vol-mark { color: var(--accent); font-size: 11px; width: 12px; }
.vol-name { font-family: var(--font-serif); font-size: 14px; color: var(--gold); letter-spacing: .1em; }
.vol-meta { margin-left: auto; font-family: var(--font-num); font-size: 11px; color: var(--text-faint); }
.vol-sum {
  font-size: 12px; line-height: 1.8; color: var(--text-dim);
  padding: 0 10px 10px 31px; border-bottom: 1px dashed var(--line);
}

/* 随身物品 */
.item-row { padding: 6px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: rgba(255,255,255,.02); }
.item-row .meta-line { border-bottom: none; padding: 0; }
.item-desc {
  font-size: 11.5px; line-height: 1.65; color: var(--text-faint);
  padding: 2px 0 0 0; margin-top: 1px;
}

.item-use { font-size: 11px; line-height: 1.6; color: var(--accent); opacity: .72; margin-top: 1px; }

.stat-help {
  font-size: 11px; line-height: 1.6; color: var(--text-faint);
  margin: -3px 0 9px; opacity: .85;
}
.stat-box .stat-help { margin: 4px 0 0; }

/* 目录 */

.vol {
  font-family: var(--font-serif); font-size: 12.5px; letter-spacing: .2em;
  color: var(--text-faint); margin: 18px 0 8px; display: flex; align-items: center; gap: 10px;
}
.vol::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

.turn { display: flex; gap: 10px; padding: 10px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; }
.turn:hover { background: var(--card); border-color: var(--line); }
.turn-no { flex: 0 0 auto; font-family: var(--font-num); font-size: 11px; color: var(--text-faint); padding-top: 2px; min-width: 22px; }
.turn-main { flex: 1; min-width: 0; }
.turn-title { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.turn-title .lock { font-size: 10px; color: var(--gold); }
.turn-title .yrs { font-family: var(--font-num); font-size: 10.5px; color: var(--text-faint); }
.turn-input { font-size: 11.5px; color: var(--gold); opacity: .75; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-sum { font-size: 12px; color: var(--text-faint); line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.turn-input-lg {
  font-family: var(--font-read); font-size: calc(var(--read-size) - 2.5px); color: var(--gold);
  margin-bottom: 12px; padding-left: 10px; border-left: 2px solid rgba(201, 169, 97, .4);
}

/* 设定 */

.theme-row { display: flex; gap: 10px; }
.theme-swatch {
  flex: 1; border-radius: var(--r); border: 2px solid transparent;
  padding: 9px; cursor: pointer; text-align: center; font-size: 12px; transition: all .18s;
}
.theme-swatch.on { border-color: var(--accent); }
.theme-swatch .sw { height: 32px; border-radius: 7px; border: 1px solid rgba(128, 128, 128, .25); margin-bottom: 6px; }
.sw-ink { background: linear-gradient(135deg, #0E1512, #1B2822 60%, #7FD1AE); }
.sw-void { background: linear-gradient(135deg, #050706, #131918 60%, #6FBF9C); }
.sw-bamboo { background: linear-gradient(135deg, #EDF2EC, #D5E0D4 60%, #3E7A63); }

.lore-card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
}
.lore-card:hover { border-color: var(--line-2); }
.lore-hd { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.lore-hd b { font-size: 13px; font-weight: 500; }
.lore-type { font-size: 10px; color: var(--accent-2); border: 1px solid var(--line-2); padding: 0 6px; border-radius: 4px; line-height: 1.7; }
.lore-type.gold { color: var(--gold); border-color: rgba(201, 169, 97, .4); }
.lore-body { font-size: 12px; color: var(--text-dim); line-height: 1.65; }
.lore-keys { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.k { font-size: 10px; color: var(--text-faint); background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }

.toggle-row { margin-bottom: 12px; }
.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.empty { text-align: center; padding: 30px 14px; color: var(--text-faint); font-size: 13px; font-family: var(--font-serif); letter-spacing: .1em; }

.tiny { font-size: 11.5px; color: var(--text-faint); line-height: 1.7; }
.split { height: 1px; background: var(--line); margin: 14px 0; }

/* Toast / Modal */

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px);
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
  box-shadow: var(--shadow); max-width: 86vw; text-align: center; line-height: 1.5;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal-root {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px);
}
.modal-root.show { display: flex; }
.modal {
  width: 100%; max-width: 560px; max-height: 86dvh; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
  animation: pop .24s cubic-bezier(.2, .8, .3, 1) both;
}
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.modal-hd h3 { margin: 0; font-family: var(--font-serif); font-size: 16px; font-weight: 400; letter-spacing: .1em; color: var(--gold); }
.modal-body { padding: 15px 17px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-ft { display: flex; gap: 9px; justify-content: flex-end; padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }

@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: rise .38s cubic-bezier(.2, .8, .3, 1) both; }

.epitaph { text-align: center; padding: 24px 8px 10px; }
.epitaph h2 {
  font-family: var(--font-serif); font-size: 28px; font-weight: 400;
  letter-spacing: .3em; color: var(--gold); margin: 0 0 16px; text-indent: .3em;
}
.bio {
  font-family: var(--font-read); font-size: calc(var(--read-size) - 1.5px); line-height: var(--read-lh); color: var(--text-dim);
  text-align: left; white-space: pre-wrap; border-left: 2px solid var(--line-2);
  padding-left: 15px; margin: 20px 0;
}

@media (max-width: 420px) {
  .eff-grid { grid-template-columns: repeat(2, 1fr); }
  .hud-loc { display: none; }
  .brand h1 { font-size: 46px; }
}
