/* ============================================================
   朝圣仙门 — 设计系统
   水墨仙侠 × 系统面板：墨夜星野 / 玉简暗青 / 帝王金 / 灵光青 / 朱砂
   ============================================================ */

:root {
  /* 色 */
  --bg: #070a12;
  --bg2: #0b1220;
  --panel: #0f1a24;
  --panel-2: #121f2b;
  --gold: #e8b45a;
  --gold-soft: #f4d9a3;
  --gold-deep: #b8862f;
  --gold-dim: rgba(232, 180, 90, .16);
  --cyan: #63e6d5;
  --cyan-dim: rgba(99, 230, 213, .14);
  --cinnabar: #e2574c;
  --cinnabar-dim: rgba(226, 87, 76, .16);
  --ink: #e9e2d0;
  --ink2: #a9b0c0;
  --ink3: #6f7a90;
  --line: rgba(232, 180, 90, .16);
  --line2: rgba(255, 255, 255, .07);
  --ok: #5fd6a8;
  --warn: #e8b45a;
  --danger: #e2574c;
  /* 字体 */
  --font-display: "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --font-kai: "KaiTi", "Kaiti SC", "STKaiti", "Songti SC", serif;
  --font-body: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Menlo", monospace;
  /* 形 */
  --r: 3px;
  --r-lg: 6px;
  --sidebar-w: 250px;
  --shadow: 0 24px 60px -40px #000;
  /* 旧变量兼容 */
  --accent: var(--gold);
  --accent2: #c98f3c;
  --accent3: var(--cyan);
  --card: var(--panel);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 82% -12%, rgba(232, 180, 90, .055), transparent 62%),
    radial-gradient(900px 620px at 8% 108%, rgba(99, 230, 213, .045), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* 星野 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, .55) .6px, transparent .8px),
    radial-gradient(rgba(232, 180, 90, .5) .5px, transparent .7px);
  background-size: 173px 173px, 267px 267px;
  background-position: 0 0, 43px 91px;
  opacity: .13;
}
/* 暗角 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(0, 0, 0, .5) 100%);
}

::selection { background: rgba(232, 180, 90, .28); color: #fff; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232, 180, 90, .18); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232, 180, 90, .34); }

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }

/* ============================================================
   布局
   ============================================================ */
#app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.menu-toggle { display: none; }

/* ---------------- 左侧玉简 ---------------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 16px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(16, 27, 38, .96), rgba(7, 11, 18, .94)),
    radial-gradient(320px 200px at 50% 0%, rgba(232, 180, 90, .07), transparent 70%);
  overflow-y: auto;
  overflow-x: hidden;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-seal, .seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--cinnabar);
  border: 1px solid rgba(226, 87, 76, .55);
  background: rgba(226, 87, 76, .07);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  border-radius: 2px;
  box-shadow: inset 0 0 18px rgba(226, 87, 76, .12);
}
.brand-txt { min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: .16em;
  color: var(--ink);
  line-height: 1.2;
  text-shadow: 0 0 22px rgba(232, 180, 90, .18);
}
.brand-sub {
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--ink3);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 境界徽记 */
.rank-medallion {
  position: relative;
  margin: 24px 2px 20px;
  padding: 18px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(220px 130px at 50% 0%, rgba(232, 180, 90, .10), transparent 72%),
    linear-gradient(180deg, rgba(18, 31, 43, .8), rgba(10, 17, 25, .6));
  text-align: center;
}
.rank-medallion::before,
.rank-medallion::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--gold);
  opacity: .75;
}
.rank-medallion::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.rank-medallion::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.rank-ring {
  --pct: 0;
  position: relative;
  width: 116px;
  height: 116px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 1px;
  background: conic-gradient(from 180deg, var(--gold) calc(var(--pct) * 1%), rgba(255, 255, 255, .07) 0);
  filter: drop-shadow(0 0 16px rgba(232, 180, 90, .18));
  transition: background .6s ease;
}
.rank-ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #16242f, #080e15 74%);
  border: 1px solid rgba(232, 180, 90, .2);
}
.rank-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(232, 180, 90, .16);
  animation: spinSlow 46s linear infinite;
}
.rank-core {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.rank-lv { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; color: var(--gold); }
.rank-realm {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .1em;
  color: var(--ink);
  line-height: 1.15;
}
.rank-xp { margin-top: 12px; font-size: 11px; color: var(--ink3); letter-spacing: .06em; }
.rank-xp b { font-family: var(--font-mono); color: var(--gold-soft); font-weight: 500; }
.xpbar {
  margin-top: 8px;
  height: 4px;
  background: rgba(0, 0, 0, .45);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(232, 180, 90, .12);
}
.xpbar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  box-shadow: 0 0 10px rgba(232, 180, 90, .55);
  transition: width .7s cubic-bezier(.2, .7, .2, 1);
}
.rank-streak {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink3);
  letter-spacing: .04em;
}
.rank-streak b { font-family: var(--font-mono); color: var(--gold); font-weight: 600; font-size: 13px; }

/* 导航 */
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--ink2);
  font-family: var(--font-body);
  font-size: 13.5px;
  letter-spacing: .08em;
  text-align: left;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.nav-ico {
  width: 24px;
  flex: 0 0 24px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: rgba(232, 180, 90, .5);
  transition: color .18s, text-shadow .18s;
}
.nav-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: rgba(255, 255, 255, .025); color: var(--ink); }
.nav-item:hover .nav-ico { color: var(--gold); }
.nav-item.active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(232, 180, 90, .12), rgba(232, 180, 90, .015) 70%, transparent);
  border-color: var(--line);
  border-left-color: var(--gold);
}
.nav-item.active .nav-ico { color: var(--gold); text-shadow: 0 0 14px rgba(232, 180, 90, .55); }
.nav-item.active::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 3px;
  height: 3px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold);
}
.nav-manage { margin-top: 8px; color: var(--ink3); font-size: 12.5px; }

.rail-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line2); }
.rail-motto {
  padding: 0 6px;
  font-family: var(--font-kai);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--ink3);
  line-height: 1.9;
}
.rail-motto em { color: rgba(232, 180, 90, .55); font-style: normal; }

/* ---------------- 主舞台 ---------------- */
.stage-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 34px 14px;
  border-bottom: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(7, 10, 18, .92), rgba(7, 10, 18, .72));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.topbar-left { min-width: 0; }
.topbar-kicker {
  font-size: 10px;
  letter-spacing: .3em;
  color: rgba(232, 180, 90, .55);
  text-transform: uppercase;
}
.topbar-title {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: .14em;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.hud { display: flex; align-items: center; gap: 0; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.hud-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 15px;
  border-left: 1px solid var(--line2);
  min-width: 0;
}
.hud-k { font-size: 9.5px; letter-spacing: .22em; color: var(--ink3); text-transform: uppercase; white-space: nowrap; }
.hud-v { font-family: var(--font-mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.hud-v b { color: var(--gold); font-weight: 600; }
.hud-today .hud-v { color: var(--gold-soft); }
.hud-monster { min-width: 152px; }
.hud-monster .hud-k { color: rgba(226, 87, 76, .8); }
.hud-monster .hud-v { font-size: 10.5px; color: var(--ink3); }
.hpbar {
  height: 5px;
  width: 128px;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(226, 87, 76, .22);
  border-radius: 3px;
  overflow: hidden;
}
.hpbar > i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7c2620, #e2574c);
  box-shadow: 0 0 10px rgba(226, 87, 76, .5);
  transition: width .6s cubic-bezier(.2, .7, .2, 1);
}
.hud-btn {
  position: relative;
  margin-left: 12px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(232, 180, 90, .05);
  color: var(--gold-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s;
  white-space: nowrap;
}
.hud-btn:hover { background: rgba(232, 180, 90, .12); border-color: rgba(232, 180, 90, .45); box-shadow: 0 0 18px rgba(232, 180, 90, .12); }
.hud-btn.is-running { color: var(--cyan); border-color: rgba(99, 230, 213, .4); background: rgba(99, 230, 213, .07); }
.hud-bell .badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: none;
  place-items: center;
  border-radius: 8px;
  background: var(--cinnabar);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 16px;
  box-shadow: 0 0 12px rgba(226, 87, 76, .6);
}
.hud-bell .badge.show { display: grid; }
.hud-icon-btn { padding: 8px 10px; }

#stage {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 34px 96px;
}

/* ============================================================
   模块头
   ============================================================ */
.module-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.module-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 64px;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(232, 180, 90, .7);
}
.module-head-main { display: flex; align-items: center; gap: 15px; min-width: 0; }
.module-seal { width: 38px; height: 38px; font-size: 19px; }
.module-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--ink);
  line-height: 1.25;
}
.module-desc { margin: 5px 0 0; font-size: 12.5px; color: var(--ink3); letter-spacing: .03em; }
.module-head-side { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.module-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink3); letter-spacing: .05em; white-space: nowrap; }
.module-meta b { color: var(--gold); font-weight: 500; }
.module-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* ============================================================
   面板 / 卡片
   ============================================================ */
.card {
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(152deg, rgba(18, 31, 43, .9), rgba(9, 15, 22, .95)),
    var(--panel);
  box-shadow: var(--shadow);
}
.card > .card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: .12em;
  color: var(--ink);
  font-weight: 600;
}
.card-title small { font-family: var(--font-body); font-size: 11px; color: var(--ink3); letter-spacing: .04em; margin-left: 8px; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  border: 1px solid rgba(232, 180, 90, .32);
  border-radius: 2px;
  background: rgba(232, 180, 90, .06);
  color: var(--gold-soft);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: .1em;
  line-height: 1.3;
  cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s, color .18s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgba(232, 180, 90, .14); border-color: rgba(232, 180, 90, .6); box-shadow: 0 0 20px rgba(232, 180, 90, .13); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  background: linear-gradient(135deg, #f2d194, #dda750 55%, #c98f3c);
  border-color: rgba(244, 217, 163, .75);
  color: #1c1305;
  font-weight: 600;
  box-shadow: 0 6px 22px -10px rgba(232, 180, 90, .8);
}
.btn-primary:hover { background: linear-gradient(135deg, #f8dfae, #e5b365 55%, #d49a45); color: #140d02; }
.btn-ghost { background: transparent; border-color: var(--line2); color: var(--ink2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, .03); }
.btn-stop { border-color: rgba(226, 87, 76, .42); color: #f0a49c; background: rgba(226, 87, 76, .07); }
.btn-stop:hover { background: rgba(226, 87, 76, .16); border-color: rgba(226, 87, 76, .7); box-shadow: 0 0 20px rgba(226, 87, 76, .14); }
.btn-sm { padding: 6px 12px; font-size: 12px; letter-spacing: .06em; }
.mini-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--ink3);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.mini-btn:hover { color: var(--gold); border-color: var(--line); background: rgba(232, 180, 90, .07); }
.mini-btn.del:hover { color: #f08c82; border-color: rgba(226, 87, 76, .4); background: rgba(226, 87, 76, .08); }

/* ============================================================
   表单
   ============================================================ */
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 2px;
  background: rgba(0, 0, 0, .28);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--ink3); }
.input:hover { border-color: rgba(232, 180, 90, .24); }
.input:focus {
  outline: none;
  border-color: rgba(232, 180, 90, .6);
  background: rgba(0, 0, 0, .4);
  box-shadow: 0 0 0 3px rgba(232, 180, 90, .08);
}
select.input { cursor: pointer; }
textarea.input { min-height: 64px; resize: vertical; }
.form-card { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink3);
  text-transform: uppercase;
}
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ============================================================
   列表条目
   ============================================================ */
.list-box { display: flex; flex-direction: column; gap: 10px; }
.li-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: linear-gradient(90deg, rgba(18, 31, 43, .55), rgba(10, 17, 25, .5));
  transition: border-color .18s, background .18s, transform .18s;
}
.li-card:hover {
  border-color: rgba(232, 180, 90, .3);
  background: linear-gradient(90deg, rgba(24, 39, 52, .7), rgba(11, 19, 27, .55));
  transform: translateX(2px);
}
.li-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.li-body { min-width: 0; }
.li-title {
  font-size: 14px;
  color: var(--ink);
  letter-spacing: .02em;
  word-break: break-word;
}
.li-title.done { color: var(--ink3); text-decoration: line-through; text-decoration-color: rgba(232, 180, 90, .4); }
.li-sub { margin-top: 3px; font-size: 11.5px; color: var(--ink3); line-height: 1.55; word-break: break-word; }
.li-sub span, .li-sub a { color: inherit; }
.li-meta { font-family: var(--font-mono); font-size: 11px; color: rgba(232, 180, 90, .7); white-space: nowrap; letter-spacing: .03em; }
.li-ops { display: flex; gap: 2px; opacity: .35; transition: opacity .18s; }
.li-card:hover .li-ops { opacity: 1; }
.li-check {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid rgba(232, 180, 90, .36);
  border-radius: 2px;
  background: rgba(0, 0, 0, .25);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .15s;
}
.li-check:hover { border-color: var(--gold); }
.li-check:checked { background: linear-gradient(135deg, #f2d194, #c98f3c); border-color: var(--gold-soft); }
.li-check:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #1c1305;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg) translate(-1px, -1px);
}
.li-stars { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .18em; color: rgba(232, 180, 90, .7); }

/* 空状态 */
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
  border: 1px dashed rgba(232, 180, 90, .18);
  border-radius: var(--r-lg);
  color: var(--ink3);
  font-size: 13px;
  letter-spacing: .06em;
  background: rgba(255, 255, 255, .012);
}
.empty-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(232, 180, 90, .18);
  border-radius: 50%;
  color: rgba(232, 180, 90, .5);
  font-size: 15px;
}

/* ============================================================
   习惯热力图
   ============================================================ */
.heat { display: grid; grid-template-columns: repeat(14, 15px); gap: 4px; margin-top: 10px; }
.heat-day {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: rgba(255, 255, 255, .045);
  color: transparent;
  font-family: var(--font-mono);
  font-size: 8px;
  transition: transform .15s;
}
.heat-day.on { background: linear-gradient(135deg, rgba(232, 180, 90, .85), rgba(184, 134, 47, .75)); color: #221605; box-shadow: 0 0 8px rgba(232, 180, 90, .3); }
.heat-day.today { outline: 1px solid var(--cyan); outline-offset: 1px; }
.heat-day:hover { transform: scale(1.15); }
.habit-main { flex: 1; min-width: 0; }
.habit-info { flex: 1; min-width: 0; }
.habit-ops { display: flex; align-items: center; gap: 8px; }
.habit-name { font-size: 14.5px; color: var(--ink); letter-spacing: .04em; }

/* ============================================================
   翻转卡片
   ============================================================ */
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.flip { position: relative; height: 168px; perspective: 1100px; cursor: pointer; }
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .55s cubic-bezier(.3, .8, .3, 1);
  transform-style: preserve-3d;
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(20, 35, 47, .95), rgba(9, 15, 22, .97));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}
.flip-face::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 180, 90, .45), transparent);
}
.flip-front { font-family: var(--font-display); font-size: 17px; letter-spacing: .06em; }
.flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(150deg, rgba(38, 31, 18, .96), rgba(13, 12, 9, .98));
  border-color: rgba(232, 180, 90, .3);
  font-size: 13px;
  color: var(--ink2);
}
.flip-tag {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: rgba(232, 180, 90, .65);
  border: 1px solid rgba(232, 180, 90, .22);
  padding: 2px 7px;
  border-radius: 2px;
}

/* ============================================================
   模块管理
   ============================================================ */
.manage-list { display: flex; flex-direction: column; gap: 8px; }
.manage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: rgba(18, 31, 43, .5);
  cursor: grab;
}
.manage-row.dragging { opacity: .5; border-color: var(--gold); }
.manage-row.off { opacity: .55; }
.manage-drag { color: var(--ink3); font-size: 14px; letter-spacing: -2px; cursor: grab; }
.manage-ico {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 15px;
}
.manage-info { flex: 1; min-width: 0; }
.manage-name { font-size: 14px; color: var(--ink); letter-spacing: .06em; }
.manage-desc { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
.manage-hint { margin: 16px 0 0; font-size: 12px; color: var(--ink3); line-height: 1.7; }
.manage-actions { margin-top: 18px; display: flex; gap: 10px; }
.switch { position: relative; display: inline-block; width: 38px; height: 20px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  background: rgba(0, 0, 0, .4);
  cursor: pointer;
  transition: .25s;
}
.slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink3);
  transition: .25s;
}
.switch input:checked + .slider { background: rgba(232, 180, 90, .2); border-color: rgba(232, 180, 90, .5); }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* ============================================================
   Toast
   ============================================================ */
#toasts {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border: 1px solid rgba(232, 180, 90, .3);
  border-left: 2px solid var(--gold);
  border-radius: 2px;
  background: rgba(12, 20, 28, .96);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .06em;
  box-shadow: 0 18px 44px -18px #000;
  animation: toastIn .25s ease both;
}
.toast.err { border-color: rgba(226, 87, 76, .5); border-left-color: var(--cinnabar); color: #f4b8b2; }
.toast.ok { border-left-color: var(--ok); color: #b6f0da; }
.toast.out { animation: toastOut .35s ease both; }

/* ============================================================
   修行总览 Dashboard
   ============================================================ */
.dash { display: flex; flex-direction: column; gap: 18px; }
.dash-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(560px 260px at 88% 0%, rgba(232, 180, 90, .13), transparent 70%),
    radial-gradient(400px 300px at 6% 110%, rgba(99, 230, 213, .06), transparent 70%),
    linear-gradient(150deg, rgba(20, 34, 46, .92), rgba(8, 13, 20, .96));
  overflow: hidden;
}
.dash-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .5) .6px, transparent .8px);
  background-size: 90px 90px;
  opacity: .12;
}
.dash-hero::after {
  content: "";
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 180, 90, .55), transparent);
}
.hero-main { position: relative; min-width: 0; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  letter-spacing: .3em;
  color: rgba(232, 180, 90, .7);
  text-transform: uppercase;
}
.hero-kicker::before { content: ""; width: 22px; height: 1px; background: rgba(232, 180, 90, .6); }
.hero-title {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--ink);
  line-height: 1.3;
}
.hero-title em { font-style: normal; color: var(--gold); text-shadow: 0 0 30px rgba(232, 180, 90, .35); }
.hero-sub { margin: 10px 0 0; font-size: 13px; color: var(--ink2); letter-spacing: .04em; line-height: 1.9; max-width: 46em; }
.hero-quote {
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 1px solid rgba(232, 180, 90, .35);
  font-family: var(--font-kai);
  font-size: 14px;
  letter-spacing: .12em;
  color: rgba(233, 226, 208, .72);
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 24px; }
.hero-stat { min-width: 92px; }
.hero-stat-k { font-size: 9.5px; letter-spacing: .24em; color: var(--ink3); text-transform: uppercase; }
.hero-stat-v { margin-top: 3px; font-family: var(--font-mono); font-size: 22px; color: var(--gold-soft); line-height: 1.2; }
.hero-stat-v small { font-size: 11px; color: var(--ink3); margin-left: 3px; }

.hero-emblem { position: relative; display: grid; place-items: center; }
.hero-emblem-ring {
  position: relative;
  width: 208px;
  height: 208px;
  border-radius: 50%;
  border: 1px solid rgba(232, 180, 90, .22);
  display: grid;
  place-items: center;
}
.hero-emblem-ring::before,
.hero-emblem-ring::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1px dashed rgba(232, 180, 90, .2);
  animation: spinSlow 60s linear infinite;
}
.hero-emblem-ring::after { inset: 34px; border-style: solid; border-color: rgba(99, 230, 213, .1); animation-direction: reverse; animation-duration: 44s; }
.hero-emblem-core { text-align: center; }
.hero-emblem-realm { font-family: var(--font-display); font-size: 26px; letter-spacing: .14em; color: var(--gold-soft); }
.hero-emblem-lv { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; color: var(--ink3); }
.hero-emblem-xp { margin-top: 12px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink3); }
.hero-emblem-bar { width: 150px; height: 3px; margin: 7px auto 0; background: rgba(0, 0, 0, .5); border-radius: 3px; overflow: hidden; }
.hero-emblem-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); box-shadow: 0 0 8px rgba(232, 180, 90, .6); transition: width .8s; }

.ds-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.ds-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ds-panel { padding: 20px 22px; }
.ds-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line2);
}
.ds-panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--ink);
}
.ds-panel-title::before {
  content: "";
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 10px rgba(232, 180, 90, .6);
}
.ds-panel-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink3); letter-spacing: .06em; }

/* 任务 */
.quest-list { display: flex; flex-direction: column; gap: 11px; }
.quest { position: relative; padding: 12px 14px; border: 1px solid var(--line2); border-radius: var(--r); background: rgba(255, 255, 255, .015); }
.quest.done { opacity: .62; }
.quest-top { display: flex; align-items: center; gap: 10px; }
.quest-kind {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid rgba(232, 180, 90, .3);
  border-radius: 2px;
  font-size: 9.5px;
  letter-spacing: .12em;
  color: rgba(232, 180, 90, .8);
}
.quest[data-kind="focus"] .quest-kind { color: var(--cyan); border-color: rgba(99, 230, 213, .3); }
.quest-name { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); letter-spacing: .02em; }
.quest.done .quest-name { color: var(--ink3); text-decoration: line-through; text-decoration-color: rgba(232, 180, 90, .35); }
.quest-xp { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold); }
.quest-progress { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.pbar { flex: 1; height: 3px; background: rgba(0, 0, 0, .45); border-radius: 3px; overflow: hidden; }
.pbar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgba(232, 180, 90, .55), var(--gold-soft)); box-shadow: 0 0 8px rgba(232, 180, 90, .4); transition: width .6s; }
.quest-num { font-family: var(--font-mono); font-size: 10px; color: var(--ink3); letter-spacing: .04em; white-space: nowrap; }
.quest-done-mark { position: absolute; right: 12px; top: 12px; color: var(--gold); font-size: 12px; }

/* 心魔 */
.monster-panel { position: relative; overflow: hidden; }
.monster-panel::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 87, 76, .16), transparent 68%);
  pointer-events: none;
}
.monster-name { font-family: var(--font-display); font-size: 20px; letter-spacing: .1em; color: #f0a49c; }
.monster-sub { font-size: 11.5px; color: var(--ink3); margin-top: 4px; letter-spacing: .06em; }
.monster-hp { margin-top: 16px; }
.monster-hp .hpbar { width: 100%; height: 8px; }
.monster-hp-text { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink3); }
.monster-defeated { color: var(--gold-soft); font-family: var(--font-display); font-size: 15px; letter-spacing: .08em; }
.monster-note { margin-top: 14px; font-size: 11.5px; color: var(--ink3); line-height: 1.7; }

/* 统计与属性 */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-cell {
  padding: 12px 14px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: rgba(0, 0, 0, .16);
}
.stat-k { font-size: 10px; letter-spacing: .18em; color: var(--ink3); text-transform: uppercase; }
.stat-v { margin-top: 4px; font-family: var(--font-mono); font-size: 19px; color: var(--gold-soft); line-height: 1.3; }
.stat-v small { font-size: 10.5px; color: var(--ink3); margin-left: 3px; }
.attr-list { display: flex; flex-direction: column; gap: 11px; }
.attr-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 34px; align-items: center; gap: 12px; }
.attr-name { font-family: var(--font-display); font-size: 13px; letter-spacing: .12em; color: var(--ink2); }
.attr-bar { height: 3px; background: rgba(0, 0, 0, .4); border-radius: 3px; overflow: hidden; }
.attr-bar > i { display: block; height: 100%; background: linear-gradient(90deg, rgba(99, 230, 213, .35), var(--cyan)); }
.attr-val { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink3); text-align: right; }

/* 成就 */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px; }
.ach {
  padding: 11px 12px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: rgba(0, 0, 0, .16);
  opacity: .42;
  transition: all .2s;
}
.ach.unlocked {
  opacity: 1;
  border-color: rgba(232, 180, 90, .32);
  background: linear-gradient(150deg, rgba(232, 180, 90, .09), rgba(0, 0, 0, .12));
  box-shadow: inset 0 0 22px rgba(232, 180, 90, .05);
}
.ach-ico { font-family: var(--font-display); font-size: 15px; color: var(--ink3); }
.ach.unlocked .ach-ico { color: var(--gold); }
.ach-name { margin-top: 6px; font-size: 12px; color: var(--ink2); letter-spacing: .04em; }
.ach.unlocked .ach-name { color: var(--gold-soft); }
.ach-desc { margin-top: 3px; font-size: 10px; color: var(--ink3); line-height: 1.45; }

/* 快速入口 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 9px; }
.quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px 11px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .015);
  cursor: pointer;
  transition: all .18s;
}
.quick:hover { border-color: rgba(232, 180, 90, .38); background: rgba(232, 180, 90, .06); transform: translateY(-2px); }
.quick-ico { font-family: var(--font-display); font-size: 18px; color: var(--gold); }
.quick-name { font-size: 11.5px; color: var(--ink2); letter-spacing: .08em; }

/* ============================================================
   传讯抽屉
   ============================================================ */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(4, 7, 12, .6);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 250;
  display: flex;
  flex-direction: column;
  width: 392px;
  max-width: 92vw;
  height: 100vh;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 22, 31, .98), rgba(6, 10, 16, .99));
  box-shadow: -30px 0 80px -40px #000;
  transform: translateX(102%);
  transition: transform .32s cubic-bezier(.3, .8, .3, 1);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-title { flex: 1; font-family: var(--font-display); font-size: 19px; letter-spacing: .18em; color: var(--ink); }
.drawer-sub { font-size: 10px; letter-spacing: .2em; color: var(--ink3); }
.drawer-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line2);
  border-radius: 2px;
  background: transparent;
  color: var(--ink3);
  font-size: 15px;
  cursor: pointer;
}
.drawer-close:hover { color: var(--gold); border-color: var(--line); }
.notify-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.notify-item {
  position: relative;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .015);
}
.notify-item.unread { border-color: rgba(232, 180, 90, .26); background: rgba(232, 180, 90, .045); }
.notify-ico { position: absolute; left: 13px; top: 13px; color: rgba(232, 180, 90, .7); font-size: 12px; font-family: var(--font-display); }
.notify-item.kind-remind .notify-ico { color: var(--cyan); }
.notify-item.kind-danger .notify-ico { color: var(--cinnabar); }
.notify-title { font-size: 13px; color: var(--ink); letter-spacing: .03em; }
.notify-text { margin-top: 3px; font-size: 12px; color: var(--ink2); line-height: 1.7; }
.notify-time { margin-top: 6px; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink3); letter-spacing: .04em; }
.notify-empty { padding: 60px 20px; text-align: center; color: var(--ink3); font-size: 13px; letter-spacing: .1em; }
.drawer-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line2); display: flex; gap: 9px; flex-wrap: wrap; }
.notify-tools { font-size: 11px; color: var(--ink3); }

/* ============================================================
   升级 / 传讯 动画层
   ============================================================ */
.levelup-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.levelup-layer.show { opacity: 1; }
.levelup-card {
  position: relative;
  padding: 32px 46px;
  text-align: center;
  border: 1px solid rgba(232, 180, 90, .5);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(30, 24, 13, .97), rgba(8, 8, 10, .98));
  box-shadow: 0 0 120px rgba(232, 180, 90, .25), 0 40px 90px -40px #000;
  animation: levelIn .55s cubic-bezier(.2, .9, .25, 1) both;
}
.levelup-card::before,
.levelup-card::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid var(--gold);
}
.levelup-card::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.levelup-card::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.levelup-kicker { font-size: 10px; letter-spacing: .4em; color: rgba(232, 180, 90, .7); }
.levelup-realm {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: .2em;
  color: var(--gold-soft);
  text-shadow: 0 0 40px rgba(232, 180, 90, .45);
}
.levelup-sub { margin-top: 8px; font-size: 12px; color: var(--ink2); letter-spacing: .12em; }

/* 修为飘字 */
.xp-float {
  position: fixed;
  z-index: 290;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold-soft);
  text-shadow: 0 0 14px rgba(232, 180, 90, .7);
  pointer-events: none;
  animation: xpFloat 1.25s ease-out both;
}

/* ============================================================
   音乐播放器
   ============================================================ */
.mu { display: grid; grid-template-columns: 388px minmax(0, 1fr); gap: 22px; align-items: start; }
.mu-hero {
  position: sticky;
  top: 92px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(320px 220px at 50% 0%, rgba(232, 180, 90, .1), transparent 70%),
    linear-gradient(165deg, rgba(19, 32, 43, .94), rgba(8, 13, 20, .97));
  overflow: hidden;
}
.mu-hero::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 180, 90, .4), transparent);
}
.mu-disc-wrap { position: relative; width: 180px; height: 180px; margin: 0 auto 14px; }
.mu-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .045) 0 1px, transparent 1px 4px),
    conic-gradient(from 0deg, #1d2c39, #0e1720 25%, #22333f 50%, #0b131a 75%, #1d2c39);
  border: 1px solid rgba(232, 180, 90, .22);
  box-shadow: 0 30px 60px -30px #000, inset 0 0 40px rgba(0, 0, 0, .8);
  animation: spinSlow 22s linear infinite;
  animation-play-state: paused;
  display: grid;
  place-items: center;
}
.mu.is-playing .mu-disc { animation-play-state: running; }
.mu-disc::before {
  content: "";
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(232, 180, 90, .35), rgba(184, 134, 47, .12) 42%, rgba(10, 16, 22, .96) 73%),
    var(--panel);
  border: 1px solid rgba(232, 180, 90, .3);
}
.mu-disc-char {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 40px;
  color: rgba(244, 217, 163, .82);
  text-shadow: 0 0 24px rgba(232, 180, 90, .5);
  letter-spacing: 0;
}
.mu-disc-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(232, 180, 90, .3);
  z-index: 2;
}
.mu-now { text-align: center; min-height: 62px; }
.mu-song {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: .06em;
  color: var(--ink);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mu-artist { margin-top: 5px; font-size: 12px; color: var(--ink3); letter-spacing: .08em; }
.mu-src {
  display: inline-block;
  margin-top: 8px;
  padding: 1px 7px;
  font-size: 9.5px;
  letter-spacing: .12em;
  color: rgba(99, 230, 213, .8);
  border: 1px solid rgba(99, 230, 213, .25);
  border-radius: 2px;
}
.mu-src.local { color: rgba(232, 180, 90, .85); border-color: rgba(232, 180, 90, .3); }
.mu-progress { margin-top: 14px; }
.mu-time-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--ink3); }
.mu-track {
  position: relative;
  height: 4px;
  margin-top: 6px;
  background: rgba(0, 0, 0, .5);
  border-radius: 4px;
  cursor: pointer;
}
.mu-track::before { content: ""; position: absolute; inset: -8px 0; }
.mu-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  box-shadow: 0 0 10px rgba(232, 180, 90, .5);
}
.mu-fill::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--gold-soft);
  opacity: 0;
  transition: opacity .15s;
}
.mu-track:hover .mu-fill::after { opacity: 1; }
.mu-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.mu-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: transparent;
  color: var(--ink2);
  font-size: 14px;
  cursor: pointer;
  transition: all .18s;
}
.mu-btn:hover { color: var(--gold); border-color: var(--line); background: rgba(232, 180, 90, .07); }
.mu-btn.play {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(232, 180, 90, .55);
  background: radial-gradient(circle at 35% 30%, rgba(244, 217, 163, .95), rgba(201, 143, 60, .9));
  color: #1c1305;
  font-size: 19px;
  box-shadow: 0 0 28px rgba(232, 180, 90, .28);
}
.mu-btn.play:hover { box-shadow: 0 0 38px rgba(232, 180, 90, .42); color: #120c02; }
.mu-extra { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mu-mode {
  padding: 3px 9px;
  border: 1px solid var(--line2);
  border-radius: 2px;
  background: transparent;
  color: var(--ink3);
  font-size: 10.5px;
  letter-spacing: .1em;
  cursor: pointer;
}
.mu-mode.on { color: var(--gold); border-color: rgba(232, 180, 90, .4); background: rgba(232, 180, 90, .07); }
.mu-lyrics {
  height: 132px;
  margin-top: 14px;
  padding-right: 6px;
  overflow-y: auto;
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  padding-top: 10px;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.mu-lyrics::-webkit-scrollbar { display: none; }
.mu-lyric { padding: 3px 0; font-size: 12px; color: var(--ink3); text-align: center; letter-spacing: .04em; transition: color .2s; }
.mu-lyric.on { color: var(--gold-soft); text-shadow: 0 0 14px rgba(232, 180, 90, .35); }
.mu-lyric.empty { color: var(--ink3); opacity: .6; }

.mu-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.mu-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.mu-tab {
  position: relative;
  padding: 9px 16px;
  border: 0;
  background: transparent;
  color: var(--ink3);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: .1em;
  cursor: pointer;
}
.mu-tab:hover { color: var(--ink2); }
.mu-tab.active { color: var(--gold-soft); }
.mu-tab.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(232, 180, 90, .6);
}
.mu-panel { min-height: 300px; }
.mu-searchbar { display: flex; gap: 9px; margin-bottom: 14px; }
.mu-searchbar .input { flex: 1; }
.mu-list { display: flex; flex-direction: column; gap: 2px; max-height: 460px; overflow-y: auto; }
.mu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.mu-row:hover { background: rgba(232, 180, 90, .06); border-color: var(--line2); }
.mu-row.playing { background: rgba(232, 180, 90, .1); border-color: rgba(232, 180, 90, .25); }
.mu-row-idx { width: 22px; flex: 0 0 22px; font-family: var(--font-mono); font-size: 10px; color: var(--ink3); text-align: right; }
.mu-row.playing .mu-row-idx { color: var(--gold); }
.mu-row-body { flex: 1; min-width: 0; }
.mu-row-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-row.playing .mu-row-name { color: var(--gold-soft); }
.mu-row-sub { font-size: 10.5px; color: var(--ink3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-row-dur { font-family: var(--font-mono); font-size: 10px; color: var(--ink3); }
.mu-row-fee { font-size: 9px; color: var(--cinnabar); border: 1px solid rgba(226, 87, 76, .35); border-radius: 2px; padding: 0 3px; }
.mu-hint { padding: 8px 0; font-size: 11.5px; color: var(--ink3); line-height: 1.7; }
.mu-empty { padding: 48px 12px; text-align: center; color: var(--ink3); font-size: 12.5px; letter-spacing: .08em; }
.mu-local-path {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.mu-local-path .input { flex: 1; font-family: var(--font-mono); font-size: 11.5px; }
.mu-login-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 255, 255, .015); }
.mu-qr { display: grid; place-items: center; padding: 12px; background: #f4f1e8; border-radius: 3px; width: 172px; height: 172px; margin: 14px auto; }
.mu-qr canvas, .mu-qr img { width: 148px; height: 148px; image-rendering: pixelated; }
.mu-qr-state { text-align: center; font-size: 12px; color: var(--ink3); letter-spacing: .06em; }
.mu-profile { display: flex; align-items: center; gap: 14px; }
.mu-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(232, 180, 90, .4);
  background: radial-gradient(circle at 35% 30%, #2a3f4f, #0b131a);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-soft);
  overflow: hidden;
}
.mu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mu-nick { font-family: var(--font-display); font-size: 18px; letter-spacing: .08em; color: var(--ink); }
.mu-profile-stats { margin-top: 8px; font-size: 11px; color: var(--ink3); letter-spacing: .05em; }
.mu-pl-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mu-pl-bar .mu-hint { padding: 0; }
.mu-note {
  margin: 2px 0 10px;
  padding: 8px 10px;
  border-left: 2px solid rgba(232, 180, 90, .42);
  background: rgba(232, 180, 90, .05);
  font-size: 11px;
  color: var(--ink3);
  line-height: 1.65;
}
.mu-pl-modes { display: flex; gap: 4px; }
.mu-pl-mode {
  padding: 4px 10px;
  border: 1px solid var(--line2);
  border-radius: 2px;
  background: transparent;
  color: var(--ink3);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .15s;
}
.mu-pl-mode:hover { color: var(--ink2); border-color: var(--line); }
.mu-pl-mode.active { color: var(--gold-soft); border-color: rgba(232, 180, 90, .45); background: rgba(232, 180, 90, .07); }
.mu-pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 14px 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 2px 2px 8px;
}
.mu-pl-card { cursor: pointer; min-width: 0; }
.mu-pl-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--line2);
  background: radial-gradient(circle at 35% 30%, rgba(232, 180, 90, .2), rgba(10, 16, 22, .96) 70%);
  display: grid;
  place-items: center;
  color: rgba(232, 180, 90, .7);
  font-family: var(--font-display);
  font-size: 26px;
}
.mu-pl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.mu-pl-card:hover .mu-pl-cover { border-color: rgba(232, 180, 90, .35); }
.mu-pl-card:hover .mu-pl-cover img { transform: scale(1.045); }
.mu-pl-name {
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mu-pl-meta { margin-top: 3px; font-size: 10px; color: var(--ink3); }
.mu-pl-detail-head { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; }
.mu-pl-detail-head > .btn { flex: 0 0 100%; width: fit-content; }
.mu-pl-detail-cover {
  width: 86px;
  height: 86px;
  flex: 0 0 86px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--line2);
  background: radial-gradient(circle at 35% 30%, rgba(232, 180, 90, .2), rgba(10, 16, 22, .96) 70%);
  display: grid;
  place-items: center;
  color: rgba(232, 180, 90, .7);
  font-family: var(--font-display);
  font-size: 24px;
}
.mu-pl-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.mu-pl-detail-info { flex: 1; min-width: 180px; }
.mu-pl-detail-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .05em;
  color: var(--ink);
  line-height: 1.4;
}
.mu-pl-detail-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.mu-pl-desc { margin: 0 0 10px; font-size: 11px; color: var(--ink3); line-height: 1.65; max-height: 46px; overflow: hidden; }

/* 迷你 dock */
.mu-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 336px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(11, 18, 26, .96);
  box-shadow: 0 24px 50px -24px #000, 0 0 0 1px rgba(0, 0, 0, .4);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.mu-dock.show { opacity: 1; transform: none; pointer-events: auto; }
.mu-dock-cover {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  border: 1px solid rgba(232, 180, 90, .3);
  background: radial-gradient(circle at 35% 30%, rgba(232, 180, 90, .35), rgba(10, 16, 22, .95) 70%);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  color: var(--gold-soft);
  font-size: 15px;
  overflow: hidden;
  cursor: pointer;
}
.mu-dock-body { flex: 1; min-width: 0; cursor: pointer; }
.mu-dock-title { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-dock-artist { font-size: 10px; color: var(--ink3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-dock-prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(255, 255, 255, .06); }
.mu-dock-prog > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); width: 0; }
.mu-dock-ops { display: flex; align-items: center; gap: 4px; }
.mu-dock-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink2);
  font-size: 12px;
  cursor: pointer;
}
.mu-dock-btn:hover { color: var(--gold); background: rgba(232, 180, 90, .08); }
.mu-dock-btn.play { color: var(--gold-soft); }
.mu-dock-progress { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: transparent; }

/* ---------- 响应式补丁：抽屉与主视觉 ---------- */
@media (max-width: 980px) {
  .sidebar { padding-top: 66px; }
  .dash-hero { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 720px) {
  .dash-hero { padding: 20px 17px; }
  .hero-title { letter-spacing: .1em; line-height: 1.35; }
  .hero-kicker { font-size: 9.5px; letter-spacing: .2em; }
}


/* ============================================================
   响应式（平板 / 手机）
   ============================================================ */
@media (max-width: 1180px) {
  :root { --sidebar-w: 216px; }
  .topbar { gap: 14px; padding: 14px 20px 12px; flex-wrap: wrap; }
  .hud-monster { min-width: 124px; }
  .hud-item { padding: 0 11px; }
  .mu { grid-template-columns: 360px minmax(0, 1fr); gap: 16px; }
  .ds-grid { grid-template-columns: 1fr; }
  #stage { padding: 22px 22px 96px; }
}

@media (max-width: 980px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    width: 262px;
    height: 100vh;
    padding-top: 66px;
    transform: translateX(-104%);
    transition: transform .3s cubic-bezier(.2, .7, .2, 1);
    box-shadow: 30px 0 90px -40px #000;
  }
  #app.open .sidebar { transform: none; }
  #app.open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(3, 6, 10, .62);
    backdrop-filter: blur(2px);
  }
  .menu-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 210;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: rgba(11, 18, 26, .94);
    color: var(--gold-soft);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 30px -18px #000;
  }
  .topbar { padding-left: 64px; }
  .hud-monster { display: none; }
  .dash-hero { grid-template-columns: 1fr; gap: 18px; }
  .mu { grid-template-columns: 1fr; }
  .mu-hero { max-width: 560px; margin: 0 auto; width: 100%; }
  .mu-side-card { min-height: 0; }
  .pomo-wrap { grid-template-columns: 1fr; }
  .ex-goal-head { gap: 10px; }
  #stage { padding: 20px 18px 100px; }
}

@media (max-width: 720px) {
  .topbar { padding: 12px 14px 10px 60px; row-gap: 8px; }
  .topbar-kicker { display: none; }
  .topbar-title { font-size: 17px; letter-spacing: .1em; }
  .hud { margin-left: 0; width: 100%; justify-content: flex-start; }
  .hud-item { padding: 0 10px; }
  .hud-item:first-child { border-left: 0; padding-left: 0; }
  .hud-item:nth-child(4) { display: none; }
  .hud-btn { margin-left: 8px; padding: 6px 10px; font-size: 10.5px; }
  #stage { padding: 16px 13px 104px; }
  .module-head { flex-wrap: wrap; gap: 10px; }
  .module-head-side { width: 100%; text-align: left; }
  .hero-title { font-size: 24px; letter-spacing: .1em; line-height: 1.35; }
  .hero-kicker { font-size: 9.5px; letter-spacing: .2em; }
  .hero-stats { flex-wrap: wrap; gap: 12px 18px; }
  .hero-emblem { display: none; }
  .dash-hero { padding: 20px 17px; }
  .mu-hero { padding: 16px 15px 14px; }
  .mu-disc-wrap { width: 148px; height: 148px; margin: 0 auto 12px; }
  .mu-side-card { padding: 14px 12px 12px; }
  .mu-qr { width: 132px; height: 132px; }
  .mu-lyrics { height: 108px; }
  .mu-dock { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .drawer { width: 100%; max-width: 100%; }
  .ds-grid, .ex-facts, .ex-prog-grid, .quick-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .heat-day { width: 12px; height: 12px; }
  .pomo-main { padding: 18px 14px 16px; }
  .pomo-ring, .pomo-ring-wrap { max-width: 230px; }
  .card { padding: 16px 14px; }
  .module-toolbar { flex-wrap: wrap; }
}

/* ============================================================
   天时与词海：顶栏时钟 / 天气芯片 / 总览新增面板
   ============================================================ */
.hud-clock { min-width: 96px; }
.hud-clock-time { font-family: var(--font-mono); font-size: 15px; line-height: 1.2; letter-spacing: .04em; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.hud-clock-date { font-size: 9.5px; letter-spacing: .12em; color: var(--ink3); white-space: nowrap; }
.hud-weather { display: inline-flex; align-items: baseline; gap: 6px; }
.hud-weather-ico { font-size: 14px; line-height: 1; }
.hud-weather-temp { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.hud-weather-city { max-width: 132px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; color: var(--ink3); }

.tian-panel .tian-now { display: flex; align-items: center; gap: 14px; padding: 4px 0 10px; }
.tian-ico { font-size: 36px; line-height: 1; filter: drop-shadow(0 0 14px rgba(232, 180, 90, .25)); }
.tian-main { min-width: 0; }
.tian-temp { font-family: var(--font-mono); font-size: 26px; line-height: 1.15; color: var(--gold-soft); }
.tian-text { font-size: 12px; color: var(--ink2); }
.tian-sub { font-size: 10.5px; color: var(--ink3); }
.tian-rain { margin: 2px 0 10px; padding: 8px 10px; border: 1px solid rgba(99, 230, 213, .28); border-radius: 2px; background: rgba(99, 230, 213, .07); color: var(--cyan); font-size: 11.5px; }
.tian-rain.is-clear { border-color: var(--line2); background: rgba(232, 180, 90, .04); color: var(--ink3); }
.tian-yiji { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 10px; }
.tian-yj-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tian-seal { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid; border-radius: 2px; font-family: var(--font-kai); font-size: 11px; }
.tian-seal.yi { color: var(--ok); border-color: rgba(95, 214, 168, .45); background: rgba(95, 214, 168, .08); }
.tian-seal.ji { color: var(--cinnabar); border-color: rgba(226, 87, 76, .4); background: rgba(226, 87, 76, .08); }
.tian-tag { padding: 2px 8px; border: 1px solid var(--line2); border-radius: 2px; background: rgba(255, 255, 255, .02); color: var(--ink2); font-size: 11px; }
.tian-tag.is-ji { color: rgba(226, 87, 76, .85); }
.tian-empty { padding: 6px 0 10px; color: var(--ink3); font-size: 11.5px; }

.word-mini { display: flex; flex-direction: column; gap: 7px; padding: 2px 0 10px; }
.word-mini-row { display: flex; align-items: baseline; justify-content: space-between; }
.word-mini-k { font-size: 11px; letter-spacing: .08em; color: var(--ink3); }
.word-mini-v { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }
.word-mini-warn { color: var(--cinnabar); }
.word-mini-bar { height: 5px; overflow: hidden; border: 1px solid var(--line2); border-radius: 3px; background: rgba(0, 0, 0, .4); }
.word-mini-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); box-shadow: 0 0 10px rgba(232, 180, 90, .4); transition: width .5s ease; }
.ds-more { width: 100%; margin-top: 2px; text-align: center; }

@media (max-width: 1180px) {
  .hud-clock-date { display: none; }
  .hud-weather-city { display: none; }
}
@media (max-width: 980px) {
  .hud-clock { display: none; }
}
@media (max-width: 720px) {
  .hud-weather { margin-left: 8px; }
  .tian-now { gap: 10px; }
  .tian-ico { font-size: 30px; }
  .tian-temp { font-size: 22px; }
}

/* ============================================================
   山门登录 / 用户身份（多用户版）
   ============================================================ */
body.auth-locked { overflow: hidden; }
body.auth-locked #app { filter: blur(3px) saturate(.8); pointer-events: none; opacity: .55; }
body.auth-locked .menu-toggle { display: none; }

.auth-gate {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 620px at 50% -10%, rgba(232, 180, 90, .10), transparent 62%),
    radial-gradient(760px 520px at 12% 108%, rgba(99, 230, 213, .07), transparent 60%),
    rgba(5, 8, 14, .92);
  overflow: hidden;
}
.auth-gate.show { display: flex; }
.auth-ink {
  position: absolute; inset: -20%;
  background:
    radial-gradient(closest-side at 24% 32%, rgba(232, 180, 90, .10), transparent 70%),
    radial-gradient(closest-side at 76% 64%, rgba(99, 230, 213, .08), transparent 70%),
    radial-gradient(closest-side at 52% 88%, rgba(226, 87, 76, .05), transparent 70%);
  filter: blur(18px);
  animation: auth-ink-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes auth-ink-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.06); }
}
.auth-card {
  position: relative; width: 100%; max-width: 372px;
  margin: auto;
  padding: 34px 30px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(18, 30, 42, .97), rgba(8, 13, 20, .985)),
    radial-gradient(360px 200px at 50% 0%, rgba(232, 180, 90, .08), transparent 70%);
  box-shadow: 0 40px 90px -50px #000, inset 0 0 0 1px rgba(255, 255, 255, .02);
  animation: auth-card-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.auth-card::before {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid rgba(232, 180, 90, .10); border-radius: var(--r);
  pointer-events: none;
}
.auth-seal {
  width: 54px !important; height: 54px !important; font-size: 26px !important;
  margin: 0 auto 12px;
  box-shadow: 0 0 0 1px rgba(232, 180, 90, .28), 0 8px 26px -12px rgba(232, 180, 90, .5);
}
.auth-title {
  font-family: var(--font-display); font-size: 23px; letter-spacing: 4px;
  text-align: center; color: var(--ink);
}
.auth-sub {
  margin-top: 3px; text-align: center;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 3px; color: var(--ink3);
}
.auth-verse {
  margin: 14px 0 20px; text-align: center;
  font-family: var(--font-kai); font-size: 12.5px; color: var(--gold-soft);
  opacity: .82; letter-spacing: 1px;
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-label {
  font-family: var(--font-kai); font-size: 11px; letter-spacing: 2px; color: var(--ink2);
}
.auth-input {
  width: 100%; padding: 11px 12px;
  background: rgba(5, 9, 14, .72);
  border: 1px solid var(--line2); border-radius: var(--r);
  color: var(--ink); font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.auth-input:focus { border-color: rgba(232, 180, 90, .55); box-shadow: 0 0 0 3px var(--gold-dim); }
.auth-input::placeholder { color: var(--ink3); }
.auth-err {
  min-height: 18px; font-size: 12px; color: var(--cinnabar);
  text-align: center; line-height: 1.5;
}
.auth-submit {
  width: 100%; justify-content: center; padding: 11px 14px;
  font-family: var(--font-kai); font-size: 14px; letter-spacing: 3px;
}
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-or {
  display: flex; align-items: center; gap: 10px;
  margin: 15px 0 12px; color: var(--ink3);
  font-family: var(--font-kai); font-size: 11px;
}
.auth-or i { flex: 1; height: 1px; background: var(--line2); }
.auth-guest {
  width: 100%; justify-content: center;
  font-family: var(--font-kai); letter-spacing: 2px;
}
.auth-hint {
  margin-top: 14px; text-align: center;
  font-size: 11px; line-height: 1.7; color: var(--ink3);
}
/* 侧栏用户卡 */
.user-card {
  display: flex; align-items: center; gap: 9px;
  margin: 12px 2px 4px; padding: 8px 9px;
  border: 1px solid var(--line2); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(0, 0, 0, .12));
}
.user-avatar {
  flex: 0 0 30px; width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 2px;
  font-family: var(--font-display); font-size: 15px;
  color: #160d05; background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.user-avatar.role-user { background: linear-gradient(160deg, #a8f0e6, #3aa398); color: #04211d; }
.user-avatar.role-guest { background: linear-gradient(160deg, #8b95a8, #4b5566); color: #0c1119; }
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1px;
  color: var(--gold-soft);
}
.user-role.role-user { color: var(--cyan); }
.user-role.role-guest { color: var(--ink3); }
.user-act {
  flex: 0 0 auto; width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line2); border-radius: 2px;
  background: transparent; color: var(--ink2);
  font-family: var(--font-kai); font-size: 12px; cursor: pointer;
  transition: all .2s;
}
.user-act:hover { color: var(--gold); border-color: var(--line); background: var(--gold-dim); }

@media (max-width: 520px) {
  .auth-card { padding: 28px 20px 20px; }
  .auth-title { font-size: 20px; letter-spacing: 3px; }
}

/* 更易灵符（修改密码）弹层 */
.pwd-card { max-width: 392px; }
.pwd-actions { display: flex; gap: 10px; margin-top: 4px; }
.pwd-actions .btn { flex: 1 1 0; justify-content: center; }


/* 顶栏诗词容器（InkVisuals 内嵌挂载点） */
.topbar-poetry { flex: 0 1 340px; min-width: 0; display: flex; align-items: center; margin-left: 2px; }
@media (max-width: 1180px) {
  .topbar-poetry { flex: 1 1 260px; max-width: 360px; }
}
@media (max-width: 720px) {
  .topbar-poetry { display: none; }
}

/* ============================================================
   藏经阁 · 书库
   ============================================================ */
.lib { display: flex; flex-direction: column; gap: 18px; }
.lib-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 22px;
  padding: 26px 28px 24px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background:
    radial-gradient(560px 220px at 92% -40%, rgba(232, 180, 90, .14), transparent 70%),
    linear-gradient(135deg, rgba(232, 180, 90, .06), rgba(99, 230, 213, .035) 55%, transparent);
  box-shadow: var(--shadow);
}
.lib-hero::after {
  content: "藏";
  position: absolute; right: 18px; top: -34px;
  font-family: var(--font-display); font-size: 168px; line-height: 1;
  color: rgba(232, 180, 90, .055); pointer-events: none;
}
.lib-hero-copy { position: relative; z-index: 1; min-width: 0; }
.lib-kicker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .34em;
  color: var(--gold-soft); text-transform: uppercase;
}
.lib-title {
  margin: 8px 0 6px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(24px, 3.4vw, 34px); letter-spacing: .12em; color: var(--ink);
}
.lib-lead { margin: 0; max-width: 560px; font-size: 13px; color: var(--ink2); line-height: 1.75; }
.lib-tabs { position: relative; z-index: 1; display: flex; gap: 8px; flex: 0 0 auto; }
.lib-tab {
  appearance: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 118px; padding: 9px 14px;
  border: 1px solid var(--line2); border-radius: var(--r);
  background: rgba(0, 0, 0, .18); color: var(--ink2);
  font-family: var(--font-body); text-align: left;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.lib-tab:hover { border-color: rgba(232, 180, 90, .38); color: var(--ink); transform: translateY(-1px); }
.lib-tab.active {
  border-color: rgba(232, 180, 90, .58);
  background: linear-gradient(180deg, rgba(232, 180, 90, .16), rgba(232, 180, 90, .05));
  color: var(--gold-soft);
  box-shadow: inset 0 0 22px rgba(232, 180, 90, .06);
}
.lib-tab-label { font-size: 13px; letter-spacing: .08em; }
.lib-tab-hint { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: var(--ink3); }
.lib-tab.active .lib-tab-hint { color: rgba(244, 217, 163, .62); }

.lib-panel {
  padding: 16px 18px 18px;
  border: 1px solid var(--line2); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), rgba(0, 0, 0, .1));
}
.lib-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lib-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-crumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 28px; }
.lib-crumb-btn {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 3px 5px; border-radius: 2px;
  font-family: var(--font-body); font-size: 12.5px; color: var(--ink2);
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.lib-crumb-btn:hover { color: var(--gold); background: var(--gold-dim); }
.lib-crumb-btn.is-current { color: var(--gold-soft); font-weight: 600; }
.lib-crumb-sep { color: var(--ink3); font-size: 11px; }
.lib-crumb-label { font-size: 12.5px; color: var(--gold-soft); }
.lib-crumb-count { font-family: var(--font-mono); font-size: 10px; color: var(--ink3); margin-right: 4px; }

.lib-searchrow { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.lib-search { flex: 1 1 auto; min-width: 0; }
.lib-search::-webkit-search-cancel-button { filter: invert(.6); }

.lib-drop {
  margin-top: 14px; padding: 14px 16px;
  border: 1px dashed rgba(232, 180, 90, .28); border-radius: var(--r);
  background:
    repeating-linear-gradient(-45deg, rgba(232, 180, 90, .018) 0 8px, transparent 8px 16px),
    rgba(0, 0, 0, .12);
  transition: border-color .2s, background .2s, box-shadow .2s, opacity .2s;
}
.lib-drop.is-dragover {
  border-color: var(--gold);
  background: rgba(232, 180, 90, .09);
  box-shadow: inset 0 0 32px rgba(232, 180, 90, .1), 0 0 24px rgba(232, 180, 90, .08);
}
.lib-drop.is-busy { opacity: .6; pointer-events: none; }
.lib-drop-main { display: flex; align-items: center; gap: 13px; }
.lib-drop-icon {
  flex: 0 0 36px; width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid rgba(232, 180, 90, .3); border-radius: 2px;
  font-family: var(--font-kai); font-size: 15px; color: var(--gold-soft);
  background: rgba(232, 180, 90, .07);
}
.lib-drop-title { font-size: 13px; color: var(--ink); letter-spacing: .04em; }
.lib-drop-hint { margin-top: 2px; font-size: 11.5px; color: var(--ink3); }
.lib-upload { margin-top: 12px; }
.lib-upload-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold-soft); }
.lib-upload-bar { margin-top: 6px; height: 4px; background: rgba(255, 255, 255, .07); border-radius: 4px; overflow: hidden; }
.lib-upload-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .25s; }

.lib-list { margin-top: 14px; border-top: 1px solid var(--line2); }
.lib-hint { padding: 18px 6px; font-size: 12.5px; color: var(--ink3); text-align: center; }
.lib-hint.is-loading { color: var(--gold-soft); animation: lib-pulse 1.6s ease-in-out infinite; }
@keyframes lib-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.lib-error {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 0; padding: 10px 12px;
  border: 1px solid rgba(226, 87, 76, .3); border-left: 2px solid var(--cinnabar);
  border-radius: 2px; background: rgba(226, 87, 76, .07);
  font-size: 12.5px; color: #f0a49c;
}
.lib-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
  padding: 9px 8px; border-bottom: 1px solid var(--line2);
  transition: background .16s;
}
.lib-row:hover { background: rgba(232, 180, 90, .045); }
.lib-icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line2); border-radius: 2px;
  background: rgba(0, 0, 0, .2);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em;
  color: var(--ink2);
}
.lib-row.is-dir .lib-icon { color: var(--cyan); border-color: rgba(99, 230, 213, .24); background: rgba(99, 230, 213, .055); }
.lib-main { min-width: 0; }
.lib-name {
  display: block; max-width: 100%;
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px; color: var(--ink); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .16s;
}
.lib-name:hover { color: var(--gold); }
.lib-meta {
  margin-top: 1px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .03em;
  color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-ops { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.lib-danger { color: #f0a49c !important; border-color: rgba(226, 87, 76, .3) !important; }
.lib-danger:hover { background: rgba(226, 87, 76, .12) !important; border-color: rgba(226, 87, 76, .6) !important; }

.lib-baidu-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 2px 2px 14px; border-bottom: 1px solid var(--line2);
}
.lib-baidu-info { min-width: 0; }
.lib-baidu-title { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink); letter-spacing: .04em; }
.lib-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border: 1px solid rgba(232, 180, 90, .35); border-radius: 2px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: var(--gold-soft);
  background: rgba(232, 180, 90, .07);
}
.lib-baidu-toolbar { padding-top: 14px; }
.lib-notice {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 14px; padding: 13px 15px;
  border: 1px solid var(--line2); border-left: 2px solid var(--gold);
  border-radius: 2px; background: rgba(232, 180, 90, .045);
  font-size: 12.5px; color: var(--ink2);
}
.lib-notice strong { color: var(--gold-soft); font-weight: 500; letter-spacing: .04em; }
.lib-notice span { color: var(--ink3); }

.lib-config {
  margin-top: 14px;
  border: 1px solid var(--line2); border-radius: var(--r);
  background: rgba(0, 0, 0, .14);
}
.lib-config summary {
  cursor: pointer; padding: 10px 13px;
  font-size: 12px; letter-spacing: .06em; color: var(--gold-soft);
  list-style: none;
}
.lib-config summary::-webkit-details-marker { display: none; }
.lib-config summary::before { content: "＋"; margin-right: 7px; color: var(--ink3); font-size: 11px; }
.lib-config[open] summary::before { content: "－"; }
.lib-config-body { display: flex; flex-direction: column; gap: 10px; padding: 0 13px 14px; }
.lib-config-compact { background: transparent; }
.lib-config-compact .lib-config-body { flex-direction: row; align-items: center; }
.lib-field { display: flex; flex-direction: column; gap: 5px; }
.lib-field-label { font-size: 11px; letter-spacing: .12em; color: var(--ink2); }
.lib-field-hint { font-size: 10.5px; color: var(--ink3); }
.lib-field-input { width: 100%; }
.lib-config-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-config-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

.lib-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(3, 6, 12, .8);
  backdrop-filter: blur(7px);
  animation: lib-fade .18s ease-out;
}
@keyframes lib-fade { from { opacity: 0; } to { opacity: 1; } }
.lib-modal-box {
  display: flex; flex-direction: column;
  width: min(980px, 100%); max-height: 92vh;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel); box-shadow: 0 32px 90px -30px #000;
  animation: lib-rise .2s ease-out;
}
@keyframes lib-rise { from { transform: translateY(10px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.lib-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line2);
}
.lib-modal-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-display); font-size: 15px; letter-spacing: .06em; color: var(--ink);
}
.lib-modal-close {
  flex: 0 0 30px; width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line2); border-radius: 2px;
  background: transparent; color: var(--ink2); font-size: 18px; line-height: 1; cursor: pointer;
}
.lib-modal-close:hover { color: var(--gold); border-color: var(--line); background: var(--gold-dim); }
.lib-modal-body { flex: 1 1 auto; min-height: 120px; overflow: auto; padding: 16px; }
.lib-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line2); }
.lib-preview-img, .lib-preview-video { display: block; max-width: 100%; max-height: 66vh; margin: 0 auto; border-radius: 2px; background: #000; }
.lib-preview-audio { display: block; width: min(560px, 100%); margin: 28px auto; }
.lib-preview-frame { display: block; width: 100%; height: min(68vh, 720px); border: 0; border-radius: 2px; background: #fff; }
.lib-preview-text {
  margin: 0; padding: 14px 16px; max-height: 66vh; overflow: auto;
  border: 1px solid var(--line2); border-radius: 2px; background: rgba(0, 0, 0, .34);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--ink2);
  white-space: pre-wrap; word-break: break-word;
}
.lib-file-input { display: none; }

@media (max-width: 900px) {
  .lib-hero { flex-direction: column; align-items: stretch; padding: 22px 20px 20px; }
  .lib-hero::after { font-size: 132px; top: -22px; }
  .lib-tabs { align-self: flex-start; }
}
@media (max-width: 720px) {
  .lib { gap: 12px; }
  .lib-hero { padding: 18px 15px 16px; }
  .lib-title { font-size: 24px; }
  .lib-lead { font-size: 12px; }
  .lib-tabs { width: 100%; }
  .lib-tab { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
  .lib-tab-hint { display: none; }
  .lib-panel { padding: 12px 11px 14px; }
  .lib-toolbar { align-items: flex-start; }
  .lib-tools { width: 100%; }
  .lib-tools .btn { flex: 1 1 auto; justify-content: center; }
  .lib-row { grid-template-columns: 32px minmax(0, 1fr); gap: 8px 10px; padding: 9px 4px; }
  .lib-icon { width: 30px; height: 30px; }
  .lib-ops { grid-column: 2; justify-content: flex-start; }
  .lib-name { font-size: 13px; }
  .lib-drop { padding: 12px; }
  .lib-modal { padding: 10px; }
  .lib-modal-box { max-height: 94vh; }
  .lib-modal-body { padding: 10px; }
  .lib-modal-title { font-size: 13.5px; }
}
@media (max-width: 480px) {
  .lib-hero::after { display: none; }
  .lib-drop-main { align-items: flex-start; }
  .lib-drop-icon { flex-basis: 30px; width: 30px; height: 30px; font-size: 13px; }
  .lib-searchrow { flex-wrap: wrap; }
  .lib-search { flex-basis: 100%; }
  .lib-baidu-head { flex-direction: column; }
}

/* ---------------- 网站备案页脚 ---------------- */
.site-foot {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 24px);
  padding: 3px 12px;
  border: 1px solid rgba(154, 116, 40, .18);
  border-radius: 999px;
  background: rgba(246, 242, 233, .66);
  color: rgba(74, 66, 50, .72);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  filter: var(--dn-surface-filter, none);
  transition: filter 1.6s linear, color .3s ease, background .3s ease;
}
.site-foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(154, 116, 40, .45);
  pointer-events: auto;
}
.site-foot a:hover { color: #9a7428; }
/* 登录/入山页的 auth-gate 层级为 9000，页脚需在其上才可见 */
body.auth-locked .site-foot { z-index: 9500; }
@media (max-width: 720px) {
  .site-foot {
    bottom: 4px;
    gap: 0;
    padding: 2px 10px;
    font-size: 10px;
    max-width: calc(100vw - 16px);
    white-space: nowrap;
    text-align: center;
  }
  .site-foot span { display: none; }
  .site-foot .site-foot-nav { display: none; }
}

