/* ============================================================
   小辛音乐 · 抽奖页
   与主站同一套视觉语言：极光背景 + 毛玻璃卡片 + 冷色高光
   零依赖，纯 CSS；结构：顶栏 / Hero / 九宫格 / 公示 / 规则
   ============================================================ */

:root {
  --bg: #070910;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-hi: rgba(255, 255, 255, 0.26);
  --txt: #f3f6ff;
  --muted: rgba(232, 238, 255, 0.62);
  --muted-2: rgba(232, 238, 255, 0.4);
  --accent: #7fc4ff;
  --accent2: #b79cff;
  --gold: #ffd479;
  --gold-2: #ff9d5c;
  --ok: #5fe0b0;
  --err: #ff8a8a;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 24px 60px rgba(3, 5, 16, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--txt);
  background: var(--bg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
ul { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }

/* ---------------- 极光背景 ---------------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.aurora::before {
  left: -22vw;
  top: -30vw;
  background: radial-gradient(circle, rgba(88, 140, 255, 0.5), transparent 62%);
}
.aurora::after {
  right: -26vw;
  top: -18vw;
  background: radial-gradient(circle, rgba(176, 120, 255, 0.36), transparent 64%);
}
.aurora .glow {
  position: absolute;
  left: 50%;
  bottom: -40vh;
  width: 90vw;
  height: 60vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 190, 120, 0.16), transparent 66%);
  filter: blur(60px);
}
.grid-lines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.3;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 6px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13.5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  backdrop-filter: blur(14px);
  transition: 0.2s;
}
.brand:hover { color: var(--txt); border-color: var(--stroke-hi); }
.brand svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 999px;
  padding: 6px 12px;
  backdrop-filter: blur(14px);
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip b { color: var(--txt); font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  backdrop-filter: blur(14px);
  color: var(--txt);
  font-size: 13.5px;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: var(--stroke-hi); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.tiny { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.primary {
  border: 0;
  background: linear-gradient(120deg, #ffcf72, #ff9d5c 55%, #ff7f9a);
  color: #2a1706;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(255, 160, 90, 0.28);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.big { height: 48px; padding: 0 34px; font-size: 15.5px; letter-spacing: 0.04em; }
.btn.ghost { background: transparent; }

/* ---------------- 布局 ---------------- */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
  padding: 20px 22px;
}
.card h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h2 em { font-style: normal; font-size: 12px; color: var(--muted-2); font-weight: 400; }

/* ---------------- Hero ---------------- */
.hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255, 212, 121, 0.16), transparent 66%);
  pointer-events: none;
}
.hero-left { min-width: 0; flex: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid rgba(255, 212, 121, 0.35);
  background: rgba(255, 212, 121, 0.09);
  border-radius: 999px;
  padding: 4px 11px;
  margin-bottom: 12px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.eyebrow.off { color: var(--muted); border-color: var(--stroke); background: var(--panel); }
.hero h1 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; }
.hero .sub { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.hero-stats { display: flex; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.hero-stats div { font-size: 12px; color: var(--muted-2); }
.hero-stats b { display: block; font-size: 19px; color: var(--txt); font-variant-numeric: tabular-nums; font-weight: 650; }
.hero-emoji {
  font-size: 86px;
  line-height: 1;
  filter: drop-shadow(0 18px 30px rgba(255, 190, 110, 0.28));
  animation: float 4.6s ease-in-out infinite;
  flex: none;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }

/* 次数胶囊 */
.quota { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.quota .pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--txt);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 6px 12px;
}
.quota .pill b { color: var(--gold); font-weight: 700; }
.quota .pill.muted { color: var(--muted-2); }

/* ---------------- 九宫格 ---------------- */
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.board-actions { margin-left: auto; display: flex; gap: 8px; }
.grid9 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.cell {
  position: relative;
  aspect-ratio: 1 / 0.82;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px 20px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.cell .ico { font-size: 27px; line-height: 1; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35)); }
.cell .nm { font-size: 12.5px; line-height: 1.25; color: var(--txt); max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cell .lv { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.04em; }
.cell .pct {
  position: absolute; right: 6px; bottom: 4px;
  font-size: 10px; color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.cell.thanks .ico { filter: grayscale(0.4) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3)); opacity: 0.8; }
.cell.rolling {
  border-color: rgba(255, 212, 121, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 212, 121, 0.35), 0 0 26px rgba(255, 190, 90, 0.35);
  transform: translateY(-2px);
  background: linear-gradient(165deg, rgba(255, 210, 130, 0.18), rgba(255, 255, 255, 0.05));
}
.cell.win {
  border-color: rgba(255, 212, 121, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 212, 121, 0.45), 0 0 48px rgba(255, 180, 80, 0.55);
  animation: pop 0.5s ease;
}
@keyframes pop { 0% { transform: scale(0.94); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.cell.center {
  border: 1px dashed rgba(255, 212, 121, 0.4);
  background: radial-gradient(circle at 50% 35%, rgba(255, 196, 110, 0.18), rgba(255, 255, 255, 0.03) 62%);
  cursor: pointer;
  padding: 4px;
}
.cell.center .start {
  width: 100%; height: 100%;
  border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-weight: 700; letter-spacing: 0.06em;
  color: #2a1706;
  background: linear-gradient(140deg, #ffd479, #ff9d5c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.cell.center .start small { font-weight: 600; font-size: 10.5px; opacity: 0.75; letter-spacing: 0; }
.cell.center .start:hover { filter: brightness(1.05); }
.cell.center .start:disabled { cursor: not-allowed; background: linear-gradient(140deg, #565d70, #3c4254); color: #cfd6e6; box-shadow: none; }
.cell.center:hover .start:disabled { filter: none; }
.board-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; justify-content: center; flex-wrap: wrap; }
.board-foot .hint { margin: 0; font-size: 12.5px; color: var(--muted-2); }

/* ---------------- 双栏 ---------------- */
.cols { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.cols .card { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head .btn { margin-left: auto; }

/* 中奖公示 */
.winners { display: flex; flex-direction: column; }
.winners li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}
.winners li:last-child { border-bottom: 0; }
.winners .who { color: var(--muted); min-width: 74px; }
.winners .prize { color: var(--txt); display: flex; align-items: center; gap: 6px; min-width: 0; }
.winners .prize .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winners .when { margin-left: auto; color: var(--muted-2); font-size: 11.5px; white-space: nowrap; }
.winners .badge-new { font-size: 10px; color: var(--gold); border: 1px solid rgba(255, 212, 121, 0.4); border-radius: 3px; padding: 0 4px; }
.empty { color: var(--muted-2); font-size: 12.5px; padding: 18px 0; text-align: center; }

/* 我的记录 */
.records li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.records li:last-child { border-bottom: 0; }
.records .r-main { min-width: 0; flex: 1; }
.records .r-name { font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.records .r-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.records .tag {
  font-size: 10.5px; padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--stroke); color: var(--muted);
}
.records .tag.win { color: var(--gold); border-color: rgba(255, 212, 121, 0.4); background: rgba(255, 212, 121, 0.08); }
.records .tag.pending { color: var(--accent); border-color: rgba(127, 196, 255, 0.35); }
.records .tag.shipped { color: var(--ok); border-color: rgba(95, 224, 176, 0.35); }
.records .tag.void { color: var(--muted-2); text-decoration: line-through; }
.records .claim-btn { margin-left: auto; }

/* ---------------- 规则 / 概率 ---------------- */
.rules { line-height: 1.8; }
.rules h2 { margin-bottom: 10px; }
.rules h3 { font-size: 13px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.rules-text { white-space: pre-wrap; color: var(--muted); font-size: 13.5px; }
.prob-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.prob-table th, .prob-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.prob-table th { color: var(--muted-2); font-weight: 500; font-size: 11.5px; }
.prob-table td.num { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.prob-table .bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); overflow: hidden; min-width: 80px; }
.prob-table .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.prob-table .gift { display: flex; align-items: center; gap: 7px; }

/* ---------------- 弹层 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(10px);
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(440px, 100%);
  border-radius: 24px;
  border: 1px solid var(--stroke-hi);
  background: linear-gradient(165deg, rgba(30, 36, 54, 0.96), rgba(14, 18, 30, 0.98));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  padding: 24px 22px;
  position: relative;
  animation: rise 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes rise { from { transform: translateY(14px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { font-size: 17px; margin-bottom: 6px; }
.sheet p.desc { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.sheet .x {
  position: absolute; right: 12px; top: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--stroke);
}
.sheet .x:hover { color: var(--txt); border-color: var(--stroke-hi); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted-2); }
.field input, .field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--txt);
  padding: 10px 12px;
  font: inherit;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: rgba(127, 196, 255, 0.55); }
.form-msg { font-size: 12.5px; color: var(--err); min-height: 18px; margin: 2px 0 8px; }
.sheet .row { display: flex; gap: 10px; }

/* 中奖结果 */
.result { text-align: center; }
.result .emoji { font-size: 64px; line-height: 1; margin: 6px 0 10px; filter: drop-shadow(0 16px 26px rgba(255, 180, 90, 0.35)); }
.result .t1 { font-size: 20px; font-weight: 700; }
.result .t2 { color: var(--gold); font-size: 22px; font-weight: 700; margin: 6px 0 2px; }
.result .t3 { color: var(--muted); font-size: 13px; }
.result .lose-emoji { filter: grayscale(0.3); opacity: 0.85; }

/* 撒花 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px;
  width: 8px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(108vh) rotate(540deg); opacity: 0.2; }
}

/* ---------------- 页脚 ---------------- */
.foot { text-align: center; color: var(--muted-2); font-size: 12px; padding: 6px 0 10px; }
.foot a { color: var(--muted); border-bottom: 1px dashed rgba(255, 255, 255, 0.2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 820px) {
  .wrap { padding: 6px 14px 48px; gap: 13px; }
  .card { padding: 16px 16px; border-radius: 22px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
  .hero-emoji { font-size: 56px; align-self: flex-end; margin-top: -6px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .board-head { flex-wrap: wrap; gap: 8px; }
  .board-head h2 { font-size: 14px; white-space: nowrap; }
  .board-head .board-actions { margin-left: auto; }
  .grid9 { gap: 8px; }
  .cell .ico { font-size: 22px; }
  .cell .nm { font-size: 11.5px; }
  .cell .lv { font-size: 10px; }
  .hero-stats { gap: 16px; }
  .sheet { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
