:root {
  --ink: #183244;
  --muted: #6d8190;
  --line: #dce6ec;
  --paper: #f2f7f9;
  --panel: #ffffff;
  --red: #e73442;
  --red-dark: #c92834;
  --teal: #0d987f;
  --blue: #315f79;
  --gold: #ffc24a;
  --shadow: 0 18px 42px rgba(24, 50, 68, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-shell {
  width: min(100%, 390px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  place-items: center;
}

.screen {
  display: none;
  width: min(100%, 340px);
  min-height: 680px;
  padding: 28px 22px 24px;
  border: 10px solid var(--ink);
  border-radius: 28px;
  background: #f9fcfd;
  box-shadow: var(--shadow);
  position: relative;
}

.back-btn {
  position: absolute;
  top: 36px;
  left: 18px;
  width: 42px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  font-size: 42px;
  line-height: 1;
  font-weight: 700;
}

.back-btn:hover {
  background: #eaf2f5;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.notch {
  width: 70px;
  height: 8px;
  border-radius: 8px;
  background: var(--ink);
  margin: -14px auto 10px;
}

.screen-title {
  margin: 0 0 18px;
  text-align: center;
  font-weight: 800;
}

.hero-panel {
  min-height: 132px;
  border-radius: 12px;
  padding: 24px 22px;
  background: var(--red);
  color: #fff;
}

.hero-panel p,
.hero-panel h1,
.hero-panel span {
  margin: 0;
}

.hero-panel p {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.3;
}

.hero-panel h1 {
  margin-top: 10px;
  max-width: 270px;
  font-size: 20px;
  line-height: 1.28;
}

.hero-panel span {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.35;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
}

.section-head span,
.muted,
.notice,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.prize-grid button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.prize-grid-featured button {
  min-height: 78px;
  display: grid;
  gap: 3px;
  align-content: center;
  text-align: left;
  padding: 10px 12px;
}

.prize-grid-featured strong,
.prize-grid-featured span {
  display: block;
}

.prize-grid-featured strong {
  color: var(--red);
  font-size: 12px;
}

.prize-grid-featured span {
  font-size: 13px;
  line-height: 1.25;
}


.home-actions {
  margin-top: auto;
  padding-top: 28px;
}

.primary,
.secondary,
.success,
.ghost {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

.primary {
  background: var(--red);
  color: #fff;
}

.primary:hover {
  background: var(--red-dark);
}

.success {
  background: var(--teal);
  color: #fff;
}

.secondary {
  min-width: 108px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
}

.ghost {
  margin-top: 10px;
  background: #eaf2f5;
  color: var(--blue);
}

.ghost-danger {
  border: 1px solid rgba(231, 52, 66, 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  font-weight: 800;
}

.full {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
}

.small {
  min-height: 44px;
  padding: 0 24px;
}

.eyebrow {
  margin: 0 0 6px;
  font-weight: 800;
}

.danger {
  color: var(--red);
  text-align: center;
  font-size: 22px;
}

.page-title {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.45;
}

.form-card {
  display: grid;
  gap: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.check-row input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.check-row span {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

.notice {
  margin: 2px 0 0;
  line-height: 1.5;
}

.center {
  text-align: center;
}

.wheel-wrap {
  width: 286px;
  height: 286px;
  margin: 34px auto 22px;
  position: relative;
}

.side-pointer {
  position: absolute;
  top: 133px;
  right: -4px;
  width: 0;
  height: 0;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-right: 40px solid var(--red);
  filter: drop-shadow(0 2px 4px rgba(24, 50, 68, 0.18));
  z-index: 3;
}

.wheel {
  width: 282px;
  height: 282px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(24, 50, 68, 0.18);
  box-shadow: 0 12px 26px rgba(24, 50, 68, 0.14);
  transition: transform 4.2s cubic-bezier(.18,.02,.18,1);
  will-change: transform;
}

.wheel-spin {
  transition-timing-function: cubic-bezier(.45,0,.16,1);
}

.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--red);
  font-weight: 900;
  font-size: 30px;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(24, 50, 68, 0.08);
}

.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  z-index: 1;
}

.wheel-label span {
  position: absolute;
  left: -38px;
  top: -16px;
  width: 76px;
  min-height: 32px;
  display: grid;
  place-items: center;
  color: #071c27;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.award-badge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 70px auto 24px;
  display: grid;
  place-items: center;
  background: #fff0c7;
  color: var(--red);
  font-size: 42px;
  font-weight: 900;
}

.result-title {
  margin: 0;
  color: var(--red);
  text-align: center;
  font-size: 24px;
}

.result-copy {
  margin: 12px 0 24px;
  text-align: center;
  font-weight: 800;
}

.redeem-card {
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.redeem-card span {
  color: var(--muted);
  font-size: 12px;
}

.redeem-card strong {
  font-size: 19px;
  letter-spacing: 1px;
}

.admin-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  background: #edf3f6;
}

.hidden {
  display: none !important;
}

.admin-login {
  grid-column: 1 / -1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 30px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
}

.captcha-box {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf3f6;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
}

.wechat-guide {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf3f6;
}

.guide-card {
  width: min(100%, 430px);
  padding: 32px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.guide-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.guide-card h1 {
  margin: 0;
  font-size: 26px;
}

.guide-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}


.sidebar {
  min-height: 100vh;
  padding: 28px 18px;
  background: #17364d;
  color: #fff;
}

.sidebar h1 {
  margin: 0;
  font-size: 24px;
}

.sidebar p {
  margin: 8px 0 28px;
  color: #bdd1dc;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar a {
  padding: 14px 18px;
  border-radius: 7px;
  color: #d8e7ee;
  text-decoration: none;
}

.sidebar a.active,
.sidebar a:hover {
  background: rgba(255,255,255,0.12);
}

.dashboard {
  padding: 32px;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dash-header h2 {
  margin: 0;
  font-size: 26px;
}

.dash-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.metric-grid article,
.panel {
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(24, 50, 68, 0.06);
}

.metric-grid article {
  min-height: 110px;
  padding: 20px;
  position: relative;
}

.metric-grid span,
.metric-grid em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.metric-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 32px;
}

.metric-grid em {
  position: absolute;
  right: 18px;
  bottom: 20px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dff5ed;
  color: var(--teal);
  font-weight: 800;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 22px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.inventory-card {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fbfdfe;
}

.inventory-card h4 {
  margin: 8px 0 10px;
  font-size: 15px;
  line-height: 1.35;
}

.inventory-tier {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.draw-on,
.draw-off {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.draw-on {
  background: #dff5ed;
  color: var(--teal);
}

.draw-off {
  background: #f3e7e9;
  color: var(--red);
}

.inventory-card dl {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.inventory-card dt {
  color: var(--muted);
  font-size: 11px;
}

.inventory-card dd {
  margin: 3px 0 0;
  font-size: 18px;
  font-weight: 900;
}

.panel {
  margin-top: 22px;
  padding: 22px;
}

.panel h3 {
  margin: 0 0 18px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-toolbar h3 {
  margin: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(420px, 100%);
}

.search-box span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  min-height: 38px;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 22px;
  border-radius: 5px;
  background: #edf3f6;
  overflow: hidden;
}

.bar-fill {
  min-width: 5%;
  height: 100%;
  border-radius: 5px;
  background: var(--blue);
}

.warm .bar-fill {
  background: var(--gold);
}

.event-list {
  margin: 0;
  color: var(--ink);
  display: grid;
  gap: 10px;
}

.event-list.compact {
  gap: 8px;
}

.event-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.compact .event-card {
  padding: 11px 14px;
}

.event-main,
.event-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.event-main strong {
  color: var(--ink);
}

.event-main span,
.event-meta,
.event-detail,
.event-empty {
  color: var(--muted);
}

.event-detail {
  margin-top: 8px;
  line-height: 1.5;
}

.event-meta {
  margin-top: 10px;
  font-size: 12px;
}

.event-empty {
  padding: 18px 0;
}

.pager {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pager button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pager span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.submissions-panel {
  padding: 24px 26px;
}

.submissions-panel table {
  min-width: 1120px;
}

.events-panel {
  padding: 18px 22px;
}

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

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

.claim-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.claim-check input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.claim-check span {
  margin: 0;
  font-size: 13px;
}

@media (max-width: 820px) {
  .admin-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard {
    padding: 20px;
  }

  .metric-grid,
  .dash-grid,
  .inventory-grid,
  .dash-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dash-actions {
    justify-content: stretch;
  }

  .dash-actions button {
    flex: 1 1 130px;
  }

  .panel-toolbar,
  .search-box {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .phone-shell {
    padding: 0;
  }

  .screen {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border-width: 0;
  }
}
