/**
 * 抽奖页面共享样式
 * 通过 CSS 变量实现主题化
 * 变量由 LotteryApp 根据主题注入:
 *   --primary, --primary-deep, --accent, --accent-light,
 *   --bg-dark, --bg-card, --text-light, --text-muted,
 *   --bg-gradient-1, --bg-gradient-2, --bg-gradient-3
 */

/* === Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: #05060c;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

button {
    cursor: pointer;
    background: none;
    border: 0;
}

a {
    color: inherit;
}

.lottery-root {
    --serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', serif;
    --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --surface: color-mix(in srgb, var(--bg-card) 70%, transparent);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --radius: 20px;

    position: relative;
    min-height: 100vh;
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.65;
}

::selection {
    background: var(--accent);
    color: var(--bg-dark);
}

/* === Sky === */
.sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 78% 8%, var(--bg-gradient-2), transparent 70%),
        radial-gradient(ellipse 70% 50% at 10% 90%, var(--bg-gradient-1), transparent 70%),
        linear-gradient(180deg, color-mix(in srgb, var(--bg-dark) 70%, #1a2350) 0%, var(--bg-dark) 60%);
}

.stars {
    position: absolute;
    inset: -50%;
    background-repeat: repeat;
    animation: twinkle 6s ease-in-out infinite alternate;
}

.stars-1 {
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 140px 80px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 90px 160px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 210px 210px, #fff, transparent);
    background-size: 240px 240px;
    opacity: 0.35;
}

.stars-2 {
    background-image:
        radial-gradient(1.5px 1.5px at 60px 120px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 300px 40px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 380px 330px, #fff, transparent);
    background-size: 420px 420px;
    opacity: 0.5;
    animation-duration: 9s;
    animation-delay: -3s;
}

@keyframes twinkle {
    from { opacity: 0.2; }
    to { opacity: 0.55; }
}

.orb {
    position: absolute;
    top: clamp(-160px, -9vw, -60px);
    right: clamp(-200px, -9vw, -60px);
    width: clamp(320px, 38vw, 560px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 38%, rgba(120, 90, 30, 0.07), transparent 9%),
        radial-gradient(circle at 60% 62%, rgba(120, 90, 30, 0.06), transparent 13%),
        radial-gradient(circle at 70% 30%, rgba(120, 90, 30, 0.05), transparent 7%),
        radial-gradient(circle at 42% 72%, rgba(120, 90, 30, 0.05), transparent 6%),
        radial-gradient(circle at 35% 30%, #fffdf3 0%, var(--accent-light) 38%, var(--accent) 100%);
    box-shadow:
        0 0 80px 10px color-mix(in srgb, var(--accent) 35%, transparent),
        0 0 240px 60px color-mix(in srgb, var(--accent) 16%, transparent);
    opacity: 0.78;
    animation: orbIn 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes orbIn {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { transform: none; }
}

/* 月亮只属于首屏，随页面滚走，不压住下方内容 */
.moon-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    min-height: 640px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.firework-canvas {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* === 中秋 × 国庆：月色、朱红灯笼与金色开奖信息 === */
.festival .sky {
    background:
        radial-gradient(ellipse 75% 65% at 85% 5%, var(--bg-gradient-2), transparent 70%),
        radial-gradient(ellipse 80% 65% at 0% 80%, var(--bg-gradient-1), transparent 75%),
        linear-gradient(165deg, #281523 0%, var(--bg-dark) 65%);
}

.festival .hero-title {
    font-size: clamp(2.4rem, 5.2vw, 3.8rem);
    white-space: nowrap;
}

.hero-caption {
    margin: -0.35rem 0 1.3rem;
    color: var(--accent-light);
    font-family: var(--serif);
    font-size: 1.15rem;
    letter-spacing: 0.16em;
}

.draw-schedule {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.8rem;
    padding: 1rem 1.2rem;
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: 16px;
    background: linear-gradient(115deg, rgba(199, 71, 54, 0.14), rgba(247, 215, 116, 0.05));
}

.draw-schedule > div + div {
    border-left: 1px solid var(--line-strong);
    padding-left: 1.25rem;
}

.schedule-label,
.schedule-date {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.draw-schedule strong {
    display: block;
    margin: 0.15rem 0;
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.3;
    color: var(--accent-light);
    font-variant-numeric: tabular-nums;
}

.draw-schedule small {
    font-size: 0.9rem;
    font-weight: 400;
}

.festival-lanterns {
    position: absolute;
    top: 0;
    right: max(2.5rem, calc((100vw - 1120px) / 2));
    display: flex;
    gap: 1.5rem;
    z-index: 1;
    pointer-events: none;
}

.festival-lantern {
    position: relative;
    width: 46px;
    height: 62px;
    margin-top: 36px;
    border: 1px solid rgba(247, 215, 116, 0.55);
    border-radius: 46%;
    background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(247, 215, 116, 0.18) 11px 12px),
        radial-gradient(ellipse at center, #e56d43, #a52e29 80%);
    box-shadow: 0 0 35px rgba(199, 71, 54, 0.25);
    transform-origin: 50% -36px;
    animation: lantern-sway 6s ease-in-out infinite alternate;
}

.festival-lantern + .festival-lantern {
    margin-top: 70px;
    animation-delay: -3s;
}

.festival-lantern::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    height: 80px;
    border-left: 1px solid rgba(247, 215, 116, 0.5);
}

.festival-lantern::after {
    content: '';
    position: absolute;
    top: 100%;
    left: calc(50% - 3px);
    width: 6px;
    height: 22px;
    background: repeating-linear-gradient(90deg, #e0a526 0 1px, transparent 1px 2px);
}

@keyframes lantern-sway {
    from { transform: rotate(-4deg); }
    to { transform: rotate(4deg); }
}

@media (max-width: 900px) {
    .festival-lanterns { right: 1.5rem; opacity: 0.6; }
    .festival-lantern { width: 32px; height: 44px; }
}

@media (max-width: 480px) {
    .festival .hero-title { font-size: clamp(1.8rem, 9vw, 2.6rem); }
    .festival .topbar-meta { font-size: 11px; }
    .festival-lanterns { right: 1rem; top: 45px; gap: 0.85rem; opacity: 0.35; }
    .draw-schedule { gap: 0.85rem; padding: 0.9rem; }
    .draw-schedule > div + div { padding-left: 0.85rem; }
    .schedule-label, .schedule-date { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .festival-lantern { animation: none; }
}

/* === Page === */
.page {
    position: relative;
    z-index: 2;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem) 3rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    font-size: 13px;
    letter-spacing: 0.04em;
}

.brand {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.topbar-meta {
    color: var(--text-muted);
}

/* === Hero === */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
    padding: clamp(2rem, 8vh, 5rem) 0 clamp(3rem, 8vh, 5rem);
}

.hero-copy {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.85rem 0.35rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    font-size: 12.5px;
    letter-spacing: 0.08em;
    color: var(--accent-light);
}

.eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.eyebrow.is-ended .eyebrow-dot {
    background: var(--text-muted);
    box-shadow: none;
}

.hero-title {
    margin: 1.4rem 0 1rem;
    font-family: var(--serif);
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.02em;
    color: #fff;
    text-wrap: balance;
}

.hero-title em {
    font-style: normal;
    background: linear-gradient(120deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    max-width: 30em;
    font-size: 16px;
    color: var(--text-muted);
}

.stats {
    display: flex;
    margin: 2.2rem 0 2.6rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stat {
    flex: 1;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    padding: 1.1rem 0;
}

.stat + .stat {
    padding-left: 1.4rem;
    border-left: 1px solid var(--line);
}

.stat dd {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.stat dt {
    margin-top: 0.2rem;
    font-size: 12.5px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.rules-title {
    margin-bottom: 0.9rem;
    font-size: 12.5px;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.rules {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.rules li {
    text-wrap: pretty;
    display: grid;
    grid-template-columns: 2.2rem 1fr;
    font-size: 14.5px;
    color: color-mix(in srgb, var(--text-light) 88%, transparent);
}

.rule-no {
    font-family: var(--mono);
    font-size: 12px;
    padding-top: 0.2rem;
    color: var(--accent);
}

.hero-figure {
    position: relative;
    margin-top: 2.4rem;
    max-width: 420px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    cursor: zoom-in;
}

.hero-figure img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s ease;
}

.hero-figure:hover img {
    transform: scale(1.03);
}

.hero-figure figcaption {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    font-size: 12px;
}

.hero-figure figcaption a {
    text-decoration: none;
}

/* === Panel === */
.panel {
    position: sticky;
    top: 1.5rem;
    padding: 0.5rem 1.75rem 1.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: var(--surface);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 30px 80px -20px rgba(0, 0, 0, 0.6);
    animation: rise 0.9s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 -0.75rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.tab {
    padding: 1rem 0 0.9rem;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s;
}

.tab:hover,
.tab.active {
    color: #fff;
}

.tab-indicator {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.tab-pane {
    animation: fadeIn 0.35s ease;
}

.panel-ended {
    padding: 1rem 0 0.5rem;
    text-align: center;
    color: var(--text-muted);
}

.panel-ended strong {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--serif);
    font-size: 1.2rem;
    color: #fff;
}

/* === Form === */
.form {
    display: grid;
    gap: 1.1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.field-label em {
    font-style: normal;
    opacity: 0.7;
}

.field input {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.field input:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.field input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.field-mono input {
    font-family: var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 50px;
    padding: 0 1.5rem;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    transition: transform 0.15s, box-shadow 0.25s, opacity 0.2s, background 0.2s;
}

.btn-primary {
    margin-top: 0.3rem;
    color: var(--bg-dark);
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.btn-primary:hover {
    box-shadow: 0 14px 36px -8px color-mix(in srgb, var(--accent) 80%, transparent);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    height: auto;
    padding: 0;
    color: var(--accent-light);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-ghost:hover {
    color: #fff;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-note {
    font-size: 12.5px;
    text-align: center;
    color: var(--text-muted);
}

.turnstile-box {
    min-height: 65px;
}

/* === Messages === */
.message {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.message::before {
    content: '';
    flex: none;
    width: 6px;
    height: 6px;
    margin-top: 0.55rem;
    border-radius: 50%;
    background: currentColor;
}

.message.success {
    background: rgba(74, 222, 128, 0.08);
    color: #a7f3c4;
}

.message.error {
    background: rgba(248, 113, 113, 0.09);
    color: #fecaca;
}

.message.info {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

/* === Code Ticket（查询码 / 邀请码） === */
.ticket {
    position: relative;
    margin-top: 1.5rem;
    padding: 1.4rem 1.25rem 1.2rem;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 16px;
    background:
        radial-gradient(120% 80% at 50% 0%, var(--accent-soft), transparent 70%),
        rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeIn 0.45s ease;
}

.ticket-label {
    font-size: 12.5px;
    letter-spacing: 0.14em;
    color: var(--accent-light);
}

.ticket-title {
    margin: 0.2rem 0 0.4rem;
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.code {
    display: inline-block;
    margin: 0.7rem 0 0.2rem;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    font-family: var(--mono);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent-light);
    word-break: break-all;
    transition: background 0.2s;
}

.code:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ticket-hint {
    font-size: 12.5px;
    color: var(--text-muted);
}

.ticket-meta {
    margin-top: 0.3rem;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.8;
}

.ticket-actions {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--line-strong);
}

/* === Sections === */
.section {
    padding: clamp(2.5rem, 6vh, 4rem) 0 0;
    animation: rise 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.section-head h2 {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
}

.section-head h2 small {
    margin-left: 0.6rem;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    height: 32px;
    padding: 0 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.chip:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.chip.active {
    color: var(--bg-dark);
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

/* === Winners === */
.winners {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    column-gap: 2.5rem;
}

.winner {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    animation: fadeIn 0.4s ease both;
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    font-family: var(--serif);
    font-weight: 700;
    color: var(--accent-light);
}

.winner-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #fff;
}

.winner-mail {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
}

.winner-time {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.show-more {
    display: block;
    margin: 1.4rem auto 0;
    height: 40px;
    padding: 0 1.4rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 13.5px;
    color: var(--text-light);
    transition: all 0.2s;
}

.show-more:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.empty {
    padding: 3.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-moon {
    width: 44px;
    height: 44px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    box-shadow: inset -10px -4px 0 0 var(--accent-light);
    opacity: 0.8;
    transform: rotate(-20deg);
}

.empty strong {
    display: block;
    margin-bottom: 0.2rem;
    font-family: var(--serif);
    font-size: 1.1rem;
    color: var(--text-light);
}

/* === Comments === */
.comments {
    padding-top: 1rem;
}

/* .artalk class is ON #artalk-comments, not a child — use compound selector (no space) */
#artalk-comments.artalk {
    --at-color-font: var(--text-light);
    --at-color-deep: var(--text-light);
    --at-color-sub: var(--text-muted);
    --at-color-grey: var(--text-muted);
    --at-color-meta: var(--text-muted);
    --at-color-border: var(--line);
    --at-color-light: var(--accent);
    --at-color-bg: transparent;
    --at-color-bg-transl: rgba(0, 0, 0, 0.85);
    --at-color-bg-grey: rgba(255, 255, 255, 0.05);
    --at-color-bg-grey-transl: rgba(255, 255, 255, 0.03);
    --at-color-main: var(--accent);
    --at-color-gradient: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0));
}

/* === Footer === */
.footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--text-muted);
}

.footer a {
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #fff;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    cursor: zoom-out;
}

.lightbox.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

/* === Success Overlay === */
.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg-dark) 70%, transparent);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}

.success-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.success-content {
    text-align: center;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.success-overlay.show .success-content {
    transform: none;
}

.success-moon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.4rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fffdf3, var(--accent-light) 40%, var(--accent));
    box-shadow: 0 0 60px 10px color-mix(in srgb, var(--accent) 40%, transparent);
}

.success-text {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.success-sub {
    margin-top: 0.4rem;
    color: var(--text-muted);
}

/* === Motion === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === Responsive === */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 1.5rem;
    }

    /* 手机上把操作面板提到规则前面：标题 → 数据 → 面板 → 规则 */
    .hero-copy {
        display: contents;
    }

    .hero-copy > * {
        order: 0;
    }

    .panel {
        order: 1;
        margin-bottom: 2.5rem;
    }

    .hero-copy > .rules-title,
    .hero-copy > .rules,
    .hero-copy > .hero-figure {
        order: 2;
    }

    .eyebrow {
        justify-self: start;
    }

    .stats {
        margin: 2rem 0;
    }

    .topbar-meta {
        display: none;
    }

    .panel {
        position: relative;
        top: 0;
    }

    .orb {
        top: -90px;
        right: -110px;
        width: 300px;
        opacity: 0.75;
    }
}

@media (max-width: 520px) {
    .lottery-root {
        font-size: 14.5px;
    }

    .panel {
        padding: 0.25rem 1.1rem 1.25rem;
        border-radius: 20px;
    }

    .tabs {
        margin: 0 -0.35rem 1.25rem;
    }

    .stat + .stat {
        padding-left: 0.9rem;
    }

    .winners {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 0.3rem;
    }
}
