:root {
  --bg: #090807;
  --bg-soft: #14100d;
  --panel: rgba(31, 24, 18, 0.84);
  --panel-solid: #211a14;
  --paper: #f6efe1;
  --paper-dim: #d9cbb3;
  --muted: #9f9077;
  --gold: #d3aa57;
  --gold-light: #f0d18b;
  --cinnabar: #b43d31;
  --cinnabar-deep: #77261f;
  --jade: #5b846d;
  --line: rgba(211, 170, 87, 0.22);
  --danger: #e16b5e;
  --ok: #78b58f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--paper);
  background:
    radial-gradient(circle at 18% 12%, rgba(180, 61, 49, 0.18), transparent 34%),
    radial-gradient(circle at 84% 10%, rgba(211, 170, 87, 0.15), transparent 30%),
    linear-gradient(120deg, #080706, #17100c 55%, #0b0908);
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.ambient {
  position: fixed;
  width: 46vw;
  height: 46vw;
  min-width: 420px;
  min-height: 420px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(24px);
  opacity: .22;
  z-index: 0;
}
.ambient-a { left: -18vw; top: -16vw; background: radial-gradient(circle, #b43d31, transparent 64%); }
.ambient-b { right: -20vw; bottom: -18vw; background: radial-gradient(circle, #d3aa57, transparent 62%); }
.curtain {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 86px;
  z-index: 1;
  pointer-events: none;
  opacity: .34;
  background:
    repeating-linear-gradient(90deg, rgba(105, 26, 23, .65) 0 8px, rgba(39, 13, 12, .4) 8px 18px),
    linear-gradient(180deg, rgba(180, 61, 49, .8), rgba(64, 18, 17, .95));
}
.curtain-left { left: 0; box-shadow: 20px 0 70px rgba(0,0,0,.45); }
.curtain-right { right: 0; box-shadow: -20px 0 70px rgba(0,0,0,.45); }

/* ───────────── 登录 ───────────── */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
}
.login-ornament {
  position: absolute;
  right: 5vw;
  top: 4vh;
  font-family: var(--serif);
  font-size: clamp(180px, 30vw, 420px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(211, 170, 87, .18);
  transform: rotate(8deg);
  user-select: none;
}
.login-card {
  position: relative;
  width: min(470px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(37, 28, 21, .94), rgba(20, 15, 12, .9)),
    radial-gradient(circle at 20% 0%, rgba(211,170,87,.15), transparent 42%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(211,170,87,.12);
  border-radius: 20px;
  pointer-events: none;
}
.brand-lockup { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand-lockup h1 { white-space: nowrap; }
.school-seal {
  position: relative;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fdfbf6, #efe3cb);
  border: 1px solid rgba(240,209,139,.65);
  box-shadow: 0 14px 36px rgba(180,61,49,.30), inset 0 0 12px rgba(180,61,49,.12);
  overflow: hidden;
}
.school-seal img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.school-seal.small { width: 50px; height: 50px; }

.utsc-badge {
  height: 68px;
  width: auto;
  padding: 7px 14px;
  background: linear-gradient(160deg, #fdfbf6, #f4ecd9);
  border: 1px solid rgba(211,170,87,.45);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.7);
  object-fit: contain;
}
.brand-lockup .utsc-badge { margin-left: auto; }
.login-card .utsc-badge { order: 3; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-utsc { height: 60px; }
.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--gold-light);
  text-transform: uppercase;
}
.login-card h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  letter-spacing: .08em;
}
.login-copy { margin: 24px 0 28px; color: var(--paper-dim); letter-spacing: .08em; }
.login-card label, .field { display: grid; gap: 8px; margin-bottom: 16px; }
.login-card label span, .field > span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .12em;
}
input, select {
  width: 100%;
  border: 1px solid rgba(211,170,87,.24);
  border-radius: 14px;
  background: rgba(9,8,7,.62);
  color: var(--paper);
  outline: none;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus {
  border-color: rgba(240,209,139,.72);
  box-shadow: 0 0 0 4px rgba(211,170,87,.12);
  background: rgba(20,15,12,.9);
}
select option { background: #211a14; color: var(--paper); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(211,170,87,.28);
  border-radius: 14px;
  padding: 11px 16px;
  color: var(--paper);
  background: rgba(246,239,225,.07);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(240,209,139,.62); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  border-color: rgba(240,209,139,.55);
  background: linear-gradient(135deg, var(--cinnabar), #8d2e25);
  box-shadow: 0 14px 34px rgba(180,61,49,.28);
}
.btn-ghost { background: rgba(246,239,225,.06); }
.btn-login { width: 100%; margin-top: 8px; padding: 14px 18px; font-weight: 700; letter-spacing: .18em; }
.form-error { min-height: 20px; color: #ff9d94; font-size: 13px; }
.form-note { min-height: 20px; color: var(--gold-light); font-size: 13px; }
.login-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid rgba(211,170,87,.14);
  padding-top: 16px;
}

/* ───────────── 应用框架 ───────────── */
.app {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  background:
    linear-gradient(180deg, rgba(17,12,10,.96), rgba(28,18,14,.92)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(211,170,87,.035) 18px 19px);
  border-right: 1px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: 13px; padding-bottom: 28px; border-bottom: 1px solid rgba(211,170,87,.15); }
.side-brand strong { display: block; font-family: var(--serif); letter-spacing: .08em; }
.side-brand span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.side-nav { display: grid; gap: 10px; margin-top: 30px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  color: var(--paper-dim);
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  text-align: left;
}
.nav-item i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-style: normal;
  color: var(--gold-light);
  background: rgba(211,170,87,.1);
  border: 1px solid rgba(211,170,87,.16);
}
.nav-item i svg { width: 19px; height: 19px; }
.nav-item.active i { background: rgba(240,209,139,.2); border-color: rgba(240,209,139,.45); }
.nav-item.active i svg { stroke-width: 2; }
.nav-item.active {
  color: var(--paper);
  border-color: rgba(240,209,139,.34);
  background: linear-gradient(135deg, rgba(180,61,49,.48), rgba(211,170,87,.11));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.side-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(211,170,87,.16);
  border-radius: 16px;
  background: rgba(246,239,225,.05);
}
.side-user > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(180,61,49,.5);
  color: var(--gold-light);
  font-family: var(--serif);
}
.side-user strong { display: block; font-size: 14px; }
.side-user small { display: block; color: var(--muted); margin-top: 3px; }
.side-logout { width: 100%; margin-top: 12px; }
.main { min-width: 0; padding: 30px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.topbar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: .08em;
}
.date-plate {
  min-width: 220px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(31,24,18,.72);
  text-align: right;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
}
.date-plate span, .date-plate em { display: block; color: var(--muted); font-size: 12px; font-style: normal; }
.date-plate strong { display: block; margin: 3px 0; color: var(--gold-light); font-family: var(--serif); font-size: 22px; }
.page { display: none; }
.page.active { display: block; animation: pageIn .35s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ───────────── 抽签页 ───────────── */
.draw-layout {
  display: grid;
  grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(35,27,20,.92), rgba(18,14,11,.86)),
    radial-gradient(circle at 100% 0%, rgba(211,170,87,.12), transparent 40%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.control-panel { padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-head h3 { margin: 0; font-family: var(--serif); font-size: 24px; letter-spacing: .08em; }
.count-medal {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1b120c;
  background: radial-gradient(circle at 30% 25%, #fff0bd, var(--gold));
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(211,170,87,.24);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-grid div {
  padding: 13px;
  border: 1px solid rgba(211,170,87,.14);
  border-radius: 16px;
  background: rgba(246,239,225,.045);
}
.stat-grid span { display: block; color: var(--muted); font-size: 11px; }
.stat-grid strong { display: block; margin-top: 5px; font-size: 24px; font-family: var(--serif); color: var(--paper); }
.department-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid rgba(211,170,87,.16);
  border-radius: 999px;
  background: rgba(246,239,225,.05);
  color: var(--paper-dim);
  font-size: 13px;
  cursor: pointer;
}
.check-chip input { width: auto; accent-color: var(--gold); }
.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.switch-line input { width: auto; accent-color: var(--cinnabar); }
.btn-draw {
  width: 100%;
  min-height: 76px;
  flex-direction: column;
  border-radius: 20px;
  font-weight: 800;
  letter-spacing: .18em;
}
.btn-draw span { font-size: 22px; font-family: var(--serif); }
.btn-draw small { color: rgba(246,239,225,.72); font-weight: 400; letter-spacing: .08em; }
.btn-draw:disabled { opacity: .56; cursor: wait; }
.draw-message { min-height: 22px; color: var(--gold-light); font-size: 13px; line-height: 1.6; }

.lottery-stage {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(211,170,87,.24);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(9,8,7,.1), rgba(9,8,7,.74)),
    radial-gradient(circle at 50% 20%, rgba(211,170,87,.24), transparent 30%),
    linear-gradient(140deg, #23130f, #090807 62%);
  box-shadow: var(--shadow), inset 0 0 90px rgba(180,61,49,.12);
}
.stage-arch {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 28px;
  height: 240px;
  border: 1px solid rgba(240,209,139,.22);
  border-bottom: 0;
  border-radius: 240px 240px 0 0;
  opacity: .52;
}
.spotlight {
  position: absolute;
  top: -60px;
  width: 42%;
  height: 520px;
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(240,209,139,.22), rgba(240,209,139,.035) 72%, transparent);
  mix-blend-mode: screen;
  pointer-events: none;
}
.spotlight-a { left: 6%; transform: rotate(9deg); }
.spotlight-b { right: 6%; transform: rotate(-9deg); }
.stage-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
  z-index: 1;
}
.stage-header span { color: var(--muted); font-size: 11px; letter-spacing: .28em; }
.stage-header strong {
  padding: 7px 13px;
  border: 1px solid rgba(211,170,87,.28);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(9,8,7,.45);
}
.slot-reels {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 22px 32px 30px;
}
.slot-reel {
  height: 250px;
  border: 1px solid rgba(240,209,139,.3);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(246,239,225,.1), transparent 18%, transparent 82%, rgba(246,239,225,.08)),
    rgba(9,8,7,.68);
  box-shadow: inset 0 18px 38px rgba(0,0,0,.55), inset 0 -18px 38px rgba(0,0,0,.55);
  overflow: hidden;
}
.reel-window { height: 100%; overflow: hidden; position: relative; }
.reel-track { display: grid; gap: 12px; padding: 86px 14px; will-change: transform; }
.reel-card {
  height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(211,170,87,.18);
  border-radius: 16px;
  background: rgba(246,239,225,.08);
  text-align: center;
  overflow: hidden;
}
.reel-card strong {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reel-card span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reel-card.final {
  border-color: rgba(240,209,139,.75);
  background: linear-gradient(145deg, rgba(180,61,49,.55), rgba(211,170,87,.22));
  box-shadow: 0 0 30px rgba(211,170,87,.22);
}
.result-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  padding: 0 32px 32px;
}
.result-grid.empty { display: block; }
.empty-state {
  margin: 22px 32px 32px;
  padding: 46px 20px;
  border: 1px dashed rgba(211,170,87,.3);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
}
.empty-state span { display: block; font-family: var(--serif); font-size: 22px; color: var(--paper-dim); }
.empty-state small { display: block; margin-top: 8px; }
.result-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(240,209,139,.4);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(246,239,225,.12), rgba(246,239,225,.045)),
    radial-gradient(circle at 90% 0%, rgba(211,170,87,.18), transparent 40%);
  box-shadow: 0 18px 46px rgba(0,0,0,.28);
  animation: resultIn .6s cubic-bezier(.2,.9,.2,1) both;
}
@keyframes resultIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.result-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--gold-light), var(--cinnabar));
}
.result-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.result-top span { color: var(--gold-light); font-size: 12px; }
.result-top em { font-style: normal; color: var(--muted); font-size: 12px; }
.result-card h4 { margin: 0; font-family: var(--serif); font-size: 24px; letter-spacing: .04em; }
.result-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 16px; }
.meta-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(246,239,225,.09);
  color: var(--paper-dim);
  font-size: 12px;
}
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-actions .btn { padding: 8px 10px; border-radius: 11px; font-size: 12px; }
.test-ribbon {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: #1b120c;
  background: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
}

/* ───────────── 总表与历史 ───────────── */
.table-panel { min-height: calc(100vh - 130px); padding: 22px; }
.table-head { align-items: flex-start; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.filters input, .filters select { width: auto; min-width: 150px; padding: 10px 12px; }
.filters input[type="search"] { min-width: 250px; }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; }
.dot.new { background: var(--ok); }
.dot.recent { background: var(--danger); }
.dot.returnable { background: var(--gold-light); }
.table-wrap {
  overflow: auto;
  border: 1px solid rgba(211,170,87,.15);
  border-radius: 18px;
}
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 13px 14px; border-bottom: 1px solid rgba(211,170,87,.11); text-align: left; vertical-align: top; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--gold-light);
  background: #1c1510;
  font-size: 12px;
  letter-spacing: .08em;
}
td { color: var(--paper-dim); font-size: 13px; }
tr.row-recent td { background: rgba(180,61,49,.12); }
tr.row-returnable td { background: rgba(211,170,87,.09); }
tr.row-new td { background: rgba(91,132,109,.045); }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(246,239,225,.08);
}
.status-badge.recent { color: #ffaaa2; }
.status-badge.returnable { color: var(--gold-light); }
.status-badge.new { color: #9fd2b1; }
.course-title { color: var(--paper); font-weight: 700; }
.subtle { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.table-actions { display: flex; gap: 6px; }
.table-actions .btn { padding: 6px 8px; border-radius: 9px; font-size: 12px; white-space: nowrap; }
.history-list { display: grid; gap: 12px; }
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(211,170,87,.15);
  border-radius: 18px;
  background: rgba(246,239,225,.045);
}
.history-item h4 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; }
.history-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.history-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-content: start; }
.history-actions .btn { padding: 8px 10px; border-radius: 10px; font-size: 12px; }
.state-completed { color: #9fd2b1; }
.state-cancelled { color: #ffaaa2; }
.state-drawn { color: var(--gold-light); }

/* ───────────── 设置 ───────────── */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 20px; }
.settings-panel { padding: 24px; }
.settings-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.settings-form .wide { grid-column: 1 / -1; }
.settings-form .btn { justify-self: start; }
.user-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.user-form .btn { grid-column: 1 / -1; }
.user-list { display: grid; gap: 10px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(211,170,87,.13);
  border-radius: 14px;
  background: rgba(246,239,225,.045);
}
.user-row strong { display: block; }
.user-row small { display: block; margin-top: 3px; color: var(--muted); }
.role-tag { color: var(--gold-light); font-size: 12px; white-space: nowrap; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: min(560px, calc(100vw - 32px));
  padding: 13px 18px;
  border: 1px solid rgba(240,209,139,.35);
  border-radius: 999px;
  background: rgba(20,15,12,.92);
  color: var(--paper);
  box-shadow: var(--shadow);
  transform: translate(-50%, 120px);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-nav { grid-template-columns: repeat(4, 1fr); }
  .nav-item { justify-content: center; }
  .nav-item span { display: none; }
  .side-user, .side-logout { display: none; }
  .draw-layout, .settings-grid { grid-template-columns: 1fr; }
  .lottery-stage { min-height: 580px; }
}

@media (max-width: 720px) {
  .curtain { display: none; }
  .main { padding: 18px 14px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-right { justify-content: space-between; }
  .date-plate { text-align: left; }
  .slot-reels { grid-template-columns: 1fr; padding: 12px 16px 22px; }
  .slot-reel { height: 150px; }
  .reel-track { padding: 36px 10px; }
  .stage-header, .result-grid { padding-left: 16px; padding-right: 16px; }
  .settings-form { grid-template-columns: 1fr; }
  .filters { width: 100%; justify-content: stretch; }
  .filters input, .filters select { width: 100%; }
  .history-item { grid-template-columns: 1fr; }
  .history-actions { justify-content: flex-start; }
  .login-card { padding: 30px 24px; }
  .brand-lockup { flex-wrap: wrap; }
  .brand-lockup .utsc-badge { margin-left: 0; height: 54px; }
  .topbar-utsc { display: none; }
  .login-hint { flex-direction: column; }
}

.supervisor-line {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #b98f3e;
  font-weight: 600;
}
.supervisor-line::before {
  content: '◆ ';
  font-size: 10px;
}
.btn-danger { color: #e08573; border-color: rgba(224,133,115,.35); }
.btn-danger:hover { background: rgba(180,61,49,.18); }

.time-rule-hint {
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.time-passed { color: #8d7a5c !important; }
