/* ============ 朋克风设计 token ============ */
:root {
  --bg: #0d0b14;
  --bg-2: #14111f;
  --panel: #1b1729;
  --panel-2: #221d33;
  --line: #342d4d;
  --ink: #f2ecff;
  --ink-dim: #a79cc4;
  --ink-mute: #6f6690;

  --neon: #ff2d78;
  --neon-2: #00f0ff;
  --acid: #c6ff2e;
  --violet: #a259ff;
  --amber: #ffb020;
  --danger: #ff4757;

  --r: 14px;
  --r-sm: 9px;
  --stroke: 2px solid #000;
  --shadow-hard: 4px 4px 0 #000;
  --shadow-hard-sm: 3px 3px 0 #000;
  --font: "Chalkboard SE", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ============ 浅色主题 ============ */
body.light-theme {
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f5f5f7;
  --line: #d1d1d6;
  --ink: #1d1d1f;
  --ink-dim: #6e6e73;
  --ink-mute: #86868b;

  --neon: #ff2d55;
  --neon-2: #00c7be;
  --acid: #30d158;
  --violet: #bf5af2;
  --amber: #ff9500;
  --danger: #ff3b30;

  --stroke: 2px solid #1d1d1f;
  --shadow-hard: 4px 4px 0 #d1d1d6;
  --shadow-hard-sm: 3px 3px 0 #d1d1d6;
}

body.light-theme {
  background:
    radial-gradient(1100px 600px at 12% -8%, #ffeef3 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #e0f7f5 0%, transparent 55%),
    var(--bg);
}

* { box-sizing: border-box; }

/* hidden 属性必须压过组件的 display:grid，否则隐藏的遮罩层会拦截点击 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 12% -8%, #2a1140 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #06303a 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 噪点 + 扫描线质感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  opacity: .05;
  background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
}

/* 浅色主题：减弱噪点效果 */
body.light-theme::before {
  opacity: .015;
  background-image: repeating-linear-gradient(0deg, #000 0 1px, transparent 1px 3px);
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0f0d18; }
::-webkit-scrollbar-thumb { background: #3d3459; border-radius: 99px; border: 2px solid #0f0d18; }
::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* 浅色主题滚动条 */
body.light-theme ::-webkit-scrollbar-track { background: #f5f5f7; }
body.light-theme ::-webkit-scrollbar-thumb { background: #c7c7cc; border-color: #f5f5f7; }
body.light-theme ::-webkit-scrollbar-thumb:hover { background: #a1a1a6; }

/* ============ 布局 ============ */
#app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: linear-gradient(180deg, #191428, #120f1d);
  border-right: 2px solid #000;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 14px;
  z-index: 3;
}

/* 浅色主题侧边栏 */
body.light-theme .sidebar {
  background: linear-gradient(180deg, #ffffff, #f5f5f7);
  border-right: 2px solid #d1d1d6;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  display: grid; place-items: center;
  font-weight: 900; font-size: 13px; letter-spacing: .5px;
  color: #000;
  background: linear-gradient(135deg, var(--acid), var(--neon-2));
  border: var(--stroke);
  border-radius: 10px;
  box-shadow: var(--shadow-hard-sm);
  transform: rotate(-4deg);
}

/* 浅色主题品牌标识 */
body.light-theme .brand-mark {
  border-color: #d1d1d6;
  color: #1d1d1f;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; letter-spacing: .5px; }
.brand-text span { font-size: 9px; color: var(--ink-mute); letter-spacing: 1.4px; }

.class-switch { display: flex; flex-direction: column; gap: 5px; }
.class-switch label { font-size: 10px; color: var(--ink-mute); letter-spacing: 1.5px; }

.nav { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 11px;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-dim);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: .15s;
}
.nav-item .ico { font-size: 16px; filter: grayscale(.4); }
.nav-item:hover { background: #241f38; color: var(--ink); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,45,120,.22), transparent);
  border-color: #000;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--neon);
}
.nav-item.active .ico { filter: none; }

/* 浅色主题导航 */
body.light-theme .nav-item:hover { background: #e5e5ea; }
body.light-theme .nav-item.active {
  background: var(--violet);
  border-color: var(--violet);
  color: #ffffff;
  box-shadow: none;
}

.sidebar-foot { display: flex; flex-direction: column; gap: 9px; }
.tip { margin: 0; font-size: 10px; line-height: 1.6; color: var(--ink-mute); }
.beian { margin: 0; font-size: 10px; line-height: 1.6; }
.beian a { color: var(--ink-mute); text-decoration: none; }
.beian a:hover { color: var(--ink); text-decoration: underline; }

/* 账号 / 云同步 */
.auth-box:empty { display: none; }
.auth-login { width: 100%; }
.auth-user {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: #191426; border: var(--stroke);
}
.auth-dot {
  width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%;
  background: var(--acid); box-shadow: 0 0 6px var(--acid);
}
.auth-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.auth-meta b {
  font-size: 11px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-plan { font-size: 9.5px; font-weight: 800; }
.auth-plan.plan-free { color: var(--ink-mute); }
.auth-plan.plan-pro { color: var(--amber); }
.auth-plan.plan-school { color: var(--neon); }

body.light-theme .auth-user { background: #f5f5f7; border-color: #d1d1d6; }
body.light-theme .auth-meta b { color: #1d1d1f; }

/* 登录弹窗 */
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-hint { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-mute); }
.login-form .field { display: flex; flex-direction: column; gap: 5px; }
.login-form .field span { font-size: 12px; font-weight: 700; color: var(--ink-dim); }
.login-form input {
  padding: 10px 12px; border: var(--stroke); border-radius: var(--r-sm);
  background: #191426; color: var(--ink); font-size: 14px;
}
body.light-theme .login-form input { background: #f5f5f7; border-color: #d1d1d6; color: #1d1d1f; }
.login-err {
  font-size: 12px; color: #ff7d88; font-weight: 700;
  padding: 6px 10px; border-radius: var(--r-sm); background: rgba(255,45,120,.12);
}
.wechat-soon { width: 100%; opacity: .5; cursor: not-allowed; }

.main { flex: 1; overflow-y: auto; padding: 20px 24px 60px; position: relative; }

/* ============ 通用组件 ============ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-title { margin: 0; font-size: 25px; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; }
.page-title small { font-size: 11px; color: var(--ink-mute); letter-spacing: 2px; font-weight: 400; }
.page-sub { margin: 6px 0 0; font-size: 12px; color: var(--ink-dim); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px;
  border: var(--stroke);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 #000; }
.btn-primary { background: linear-gradient(135deg, var(--neon), #ff6a3d); color: #fff; }
.btn-acid { background: linear-gradient(135deg, var(--acid), #6fe36f); color: #101010; }
.btn-cyan { background: linear-gradient(135deg, var(--neon-2), var(--violet)); color: #04121a; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #b3122b); color: #fff; }
.btn-ghost { background: #1f1a30; }
.btn-sm { padding: 6px 11px; font-size: 12px; box-shadow: 2px 2px 0 #000; }
.btn:disabled { opacity: .42; cursor: not-allowed; filter: none; transform: none; }

/* 浅色主题按钮 */
body.light-theme .btn-ghost { background: #e5e5ea; color: #1d1d1f; }
body.light-theme .btn-sm { box-shadow: 2px 2px 0 #d1d1d6; }
body.light-theme .btn:active { box-shadow: 0 0 0 #d1d1d6; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  background: #100d1b;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--neon-2); box-shadow: 0 0 0 3px rgba(0,240,255,.13); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.7; }
.select { cursor: pointer; }
option { background: #16121f; }

/* 浅色主题表单 */
body.light-theme .input,
body.light-theme .select,
body.light-theme .textarea {
  background: #ffffff;
  color: #1d1d1f;
  border-color: #d1d1d6;
}
body.light-theme option { background: #ffffff; color: #1d1d1f; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow-hard);
  padding: 16px;
}

/* 浅色主题卡片 */
body.light-theme .card {
  background: #ffffff;
  border-color: #d1d1d6;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field > label { font-size: 12px; color: var(--ink-dim); font-weight: 700; }
.field .hint { font-size: 10.5px; color: var(--ink-mute); line-height: 1.6; }
.field-row { display: flex; gap: 11px; }
.field-row > * { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: #191527;
  font-size: 11.5px;
  color: var(--ink-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
}
.chip:hover { border-color: var(--violet); color: var(--ink); }
.chip.on { background: var(--violet); border-color: #000; color: #fff; font-weight: 700; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }

/* 浅色主题chip */
body.light-theme .chip {
  background: #f5f5f7;
  border-color: #d1d1d6;
}
body.light-theme .chip.on {
  background: var(--violet);
  border-color: var(--violet);
  color: #ffffff;
}

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; border: 1.5px solid #000;
}
.tag-plus { background: rgba(198,255,46,.19); color: var(--acid); border-color: rgba(198,255,46,.4); }
.tag-minus { background: rgba(255,71,87,.19); color: #ff7d88; border-color: rgba(255,71,87,.4); }

.empty {
  text-align: center; padding: 56px 20px; color: var(--ink-mute);
}
.empty .big { font-size: 46px; margin-bottom: 12px; filter: grayscale(.3); }
.empty h3 { margin: 0 0 7px; color: var(--ink-dim); font-size: 16px; }
.empty p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.7; }

.stat-row { display: flex; gap: 11px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  flex: 1; min-width: 118px;
  padding: 12px 14px;
  background: var(--panel);
  border: var(--stroke);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-hard-sm);
}
.stat b { display: block; font-size: 23px; line-height: 1.1; }
.stat span { font-size: 10.5px; color: var(--ink-mute); letter-spacing: 1px; }

/* 浅色主题统计卡片 */
body.light-theme .stat {
  background: #ffffff;
  border-color: #d1d1d6;
}

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 10px 11px;
  font-size: 11px; letter-spacing: 1px; color: var(--ink-mute);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
table.tbl td { padding: 10px 11px; border-bottom: 1px solid #241f36; vertical-align: middle; }
table.tbl tr:hover td { background: #1d1830; }

/* 浅色主题表格 */
body.light-theme table.tbl td { border-bottom-color: #e5e5ea; }
body.light-theme table.tbl tr:hover td { background: #f5f5f7; }

/* ============ 宠物园 ============ */
.garden-toolbar {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  margin-bottom: 15px;
}
.search-box { position: relative; }
.search-box .input { width: 190px; padding-left: 30px; }
.search-box::before {
  content: "🔍"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 12px; opacity: .55; pointer-events: none;
}

.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(174px, 1fr));
  gap: 14px;
}

.pet-card {
  position: relative;
  padding: 13px 12px 12px;
  background: linear-gradient(180deg, var(--panel), #171326);
  border: var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform .13s, box-shadow .13s;
  overflow: hidden;
}
.pet-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120px 70px at 50% 0%, rgba(162,89,255,.16), transparent 70%);
}
.pet-card:hover { transform: translate(-2px, -3px); box-shadow: 6px 7px 0 #000; }
.pet-card.selected { border-color: var(--acid); box-shadow: 4px 4px 0 #000, 0 0 0 3px rgba(198,255,46,.45); }

/* 浅色主题宠物卡片 */
body.light-theme .pet-card {
  background: linear-gradient(180deg, #ffffff, #f5f5f7);
  border-color: #d1d1d6;
}
body.light-theme .pet-card::after {
  background: radial-gradient(120px 70px at 50% 0%, rgba(191,90,242,.08), transparent 70%);
}
body.light-theme .pet-card:hover { box-shadow: 6px 7px 0 #d1d1d6; }
body.light-theme .pet-card.selected { box-shadow: 4px 4px 0 #d1d1d6, 0 0 0 3px rgba(48,209,88,.3); }

.pet-card .pick {
  position: absolute; top: 8px; left: 8px;
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid #000; background: #2b2440;
  display: none; place-items: center;
  font-size: 12px; color: #000; font-weight: 900;
  z-index: 2;
}
body.batch-mode .pet-card .pick { display: grid; }
.pet-card.selected .pick { background: var(--acid); }

.pet-lv {
  position: absolute; top: 8px; right: 8px;
  padding: 2px 8px; border-radius: 99px;
  background: linear-gradient(135deg, var(--amber), var(--neon));
  color: #14060f; font-size: 10.5px; font-weight: 900;
  border: 2px solid #000;
  z-index: 2;
}
.pet-lv.max { background: linear-gradient(135deg, var(--acid), var(--neon-2)); }

/* 浅色主题等级标签 */
body.light-theme .pet-lv {
  border-color: #d1d1d6;
  color: #1d1d1f;
}

.pet-art {
  height: 130px;
  display: grid; place-items: center;
  margin: 8px 0 6px;
}
.pet-art svg { width: 120px; height: 120px; overflow: visible; animation: float 3s ease-in-out infinite; }
.pet-card:hover .pet-art svg { animation: floatHover 0.7s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes floatHover { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(-3deg); } }

.pet-name {
  font-size: 14.5px; font-weight: 800; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pet-sub { font-size: 10px; color: var(--ink-mute); text-align: center; margin-top: 2px; height: 13px; }

.bar {
  height: 9px; margin-top: 9px;
  background: #0c0a14;
  border: 2px solid #000;
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--neon-2), var(--acid));
  transition: width .5s cubic-bezier(.2,.9,.2,1);
}
.bar.full > i { background: linear-gradient(90deg, var(--amber), var(--neon)); }

/* 浅色主题进度条 */
body.light-theme .bar {
  background: #e5e5ea;
  border-color: #d1d1d6;
}

.pet-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 7px; font-size: 10.5px; color: var(--ink-dim);
}
.pet-foot .badges { color: var(--amber); font-weight: 700; }

.batch-bar {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding: 11px 14px;
  background: linear-gradient(90deg, #241535, #14202e);
  border: var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow-hard);
}
.batch-bar b { color: var(--acid); }

/* 浅色主题批量操作栏 */
body.light-theme .batch-bar {
  background: linear-gradient(90deg, #f5f5f7, #e5e5ea);
  border-color: #d1d1d6;
}

/* ============ 弹窗 ============ */
.modal-root {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(6,4,12,.76);
  backdrop-filter: blur(4px);
  animation: fade .16s;
}
@keyframes fade { from { opacity: 0; } }

/* 浅色主题模态框遮罩 */
body.light-theme .modal-root {
  background: rgba(29,29,31,.5);
}

.modal {
  width: 100%; max-width: 520px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #201a31, #15111f);
  border: var(--stroke);
  border-radius: 16px;
  box-shadow: 7px 8px 0 #000;
  animation: pop .2s cubic-bezier(.2,1.2,.3,1);
  overflow: hidden;
}
.modal.wide { max-width: 720px; }
@keyframes pop { from { transform: translateY(14px) scale(.96); opacity: 0; } }

/* 浅色主题模态框 */
body.light-theme .modal {
  background: linear-gradient(180deg, #ffffff, #f5f5f7);
  border-color: #d1d1d6;
  box-shadow: 7px 8px 0 #d1d1d6;
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  border-bottom: 2px solid #000;
  background: #191426;
}

/* 浅色主题模态框头部 */
body.light-theme .modal-head {
  background: #f5f5f7;
  border-bottom-color: #d1d1d6;
}
body.light-theme .modal-foot {
  background: #f5f5f7;
  border-top-color: #d1d1d6;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .x {
  border: none; background: transparent; color: var(--ink-mute);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.modal-head .x:hover { color: var(--neon); }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 13px 16px; border-top: 2px solid #000; background: #191426;
}

/* 加减分弹窗 */
.score-tabs { display: flex; gap: 8px; margin-bottom: 13px; }
.score-tabs button {
  flex: 1; padding: 9px; border: var(--stroke); border-radius: var(--r-sm);
  background: #1d1830; color: var(--ink-dim); font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
}
.score-tabs button.on.plus { background: linear-gradient(135deg, var(--acid), #63dd63); color: #0e1a0e; }
.score-tabs button.on.minus { background: linear-gradient(135deg, var(--danger), #a3112a); color: #fff; }

/* 浅色主题评分标签 */
body.light-theme .score-tabs button {
  background: #f5f5f7;
  border-color: #d1d1d6;
}
body.light-theme .score-tabs button.on.plus {
  background: linear-gradient(135deg, #34c759, #30a14e);
  border-color: #34c759;
  color: #ffffff;
}
body.light-theme .score-tabs button.on.minus {
  background: linear-gradient(135deg, #ff3b30, #d70015);
  border-color: #ff3b30;
  color: #ffffff;
}

.rule-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
.rule-btn {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 11px;
  border: 2px solid var(--line); border-radius: var(--r-sm);
  background: #191426; color: var(--ink);
  cursor: pointer; text-align: left;
  transition: .13s;
}
.rule-btn:hover { border-color: var(--neon-2); background: #211b34; transform: translateY(-2px); }

/* 浅色主题规则按钮 */
body.light-theme .rule-btn {
  background: #f5f5f7;
  border-color: #d1d1d6;
}
body.light-theme .rule-btn:hover {
  background: #ffffff;
}
.rule-btn strong { font-size: 13px; }
.rule-btn span { font-size: 11px; color: var(--ink-mute); }
.rule-btn .val { font-size: 15px; font-weight: 900; }
.rule-btn.plus .val { color: var(--acid); }
.rule-btn.minus .val { color: #ff7d88; }

.pet-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pet-opt {
  padding: 9px 6px;
  border: 2px solid var(--line); border-radius: var(--r-sm);
  background: #191426; cursor: pointer; text-align: center;
  transition: .13s;
}

/* 浅色主题宠物选择器 */
body.light-theme .pet-opt {
  background: #f5f5f7;
  border-color: #d1d1d6;
}
.pet-opt:hover { border-color: var(--neon); transform: translateY(-3px); }
.pet-opt.on { border-color: var(--acid); background: #24202f; box-shadow: 0 0 0 3px rgba(198,255,46,.28); }

/* 浅色主题宠物选择激活状态 */
body.light-theme .pet-opt.on {
  background: var(--violet);
  border-color: var(--violet);
  box-shadow: none;
}
body.light-theme .pet-opt.on small {
  color: #ffffff;
}
.pet-opt svg { width: 56px; height: 56px; }
.pet-opt small { display: block; font-size: 10.5px; color: var(--ink-dim); margin-top: 3px; }

/* ============ 荣誉榜 / 商店 ============ */
.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-row {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px;
  background: var(--panel); border: var(--stroke); border-radius: var(--r-sm);
  box-shadow: var(--shadow-hard-sm);
}
.rank-row .no {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center; border-radius: 9px;
  background: #2a2340; border: 2px solid #000;
  font-weight: 900; font-size: 13px;
}

/* 浅色主题排名号码 */
body.light-theme .rank-row .no {
  background: #e5e5ea;
  border-color: #d1d1d6;
}
.rank-row.top1 .no { background: linear-gradient(135deg, #ffd54a, var(--amber)); color: #241500; }
.rank-row.top2 .no { background: linear-gradient(135deg, #e2e8f0, #9aa6b8); color: #1a1f27; }
.rank-row.top3 .no { background: linear-gradient(135deg, #e8965a, #a75f2c); color: #24120a; }
.rank-row svg { width: 42px; height: 42px; flex: 0 0 42px; }
.rank-row .who { flex: 1; min-width: 0; }
.rank-row .who b { display: block; font-size: 14.5px; }
.rank-row .who span { font-size: 11px; color: var(--ink-mute); }
.rank-row .metric { text-align: right; font-size: 11px; color: var(--ink-dim); }
.rank-row .metric b { display: block; font-size: 17px; color: var(--amber); }

.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 13px; }
.goods {
  padding: 14px 13px;
  background: linear-gradient(180deg, var(--panel), #171326);
  border: var(--stroke); border-radius: var(--r);
  box-shadow: var(--shadow-hard);
  display: flex; flex-direction: column; gap: 7px;
}

/* 浅色主题商品卡片 */
body.light-theme .goods {
  background: linear-gradient(180deg, #ffffff, #f5f5f7);
  border-color: #d1d1d6;
}
.goods .emo { font-size: 34px; text-align: center; }
.goods b { font-size: 14.5px; }
.goods p { margin: 0; font-size: 11px; color: var(--ink-mute); line-height: 1.6; min-height: 32px; }
.goods .price { font-weight: 900; color: var(--amber); font-size: 15px; }
.goods .row { display: flex; align-items: center; justify-content: space-between; }
.goods .stock { font-size: 10.5px; color: var(--ink-mute); }
.goods.out { opacity: .5; }

/* ============ 升级动画 ============ */
.levelup-root {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(5,3,10,.86);
  cursor: pointer;
  animation: fade .2s;
}

/* 浅色主题升级动画背景 */
body.light-theme .levelup-root {
  background: rgba(245,245,247,.92);
}
.levelup-card { text-align: center; animation: pop .35s cubic-bezier(.2,1.4,.3,1); }
.levelup-card svg { width: 168px; height: 168px; filter: drop-shadow(0 0 26px rgba(198,255,46,.55)); }
.levelup-card h2 {
  margin: 14px 0 5px; font-size: 32px; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--acid), var(--neon-2), var(--neon));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.levelup-card p { margin: 0; color: var(--ink-dim); font-size: 13.5px; }
.levelup-card .hint2 { margin-top: 18px; font-size: 11px; color: var(--ink-mute); }

/* ============ Toast ============ */
.toast-root {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 17px;
  background: #1d1830; color: var(--ink);
  border: var(--stroke); border-radius: 99px;
  box-shadow: var(--shadow-hard-sm);
  font-size: 13px; font-weight: 700;
  animation: toastIn .22s;
}
.toast.ok { background: linear-gradient(135deg, #2b7a2b, #1d5a1d); }
.toast.err { background: linear-gradient(135deg, #a3122a, #6d0d1d); }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } }

/* 浅色主题toast */
body.light-theme .toast {
  background: #ffffff;
  border-color: #d1d1d6;
  color: #1d1d1f;
}
body.light-theme .toast.ok {
  background: linear-gradient(135deg, #34c759, #30a14e);
  color: #ffffff;
}
body.light-theme .toast.err {
  background: linear-gradient(135deg, #ff3b30, #d70015);
  color: #ffffff;
}

/* 浅色主题班级选择器（覆盖内联样式） */
body.light-theme [data-pick-class] {
  background: #f5f5f7 !important;
  border-color: #d1d1d6 !important;
}
body.light-theme [data-pick-class]:hover {
  background: #e5e5ea !important;
}
/* 浅色主题当前选中班级的父容器 */
body.light-theme [data-pick-class] + button + button {
  /* 选中状态的父div有border: 2px solid #000，需要覆盖 */
}
body.light-theme div[style*="border:2px solid #000"] {
  border-color: var(--acid) !important;
  background: #ffffff !important;
}

/* 浅色主题加减分规则项 */
body.light-theme [data-edit-rule] {
  /* 规则项的父div */
}
body.light-theme div[style*="background:#191426"] {
  background: #f5f5f7 !important;
  border-color: #d1d1d6 !important;
}

/* 浅色主题SVG描边 */
body.light-theme svg [stroke="#000"] {
  stroke: #8e8e93 !important;
}
body.light-theme svg [fill="#000"] {
  fill: #1d1d1f !important;
}
body.light-theme svg [stroke="#111"] {
  stroke: #1d1d1f !important;
}
body.light-theme svg [fill="#111"] {
  fill: #1d1d1f !important;
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  #app { flex-direction: column; height: auto; }
  .sidebar {
    width: 100%; flex: none; flex-direction: row; flex-wrap: wrap;
    align-items: center; border-right: none; border-bottom: 2px solid #000;
    position: sticky; top: 0;
  }
  .nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; }
  .nav-item { white-space: nowrap; }
  .sidebar-foot { flex-direction: row; align-items: center; flex: 1 1 100%; }
  .tip { display: none; }
  .class-switch { flex: 1; }
  .main { height: auto; padding: 16px; }
  .pet-grid { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); }
}
