/* ============================================================
   班级幻兽学院 · 桌面端 / 官网样式
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸张颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 180px 180px;
  opacity: 0.045;
  mix-blend-mode: multiply;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 基础排版 ---------- */
.display { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
.serif { font-family: var(--font-serif); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 600;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: currentColor; opacity: .55;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.section { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-head h2 { font-size: 26px; }
.section-head p { color: var(--muted); font-size: 13px; max-width: 560px; }

.rule-dashed { border: 0; border-top: 1.5px dashed var(--line); margin: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: var(--bw) solid transparent;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(160deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--accent-strong) 70%, transparent);
}
.btn-primary:hover { background: linear-gradient(160deg, var(--accent-strong), var(--accent-strong)); }

.btn-outline { border-color: var(--line); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 999px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-danger { background: var(--seal); color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- 标签 / 徽章 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .16s ease;
}
.chip:hover { border-color: var(--line); }
.chip.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
}
.chip.is-plus { background: var(--good-soft); color: var(--good); }
.chip.is-minus { background: var(--bad-soft); color: var(--bad); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  background: var(--paper-2); color: var(--ink-2);
  border: 1px solid var(--line-soft);
}
.tag--gold { background: var(--warn-soft); color: var(--warn); border-color: #efd9ab; }
.tag--green { background: var(--good-soft); color: var(--good); border-color: #cbe6d9; }
.tag--red { background: var(--bad-soft); color: var(--bad); border-color: #f0cdd3; }
.tag--cool { background: var(--sky); color: #3b6479; border-color: var(--cool-line); }
.tag--plain { background: transparent; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- 等级徽章 ---------- */
.lvl {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 42px; height: 24px; padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6e0, #f6e2b6);
  border: 1px solid #e8c987;
  color: #7c5a1c;
  font-family: var(--font-num);
  font-weight: 800; font-size: 12px;
  letter-spacing: .02em;
  box-shadow: inset 0 -2px 0 rgba(180, 130, 40, .18);
}
.lvl::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #e0a63c; }

/* ---------- 印章 ---------- */
.stamp {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 7px;
  border: 2px solid var(--seal);
  border-radius: 5px;
  color: var(--seal);
  font-family: var(--font-serif); font-weight: 700;
  font-size: 10px; letter-spacing: .18em;
  transform: rotate(-6deg);
  opacity: .78;
  mix-blend-mode: multiply;
  white-space: nowrap;
}
.stamp--gold { border-color: var(--warn); color: var(--warn); }
.stamp--green { border-color: var(--good); color: var(--good); }
.stamp--large { font-size: 12px; padding: 5px 10px; letter-spacing: .24em; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card--flat { box-shadow: none; }
.card--soft { background: var(--paper-2); border-color: var(--line-soft); box-shadow: none; }
.card-pad-sm { padding: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 统计 ---------- */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .k { font-size: 11px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.stat .v { font-family: var(--font-num); font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.stat-row > .stat { padding: 4px 20px; border-left: 1.5px dashed var(--line); }
.stat-row > .stat:first-child { border-left: 0; padding-left: 0; }

/* ---------- 进度条 ---------- */
.progress {
  --v: 60%;
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 55%, var(--paper) 45%);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(80, 60, 20, .12);
}
.progress > i {
  display: block; height: 100%; width: var(--v);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2)));
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.progress--thin { height: 6px; }
.progress--thick { height: 12px; }
.progress-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 7px; font-size: 11px; color: var(--muted); }
.progress-label b { color: var(--ink); font-family: var(--font-num); font-size: 12px; }

/* ---------- 环形进度 ---------- */
.ring {
  --p: 68;
  position: relative;
  width: 108px; height: 108px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), color-mix(in srgb, var(--line) 70%, transparent) 0);
  display: grid; place-items: center;
}
.ring::after {
  content: "";
  position: absolute; inset: 9px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.ring .ring-in { position: relative; z-index: 1; text-align: center; line-height: 1.15; }
.ring .ring-in b { font-family: var(--font-num); font-size: 22px; font-weight: 800; display: block; }
.ring .ring-in span { font-size: 10px; color: var(--muted); letter-spacing: .08em; }

/* ---------- 幻兽容器 ---------- */
.pet { width: 100%; height: 100%; display: block; transition: transform .35s ease; }
.pet-wrap { display: grid; place-items: center; position: relative; }
.pet-frame {
  position: relative; display: grid; place-items: center;
  width: 92px; height: 92px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.9), transparent 58%),
    radial-gradient(circle at 50% 58%, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, var(--paper-2)));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.pet-frame::after {
  content: ""; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  width: 56%; height: 10px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(70,50,20,.18), transparent 70%);
  filter: blur(1px);
}
.pet-frame > .pet { width: 78%; height: 78%; }
.pet-frame.pet-sm { width: 52px; height: 52px; }
.pet-frame.pet-lg { width: 148px; height: 148px; }
.pet-frame.pet-xl { width: 196px; height: 196px; }
.pet-frame.pet-cool {
  background: radial-gradient(circle at 34% 26%, rgba(255,255,255,.92), transparent 60%),
    radial-gradient(circle at 50% 60%, #dbebf3, #eef5f8);
  border-color: var(--cool-line);
}
.pet-frame.pet-warm {
  background: radial-gradient(circle at 34% 26%, rgba(255,255,255,.92), transparent 60%),
    radial-gradient(circle at 50% 60%, #ffe7c9, #fff3e0);
  border-color: var(--warm-line);
}

/* ---------- 头像 ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong);
  font-weight: 700; font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  flex: none;
}
.avatar--green { background: var(--good-soft); color: var(--good); border-color: #c9e3d6; }
.avatar--cool { background: var(--sky); color: #3b6479; border-color: var(--cool-line); }
.avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.avatar--lg { width: 46px; height: 46px; font-size: 16px; }

/* ---------- 性别图标 ---------- */
.table .who .gender-ico {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0;
  border: 1px solid var(--line-soft);
  background: var(--paper-2);
  color: var(--muted);
}
.table .who .gender-ico svg { width: 15px; height: 15px; display: block; }
.table .who .gender-ico.is-m { background: #e8f1f7; border-color: #cfe1ec; color: #3b6479; }
.table .who .gender-ico.is-f { background: #fbeaf0; border-color: #f4d3df; color: #c2557a; }

/* ---------- 学生管理：左侧添加表单 + 右侧列表 ---------- */
.students-split {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.student-add { padding: 16px; position: sticky; top: 16px; }
.student-add .sa-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.student-add .sa-head b { font-size: 13.5px; }
.student-main { min-width: 0; }
.stu-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 4px 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
.stu-stats b { margin-left: 3px; font-size: 13.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.stu-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.stu-dot--m { background: #3b6479; }
.stu-dot--f { background: #c2557a; }
.stu-dot--n { background: var(--line); }
.bulk-add { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.bulk-add b { font-size: 13px; }
.bulk-add textarea.input { min-height: 96px; resize: none; overflow: hidden; field-sizing: content; padding: 10px 12px; line-height: 1.5; }
.bulk-actions { display: flex; gap: 8px; margin-top: 2px; }
.btn-bulk { height: 34px; padding: 0 14px; border: none; border-radius: 10px; font-size: 12.5px; font-weight: 800; cursor: pointer; transition: filter .15s ease; }
.btn-bulk:hover { filter: brightness(.97); }
.btn-bulk--add { background: #fdece1; color: #c2673a; }
.btn-bulk--import { background: #e4f4ec; color: #2f7d5f; }
.pet-assign { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 10px; }
.pet-assign > b { font-size: 13px; }
.pa-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1.5px solid var(--line-soft); border-radius: 12px; background: var(--surface); }
.pa-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; }
.pa-ico { font-size: 15px; line-height: 1; }
.pa-desc { font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.pa-btn { margin-top: 4px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.pa-btn--outline { background: var(--surface); border-color: color-mix(in srgb, var(--accent-strong) 45%, transparent); color: var(--accent-strong); }
.pa-btn--outline:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.pa-btn--solid { background: var(--accent-strong); color: #fff; }
.pa-btn--solid:hover { filter: brightness(1.04); }
@media (max-width: 900px) {
  .students-split { grid-template-columns: 1fr; }
  .student-add { position: static; }
}

/* ---------- 表格 ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: var(--bw) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--muted);
  background: var(--paper-2);
  border-bottom: 1.5px dashed var(--line);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px dashed var(--line-soft);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .16s ease; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 28%, transparent); }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who b { font-weight: 600; }
.table .who span { display: block; font-size: 11px; color: var(--muted); }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table--ledger td:first-child { font-family: var(--font-num); color: var(--muted); font-size: 12px; white-space: nowrap; }

.delta { font-family: var(--font-num); font-weight: 800; font-size: 13px; }
.delta.plus { color: var(--good); }
.delta.minus { color: var(--bad); }
.delta.neutral { color: var(--muted); }

/* ---------- 规则行列表（行内编辑） ---------- */
.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: var(--bw) solid var(--line-soft);
  border-radius: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.rule-row:hover { border-color: var(--line); }
.rule-row.is-dragging { opacity: .45; }
.rule-drag { flex: none; display: grid; place-items: center; width: 16px; color: var(--muted); cursor: grab; }
.rule-drag:active { cursor: grabbing; }
.rule-drag svg { width: 14px; height: 14px; display: block; }
.rule-name {
  flex: 1; min-width: 0; height: 34px; padding: 0 12px;
  border: var(--bw) solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 600;
}
.rule-points {
  flex: none; width: 58px; height: 34px; padding: 0 4px;
  border: var(--bw) solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  font-family: var(--font-num); font-size: 13px; font-weight: 800;
  text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.rule-points::-webkit-outer-spin-button,
.rule-points::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rule-name:focus, .rule-points:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rule-del {
  flex: none; padding: 2px 4px; border: 0; background: none;
  color: var(--bad); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.rule-del:hover { text-decoration: underline; }
.rule-row .switch { flex: none; cursor: pointer; }
.rule-add {
  width: 100%; margin-top: 10px; padding: 11px;
  border: 1.5px dashed var(--accent); border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: .1em;
  cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.rule-add:hover { color: #fff; border-color: var(--accent-strong); background: var(--accent-strong); }
.rule-actions { display: flex; align-items: stretch; gap: 10px; margin-top: 10px; }
.rule-actions .rule-add { flex: none; width: auto; margin-top: 0; padding: 11px 28px; }
.rule-actions .btn { flex: none; padding: 0 22px; border-radius: 12px; font-size: 12px; letter-spacing: .06em; }

/* 商品添加（规则设置 · 积分商店） */
.goods-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.goods-row {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.goods-img-wrap { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.goods-img-note { font-size: 10px; color: var(--muted); white-space: nowrap; }
.goods-img {
  position: relative;
  flex: none; width: 56px; height: 56px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1.5px dashed var(--line); border-radius: 10px; background: var(--paper);
  color: var(--muted); font-size: 10px; cursor: pointer;
  transition: border-color .16s ease, color .16s ease;
}
.goods-img:hover { border-color: var(--accent); color: var(--accent-strong); }
.goods-img svg { width: 18px; height: 18px; }
.goods-img img { width: 100%; height: 100%; object-fit: cover; }
.goods-img-del {
  position: absolute; top: 2px; right: 2px; z-index: 1;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; line-height: 16px; text-align: center; cursor: pointer;
}
.goods-img-del:hover { background: var(--bad); }
.goods-fields { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.goods-fields .input { min-width: 0; }
.goods-nums { flex: none; display: flex; gap: 8px; }
.goods-nums label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.goods-nums .input { width: 52px; min-width: 0; }
.goods-nums .input[data-goods-field="points"],
.goods-nums .input[data-goods-field="stock"] { width: 70px; }
.goods-row .rule-del { flex: none; }
#goods-add { width: auto; padding: 11px 28px; }
.goods-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.goods-actions .rule-add { margin-top: 0; }
.goods-actions .btn { flex: none; padding: 0 22px; border-radius: 12px; font-size: 12px; letter-spacing: .06em; }

/* 商店设置：三个开关同行，各自独立卡片便于区分 */
.switch-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.switch-group .switch-row,
.switch-group .switch-row:first-child,
.switch-group .switch-row:last-child {
  padding: 12px 14px; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.switch-group .switch-row .switch { flex: none; }
@media (max-width: 900px) {
  .switch-group { grid-template-columns: 1fr; }
}

/* 积分商店：商品一行六个 */
.tiles.tiles--six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tiles--six .tile { padding: 12px; }
.tiles--six .tile-foot { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; }
.tiles--six .tile .tile-cost { font-size: 15px; white-space: nowrap; flex: none; }
.tiles--six .tile .actions { display: flex; flex: none; gap: 4px; }
.tiles--six .tile .actions .btn { flex: none; padding: 4px 6px; font-size: 10.5px; border-radius: 8px; }
@media (max-width: 1180px) {
  .tiles.tiles--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tiles.tiles--six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 商品兑换弹窗 */
.ex-bulk {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); cursor: pointer; margin-bottom: 12px;
}
.ex-bulk input { width: 14px; height: 14px; accent-color: var(--accent); }
.ex-bulk-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.ex-bulk-row .ex-bulk { margin-bottom: 0; }
.ex-all-tip { margin-left: auto; font-size: 11px; color: var(--accent-strong); white-space: nowrap; }
.ex-selectall {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  font-size: 11px; color: var(--accent-strong); padding: 3px 12px; cursor: pointer;
}
.ex-selectall[hidden] { display: none; }
.ex-selectall:disabled { opacity: .5; cursor: not-allowed; }
.ex-picker { display: flex; flex-direction: column; gap: 8px; }
#modal-exchange-goods .modal-card { max-width: 800px; }
.ex-students {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px;
  max-height: 178px; overflow-y: auto; padding: 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.ex-stu {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
}
.ex-stu b { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ex-stu span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ex-stu:hover { border-color: var(--accent); }
.ex-stu.on { border-color: var(--accent); background: var(--accent-soft); }
.ex-stu.on span { color: var(--accent-strong); }
.ex-stu.lack { opacity: .5; cursor: not-allowed; }
.ex-stu.lack span { color: var(--warn); }
.ex-empty { grid-column: 1 / -1; text-align: center; font-size: 12px; color: var(--muted); padding: 18px 0; }
.ex-picked { font-size: 11.5px; color: var(--muted); }
.ex-picked.on { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) {
  .ex-students { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ex-qty { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.ex-qty .input { width: 78px; }
.ex-goods {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 12px;
}
.ex-goods-ico {
  width: 40px; height: 40px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center;
}
.ex-goods-ico img { width: 100%; height: 100%; object-fit: cover; }
.ex-goods-ico svg { width: 20px; height: 20px; }
.ex-limit {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
  font-size: 11.5px; color: color-mix(in srgb, var(--warn) 78%, var(--ink));
  display: flex; flex-direction: column; gap: 4px;
}
.ex-actions { justify-content: space-between; align-items: stretch; }
.ex-confirm {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 24px; line-height: 1.25;
}
.ex-confirm span { font-size: 10px; font-weight: 500; opacity: .85; }
.ex-confirm:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1100px) {
  .goods-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .goods-row { flex-wrap: wrap; }
  .goods-nums { flex-wrap: wrap; }
}

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .03em; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.textarea { min-height: 84px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 幻兽等级设置：Lv.1 - Lv.10 成长值 + 名称，每行 5 个 */
.lvl-head { display: flex; gap: 14px; padding: 0 9px 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.lvl-head span:nth-child(1) { width: 30px; }
.lvl-head span:nth-child(2) { width: 58px; }
.lvl-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.lvl-row {
  display: grid;
  grid-template-columns: auto 58px minmax(0, 1fr);
  align-items: center;
  gap: 6px 10px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper-2);
}
.lvl-row > b { font-size: 12px; font-weight: 800; color: var(--ink-2); letter-spacing: .02em; white-space: nowrap; }
.lvl-row .input { padding: 7px 9px; font-size: 12.5px; min-width: 0; }
.lvl-row input.num { width: 58px; padding-left: 6px; padding-right: 4px; }
.lvl-row .input.is-error { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.lvl-hint.is-error { color: var(--bad); font-weight: 600; }
@media (max-width: 1280px) {
  .lvl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lvl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 形态列表编辑器 */
.formlist { display: flex; flex-direction: column; gap: 8px; }
.formlist-head, .formlist-row { display: grid; grid-template-columns: 48px minmax(140px, 1fr) 86px 86px 64px auto; gap: 8px; align-items: center; }
.formlist-head { font-size: 12px; color: var(--muted); padding: 0 4px; white-space: nowrap; }
.formlist-head span:last-child { text-align: center; }
.formlist-row .input, .formlist-row .select { margin: 0; min-width: 0; }
[data-fl-del] { padding: 0 10px; min-width: auto; }
.fl-upload { cursor: pointer; user-select: none; position: relative; }
/* 升级动画列比上传框宽，居中显示避免右侧留白 */
.formlist-row > [data-fl-anim-upload] { justify-self: center; }
/* 固定「蛋碎形态」行：不可编辑，用浅底 + 虚线区分 */
.formlist-row[data-formlist-fixed] { background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 6px 8px; }
.formlist-row[data-formlist-fixed] .input[readonly] { background: transparent; color: var(--muted); }
.formlist-row[data-formlist-fixed] .btn[disabled] { opacity: .55; cursor: default; }
.fl-preview {
  width: 48px; height: 48px; border: 2px dashed var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--surface-2); transition: border-color .2s;
}
.fl-upload:hover .fl-preview { border-color: var(--primary); }
.fl-preview .fl-ph { font-size: 18px; color: var(--muted); line-height: 1; font-weight: 300; }
.fl-preview img, .fl-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fl-preview.has-file { cursor: zoom-in; }
.fl-del-img {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--seal); color: #fff; border: 2px solid var(--surface);
  font-size: 11px; line-height: 14px; text-align: center; cursor: pointer;
  opacity: 0; transition: opacity .2s; z-index: 2;
}
.fl-upload:hover .fl-del-img { opacity: 1; }

/* 图片灯箱 */
.pet-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 9999;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.pet-lightbox img, .pet-lightbox video { max-width: 90vw; max-height: 90vh; object-fit: contain; }

/* 升级动画预设 */
@keyframes anim-flash { 0%,100%{opacity:1} 50%{opacity:.2} }
@keyframes anim-spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes anim-bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes anim-glow { 0%,100%{filter:drop-shadow(0 0 0 transparent)} 50%{filter:drop-shadow(0 0 12px #ffd666)} }
@keyframes anim-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
@keyframes anim-fade { from{opacity:0;transform:scale(.6)} to{opacity:1;transform:scale(1)} }
.anim-flash { animation: anim-flash .8s ease-in-out infinite; }
.anim-spin { animation: anim-spin 2s linear infinite; }
.anim-bounce { animation: anim-bounce 1s ease-in-out infinite; }
.anim-glow { animation: anim-glow 1.5s ease-in-out infinite; }
.anim-shake { animation: anim-shake .5s ease-in-out infinite; }
.anim-fade { animation: anim-fade .6s ease-out; }

@media (max-width: 640px) {
  .formlist-head { display: none; }
  .formlist-row { grid-template-columns: 64px 1fr; }
  .formlist-row .input:nth-child(n+3), .formlist-row .select { grid-column: 1 / -1; }
}

.search {
  position: relative;
  display: flex; align-items: center;
}
.search .input { padding-left: 36px; }
.search svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, var(--paper));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  transition: transform .2s cubic-bezier(.3,1.4,.5,1);
}
.switch.on { background: var(--accent); border-color: var(--accent-strong); }
.switch.on::after { transform: translateX(18px); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px dashed var(--line-soft); }
.switch-row:last-child { border-bottom: 0; padding-bottom: 0; }
.switch-row:first-child { padding-top: 0; }
.switch-row .txt b { font-size: 13px; font-weight: 600; display: block; }
.switch-row .txt span { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }

/* ---------- 布告条 ---------- */
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent-strong);
  font-size: 12px;
}
.banner--cool { background: var(--sky); border-color: var(--cool-line); color: #3b6479; }
.banner--warm { background: var(--warm-2); border-color: var(--warm-line); color: #8a5a2b; }

/* ---------- 时间线 ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid; grid-template-columns: 54px 1fr auto;
  gap: 12px; align-items: center;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.tl-item:last-child { border-bottom: 0; padding-bottom: 0; }
.tl-item .time { font-family: var(--font-num); font-size: 11px; color: var(--muted); }
.tl-item .what b { font-weight: 600; font-size: 13px; }
.tl-item .what span { display: block; font-size: 11px; color: var(--muted); }

/* ---------- 半栏布局 ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr); gap: 22px; align-items: start; }
.split-even { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px dashed var(--line); margin-bottom: 20px; }
.tab {
  position: relative;
  padding: 9px 16px 11px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: "";
  position: absolute; left: 12px; right: 12px; bottom: -2px; height: 3px;
  border-radius: 3px;
  background: var(--accent);
}
/* tabs 右侧的跳转链接：复用 .btn 体系，仅负责靠右垂直居中 */
.tab-link { margin-left: auto; align-self: center; }

/* ---------- 班级邀请码 ---------- */
.invite-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 8px 10px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.invite-label { font-size: 12px; color: var(--muted); }
.invite-code {
  font-family: var(--font-num); font-size: 16px; font-weight: 700;
  letter-spacing: .12em; color: var(--accent-strong); cursor: pointer;
  user-select: all;
}
.invite-bar .btn { margin-left: auto; }

/* ---------- 入班申请 ---------- */
.join-req { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.join-req:last-child { border-bottom: 0; }
.join-req .jr-main { flex: 1; min-width: 0; }
.join-req .jr-main b { display: block; font-size: 13px; }
.join-req .jr-main span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.join-req .actions { display: flex; gap: 6px; flex: none; }

/* ---------- 图表（纯 CSS） ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 132px; padding-top: 8px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .bar {
  width: 100%; max-width: 34px;
  height: var(--h, 50%);
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), color-mix(in srgb, var(--accent) 55%, var(--paper)));
  position: relative;
  transition: height .8s cubic-bezier(.2,.8,.2,1);
  min-height: 6px;
}
.bars .bar::after {
  content: attr(data-val);
  position: absolute; top: -19px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-num); font-size: 10px; color: var(--muted);
}
.bars .bar-col > span { font-size: 10px; color: var(--muted); font-family: var(--font-num); }
.bars .bar.highlight { background: linear-gradient(180deg, var(--accent-2), color-mix(in srgb, var(--accent-2) 60%, var(--paper))); }

.donut {
  --seg1: 45%; --seg2: 70%;
  width: 128px; height: 128px; border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0 var(--seg1),
    var(--accent-2) var(--seg1) var(--seg2),
    #c7b9a2 var(--seg2) 100%
  );
  position: relative;
  flex: none;
}
.donut::after {
  content: ""; position: absolute; inset: 20px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}
.donut-leg { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.donut-leg span { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.donut-leg i { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: none; place-items: start center;
  overflow-y: auto;
  padding: 24px;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  backdrop-filter: blur(6px);
}
.modal.open { display: grid; animation: fade-in .2s ease; }
.modal-card { margin: auto 0; }
.modal-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 40px 90px -40px rgba(20, 20, 20, .55);
  padding: 26px;
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px; border: none; background: transparent;
  font-size: 20px; line-height: 28px; color: var(--muted);
  cursor: pointer; border-radius: 50%; transition: all .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-card.modal-wide { max-width: 620px; }
.modal-card {
  animation: pop-in .28s cubic-bezier(.2,1.2,.4,1);
}
.modal-card h3 { font-size: 17px; margin-bottom: 4px; }
.modal-card .modal-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- 指定领养：幻兽选择卡与图鉴 ---------- */
.pet-pick { margin-top: 10px; }
.pet-pick[hidden], .pet-pick-empty[hidden], .pet-pick-filled[hidden] { display: none; }
.pet-pick-card {
  display: block; width: 100%; padding: 16px 14px;
  border-radius: 13px; border: 2px dashed var(--line);
  background: var(--surface); cursor: pointer; text-align: center;
  transition: all .15s ease;
}
.pet-pick-card:hover { border-color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.pet-pick-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pet-pick-plus { font-size: 22px; font-weight: 700; line-height: 1; color: var(--accent-strong); }
.pet-pick-empty b { font-size: 13px; }
.pet-pick-filled { display: flex; align-items: center; gap: 12px; text-align: left; }
.pet-pick-filled .pet-frame { width: 64px; height: 64px; flex: none; }
.pet-pick-info { display: flex; flex-direction: column; gap: 2px; }
.pet-pick-info b { font-size: 14px; }
.pet-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.pet-grid-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; padding: 8px 6px 10px; overflow: hidden; border-radius: 13px;
  border: 2px solid var(--line-soft); background: var(--surface);
  cursor: pointer; transition: all .15s ease;
}
.pet-grid-card:hover { border-color: var(--line); transform: translateY(-2px); }
.pet-grid-card .pet-frame { width: 74px; height: 74px; }
.pet-grid-card b { font-size: 11.5px; line-height: 1.2; white-space: nowrap; }
.pet-grid-card .tiny { font-size: 9.5px; white-space: nowrap; }
.pet-grid-card.on { border-color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: 0 6px 18px -10px var(--accent-strong); }
.pet-cat {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--line-soft);
  background: var(--surface); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.pet-cat-n { font-size: 10px; font-weight: 800; opacity: .6; }
.pet-cat.on { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.pet-cat.on .pet-cat-n { opacity: .85; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  z-index: 400;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .dot { background: var(--accent); width: 8px; height: 8px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 12px; }
.empty .pet-frame { margin: 0 auto 10px; opacity: .55; }

/* ---------- 应用外壳 ---------- */
.app { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px 18px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper-2) 45%, var(--surface)), var(--paper) 60%);
  border-right: 1.5px solid var(--line);
  z-index: 30;
}
.side::-webkit-scrollbar { display: none; }
/* 侧栏首屏骨架：真实菜单渲染前占位，避免布局跳动 */
.side--skeleton { pointer-events: none; }
.side--skeleton .brand-mark { opacity: .6; }
.sk-nav { display: flex; flex-direction: column; gap: 9px; padding: 8px; }
.sk-title { width: 46px; height: 8px; border-radius: 999px; background: var(--line-soft); opacity: .75; margin: 10px 0 2px; }
.sk-item { height: 32px; border-radius: 9px; background: var(--surface-2); opacity: .65; }
.side::after {
  content: ""; position: absolute; top: 0; right: -7px; bottom: 0; width: 7px;
  background-image: radial-gradient(circle, var(--line) 1.2px, transparent 1.4px);
  background-size: 7px 12px;
  opacity: .55;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(150deg, var(--accent), var(--accent-strong));
  display: grid; place-items: center;
  box-shadow: 0 8px 16px -10px color-mix(in srgb, var(--accent-strong) 80%, transparent);
  flex: none;
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-txt { line-height: 1.25; }
.brand-txt b { display: block; font-family: var(--font-display); font-size: 17px; letter-spacing: .04em; }
.brand-txt span { font-size: 10px; letter-spacing: .12em; color: var(--muted); }

.nav-group { margin-top: 12px; }
.nav-group .ng-title { font-size: 10px; letter-spacing: .18em; color: var(--muted); padding: 0 10px 7px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background .16s ease, color .16s ease, transform .16s ease;
  position: relative;
}
.nav-link svg { width: 17px; height: 17px; flex: none; opacity: .7; stroke-width: 1.7; }
.nav-link:hover { background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--ink); }
.nav-link.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-link.active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 18px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-link.active svg { opacity: 1; color: var(--accent-strong); }
.nav-link .badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--seal); color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  font-family: var(--font-num);
}
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1.5px dashed var(--line); }
.side-foot .sf-note { font-size: 10px; color: var(--muted); line-height: 1.6; }
.side-foot .sf-user { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.side-foot .sf-user b { display: block; font-size: 12px; }
.side-foot .sf-user span { display: block; font-size: 10px; color: var(--muted); }

.stage { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 30px;
  min-height: 64px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1.5px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar .tb-title { line-height: 1.25; margin-right: auto; }
.topbar .tb-title b { font-family: var(--font-display); font-size: 19px; letter-spacing: .03em; display: block; }
.topbar .tb-title span { font-size: 11px; color: var(--muted); }
.topbar .tb-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  position: relative;
  transition: all .16s ease;
  flex: none;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .ping {
  position: absolute; top: 6px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--seal);
  border: 1.5px solid var(--surface);
}
.menu-btn { display: none; }
.class-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.class-pill .cp-ico {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft);
  display: grid; place-items: center;
  color: var(--accent-strong);
  font-size: 10px;
}
.class-pill svg { width: 12px; height: 12px; color: var(--muted); }

/* 教师多班级切换 */
.class-switch { position: relative; }
.class-switch .class-pill { cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.class-switch .class-pill:hover { border-color: var(--accent); background: var(--paper-2); }
.class-switch .class-pill svg { transition: transform .18s ease; }
.class-switch.open .class-pill svg { transform: rotate(180deg); }
.class-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 272px; padding: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 26px 54px -26px rgba(40, 50, 45, .45);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.class-switch.open .class-menu { opacity: 1; visibility: visible; transform: none; }
.cm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 8px;
  border-bottom: 1px dashed var(--line);
}
.cm-head b { font-size: 11px; letter-spacing: .08em; color: var(--ink-2); }
.cm-head span { font-size: 10.5px; color: var(--muted); }
.cm-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin-top: 4px; padding: 9px 10px;
  border-radius: 11px; text-align: left;
  transition: background .15s ease;
}
.cm-item:hover { background: var(--paper-2); }
.cm-item.active { background: var(--accent-soft); }
.cm-ico {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  font-family: var(--font-display); font-size: 13px; color: var(--ink-2);
}
.cm-item.active .cm-ico { background: var(--accent); color: #fff; }
.cm-txt { flex: 1; min-width: 0; }
.cm-txt b { display: block; font-size: 12.5px; line-height: 1.3; }
.cm-txt span { display: block; font-size: 10.5px; color: var(--muted); }
.cm-check { display: inline-flex; color: var(--accent-strong); opacity: 0; }
.cm-item.active .cm-check { opacity: 1; }
.cm-all {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 6px; padding: 9px 8px 6px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--accent-strong);
}
.cm-all:hover { text-decoration: underline; }

.content {
  flex: 1;
  width: 100%;
  padding: 28px 30px 70px;
}

/* 页面小节 */
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-head h2 { font-family: var(--font-display); font-size: 21px; letter-spacing: .03em; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.panel-head .ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hidden { display: none !important; }

/* ---------- 官网 ---------- */
.pub { background: var(--paper); }
.pub-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.pub-nav-in {
  max-width: 1220px; margin: 0 auto; padding: 15px 28px;
  display: flex; align-items: center; gap: 28px;
}
.pub-brand { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.pub-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.pub-brand .brand-mark svg { width: 24px; height: 24px; }
.pub-brand b { font-family: var(--font-display); font-size: 17px; letter-spacing: .05em; }
.pub-links { display: flex; align-items: center; gap: 22px; font-size: 13px; color: var(--ink-2); }
.pub-links a { position: relative; padding: 4px 0; transition: color .16s ease; }
.pub-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--accent); transition: right .22s ease;
  border-radius: 2px;
}
.pub-links a:hover { color: var(--ink); }
.pub-links a:hover::after { right: 0; }
.pub-nav .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 66px 0 54px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(760px 420px at 72% 6%, color-mix(in srgb, var(--accent-soft) 80%, transparent), transparent 70%),
    radial-gradient(640px 420px at 8% 92%, color-mix(in srgb, var(--accent-2-soft) 70%, transparent), transparent 72%),
    repeating-linear-gradient(0deg, transparent 0 27px, color-mix(in srgb, var(--line) 26%, transparent) 27px 28px);
  opacity: .9;
  z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 46px; align-items: center; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.4vw, 66px);
  line-height: 1.16;
  letter-spacing: .015em;
  margin: 18px 0 20px;
}
.hero h1 .hl { position: relative; white-space: nowrap; color: var(--accent-strong); }
.hero h1 .hl::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: 4px; height: 10px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 3px; z-index: -1;
}
.hero-lede { max-width: 480px; color: var(--ink-2); font-size: 14.5px; line-height: 1.8; }
.hero-ctas { display: flex; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 11.5px; color: var(--muted); }
.hero-note .stamp { transform: rotate(-4deg); }

/* 英雄区主视觉 */
.hero-scene { position: relative; height: 470px; }
.scene-board {
  position: absolute; top: 6px; right: 0; width: 88%;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 34px 70px -40px rgba(80, 55, 20, .55);
  padding: 16px;
  transform: rotate(-2.2deg);
  animation: float-slow 9s ease-in-out infinite;
}
.scene-board .sb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.scene-board .sb-head b { font-family: var(--font-display); font-size: 13px; }
.scene-board .sb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mini-pet {
  background: var(--sky);
  border: 1px solid var(--cool-line);
  border-radius: 12px;
  padding: 9px 9px 10px;
  text-align: center;
}
.mini-pet .mp-art { height: 58px; margin: 0 auto 6px; width: 58px; }
.mini-pet b { font-size: 10.5px; display: block; font-weight: 600; }
.mini-pet .progress { height: 5px; margin-top: 5px; }
.mini-pet .progress-label { display: none; }
.scene-board .sb-rank {
  margin-top: 12px; padding-top: 10px;
  border-top: 1.5px dashed var(--line);
  display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted);
}
.scene-board .sb-rank span { display: inline-flex; align-items: center; gap: 4px; }
.scene-board .sb-rank .rank-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.scene-phone {
  position: absolute; left: 0; bottom: 0; width: 178px;
  border-radius: 26px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(80, 55, 20, .6);
  padding: 9px;
  transform: rotate(4deg);
  animation: float-slow 7s ease-in-out infinite reverse;
}
.scene-phone .sp-screen {
  border-radius: 19px;
  background: linear-gradient(180deg, #e9f2f7, #f7fbfd);
  padding: 16px 12px 13px;
  text-align: center;
  border: 1px solid var(--cool-line);
}
.scene-phone .sp-art { width: 96px; height: 96px; margin: 4px auto 6px; }
.scene-phone .sp-name { font-size: 12px; font-weight: 700; }
.scene-phone .sp-lvl { margin: 4px 0 8px; }
.scene-phone .progress { height: 6px; background: #dceaf1; }
.scene-phone .sp-nums { display: flex; justify-content: center; gap: 12px; margin-top: 9px; font-size: 9px; color: #5d7889; }
.scene-phone .sp-nums b { font-family: var(--font-num); font-size: 12px; color: var(--cool-ink); display: block; }

.scene-seal {
  position: absolute; right: -6px; top: -18px;
  width: 96px; height: 96px; border-radius: 50%;
  border: 2.5px solid var(--seal);
  display: grid; place-items: center;
  color: var(--seal);
  font-family: var(--font-serif); font-weight: 700;
  font-size: 11px; letter-spacing: .2em;
  transform: rotate(12deg);
  opacity: .72;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  animation: seal-in .7s .3s cubic-bezier(.2,1.3,.4,1) both;
}
.scene-seal::after {
  content: ""; position: absolute; inset: 7px; border-radius: 50%;
  border: 1px dashed currentColor; opacity: .65;
}
.scene-ticket {
  position: absolute; left: 24px; top: 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 10px; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transform: rotate(-6deg);
}
.scene-ticket b { font-family: var(--font-num); color: var(--good); font-size: 13px; }
.scene-spark { position: absolute; color: var(--accent); opacity: .7; }
.scene-spark svg { width: 22px; height: 22px; }

/* 统计条 */
.stat-band {
  margin-top: 26px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1.5px dashed var(--line);
  border-bottom: 1.5px dashed var(--line);
}
.stat-band .cell {
  padding: 22px 22px;
  border-left: 1.5px dashed var(--line);
}
.stat-band .cell:first-child { border-left: 0; padding-left: 0; }
.stat-band .cell b {
  display: block; font-family: var(--font-num); font-weight: 800;
  font-size: 30px; letter-spacing: -.02em; line-height: 1.1;
}
.stat-band .cell b i { font-style: normal; font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.stat-band .cell span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

/* 场景分栏 */
.scene-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.scene-card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  border: var(--bw) solid var(--line);
  padding: 28px;
  min-height: 330px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.scene-card.cool {
  background: linear-gradient(160deg, #eef6fa 0%, #e2eff5 60%, #dcebf3 100%);
}
.scene-card.warm {
  background: linear-gradient(160deg, #fff8ec 0%, #ffeed6 62%, #ffe4c4 100%);
}
.scene-card::after {
  content: ""; position: absolute; right: -40px; bottom: -60px;
  width: 230px; height: 230px; border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 18%, transparent);
  opacity: .6;
}
.scene-card .sc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.scene-card h3 { font-family: var(--font-display); font-size: 25px; letter-spacing: .03em; }
.scene-card .sc-desc { font-size: 12.5px; color: var(--ink-2); max-width: 340px; margin-top: 6px; }
.scene-card.cool h3 { color: #24404f; }
.scene-card.warm h3 { color: #74441c; }
.scene-card .sc-list { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
.scene-card .sc-list li { display: flex; align-items: center; gap: 8px; }
.scene-card .sc-list i {
  width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(0,0,0,.12);
  font-size: 9px; font-style: normal;
}
.scene-card .sc-link { margin-top: auto; padding-top: 20px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.scene-card .sc-art {
  position: absolute; right: 18px; bottom: 10px;
  width: 150px; height: 150px; opacity: .95;
}
.scene-card.cool .sc-art { width: 128px; height: 128px; bottom: 22px; right: 32px; }
.scene-card.warm .sc-art { bottom: 6px; right: 14px; }

/* 三步 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step {
  position: relative;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.step:hover { transform: translateY(-3px); box-shadow: 0 26px 50px -34px rgba(80,55,20,.6); }
.step .n {
  font-family: var(--font-num); font-size: 44px; font-weight: 800;
  color: color-mix(in srgb, var(--accent) 52%, var(--line));
  line-height: 1; letter-spacing: -.04em;
}
.step h4 { font-family: var(--font-display); font-size: 19px; margin: 10px 0 6px; letter-spacing: .04em; }
.step p { font-size: 12.5px; color: var(--muted); line-height: 1.75; }

/* 角色入口 */
.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.role-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px;
  border: var(--bw) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.role-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.role-card .rc-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong);
  margin-bottom: 2px;
}
.role-card .rc-ico svg { width: 17px; height: 17px; }
.role-card b { font-size: 14px; }
.role-card span { font-size: 11px; color: var(--muted); line-height: 1.55; }
.role-card .arrow { position: absolute; right: 16px; top: 20px; color: var(--line); font-size: 16px; transition: all .2s ease; }
.role-card:hover .arrow { color: var(--accent); transform: translateX(3px); }

/* 官网横幅 */
.band { padding: 64px 0; }
.band--paper { background: color-mix(in srgb, var(--paper-2) 55%, var(--paper)); border-top: 1.5px solid var(--line-soft); border-bottom: 1.5px solid var(--line-soft); }
.band--ink { background: #25302c; color: #f1e9d8; }
.quote {
  max-width: 780px; margin: 0 auto; text-align: center;
}
.quote p { font-family: var(--font-serif); font-size: clamp(20px, 2.4vw, 30px); line-height: 1.6; }
.quote .by { margin-top: 20px; font-size: 12px; letter-spacing: .16em; opacity: .6; }
.band--ink .stamp { color: #e8b77a; border-color: #e8b77a; }

.pub-foot {
  background: #202925; color: #cfc9ba;
  padding: 44px 0 34px;
  font-size: 12px;
}
.pub-foot .foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.pub-foot b { color: #f4efe3; font-family: var(--font-display); font-size: 16px; letter-spacing: .06em; }
.pub-foot .f-links { display: flex; gap: 18px; flex-wrap: wrap; }
.pub-foot a:hover { color: #fff; }
.pub-foot .fine { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: 10.5px; opacity: .6; }

/* ---------- 登录 / 身份 ---------- */
.auth {
  min-height: 100vh;
  display: grid; place-items: center;
  position: relative;
  padding: 40px 20px;
  background:
    radial-gradient(680px 420px at 80% 10%, color-mix(in srgb, var(--accent-soft) 75%, transparent), transparent 70%),
    radial-gradient(620px 480px at 6% 90%, color-mix(in srgb, var(--accent-2-soft) 72%, transparent), transparent 72%),
    var(--paper);
  overflow: hidden;
}
.auth-deco {
  position: absolute; width: 180px; height: 180px; opacity: .45;
  pointer-events: none;
}
.auth-deco.d1 { left: -30px; bottom: -40px; transform: rotate(-12deg); }
.auth-deco.d2 { right: 4%; top: 8%; width: 118px; height: 118px; opacity: .35; transform: rotate(14deg); }
.auth-card {
  width: 100%; max-width: 452px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 40px 80px -46px rgba(80, 55, 20, .6);
  padding: 34px 34px 30px;
  position: relative;
  z-index: 1;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 40px; height: 40px; }
.auth-card h1 { font-family: var(--font-display); font-size: 27px; letter-spacing: .04em; }
.auth-card .sub { font-size: 12.5px; color: var(--muted); margin: 6px 0 24px; }
.auth-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--paper-2); margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; padding: 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted);
  transition: all .16s ease;
}
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row .input { flex: 1; }
.code-row .btn { white-space: nowrap; }
.auth-foot { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.auth-fine { text-align: center; margin-top: 22px; font-size: 10.5px; color: var(--muted); line-height: 1.7; }

.identity-wrap { width: 100%; max-width: 980px; margin: 0 auto; }
.identity-head { text-align: center; margin-bottom: 28px; }
.identity-head h1 { font-family: var(--font-display); font-size: 32px; letter-spacing: .04em; }
.identity-head p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.identity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.identity-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  transition: all .22s ease;
  overflow: hidden;
  text-align: left;
}
.identity-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 30px 55px -36px rgba(80,55,20,.6); }
.identity-card .ic-top { display: flex; align-items: center; justify-content: space-between; }
.identity-card .ic-role { font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.identity-card h3 { font-family: var(--font-display); font-size: 23px; margin: 6px 0 2px; letter-spacing: .03em; }
.identity-card .ic-desc { font-size: 11.5px; color: var(--muted); }
.identity-card .ic-body { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.identity-card .ic-stats { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--ink-2); flex: 1; }
.identity-card .ic-stats b { font-family: var(--font-num); font-size: 13px; color: var(--ink); }
.identity-card .ic-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1.5px dashed var(--line); font-size: 12px; font-weight: 600; color: var(--accent-strong); }
.identity-card .ic-enter { display: inline-flex; align-items: center; gap: 5px; }
.identity-card.cool { background: linear-gradient(170deg, #fbfeff, #eef7fb 70%, #e6f2f8); }
.identity-card.warm { background: linear-gradient(170deg, #fffdf8, #fff0da 70%, #ffe7c8); }
.identity-card.teacher { background: linear-gradient(170deg, #fffdf8, #fbf1dc 70%, #f7e8ca); }
.identity-card .ic-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted); margin-top: 18px;
}
.reg-panel { max-width: 452px; margin: 0 auto; }
.reg-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted); margin-bottom: 14px;
  transition: color .16s ease;
}
.reg-back:hover { color: var(--accent-strong); }
.login-demos {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 10.5px; color: var(--muted);
}
.demo-chip {
  padding: 5px 10px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
  font-size: 10.5px; color: var(--ink-2);
  transition: all .16s ease;
}
.demo-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
/* 走错登录入口时的提示条 */
.login-hint {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px dashed var(--line); background: var(--paper-2);
  font-size: 11.5px; line-height: 1.7; color: var(--ink-2);
}
.login-hint a { font-weight: 600; color: var(--accent-strong); }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 920px; }
.faq details {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-num); font-size: 18px; color: var(--muted);
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  flex: none;
  transition: all .18s ease;
}
.faq details[open] summary::after { content: "−"; background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.faq p {
  margin-top: 12px; padding-top: 12px;
  border-top: 1.5px dashed var(--line-soft);
  font-size: 12.5px; color: var(--muted); line-height: 1.85;
}

/* ---------- 工作台 ---------- */
.wb-steps { display: flex; flex-direction: column; gap: 24px; }
.wb-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 13px; }
.wb-step > .n {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  display: grid; place-items: center;
  font-family: var(--font-num); font-size: 12px; font-weight: 800;
  margin-top: 2px;
}
.wb-step .wb-body-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wb-step .wb-body-head h4 { font-size: 13px; font-weight: 700; }
.wb-step .wb-body-head span { font-size: 11px; color: var(--muted); }

.students-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.student-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 6px 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: all .16s ease;
  text-align: center;
}
.student-cell:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-1px); }
.student-cell .pet-frame { width: 46px; height: 46px; }
.student-cell b { font-size: 11.5px; font-weight: 600; line-height: 1.2; }
.student-cell span { font-size: 9.5px; color: var(--muted); font-family: var(--font-num); }
.student-cell.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 8px 18px -14px color-mix(in srgb, var(--accent-strong) 70%, transparent);
}

.reasons { display: flex; flex-wrap: wrap; gap: 7px; }
.reason {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px; color: var(--ink-2);
  cursor: pointer;
  transition: all .16s ease;
}
.reason b { font-family: var(--font-num); font-weight: 800; font-size: 12px; color: var(--good); }
.reason.minus b { color: var(--bad); }
.reason:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.reason.active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.reason.active b { color: var(--accent-strong); }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line-soft); }
.seg button { padding: 5px 12px; border-radius: 999px; font-size: 11.5px; color: var(--muted); font-weight: 600; transition: all .16s ease; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.wb-preview { position: sticky; top: 84px; }
.wb-person { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1.5px dashed var(--line); position: relative; }
.wb-person .pet-frame { width: 78px; height: 78px; flex: none; }
.wb-person .wp-name { font-family: var(--font-display); font-size: 24px; letter-spacing: .04em; line-height: 1.25; }
.wb-person .wp-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.wb-person .wp-level { margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.wb-stamp {
  position: absolute; right: 0; top: 4px;
  opacity: 0; transform: scale(1.6) rotate(-12deg);
  pointer-events: none;
}
.wb-stamp.show { animation: stamp-pop .55s cubic-bezier(.2,1.1,.4,1) both; }
@keyframes stamp-pop {
  0% { opacity: 0; transform: scale(1.8) rotate(-16deg); }
  55% { opacity: .9; transform: scale(.94) rotate(-6deg); }
  100% { opacity: .85; transform: scale(1) rotate(-8deg); }
}
.wb-summary { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 0 10px; }
.wb-summary .k { font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.wb-summary .v { font-family: var(--font-num); font-size: 34px; font-weight: 800; color: var(--good); line-height: 1; }
.wb-note { font-size: 11px; color: var(--muted); padding: 10px 12px; background: var(--paper-2); border-radius: 9px; border: 1px dashed var(--line); margin-bottom: 14px; }

.ex-list { display: flex; flex-direction: column; gap: 9px; }
.ex-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper-2) 55%, var(--surface));
}
.ex-item .ex-main { flex: 1; min-width: 0; }
.ex-item .ex-main b { display: block; font-size: 12px; font-weight: 600; }
.ex-item .ex-main span { display: block; font-size: 10px; color: var(--muted); }
.ex-item .ex-btns { display: flex; gap: 4px; }

/* ---------- 上传区 ---------- */
.upload {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  background: color-mix(in srgb, var(--paper-2) 60%, var(--surface));
}
.group-card { display: flex; flex-direction: column; gap: 14px; }
.group-card .gc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.group-card .gc-body { display: flex; align-items: center; gap: 14px; }
.group-card .gc-body .pet-frame { width: 86px; height: 86px; flex: none; }
.group-card .gc-name { font-family: var(--font-display); font-size: 20px; letter-spacing: .04em; }
.group-card .gc-sub { font-size: 10.5px; color: var(--muted); }
.group-card .gc-nums { display: flex; gap: 16px; }
.group-card .gc-nums .k { font-size: 9.5px; color: var(--muted); letter-spacing: .08em; }
.group-card .gc-nums .v { font-family: var(--font-num); font-size: 19px; font-weight: 800; }
.group-card .gc-members { display: flex; align-items: center; gap: 4px; }
.group-card .gc-members .avatar { width: 24px; height: 24px; font-size: 10px; margin-right: -8px; border: 2px solid var(--surface); }
.group-card .gc-members span { font-size: 10.5px; color: var(--muted); margin-left: 12px; }

.split-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.split-col { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; min-height: 190px; }
.split-col .sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.split-col .sc-head b { font-size: 12px; }
.split-col .sc-head span { font-size: 10px; color: var(--muted); font-family: var(--font-num); }
.split-col .sc-body { display: flex; flex-direction: column; gap: 5px; }
.member-chip { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 8px; background: var(--paper-2); font-size: 11px; border: 1px solid transparent; }
.member-chip .avatar { width: 20px; height: 20px; font-size: 9px; }
.member-chip:hover { border-color: var(--accent); }

/* ---------- 进化链 ---------- */
.evo-chain { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.evo-node { text-align: center; width: 78px; }
.evo-node .pet-frame { width: 62px; height: 62px; margin: 0 auto 5px; }
.evo-node b { display: block; font-size: 10.5px; font-weight: 600; }
.evo-node span { display: block; font-size: 9px; color: var(--muted); font-family: var(--font-num); }
.evo-node.locked { opacity: .5; }
.evo-arrow { display: flex; align-items: center; padding-top: 24px; color: var(--line); }
.evo-arrow svg { width: 18px; height: 18px; }
.chain-card { display: flex; flex-direction: column; gap: 10px; }
.chain-card .cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chain-card .cc-title { font-size: 13px; font-weight: 700; }
.chain-card .cc-meta { font-size: 10px; color: var(--muted); }

/* ---------- 商品瓦片 ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px;
  display: flex; flex-direction: column; gap: 5px;
  position: relative;
  transition: all .18s ease;
}
.tile:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow-sm); }
.tile .tile-ico {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.tile .tile-ico svg { width: 17px; height: 17px; }
.tile b { font-size: 13px; font-weight: 600; }
.tile .tile-meta { font-size: 12px; color: var(--muted); }
.tile .stock-quick {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 0; border: 0; background: none; font: inherit; color: inherit;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent-strong) 45%, transparent);
  cursor: pointer; vertical-align: baseline;
}
.tile .stock-quick:hover { color: var(--accent-strong); border-bottom-style: solid; }
.tile .stock-quick svg { width: 9px; height: 9px; flex: none; }
.tile .tile-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .tile-cost { font-family: var(--font-num); font-weight: 800; font-size: 15px; color: var(--accent-strong); }
.tile .tile-cost small { font-family: var(--font-body); font-size: 10px; color: var(--muted); font-weight: 500; }
.tile.off { opacity: .6; }

/* ---------- 皮肤选择 ---------- */
.skin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skin-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all .16s ease;
}
.skin-opt:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.skin-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.skin-opt .sw { width: 42px; height: 42px; border-radius: 10px; flex: none; border: 1px solid rgba(0,0,0,.08); position: relative; overflow: hidden; }
.skin-opt .sw.sweet { background: linear-gradient(140deg, #fcf7ec, #f5d9ae 55%, #e9a03b); }
.skin-opt .sw.fantasy { background: linear-gradient(140deg, #f3f1ea, #b9cfc9 55%, #2f6f6b); }
.skin-opt .sw::after { content: ""; position: absolute; right: -10px; bottom: -10px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.65); }
.skin-opt b { font-size: 13px; display: block; }
.skin-opt span { font-size: 10.5px; color: var(--muted); display: block; margin-top: 2px; }

/* ---------- 大屏主题选择 ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.theme-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius, 14px);
  background: var(--surface, #fff);
  cursor: pointer; text-align: left;
  transition: all .16s ease;
  font-family: inherit; color: inherit;
}
.theme-opt:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-1px); }
.theme-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft, transparent) 60%, var(--surface, #fff)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.theme-swatch {
  width: 48px; height: 48px; border-radius: 12px; flex: none;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.1);
  border: 1px solid rgba(0,0,0,.06);
}
.theme-swatch::after {
  content: ""; position: absolute; right: -12px; bottom: -12px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.55);
}
.theme-swatch.t1 { background: linear-gradient(135deg, #2f6f6b 0%, #1a4a47 40%, #c99a4b 100%); }
.theme-swatch.t2 { background: linear-gradient(135deg, #5a7ab8 0%, #3a5589 40%, #d4b25c 100%); }
.theme-swatch.t3 { background: linear-gradient(135deg, #d87030 0%, #8a3f18 40%, #c98432 100%); }
.theme-swatch.t4 { background: linear-gradient(135deg, #8668b0 0%, #4f3878 40%, #d4b058 100%); }
.theme-swatch.t5 { background: linear-gradient(135deg, #3f8f6f 0%, #24614a 40%, #d8c07a 100%); }
.theme-swatch.t6 { background: linear-gradient(135deg, #2f7f9f 0%, #1d5a72 40%, #7fc7cf 100%); }
.theme-swatch.t7 { background: linear-gradient(135deg, #c76a86 0%, #8e4460 40%, #e6c79a 100%); }
.theme-opt b { display: block; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.theme-opt span:last-child { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 动画 ---------- */
@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-9px) rotate(var(--rot, 0deg)); }
}
.scene-board { --rot: -2.2deg; }
.scene-phone { --rot: 4deg; }
@keyframes seal-in {
  from { opacity: 0; transform: rotate(12deg) scale(1.3); }
  to { opacity: .72; transform: rotate(12deg) scale(1); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { animation: rise-in .7s cubic-bezier(.2,.75,.25,1) both; }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-scene { height: 420px; max-width: 620px; margin: 0 auto; width: 100%; }
  .hero { padding-top: 44px; }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .identity-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .split-even { grid-template-columns: 1fr; }
  .scene-split { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .content { padding: 22px 18px 60px; }
  .topbar { padding: 12px 18px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 250px;
    transform: translateX(-105%);
    transition: transform .26s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 0 60px -10px rgba(0,0,0,.3);
  }
  body.nav-open .side { transform: none; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; z-index: 29;
    background: rgba(30, 24, 16, .28);
    backdrop-filter: blur(2px);
  }
  .menu-btn { display: grid; }
}
@media (max-width: 720px) {
  .pub-links { display: none; }
  .pub-nav-in { padding: 12px 18px; }
  .section { padding: 0 18px; }
  .stat-band { grid-template-columns: 1fr 1fr; }
  .stat-band .cell { border-left: 0; border-top: 1.5px dashed var(--line); padding: 16px 0; }
  .stat-band .cell:nth-child(2n) { padding-left: 16px; border-left: 1.5px dashed var(--line); }
  .stat-band .cell:nth-child(-n+2) { border-top: 0; }
  .identity-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-row > .stat { padding: 12px 14px; border-left: 1.5px dashed var(--line); }
  .stat-row > .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .hero-scene { height: 380px; }
  .scene-board { width: 92%; }
  .scene-phone { width: 156px; }
  .auth-card { padding: 26px 22px; }
  .tl-item { grid-template-columns: 44px 1fr auto; }
}

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