:root {
  --bg: #f5f7ff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: #fff8f3;
  --line: #e9edf7;
  --text: #253046;
  --muted: #77819b;
  --brand: #ff8d4d;
  --brand-strong: #ff7a2f;
  --bad: #ef4444;
  --radius: 22px;
  --shadow: 0 22px 60px rgba(30, 41, 59, 0.08);
  --shadow-soft: 0 14px 34px rgba(30, 41, 59, 0.06);
  --container: 1380px;
  --page-accent: #ff8d4d;
  --page-soft: rgba(255, 141, 77, 0.16);
  --page-glow: rgba(255, 189, 143, 0.38);
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 520px at 0% 0%, rgba(255, 141, 77, 0.14), transparent 50%),
    radial-gradient(780px 520px at 100% 0%, rgba(255, 212, 181, 0.35), transparent 50%),
    linear-gradient(180deg, #fdf8f3 0%, #f5f7ff 180px, #f5f7ff 100%);
}

body[data-page="login"] {
  background:
    radial-gradient(900px 540px at 12% 18%, rgba(255, 141, 77, 0.24), transparent 45%),
    radial-gradient(700px 480px at 88% 12%, rgba(255, 189, 143, 0.22), transparent 44%),
    linear-gradient(135deg, #fff7f1 0%, #f6f8ff 54%, #eef6ff 100%);
}

body[data-page="honors"] {
  --page-accent: #ff7a2f;
  --page-soft: rgba(255, 122, 47, 0.16);
  --page-glow: rgba(255, 198, 140, 0.34);
}

body[data-page="store"] {
  --page-accent: #f97316;
  --page-soft: rgba(249, 115, 22, 0.15);
  --page-glow: rgba(255, 210, 153, 0.35);
}

body[data-page="lottery"] {
  --page-accent: #f43f5e;
  --page-soft: rgba(244, 63, 94, 0.15);
  --page-glow: rgba(253, 164, 175, 0.34);
}

body[data-page="records"] {
  --page-accent: #fb7185;
  --page-soft: rgba(251, 113, 133, 0.14);
  --page-glow: rgba(254, 205, 211, 0.35);
}

body[data-page="settings"] {
  --page-accent: #f59e0b;
  --page-soft: rgba(245, 158, 11, 0.15);
  --page-glow: rgba(254, 240, 138, 0.28);
}

body[data-page="classroom"] {
  --page-accent: #10b981;
  --page-soft: rgba(16, 185, 129, 0.14);
  --page-glow: rgba(167, 243, 208, 0.32);
}

body[data-page="gallery"] {
  --page-accent: #0ea5e9;
  --page-soft: rgba(14, 165, 233, 0.14);
  --page-glow: rgba(186, 230, 253, 0.35);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 24px;
  align-items: center;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
}

.login-panel {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 80px rgba(255, 141, 77, 0.14);
  backdrop-filter: blur(14px);
}

.login-panel-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.95fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
  min-height: 520px;
}

.login-visual-copy {
  display: grid;
  gap: 16px;
  align-content: center;
}

.login-eyebrow {
  color: var(--page-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.login-visual-copy h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.login-visual-copy p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.login-visual-frame {
  position: relative;
  min-height: 320px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(160deg, rgba(255, 141, 77, 0.16), rgba(255, 255, 255, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 24px 60px rgba(255, 141, 77, 0.14);
}

.login-visual-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.5), transparent 26%),
    radial-gradient(circle at 22% 84%, rgba(255, 182, 123, 0.22), transparent 34%);
  pointer-events: none;
}

.login-visual-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.login-panel-form {
  width: 100%;
  padding: 28px;
}

.login-brand,
.topbar-left,
.user-chip {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(145deg, var(--page-accent), #ffb15a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 28px rgba(255, 141, 77, 0.26);
}

.brand-en {
  color: var(--page-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.login-panel h1,
.brand-zh {
  margin: 2px 0 0;
  font-size: 24px;
  font-weight: 800;
}

.login-panel-form h2 {
  margin: 2px 0 0;
  font-size: 24px;
  font-weight: 800;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 22px 0 18px;
}

.login-tabs button {
  padding: 14px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
}

.login-tabs .active {
  color: var(--brand-strong);
  font-weight: 700;
  border-color: var(--brand-strong);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.search-input,
.small-input,
.small-select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 10px;
  color: var(--muted);
}

.login-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 13px;
  line-height: 1.7;
}

.btn {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-strong), #ffb15a);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.btn-small {
  padding: 10px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.form-error {
  margin: 10px 0 0;
  color: var(--bad);
  font-size: 13px;
}

.rollcall-result-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.rollcall-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 241, 0.94)),
    radial-gradient(circle at top right, var(--page-soft), transparent 72%);
  box-shadow: var(--shadow-soft);
}

.rollcall-order {
  color: var(--page-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rollcall-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.rollcall-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard {
  width: min(var(--container), calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 30px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 241, 0.88)),
    radial-gradient(circle at top left, var(--page-glow), transparent 52%);
  box-shadow:
    0 24px 60px rgba(30, 41, 59, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  padding: 8px 10px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 246, 239, 0.8)),
    radial-gradient(circle at center, var(--page-soft), transparent 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a,
.main-nav button {
  position: relative;
  padding: 10px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.main-nav a:hover,
.main-nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.main-nav a.active,
.main-nav button.active {
  color: #fff;
  background:
    linear-gradient(135deg, var(--page-accent), #ffb15a),
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.28), transparent 40%);
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 22px rgba(255, 141, 77, 0.28);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-select {
  min-width: 118px;
  max-width: 160px;
  padding: 10px 12px;
  border-radius: 999px;
}

.class-chip,
.user-chip,
.pill {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 243, 0.9)),
    radial-gradient(circle at top left, var(--page-soft), transparent 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.user-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--page-accent);
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 243, 234, 0.95);
}

.main-layout {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.hero-card,
.panel,
.table-wrap,
.empty-state,
.dialog-card,
.student-card,
.store-card,
.beast-card,
.rank-card,
.setting-card {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 26px;
  background:
    radial-gradient(circle at top right, var(--page-glow), transparent 36%),
    radial-gradient(circle at bottom left, var(--page-soft), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 246, 239, 0.9));
}

.hero-card.hero-home {
  padding: 18px 22px;
  border-radius: 24px;
}

.hero-card.hero-home h2 {
  font-size: 26px;
}

.hero-card h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.hero-card p,
.muted {
  color: var(--muted);
}

.hero-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-card.hero-home .hero-metrics {
  gap: 10px;
}

.metric,
.mini-stat {
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 245, 0.92)),
    radial-gradient(circle at top left, var(--page-soft), transparent 75%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.metric {
  min-width: 120px;
}

.metric-label,
.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong,
.mini-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.view-panel {
  display: grid;
  gap: 18px;
}

.toolbar,
.section-head,
.panel {
  padding: 18px 20px;
}

.toolbar,
.section-head,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-actions,
.inline-actions,
.tag-row,
.card-actions,
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.home-control-bar {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 16px;
  align-items: center;
}

.home-control-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.home-control-left .search-input {
  max-width: 280px;
}

.home-control-left .small-select {
  width: 140px;
  min-width: 140px;
}

.home-quick-side {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.home-side-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.home-actions-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.home-mini-stats {
  margin-top: 0;
}

.small-input {
  width: 120px;
  padding: 12px 14px;
}

.small-select {
  min-width: 130px;
  padding: 12px 14px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}

.student-card,
.store-card,
.beast-card,
.rank-card,
.setting-card {
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.student-card-header,
.rank-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.student-title {
  font-size: 18px;
  font-weight: 800;
}

.student-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.level-badge,
.score-badge,
.series-badge,
.rank-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #fff2e8;
  color: var(--brand-strong);
}

.pet-stage,
.beast-card .image-box {
  margin-top: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdfb, #fff4ea);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pet-stage {
  aspect-ratio: 1.15;
}

.beast-card .image-box {
  aspect-ratio: 1;
}

.pet-stage img,
.beast-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-meta {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.beast-card-top {
  display: flex;
  justify-content: flex-start;
}

.beast-card-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.beast-card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
}

.beast-card-bottom {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.beast-preview-hero {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 8px;
}

.beast-preview-hero img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdfb, #fff4ea);
}

.beast-preview-meta {
  display: grid;
  gap: 12px;
}

.beast-preview-meta strong {
  font-size: 34px;
  line-height: 1.1;
}

.beast-stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.beast-stage-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.beast-stage-image {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdfb, #fff4ea);
}

.beast-stage-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.beast-stage-info {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.beast-stage-info span {
  color: var(--muted);
  font-size: 12px;
}

.pet-name {
  font-weight: 800;
}

.student-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.progress-bar {
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1fa;
}

.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-strong), #ffc16a);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.two-col,
.three-col {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: 1.2fr 0.8fr;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rules-list,
.store-list,
.students-list,
.gallery-grid,
.rank-grid {
  display: grid;
  gap: 12px;
}

.rule-row,
.store-row,
.student-row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.rule-row {
  grid-template-columns: 100px 1fr 100px auto;
}

.store-row {
  grid-template-columns: 90px 1fr 90px 90px auto;
}

.store-row.store-row-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  border-style: dashed;
}

.asset-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: start;
}

.asset-preview {
  display: grid;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.asset-preview img {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  object-fit: cover;
}

.asset-preview-fallback strong {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff7ef;
  font-size: 34px;
}

.student-row {
  grid-template-columns: 1fr 120px 120px auto;
}

.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.empty-state {
  padding: 32px 24px;
  text-align: center;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(37, 48, 70, 0.35);
  backdrop-filter: blur(8px);
}

.dialog-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
}

.dialog-card.dialog-sm {
  width: min(520px, 100%);
}

.dialog-card.dialog-xl {
  width: min(1120px, 100%);
}

.dialog-backdrop:has(.dialog-unlock) {
  place-items: end center;
  padding: 20px 20px 40px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.dialog-card.dialog-unlock {
  pointer-events: auto;
  width: min(420px, calc(100vw - 32px));
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top, rgba(244, 63, 94, 0.16), transparent 30%),
    rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.lock-marquee-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0.34;
  pointer-events: none;
}

.lock-marquee-columns {
  display: grid;
  grid-template-columns: repeat(3, 190px);
  gap: 24px;
  align-items: start;
}

.lock-marquee-column {
  height: min(76vh, 760px);
  overflow: hidden;
}

.lock-marquee-track {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  height: max-content;
  padding: 24px 0;
  animation: lockMarqueeVertical 30s linear infinite;
}

.lock-marquee-column-2 .lock-marquee-track {
  animation-duration: 26s;
}

.lock-marquee-column-3 .lock-marquee-track {
  animation-duration: 34s;
}

.lock-pet-card {
  width: 190px;
  padding: 16px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.lock-pet-card-rich {
  display: grid;
  gap: 10px;
}

.lock-pet-thumb {
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
}

.lock-pet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lock-pet-meta {
  display: grid;
  gap: 4px;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
}

.lock-pet-meta strong {
  font-size: 14px;
}

.lock-pet-meta span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.lock-card {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 247, 0.92));
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.lock-card.lock-card-min {
  width: min(360px, 100%);
  text-align: center;
  margin-top: 28px;
}

#lockRoot.unlocking [data-lock-act="openUnlock"] {
  pointer-events: none;
  opacity: 0;
}

.lock-teacher-entry {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 2;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.lock-teacher-entry:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.14);
}

.lock-card h2 {
  margin: 12px 0 8px;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #f43f5e, #fb7185);
}

@keyframes lockMarqueeVertical {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50%);
  }
}

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.celebration-card {
  min-width: 260px;
  padding: 18px 22px;
  border-radius: 24px;
  color: #fff;
  text-align: center;
  background: rgba(37, 48, 70, 0.78);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(10px);
}

.celebration-card-rich {
  position: relative;
  min-width: 320px;
  padding: 30px 28px 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    radial-gradient(circle at top, rgba(255, 238, 184, 0.28), transparent 34%),
    linear-gradient(145deg, rgba(255, 109, 56, 0.96), rgba(255, 74, 133, 0.94) 58%, rgba(124, 58, 237, 0.94));
  box-shadow:
    0 28px 70px rgba(255, 92, 138, 0.26),
    0 0 60px rgba(255, 177, 90, 0.18);
}

.celebration-halo {
  position: absolute;
  inset: -30% -10% auto;
  height: 170px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32), transparent 66%);
  pointer-events: none;
}

.celebration-card h3 {
  margin: 12px 0 6px;
  font-size: 28px;
}

.celebration-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.celebration-stars {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 18px;
  color: rgba(255, 245, 214, 0.96);
}

.celebration-burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.firework {
  position: absolute;
  top: 56%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: hsl(var(--hue), 92%, 62%);
  box-shadow:
    0 0 18px hsla(var(--hue), 92%, 62%, 0.9),
    0 0 36px hsla(var(--hue), 92%, 62%, 0.45);
  animation: fireworkBurst 1.15s ease-out var(--delay) forwards;
  opacity: 0;
}

.confetti {
  position: absolute;
  top: -18px;
  width: 12px;
  height: 22px;
  border-radius: 4px;
  background: hsl(var(--hue), 92%, 64%);
  box-shadow: 0 0 16px hsla(var(--hue), 92%, 64%, 0.34);
  transform: rotate(var(--rotate));
  animation: confettiDrop 1.5s ease-in var(--delay) forwards;
  opacity: 0;
}

@keyframes fireworkBurst {
  0% {
    transform: translateY(0) scale(0.3);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translateY(-220px) scale(1.25);
    opacity: 0;
  }
}

@keyframes confettiDrop {
  0% {
    transform: translateY(-20px) rotate(var(--rotate)) scale(0.7);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translateY(320px) rotate(calc(var(--rotate) + 180deg)) scale(1);
    opacity: 0;
  }
}

.batch-grid,
.picker-grid {
  display: grid;
  gap: 12px;
}

.batch-row {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.picker-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.picker-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}

.picker-item button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.picker-item .thumb {
  aspect-ratio: 1;
  background: #fff7ef;
}

.picker-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.picker-item .meta {
  padding: 10px 12px 12px;
  text-align: left;
}

.lottery-wheel-layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 22px;
  align-items: stretch;
}

.lottery-wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px 24px 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 241, 0.9)),
    radial-gradient(circle at top, rgba(255, 178, 120, 0.18), transparent 56%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.lottery-wheel-badge {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 4;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255, 241, 231, 0.96);
  border: 1px solid rgba(255, 186, 130, 0.35);
}

.lottery-wheel-stage::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, #fffef7 0 24%, #ffd98a 25%, #ff9a4d 68%, #c2410c 100%);
  box-shadow:
    0 0 0 7px rgba(255, 196, 122, 0.18),
    0 0 20px rgba(255, 160, 81, 0.3);
  z-index: 4;
}

.lottery-wheel {
  width: min(372px, 80vw);
  aspect-ratio: 1;
  border-radius: 999px;
  border: 14px solid rgba(255, 255, 255, 0.94);
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.12),
    0 0 0 12px rgba(255, 180, 104, 0.14),
    0 0 36px rgba(255, 154, 82, 0.18),
    inset 0 0 0 6px rgba(255, 255, 255, 0.56);
  position: relative;
  overflow: hidden;
}

.lottery-wheel::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.5);
}

.lottery-wheel-glow {
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(255, 179, 107, 0.16), transparent 72%);
  pointer-events: none;
}

.lottery-wheel-center {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: 112px;
  height: 112px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.38), transparent 30%),
    linear-gradient(135deg, var(--brand-strong), #ffb15a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 14px 30px rgba(255, 141, 77, 0.28);
  z-index: 2;
}

.lottery-wheel-center strong {
  font-size: 22px;
}

.lottery-wheel-center span {
  font-size: 12px;
  opacity: 0.86;
}

.lottery-wheel-arrow {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 34px solid #1f2a44;
  z-index: 3;
  filter:
    drop-shadow(0 8px 14px rgba(15, 23, 42, 0.16))
    drop-shadow(0 0 14px rgba(255, 177, 90, 0.42));
}

.lottery-wheel-side {
  display: grid;
  gap: 16px;
}

.lottery-wheel-side .student-stats {
  margin-top: 0;
}

.lottery-legend {
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.lottery-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 243, 0.9)),
    radial-gradient(circle at top left, rgba(255, 141, 77, 0.08), transparent 68%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.lottery-legend-item strong {
  font-size: 14px;
}

.lottery-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.lottery-win-dialog {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.lottery-win-card {
  padding: 26px 24px 24px;
  border-radius: 30px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(255, 235, 179, 0.28), transparent 36%),
    linear-gradient(160deg, #ff8a47, #ff5c8a 70%, #7c3aed);
  box-shadow:
    0 24px 60px rgba(255, 92, 138, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.lottery-win-badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.lottery-win-icon {
  margin: 18px auto 10px;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 48px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.lottery-win-card h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.lottery-win-card p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.lottery-win-meta {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lottery-win-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
}

.light-toast {
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(31, 42, 68, 0.82);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(10px);
}

.records-groups {
  display: grid;
  gap: 14px;
}

.record-day-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.record-day-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.record-day-card summary::-webkit-details-marker {
  display: none;
}

.records-day-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.record-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.record-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.record-item-side {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.record-type {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
}

.score-up {
  color: #16a34a;
}

.score-down {
  color: #dc2626;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .login-screen {
    grid-template-columns: 1fr;
    width: min(1280px, calc(100% - 28px));
  }

  .login-panel-visual {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .home-control-bar,
  .home-actions-bar {
    grid-template-columns: 1fr;
  }

  .home-quick-side {
    justify-content: flex-start;
  }

  .lottery-wheel-layout {
    grid-template-columns: 1fr;
  }

  .lottery-wheel-stage {
    padding-bottom: 30px;
  }

  .lock-marquee-columns {
    grid-template-columns: repeat(2, 180px);
  }
}

@media (max-width: 780px) {
  .dashboard {
    width: min(var(--container), calc(100% - 16px));
  }

  .login-screen {
    width: calc(100% - 16px);
    padding: 16px 0;
  }

  .login-panel {
    padding: 18px;
    border-radius: 24px;
  }

  .login-panel-visual {
    gap: 18px;
  }

  .login-visual-frame {
    min-height: 220px;
  }

  .hero-card,
  .toolbar,
  .section-head,
  .panel,
  .dialog-card {
    padding: 16px;
  }

  .student-stats,
  .rule-row,
  .store-row,
  .student-row {
    grid-template-columns: 1fr;
  }

  .home-control-left {
    flex-direction: column;
    align-items: stretch;
  }

  .home-control-left .search-input,
  .home-control-left .small-select {
    max-width: none;
    width: 100%;
  }

  .asset-field {
    grid-template-columns: 1fr;
  }

  .lock-marquee-columns {
    grid-template-columns: 1fr;
  }

  .lock-marquee-column:nth-child(n + 2) {
    display: none;
  }

  .record-item {
    grid-template-columns: 1fr;
  }

  .record-item-side {
    justify-items: start;
    text-align: left;
  }
}
