/**
 * 抽奖页面共享样式
 * 通过 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;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Source Han Serif SC', 'Noto Serif SC', serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

input,
button,
select,
textarea {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', serif;
}

/* === Background === */
.bg-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, var(--bg-gradient-1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, var(--bg-gradient-2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, var(--bg-gradient-3) 0%, transparent 60%);
    z-index: 0;
}

/* === Fireworks === */
.firework-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* === Decorations === */
.lantern {
    position: fixed;
    z-index: 2;
    animation: floatLantern 6s ease-in-out infinite;
    pointer-events: none;
    font-size: 2.5rem;
    opacity: 0.6;
}

.lantern-0 {
    left: 5%;
    top: 10%;
}

.lantern-1 {
    right: 8%;
    top: 15%;
    animation-delay: 1.5s;
    font-size: 2rem;
}

.lantern-2 {
    left: 15%;
    top: 60%;
    animation-delay: 3s;
    font-size: 1.8rem;
    opacity: 0.4;
}

.lantern-3 {
    right: 12%;
    top: 55%;
    animation-delay: 2s;
    font-size: 2.2rem;
    opacity: 0.5;
}

@keyframes floatLantern {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-20px) rotate(3deg);
    }
}

/* === Container === */
.container {
    position: relative;
    z-index: 10;
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* === Header === */
.header {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.header .year-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--primary-deep);
    font-weight: 900;
    font-size: 0.85rem;
    padding: 0.35rem 1.2rem;
    border-radius: 50px;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 15px rgba(245, 200, 66, 0.3);
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.header p {
    color: var(--text-muted);
    margin-top: 0.8rem;
    font-size: 1rem;
    line-height: 1.6;
}

.rules-block {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(201, 168, 142, 0.6);
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* === Card === */
.card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(245, 200, 66, 0.15);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(245, 200, 66, 0.1);
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.2rem;
    color: var(--accent-light);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title .icon {
    font-size: 1.4rem;
}

/* === Form === */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-group input,
.prize-check input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(245, 200, 66, 0.2);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input::placeholder,
.prize-check input::placeholder {
    color: rgba(201, 168, 142, 0.5);
}

.form-group input:focus,
.prize-check input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.1);
}

/* === Buttons === */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: var(--accent-light);
    border: 1px solid rgba(245, 200, 66, 0.2);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 35, 42, 0.4);
}

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

.check-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent), #e6b800);
    color: var(--primary-deep);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 200, 66, 0.4);
}

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

/* === Messages === */
.message {
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-size: 0.9rem;
    animation: fadeIn 0.4s ease;
}

.message.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.message.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.message.info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Prize Reveal === */
.prize-reveal {
    margin-top: 1.5rem;
    animation: fadeIn 0.6s ease;
}

.prize-card {
    text-align: center;
    padding: 2rem;
    background: rgba(245, 200, 66, 0.06);
    border: 2px solid rgba(245, 200, 66, 0.25);
    border-radius: 16px;
}

.prize-emoji {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.prize-label {
    font-size: 1.2rem;
    color: var(--accent-light);
    font-weight: 700;
    margin-bottom: 1rem;
}

.prize-code {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed var(--accent);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
    user-select: all;
    cursor: pointer;
}

.prize-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
}

/* === Registration Layout === */
.reg-row {
    display: flex;
}

.reg-img {
    flex: 0 0 280px;
    background: radial-gradient(circle at center, #2e1010 0%, var(--bg-dark) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    cursor: zoom-in;
}

.reg-img:hover {
    opacity: 0.95;
}

.reg-img img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.6));
}

.reg-img .artist {
    position: absolute;
    bottom: 8px;
    right: 12px;
    z-index: 2;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    font-weight: 500;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.reg-img .artist:hover {
    color: #fff;
    text-decoration: underline;
}

/* === Winners === */
.date-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.date-btn {
    padding: 0.4rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(245, 200, 66, 0.15);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.date-btn:hover {
    border-color: rgba(245, 200, 66, 0.3);
    color: var(--text-light);
}

.date-btn.active {
    background: rgba(245, 200, 66, 0.1);
    border-color: var(--accent);
    color: var(--accent-light);
    font-weight: 700;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 0.6rem;
    border: 1px solid rgba(245, 200, 66, 0.08);
    transition: border-color 0.3s, background 0.3s;
    animation: fadeIn 0.4s ease both;
}

.winner-item:hover {
    border-color: rgba(245, 200, 66, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.winner-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.winner-info {
    flex: 1;
    min-width: 0;
}

.winner-name {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 700;
}

.winner-email-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.winner-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.no-winners {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

.show-more-btn {
    text-align: center;
    padding: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    border-top: 1px dashed rgba(245, 200, 66, 0.1);
    margin-top: 0.5rem;
    transition: color 0.2s;
}

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

.participant-count {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.participant-count span {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* === Success Overlay === */
.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 10, 10, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

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

.success-content {
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-overlay.show .success-content {
    transform: scale(1);
}

.success-emoji {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: bounce 1s ease infinite;
}

.success-text {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
}

.success-sub {
    color: var(--text-muted);
    font-size: 1rem;
}

/* === Ended Notice === */
.ended-notice {
    text-align: center;
}

.ended-text {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1rem;
    padding: 1.5rem 0;
}

/* === Footer === */
.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.8rem;
    color: rgba(201, 168, 142, 0.4);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.footer a:hover {
    opacity: 1;
}

/* === Artalk Dark Theme Override === */
/* .artalk class is ON #artalk-comments, not a child — use compound selector (no space) */
#artalk-comments.artalk {
    --at-color-font: #e0d6c8;
    --at-color-deep: #e0d6c8;
    --at-color-sub: #c9a88e;
    --at-color-grey: #b0a090;
    --at-color-meta: #9a8a7a;
    --at-color-border: rgba(245, 200, 66, 0.1);
    --at-color-light: #f5c842;
    --at-color-bg: transparent;
    --at-color-bg-transl: rgba(0, 0, 0, 0.85);
    --at-color-bg-grey: rgba(255, 255, 255, 0.06);
    --at-color-bg-grey-transl: rgba(255, 255, 255, 0.04);
    --at-color-main: #f5c842;
    --at-color-gradient: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0));
}

/* === Responsive === */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem 3rem;
        max-width: 100%;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .card {
        padding: 1.8rem 1.5rem;
    }

    .lantern {
        display: none;
    }

    .reg-row {
        flex-direction: column;
    }

    .reg-img {
        flex: none !important;
        width: 100%;
        min-height: auto !important;
        max-height: 220px;
    }
}