/* ================= 班级宠物园 · 设计系统 ================= */
:root {
  --bg: #faf7f2;
  --bg-soft: #f4eee5;
  --card: #ffffff;
  --ink: #3d2f2a;
  --ink-2: #5f4c43;
  --sub: #8a776d;
  --line: #efe6da;
  --line-2: #e5d9c9;
  --primary: #ff8a4c;
  --primary-d: #ef6f2c;
  --primary-soft: #fff1e6;
  --gold: #c9962e;
  --gold-soft: #fdf4e0;
  --green: #4a8f6d;
  --green-soft: #eaf5ee;
  --red: #d9534f;
  --red-soft: #fdecea;
  --blue: #4a7cbf;
  --blue-soft: #eef3fb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(90, 60, 40, .06);
  --shadow-lg: 0 8px 28px rgba(90, 60, 40, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { display: block; }
ul, ol { list-style: none; }

/* ---------- 布局 ---------- */
.shell { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: rgba(250, 247, 242, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; }
.topbar .brand .logo { font-size: 22px; }
.topbar .brand small { font-size: 11px; color: var(--sub); font-weight: 400; }
.topbar .spacer { flex: 1; }
.topbar .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.topbar .role-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-d); font-weight: 600;
}
.topbar .role-tag.gold { background: var(--gold-soft); color: var(--gold); }
.topbar .role-tag.blue { background: var(--blue-soft); color: var(--blue); }

.layout { display: flex; flex: 1; align-items: flex-start; }

.sidebar {
  position: sticky; top: 57px;
  width: 208px; flex: 0 0 208px;
  padding: 16px 12px 40px;
  display: flex; flex-direction: column; gap: 3px;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink-2); transition: .15s;
}
.sidebar .nav-item:hover { background: var(--bg-soft); }
.sidebar .nav-item.on { background: var(--primary-soft); color: var(--primary-d); font-weight: 600; }
.sidebar .nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.sidebar .nav-group { font-size: 11px; color: var(--sub); padding: 14px 12px 5px; }

.content { flex: 1; min-width: 0; padding: 20px 22px 60px; }
.page { display: none; }
.page.on { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 21px; font-weight: 700; margin-bottom: 4px; }
page-title + .page-desc, .page-desc { font-size: 13px; color: var(--sub); margin-bottom: 18px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-size: 12px; color: var(--sub); font-weight: 400; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 12px; color: var(--sub); }
.stat .value { font-size: 26px; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--sub); margin-left: 3px; }
.stat .value.primary { color: var(--primary-d); }
.stat .value.gold { color: var(--gold); }
.stat .value.green { color: var(--green); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line-2);
  font-size: 14px; color: var(--ink-2); transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary-d); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.danger { color: var(--red); border-color: #f3cfcd; }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field .hint { font-size: 11px; color: var(--sub); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 138, 76, .12); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a776d'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .field { flex: 1; min-width: 160px; margin-bottom: 0; }

.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--line-2); transition: .2s; flex: 0 0 auto; }
.switch.on { background: var(--primary); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on::after { left: 20px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--sub); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fdfbf8; }

/* ---------- 标签/徽标 ---------- */
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-soft); color: var(--sub); }
.tag.primary { background: var(--primary-soft); color: var(--primary-d); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.gray { background: #f0ece6; color: #9b8d82; }

/* ---------- 学生选择网格 ---------- */
.stu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.stu-chip {
  position: relative; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 6px; text-align: center; background: #fff; transition: .15s; cursor: pointer;
}
.stu-chip:hover { border-color: var(--primary); }
.stu-chip.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(255,138,76,.15); }
.stu-chip .av {
  width: 38px; height: 38px; margin: 0 auto 5px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.stu-chip .nm { font-size: 13px; font-weight: 600; }
.stu-chip .lv { font-size: 10px; color: var(--sub); }

/* ---------- 规则标签 ---------- */
.rule-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; font-size: 13px; transition: .15s;
}
.rule-chip:hover { border-color: var(--primary); }
.rule-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rule-chip.add { border-color: #cfe6da; }
.rule-chip.add.on { background: var(--green); border-color: var(--green); color: #fff; }
.rule-chip.deduct { border-color: #f0d2d0; }
.rule-chip.deduct.on { background: var(--red); border-color: var(--red); color: #fff; }
.rule-chip .pt { font-weight: 700; }

/* ---------- 宠物卡片 ---------- */
.pet-hero {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff8f0, #fdf1e4);
  border: 1px solid var(--line); border-radius: 20px; padding: 20px;
}
.pet-hero .stage { width: 150px; height: 150px; flex: 0 0 auto; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.pet-hero .stage img { width: 92%; height: 92%; object-fit: contain; }
.pet-hero .info { flex: 1; min-width: 220px; }
.pet-hero .pname { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pet-hero .pmeta { font-size: 12px; color: var(--sub); margin-top: 3px; }
.progress { height: 12px; border-radius: 999px; background: #f1e8db; overflow: hidden; margin: 10px 0 5px; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb26b, #ff8a4c); transition: width .5s; }
.progress.gold > i { background: linear-gradient(90deg, #e8c06a, #c9962e); }
.progress-txt { display: flex; justify-content: space-between; font-size: 11px; color: var(--sub); }

.stage-strip { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.stage-strip .s { flex: 1; min-width: 76px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 7px 4px; text-align: center; }
.stage-strip .s.on { border-color: var(--primary); background: var(--primary-soft); }
.stage-strip .s img { width: 100%; height: 58px; object-fit: contain; }
.stage-strip .s b { display: block; font-size: 10px; color: var(--ink-2); }
.stage-strip .s i { display: block; font-size: 9px; color: var(--sub); font-style: normal; }

/* ---------- 宠物库 ---------- */
.pet-lib-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line-2); background: #fff; border-radius: 999px;
  padding: 5px 14px; font-size: 13px; transition: .15s;
}
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.zodiac { border-color: var(--gold); color: var(--gold); }
.chip.zodiac.on { background: var(--gold); border-color: var(--gold); color: #fff; }

.species-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); transition: .18s;
}
.species-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.species-card.zodiac { border: 2px solid var(--gold); }
.species-card .head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.species-card .nm { font-size: 15px; font-weight: 700; }
.species-card .stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.species-card .stages .s2 { background: linear-gradient(180deg, #fffdf9, #f6f0e7); border-radius: 8px; padding: 3px 1px; text-align: center; cursor: zoom-in; }
.species-card .stages img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.species-card .stages b { display: block; font-size: 9px; color: var(--sub); }
.species-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); }
.species-card .foot img { width: 42px; height: 42px; cursor: zoom-in; }
.species-card .foot .bn { font-size: 12px; font-weight: 700; color: var(--red); }

/* ---------- 徽章墙 ---------- */
.badge-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.badge-item { text-align: center; }
.badge-item img { width: 76px; height: 76px; margin: 0 auto 5px; }
.badge-item.locked img { filter: grayscale(1) opacity(.28); }
.badge-item .bn { font-size: 12px; font-weight: 600; }
.badge-item.locked .bn { color: var(--sub); font-weight: 400; }

/* ---------- 排行榜 ---------- */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; transition: .15s; }
.rank-item:hover { background: #fdfbf8; }
.rank-item.me { background: var(--primary-soft); }
.rank-item .no { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--bg-soft); color: var(--sub); flex: 0 0 auto; }
.rank-item .no.t1 { background: linear-gradient(135deg,#ffd76e,#e0a52a); color: #fff; }
.rank-item .no.t2 { background: linear-gradient(135deg,#dfe6ee,#a9bacb); color: #fff; }
.rank-item .no.t3 { background: linear-gradient(135deg,#f0cba6,#c68d5c); color: #fff; }
.rank-item .av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.rank-item .nm { flex: 1; font-weight: 600; font-size: 14px; }
.rank-item .vl { font-weight: 700; color: var(--primary-d); font-size: 15px; }

/* ---------- 打卡 ---------- */
.timer-face {
  --tw: 460px;                      /* 计时卡内统一内容宽度：书名框 / 按钮行 / 底部统计行 */
  text-align: center; padding: 26px 16px;
  background: linear-gradient(135deg, #fff6ec, #fdeee0);
  border: 1px solid var(--line); border-radius: 20px;
}
.timer-face .clock { font-size: 58px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; color: var(--primary-d); line-height: 1.15; }
.timer-face .st { font-size: 14px; color: var(--sub); margin: 6px 0 18px; }
/* 书名输入：与按钮行等宽、居中放大 */
.timer-face .book-field { width: 100%; max-width: var(--tw); margin: 0 auto 18px; }
.timer-face .book-field .input {
  padding: 13px 16px; font-size: 15px; text-align: center;
  border-radius: 12px; border-color: rgba(255, 138, 76, .35);
}
.timer-face .book-field .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
/* 按钮行：与书名输入框同宽（同 --tw），两个按钮等分 */
.timer-btns { display: flex; gap: 12px; width: 100%; max-width: var(--tw); margin: 0 auto; }
.timer-btns .btn { flex: 1; min-width: 0; padding: 14px 26px; font-size: 16px; border-radius: 14px; }
/* 底部统计行同样收齐到 --tw，整卡左右边缘对齐 */
.timer-face > .row { width: 100%; max-width: var(--tw); margin-left: auto; margin-right: auto; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .h { text-align: center; font-size: 11px; color: var(--sub); padding: 4px 0; }
.cal .d { aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; background: #fbf8f3; }
.cal .d.done { background: var(--green-soft); color: var(--green); font-weight: 700; }
.cal .d.today { outline: 2px solid var(--primary); }
.cal .d .m { font-size: 9px; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(45, 32, 24, .45);
  display: none; align-items: center; justify-content: center; z-index: 8600; padding: 18px;
  backdrop-filter: blur(2px);
}
.mask.on { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.modal-head h3 { font-size: 17px; flex: 1; }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 0 18px 18px; display: flex; gap: 10px; justify-content: flex-end; }
.modal.wide { max-width: 860px; }
.modal.zoom { max-width: 560px; background: transparent; box-shadow: none; text-align: center; }
.modal.zoom img { max-width: 100%; max-height: 76vh; border-radius: 16px; background: #fff; padding: 12px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(61, 47, 42, .94); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: drop .22s ease;
}
.toast.ok { background: rgba(74, 143, 109, .96); }
.toast.err { background: rgba(217, 83, 79, .96); }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; padding: 40px 16px; color: var(--sub); font-size: 13px; }
.empty .ico { font-size: 38px; margin-bottom: 8px; opacity: .55; }
.loading { text-align: center; padding: 36px; color: var(--sub); font-size: 13px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--primary); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, #fff3e6, #faf7f2); }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); padding: 28px 26px; border: 1px solid var(--line); }
.login-card .logo { font-size: 44px; text-align: center; }
.login-card h2 { text-align: center; font-size: 21px; margin: 6px 0 3px; }
.login-card .sub { text-align: center; font-size: 12px; color: var(--sub); margin-bottom: 20px; }
.role-tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.role-tabs button { flex: 1; padding: 8px 4px; border-radius: 9px; font-size: 13px; color: var(--ink-2); }
.role-tabs button.on { background: #fff; color: var(--primary-d); font-weight: 600; box-shadow: 0 1px 4px rgba(90,60,40,.08); }
.reg-roles { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.reg-roles .chip { padding: 7px 18px; font-size: 13px; }
.login-foot { text-align: center; font-size: 12px; color: var(--sub); margin-top: 16px; }
.login-foot a { color: var(--primary-d); font-weight: 600; }
.demo-tip { margin-top: 14px; padding: 10px 12px; background: var(--blue-soft); border-radius: 10px; font-size: 11.5px; color: #3d6ba3; line-height: 1.7; }

/* ---------- 其它 ---------- */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.muted { color: var(--sub); }
.small { font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .aic { align-items: center; }
.gap6 { gap: 6px; } .gap10 { gap: 10px; } .gap14 { gap: 14px; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.scroll-x { overflow-x: auto; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 57px; bottom: 0; z-index: 60; background: var(--bg); width: 208px; transform: translateX(-100%); transition: .22s; box-shadow: var(--shadow-lg); overflow-y: auto; }
  .sidebar.open { transform: none; }
  .content { padding: 14px 14px 60px; }
  .menu-btn { display: flex !important; }
  .topbar { padding: 10px 14px; }
  .topbar .brand { font-size: 15px; white-space: nowrap; }
  .topbar .brand small { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .who { font-size: 12px; gap: 6px; }
  .topbar .who > span { white-space: nowrap; }
  .pet-hero .stage { width: 110px; height: 110px; }
  .timer-face { padding: 22px 14px; }
  .timer-face .clock { font-size: 48px; }
  .timer-face .book-field { max-width: none; margin-bottom: 16px; }
  .timer-face .book-field .input { font-size: 16px; }
  .timer-face > .row { max-width: none; }
  .timer-btns { gap: 10px; max-width: none; }
  .timer-btns .btn { flex: 1; min-width: 0; padding: 14px 12px; font-size: 15.5px; }
  .stage-strip { gap: 6px; }
  .stage-strip .s { min-width: 56px; padding: 6px 2px; }
  .stage-strip .s img { height: 44px; }
  .stage-strip .s b { font-size: 9px; }
  .stage-strip .s i { font-size: 8px; }
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .cal .d { font-size: 11px; }
}
.menu-btn { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
.menu-btn:hover { background: var(--bg-soft); }

/* ============================================================
   工作台宠物卡片墙 + 特效引擎（参考 classpet.vip 动效还原）
   ============================================================ */

/* ---------- 卡片墙 ---------- */
.petwall { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.pw-card {
  position: relative; border-radius: 20px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--line-2); background: var(--card);
  box-shadow: 0 6px 18px rgba(90, 60, 40, .08);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column; text-align: left; padding: 0; font: inherit; color: inherit;
}
.pw-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(90, 60, 40, .14); }
.pw-card[data-tone="0"] { background: linear-gradient(175deg, #fff0f3 0%, #fff7f2 46%, #ffffff 100%); border-color: #ffd6de; }
.pw-card[data-tone="1"] { background: linear-gradient(175deg, #fff3e8 0%, #fffaf2 46%, #ffffff 100%); border-color: #ffd9b8; }
.pw-card[data-tone="2"] { background: linear-gradient(175deg, #eef7f0 0%, #f7fcf6 46%, #ffffff 100%); border-color: #cfe8d6; }
.pw-card[data-tone="3"] { background: linear-gradient(175deg, #eef3fb 0%, #f8fbff 46%, #ffffff 100%); border-color: #ccdafa; }
.pw-card[data-tone="4"] { background: linear-gradient(175deg, #f3effb 0%, #faf7ff 46%, #ffffff 100%); border-color: #ddd2f5; }
.pw-card[data-tone="0"] .pw-name { color: #d94f6b; }
.pw-card[data-tone="1"] .pw-name { color: #d97a2e; }
.pw-card[data-tone="2"] .pw-name { color: #3e8e63; }
.pw-card[data-tone="3"] .pw-name { color: #3f6fb5; }
.pw-card[data-tone="4"] .pw-name { color: #7c5cc4; }
.pw-card[data-tone="0"] .pw-progress i { background: #f97fa4; }
.pw-card[data-tone="1"] .pw-progress i { background: #ff9f5c; }
.pw-card[data-tone="2"] .pw-progress i { background: #5cb984; }
.pw-card[data-tone="3"] .pw-progress i { background: #6b96d9; }
.pw-card[data-tone="4"] .pw-progress i { background: #9a78e0; }

.pw-top { position: relative; padding: 18px 14px 8px; display: flex; align-items: center; justify-content: center; min-height: 128px; }
.pw-top::before { content: ""; position: absolute; inset: 0; opacity: .35; background: linear-gradient(180deg, transparent 30%, rgba(255, 255, 255, .85) 100%); pointer-events: none; }
.pw-visual { position: relative; z-index: 2; width: 108px; height: 108px; }
.pw-visual img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(90, 60, 40, .18)); }
.pw-img-wrap { width: 100%; height: 100%; }

.pw-body { position: relative; padding: 8px 14px 14px; background: rgba(255, 255, 255, .55); backdrop-filter: blur(2px); border-top: 1px solid rgba(255, 255, 255, .6); flex: 1; display: flex; flex-direction: column; gap: 8px; }
.pw-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pw-name { font-weight: 900; font-size: 16px; line-height: 1.2; }
.pw-nick { font-size: 11px; color: var(--sub); background: rgba(255, 255, 255, .7); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pw-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw-lv { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 900; color: var(--ink-2); box-shadow: 0 1px 4px rgba(90, 60, 40, .08); }
.pw-lv .dot { width: 7px; height: 7px; border-radius: 50%; background: #a855f7; box-shadow: 0 0 8px rgba(168, 85, 247, .6); animation: fx-pulse-dot 1.6s ease-in-out infinite; }
.pw-stage { font-size: 11px; color: var(--sub); }
.pw-progress-wrap { display: flex; flex-direction: column; gap: 4px; }
.pw-progress-txt { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--sub); }
.pw-progress-txt b { color: #6b6bdd; }
.pw-progress { position: relative; height: 10px; background: #efe9e2; border-radius: 999px; overflow: hidden; }
.pw-progress i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--primary); transition: width .5s ease-out; }
.pw-foot { display: flex; align-items: center; gap: 10px; border-top: 1px dashed var(--line-2); padding-top: 8px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.pw-foot .sp { flex: 1; }
.pw-foot .ic { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }

/* 神秘蛋卡片 */
.pw-egg { text-align: center; }
.pw-egg .egg { width: 92px; height: 108px; margin: 4px auto 0; display: flex; align-items: center; justify-content: center; }
.pw-egg .egg-inner { width: 84px; height: 104px; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%; background: linear-gradient(160deg, #f6edff 0%, #e4d2fb 70%, #c9aef2 100%); box-shadow: inset 0 -10px 18px rgba(124, 92, 196, .25), 0 10px 18px rgba(124, 92, 196, .2); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 900; color: #a07fe0; animation: fx-egg-wobble 1.6s ease-in-out infinite; }
.pw-egg .wait { font-size: 12px; font-weight: 800; color: var(--sub); }
.pw-egg .go { font-size: 12px; font-weight: 900; color: #a07fe0; }
.pw-egg:hover .go { text-decoration: underline; }

/* ---------- 特效层 ---------- */
.pw-card, .fx-closeup-stage { --fxz: 5; }
.fx-food { position: absolute; top: 40%; left: 50%; font-size: 30px; z-index: 40; pointer-events: none; animation: fx-food-fly .85s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.fx-exp { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); font-size: 22px; font-weight: 900; z-index: 40; pointer-events: none; animation: fx-exp-up 1.05s ease-out forwards; }
.fx-exp.up { color: #fbbf24; text-shadow: 0 2px 8px rgba(251, 191, 36, .5), 0 0 20px rgba(255, 215, 0, .3); }
.fx-exp.down { color: #7fb2e8; text-shadow: 0 2px 8px rgba(127, 178, 232, .45); }
.fx-particles { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 35; }
.fx-particle { position: absolute; font-size: 15px; pointer-events: none; animation: fx-particle-burst .8s ease-out forwards; }
.fx-card-glow { animation: fx-card-glow-pulse .65s ease-out; }
.fx-jump { animation: fx-pet-jump .65s cubic-bezier(.34, 1.56, .64, 1); }
.fx-bar-flash::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .85) 50%, transparent 100%); background-size: 50% 100%; animation: fx-progress-flash .65s ease-out; }

/* 卡片升级覆盖层 */
.fx-lv-glow { animation: fx-levelup-glow .9s ease-out; }
.fx-lvcard { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; border-radius: 20px; background: rgba(30, 20, 10, .45); backdrop-filter: blur(3px); animation: fx-fade-in .3s ease-out; }
.fx-lvcard-inner { position: relative; text-align: center; animation: fx-bob 1s ease-in-out infinite; }
.fx-lvcard-glow { position: absolute; inset: -30px; background: #fbbf24; filter: blur(28px); opacity: .5; transform: scale(1.4); animation: fx-pulse-dot 1.4s ease-in-out infinite; border-radius: 50%; }
.fx-lvcard-text { position: relative; z-index: 2; }
.fx-lvcard-text .e { font-size: 34px; margin-bottom: 2px; }
.fx-lvcard-text .t { font-size: 24px; font-weight: 900; background: linear-gradient(90deg, #fde68a, #fb923c, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .3)); }
.fx-lvcard-text .s { color: #fff; font-weight: 800; font-size: 14px; margin-top: 3px; text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.fx-lvcard-stars { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: 20px; }
.fx-lvcard-stars span { position: absolute; font-size: 18px; opacity: 0; }

/* 全屏升级庆祝 */
.fx-lvscreen { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; background: rgba(20, 12, 4, .72); backdrop-filter: blur(6px); animation: fx-fade-in .3s ease-out; cursor: pointer; }
.fx-lvscreen.out { opacity: 0; transition: opacity .3s; }
.fx-lvscreen-box { position: relative; display: flex; flex-direction: column; align-items: center; animation: fx-lv-in .5s cubic-bezier(.34, 1.56, .64, 1); }
.fx-lvscreen-halo { position: absolute; top: 26%; left: 50%; transform: translate(-50%, -50%); width: 340px; height: 340px; border-radius: 50%; background: rgba(251, 191, 36, .4); filter: blur(90px); animation: fx-pulse-dot 2s ease-in-out infinite; }
.fx-lvscreen-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.fx-lvscreen-confetti i { position: absolute; top: -20px; width: 9px; height: 9px; opacity: 0; }
.fx-lvscreen-pet { position: relative; z-index: 2; width: 210px; height: 210px; margin-bottom: 14px; animation: fx-bob 1.6s ease-in-out infinite; }
.fx-lvscreen-pet img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 34px rgba(250, 204, 21, .8)) brightness(1.1) saturate(1.1); }
.fx-lvscreen-pill { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 7px 20px; border-radius: 999px; background: rgba(245, 158, 11, .2); border: 1px solid rgba(251, 191, 36, .5); backdrop-filter: blur(6px); box-shadow: 0 0 22px rgba(250, 204, 21, .3); color: #fef3c7; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; font-size: 13px; }
.fx-lvscreen-title { position: relative; z-index: 2; margin: 0 0 10px; font-size: 40px; font-weight: 900; text-align: center; background: linear-gradient(180deg, #ffffff, #fef3c7 55%, #fcd34d); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .4)); }
.fx-lvscreen-lv { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 22px; font-weight: 900; }
.fx-lvscreen-lv .from { font-size: 26px; color: rgba(226, 232, 240, .9); }
.fx-lvscreen-lv .arrow { font-size: 30px; color: #fbbf24; animation: fx-pulse-dot 1.2s ease-in-out infinite; }
.fx-lvscreen-lv .to { font-size: 40px; color: #fcd34d; text-shadow: 0 0 16px rgba(250, 204, 21, .6); }
.fx-lvscreen-skip { position: relative; z-index: 2; margin-top: 26px; font-size: 12px; color: rgba(255, 255, 255, .55); }

/* ---------- 特写弹层 ---------- */
.fx-closeup { position: fixed; inset: 0; z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(30, 20, 12, .6); backdrop-filter: blur(6px); animation: fx-fade-in .25s ease-out; }
.fx-closeup.out { opacity: 0; transition: opacity .25s; }
.fx-closeup-box { position: relative; width: min(560px, 94vw); max-height: 92vh; overflow: auto; border-radius: 26px; background: linear-gradient(175deg, #fff4ec 0%, #fffdf9 40%, #ffffff 100%); box-shadow: 0 24px 60px rgba(30, 15, 5, .35); animation: fx-pop-in .38s cubic-bezier(.34, 1.56, .64, 1); }
.fx-closeup-close { position: absolute; right: 12px; top: 12px; z-index: 5; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .9); color: var(--sub); font-size: 16px; cursor: pointer; box-shadow: var(--shadow); }
.fx-closeup-close:hover { color: var(--ink); transform: scale(1.08); }
.fx-closeup-stage { position: relative; display: flex; align-items: center; justify-content: center; padding: 26px 20px 6px; min-height: 190px; }
.fx-closeup-stage::before { content: ""; position: absolute; width: 240px; height: 240px; top: 50%; left: 50%; transform: translate(-50%, -54%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 120, .35) 0%, rgba(255, 190, 120, 0) 70%); animation: fx-pulse-dot 2.4s ease-in-out infinite; pointer-events: none; }
.fx-closeup-stage img { position: relative; z-index: 2; width: 170px; height: 170px; object-fit: contain; filter: drop-shadow(0 14px 22px rgba(90, 60, 40, .22)); }
.fx-closeup-info { text-align: center; padding: 0 22px 6px; }
.fx-closeup-info .nm { font-size: 19px; font-weight: 900; color: var(--ink); }
.fx-closeup-info .nm .pet { color: var(--primary-d); }
.fx-closeup-info .meta { font-size: 12px; color: var(--sub); margin-top: 3px; }
.fx-closeup-info .row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.fx-closeup-stats { display: flex; gap: 10px; justify-content: center; margin: 12px 18px 0; }
.fx-closeup-stats .st { flex: 1; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px; text-align: center; }
.fx-closeup-stats .st b { font-size: 17px; display: block; }
.fx-closeup-stats .st span { font-size: 11px; color: var(--sub); }
.fx-closeup-progress { margin: 12px 18px 0; }
.fx-closeup-rules { padding: 14px 18px 18px; }
.fx-closeup-rules .sec { font-size: 12px; font-weight: 900; color: var(--sub); margin: 8px 0 6px; }
.fx-closeup-rules .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.fx-quick { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 800; cursor: pointer; transition: all .15s; font-family: inherit; }
.fx-quick:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.fx-quick.add { color: var(--green); border-color: #cfe8d6; background: var(--green-soft); }
.fx-quick.deduct { color: var(--red); border-color: #f5cfcD; background: var(--red-soft); }
.fx-quick.sel { outline: 2px solid var(--primary); outline-offset: 1px; }
.fx-custom-row { display: flex; gap: 8px; margin-top: 10px; }
.fx-custom-row .input { flex: 1; }
.fx-do-btn { width: 100%; margin-top: 12px; }

/* ---------- 待机动画 ---------- */
.fx-breathe { animation: fx-breathe 2.5s ease-in-out infinite; will-change: transform; }
.fx-hover-pet:hover .pw-img-wrap { animation: fx-hover-excited .6s ease-in-out; }

/* ---------- 关键帧 ---------- */
@keyframes fx-breathe { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.035) translateY(-4px); } }
@keyframes fx-pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes fx-hover-excited { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.06) rotate(-2deg); } 50% { transform: scale(1.04) rotate(2deg); } 75% { transform: scale(1.06) rotate(-1deg); } }
@keyframes fx-pet-jump { 0% { transform: scale(1) translateY(0) rotate(0); } 15% { transform: scale(1.1, .9) translateY(5px) rotate(-2deg); } 30% { transform: scale(.95, 1.15) translateY(-20px) rotate(2deg); } 45% { transform: scale(1.05, .95) translateY(-10px) rotate(-1deg); } 60% { transform: scale(.98, 1.08) translateY(-15px) rotate(1deg); } 75% { transform: scale(1.02, .98) translateY(-5px) rotate(0); } 100% { transform: scale(1) translateY(0) rotate(0); } }
@keyframes fx-food-fly { 0% { transform: translate(-60px, -80px) scale(.3) rotate(-30deg); opacity: 0; } 30% { opacity: 1; transform: translate(-20px, -30px) scale(1.2) rotate(10deg); } 60% { transform: translate(0, 0) scale(1) rotate(0); } 80% { transform: translateY(5px) scale(.8) rotate(5deg); opacity: 1; } 100% { transform: translate(0, 0) scale(0) rotate(0); opacity: 0; } }
@keyframes fx-exp-up { 0% { transform: translate(-50%, 0) scale(.5); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.2); opacity: 1; } 80% { transform: translate(-50%, -60px) scale(1); opacity: 1; } 100% { transform: translate(-50%, -80px) scale(.8); opacity: 0; } }
@keyframes fx-particle-burst { 0% { transform: translate(0, 0) scale(0); opacity: 0; } 20% { opacity: 1; transform: translate(var(--tx, 0), var(--ty, 0)) scale(1); } 100% { transform: translate(calc(var(--tx, 0) * 2), calc(var(--ty, 0) * 2 - 30px)) scale(0); opacity: 0; } }
@keyframes fx-card-glow-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 184, 80, 0), 0 6px 18px rgba(90, 60, 40, .08); } 30% { box-shadow: 0 0 30px 10px rgba(255, 184, 80, .45), 0 6px 28px rgba(255, 160, 90, .5); } 100% { box-shadow: 0 0 0 0 rgba(255, 184, 80, 0), 0 6px 18px rgba(90, 60, 40, .08); } }
@keyframes fx-progress-flash { 0% { background-position: -100% 0; } 100% { background-position: 200% 0; } }
@keyframes fx-float-up { 0% { opacity: 0; transform: translateY(0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-86px) scale(1.1); } }
@keyframes fx-twinkle { 0%, 100% { opacity: 0; transform: scale(0) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(180deg); } }
@keyframes fx-egg-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes fx-levelup-glow { 0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, .7); } 50% { box-shadow: 0 0 24px 12px rgba(255, 215, 0, .4); } 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); } }
@keyframes fx-fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes fx-pop-in { 0% { opacity: 0; transform: scale(.8) translateY(16px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fx-lv-in { 0% { opacity: 0; transform: scale(.86) translateY(40px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fx-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes fx-confetti-fall { 0% { transform: translateY(-20px) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(720deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .fx-breathe, .pw-egg .egg-inner, .pw-lv .dot, .fx-lvscreen-pet, .fx-closeup-stage::before { animation: none !important; }
}

/* 底部结果条（加减分可撤回） */
.fx-pill {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); z-index: 8500;
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line-2); border-radius: 999px;
  box-shadow: 0 10px 30px rgba(90, 60, 40, .2); font-size: 13px; font-weight: 700; color: var(--ink-2);
  opacity: 0; pointer-events: none; transition: all .3s ease; max-width: 92vw;
}
.fx-pill.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fx-pill .ic { font-size: 15px; }
.fx-pill b.up { color: var(--primary-d); }
.fx-pill b.down { color: var(--blue); }
.fx-pill .undo { border: none; background: var(--primary-soft); color: var(--primary-d); font-weight: 900; font-size: 12px; padding: 4px 12px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.fx-pill .undo:hover { background: #ffe4d1; }
.fx-pill .undo:disabled { opacity: .5; cursor: default; }

/* ============================================================
   顶部导航版布局（老师端）+ 加减分面板 + 批量模式
   ============================================================ */

/* ---------- 顶部导航 ---------- */
.cls-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--ink-2); transition: .15s;
  max-width: 220px; white-space: nowrap; overflow: hidden;
}
.cls-chip:hover { border-color: var(--primary); color: var(--primary-d); }
.cls-chip .pen { font-size: 11px; opacity: .55; }
.cls-chip span { overflow: hidden; text-overflow: ellipsis; }

.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); transition: .15s;
}
.top-nav a:hover { background: var(--bg-soft); }
.top-nav a.on { background: var(--primary-soft); color: var(--primary-d); font-weight: 700; }

.nav-drop { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); transition: .15s;
}
.nav-drop-btn:hover, .nav-drop.open .nav-drop-btn { background: var(--bg-soft); }
.nav-drop-btn i { font-size: 10px; font-style: normal; color: var(--sub); }
.drop-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 80;
  min-width: 176px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; gap: 2px;
  animation: fx-fade-in .15s ease-out;
}
.drop-menu.open { display: flex; }
.drop-menu.drop-right { left: auto; right: 0; }
.drop-menu a, .drop-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 11px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); text-align: left; transition: .12s;
}
.drop-menu a:hover, .drop-menu button:hover { background: var(--primary-soft); color: var(--primary-d); }
.drop-menu button.on { background: var(--primary-soft); color: var(--primary-d); font-weight: 700; }
.drop-menu .drop-cap { font-size: 11px; color: var(--sub); padding: 4px 11px 5px; font-weight: 700; }
.drop-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}

.top-tools { display: flex; align-items: center; gap: 8px; }
.tool-dd { position: relative; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: #fff; font-size: 12.5px; font-weight: 700; color: var(--ink-2); transition: .15s;
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary-d); }
.tool-btn i { font-size: 10px; font-style: normal; color: var(--sub); }
.top-search {
  width: 168px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; outline: none; font-size: 12.5px; transition: .15s;
}
.top-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 138, 76, .12); width: 200px; }

/* ---------- 加减分面板（常用 | 加分 | 扣分） ---------- */
.sc-tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.sc-tabs button { flex: 1; padding: 8px 4px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: .15s; }
.sc-tabs button.on { background: var(--ink); color: #fff; box-shadow: 0 1px 4px rgba(90, 60, 40, .18); }
.sc-pane { animation: fx-fade-in .18s ease-out; }
.sc-pane.hidden { display: none; }
.sc-pane .sec { font-size: 12px; font-weight: 900; color: var(--sub); margin: 4px 0 7px; display: flex; align-items: baseline; gap: 8px; }
.sc-pane .sec .sub { font-size: 11px; font-weight: 500; }
.sc-pane .chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }

.sc-sec { border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.sc-sec.add { background: linear-gradient(175deg, #f2fbf5, #fdfffd); border: 1px solid #d8eee0; }
.sc-sec.deduct { background: linear-gradient(175deg, #fef4f3, #fffcfc); border: 1px solid #f6dcd9; }
.ss-head { font-size: 13px; font-weight: 900; margin-bottom: 9px; }
.sc-sec.add .ss-head { color: var(--green); }
.sc-sec.deduct .ss-head { color: var(--red); }

.rule-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.rule-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 11px 12px; border-radius: 13px; text-align: left;
  border: 1px solid var(--line-2); background: #fff; transition: .15s; min-height: 86px;
}
.rule-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rule-card .ric {
  width: 30px; height: 30px; border-radius: 10px; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rule-card.add .ric { background: var(--green-soft); }
.rule-card.deduct .ric { background: var(--red-soft); }
.rule-card .rnm { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.rule-card .rpt {
  font-size: 11px; font-weight: 900; padding: 1px 9px; border-radius: 999px; margin-top: auto;
}
.rule-card.add .rpt { background: var(--green-soft); color: var(--green); }
.rule-card.deduct .rpt { background: var(--red-soft); color: var(--red); }
.rule-card.add:hover { border-color: #b9dcc8; }
.rule-card.deduct:hover { border-color: #eec3bf; }

.sc-search { margin-bottom: 10px; }
.sc-search .input { border-radius: 999px; background: var(--bg-soft); border-color: transparent; }

.sc-custom { border: 1px dashed var(--line-2); border-radius: 14px; padding: 10px 12px; margin-top: 10px; }
.sc-custom-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-custom-head b { font-size: 13px; }
.sc-custom-body { margin-top: 10px; }
.sc-custom-body.hidden { display: none; }

/* ---------- 批量模式 ---------- */
.petwall.batch { padding-bottom: 4px; }
.pw-card.sel { outline: 3px solid var(--primary); outline-offset: 2px; }
.pw-check {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-2); background: #fff; color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; transition: .15s; flex: 0 0 auto;
}
.pw-check.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.batch-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 16px); z-index: 8400;
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--line-2); border-radius: 999px;
  box-shadow: 0 10px 30px rgba(90, 60, 40, .22); opacity: 0; pointer-events: none; transition: all .3s ease;
  max-width: 94vw; flex-wrap: wrap; justify-content: center;
}
.batch-bar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.batch-bar .binfo { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 4px; }
.batch-bar .binfo b { color: var(--primary-d); font-size: 16px; }

/* ---------- 大卡片变体（学生端 / 家长端 hero） ---------- */
.pw-card.pw-lg { max-width: 340px; }
.pw-card.pw-lg .pw-top { min-height: 168px; }
.pw-card.pw-lg .pw-visual { width: 136px; height: 136px; }
.pw-card.pw-lg .pw-name { font-size: 18px; }
.pw-card.pw-static { cursor: default; }

@media (max-width: 1080px) {
  .top-tools { display: none !important; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .top-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .top-nav a { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
  .cls-chip { max-width: 150px; font-size: 12px; }
  .drop-menu { position: fixed; top: auto; left: 12px; right: 12px; min-width: 0; }
  .rule-cards { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}

/* ================= 家长端 · 孩子 Tab 卡片 ================= */
.kid-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.ktab {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card);
  cursor: pointer; font: inherit; color: var(--ink); text-align: left;
  transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}
.ktab:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.ktab.on {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 4px 16px rgba(255, 138, 76, .18); transform: translateY(-1px);
}
.ktab .kav {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.ktab .kmain { display: flex; flex-direction: column; line-height: 1.3; }
.ktab .knm { font-weight: 700; font-size: 14px; }
.ktab .krel { font-size: 11px; color: var(--sub); }
.ktab .kpet {
  flex: 0 0 auto; margin-left: 4px; font-size: 11.5px; font-weight: 600;
  color: var(--primary-d); background: var(--primary-soft);
  border: 1px solid rgba(255, 138, 76, .25); padding: 2px 9px; border-radius: 999px;
}
.ktab .kpet.egg { color: var(--sub); background: var(--bg-soft); border-color: var(--line); }
.ktab.on .kpet { background: #fff; }

@media (max-width: 720px) {
  .kid-tabs { gap: 8px; }
  .ktab { padding: 8px 12px 8px 8px; }
  .ktab .kpet { display: none; }
}

/* ================= 守护神兽选择器（代领养弹窗） ================= */
.gp-sub { text-align: center; color: var(--sub); font-size: 12.5px; margin-bottom: 12px; }
.gp-sub .gp-who {
  font-size: 20px; font-weight: 800; color: var(--ink);
  padding: 1px 8px; margin: 0 3px; border-radius: 8px;
  background: rgba(255, 138, 76, .12); vertical-align: -2px;
}
.gp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px; max-height: 56vh; overflow-y: auto; padding: 4px 2px 8px;
}
.gp-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px 10px; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--card); cursor: pointer; font: inherit; color: var(--ink);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.gp-card:hover {
  transform: translateY(-3px); border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(255, 138, 76, .18);
}
.gp-card:active { transform: translateY(-1px) scale(.98); }
.gp-card img { width: 72px; height: 72px; object-fit: contain; }
.gp-card b { font-size: 13px; }
.gp-card.zodiac b::after { content: ' 🧧'; font-size: 11px; }

@media (max-width: 560px) {
  .gp-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .gp-card img { width: 58px; height: 58px; }
}

/* ================= 阅读打卡页 · 打卡卡与日历卡等高 ================= */
.split.eq { align-items: stretch; }
.split.eq > div { display: flex; flex-direction: column; }
.split.eq > div > .card { flex: 1; display: flex; flex-direction: column; }
.split.eq > .card { display: flex; flex-direction: column; }   /* 卡片直接作 grid 子项（如超管看板） */
.split.eq > .card + .card, .split.eq > div > .card + .card { margin-top: 0; }   /* 横向并排时清除相邻卡纵距，保证等高 */
.split.eq > .card .btn { align-self: flex-start; }   /* 卡内按钮保持内容宽度，不随卡片拉伸 */
.split.eq > div > .card .timer-face { flex: 1; display: flex; flex-direction: column; justify-content: center; }
