/* 抽奖页 */
.selection-title {
    font-size: 13px;
    letter-spacing: 0.28em;
    color: var(--gold);
    text-align: center;
    margin: 18px 0 22px;
    font-weight: 500;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.category-card {
    position: relative;
    overflow: hidden;
    padding: 22px 18px 18px;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--line);
    border-radius: 20px;
    transition: 0.25s ease;
}

.category-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(232, 195, 106, 0.08));
    opacity: 0;
    transition: 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 195, 106, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.category-card:hover::before { opacity: 1; }

.category-card:nth-child(3n+1) { --accent: #e11d48; }
.category-card:nth-child(3n+2) { --accent: #e8c36a; }
.category-card:nth-child(3n) { --accent: #34d399; }

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 22px;
    margin-bottom: 14px;
}

.category-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.category-desc {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
    min-height: 1.5em;
}

.category-amount {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ivory);
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(232, 195, 106, 0.2);
}

.category-amount .amount-number {
    color: var(--gold);
    font-weight: 800;
    font-size: 16px;
}

.empty-categories {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    padding: 40px 0;
}

.code-input-container {
    max-width: 460px;
    margin: 24px auto 0;
    padding: 28px 24px;
}

.category-info {
    text-align: center;
    margin-bottom: 22px;
}

.category-info h3 {
    font-family: var(--display);
    letter-spacing: 0.12em;
    font-size: 22px;
    color: var(--gold-soft);
    margin-bottom: 6px;
}

.category-info p {
    color: var(--muted);
    font-size: 13px;
}

.input-group {
    display: flex;
    gap: 10px;
}

#codeInput {
    flex: 1;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    color: var(--ivory);
    text-align: center;
    letter-spacing: 0.28em;
    font-weight: 700;
    font-size: 16px;
    outline: none;
}

#codeInput:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(232, 195, 106, 0.12);
}

.verify-btn {
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #f6e7b0, #d4ae52);
    color: #3a140f;
    font-weight: 700;
    cursor: pointer;
}

.back-btn {
    width: 100%;
    margin-top: 14px;
    height: 44px;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    cursor: pointer;
}

.code-status {
    min-height: 22px;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}

.code-status.success { color: #34d399; }
.code-status.error {
    color: #fda4af;
    background: rgba(225, 29, 72, 0.12);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(225, 29, 72, 0.3);
}

.lottery-info {
    text-align: center;
    margin: 18px 0 8px;
}

.info-item {
    display: inline-flex;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}

.value { color: var(--gold); font-weight: 800; }

.lottery-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 10px 0 20px;
}

.lottery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    justify-items: center;
}

.red-packet {
    width: 150px;
    height: 196px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
}

.red-packet:hover { transform: translateY(-4px); }
.red-packet.disabled { cursor: not-allowed; opacity: 0.55; }

.packet-front, .packet-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s ease;
    overflow: hidden;
}

.packet-front {
    background:
        linear-gradient(180deg, #c81e3a 0%, #9f1239 42%, #7f1d1d 100%);
    border: 1px solid rgba(243, 223, 154, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 16px 28px rgba(0,0,0,0.35);
    transform: rotateY(0deg);
}

.packet-front::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    background: linear-gradient(180deg, #8a1020, #be123c);
    clip-path: polygon(0 0, 50% 70%, 100% 0);
}

.packet-front::after {
    content: "";
    position: absolute;
    top: 38px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff3c4, #d4ae52 55%, #8a6a1f);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.packet-back {
    background: linear-gradient(180deg, #fff8e7, #e8c36a);
    color: #9f1239;
    transform: rotateY(180deg);
}

.red-packet.flipped .packet-front { transform: rotateY(-180deg); }
.red-packet.flipped .packet-back { transform: rotateY(0deg); }

.packet-icon {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    color: #fde68a;
    margin-top: 36px;
    margin-bottom: 8px;
    letter-spacing: 0.12em;
    z-index: 1;
}

.packet-text {
    font-size: 14px;
    letter-spacing: 0.28em;
    font-weight: 700;
    color: #fde68a;
}

.amount {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
}

.red-packet.winning { animation: winningPulse 1s ease-in-out; }

@keyframes winningPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.red-packet.winner-highlight {
    animation: winnerGlow 2s ease-in-out infinite;
}

.red-packet.winner-highlight::before {
    content: "中奖";
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: #3a140f;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    z-index: 3;
}

@keyframes winnerGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(232, 195, 106, 0.45)); }
    50% { filter: drop-shadow(0 0 18px rgba(232, 195, 106, 0.8)); }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-overlay.show { display: flex; }

.modal {
    width: min(400px, 92vw);
    background: #14121c;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 36px 28px 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transform: scale(0.92);
    opacity: 0;
    transition: 0.25s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
    opacity: 1;
}

.prize-icon { font-size: 42px; margin-bottom: 8px; }
.prize-title {
    font-family: var(--display);
    letter-spacing: 0.16em;
    color: var(--gold-soft);
    font-size: 22px;
    margin-bottom: 8px;
}
.prize-amount {
    font-size: 42px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 8px;
}
.prize-message, .remaining-info {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.continue-btn, .close-btn {
    margin: 12px 6px 0;
    padding: 11px 22px;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.continue-btn {
    background: linear-gradient(180deg, #f6e7b0, #d4ae52);
    color: #3a140f;
}

.close-btn {
    background: transparent;
    color: var(--ivory);
    border: 1px solid var(--line);
}

.loading {
    position: fixed;
    inset: 0;
    background: rgba(7, 6, 12, 0.78);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.loading-spinner {
    width: 46px;
    height: 46px;
    border: 3px solid rgba(232, 195, 106, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 14px;
}

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

.loading-text { color: var(--gold-soft); letter-spacing: 0.18em; }

.reset-container {
    text-align: center;
    margin-top: 8px;
    display: none;
}

.reset-btn {
    padding: 10px 18px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.admin-link { display: none; }

.withdrawal-container {
    max-width: 640px;
    margin: 0 auto;
}

.withdrawal-card {
    padding: 24px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    letter-spacing: 0.12em;
    color: var(--gold-soft);
    margin-bottom: 18px;
}

.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--ivory);
    padding: 0 14px;
    outline: none;
}

.form-input:focus {
    border-color: var(--gold);
}

.balance-info {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--muted);
}

.balance-item:last-child {
    color: var(--gold);
    font-weight: 800;
    border-top: 1px solid var(--line);
    margin-top: 6px;
    padding-top: 12px;
}

.submit-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #f6e7b0, #d4ae52);
    color: #3a140f;
    font-weight: 800;
    cursor: pointer;
}

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

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

.record-table th, .record-table td {
    padding: 10px 6px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
}

.record-table th { color: var(--muted); font-weight: 500; }

.status-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.status-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-approved { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.status-rejected { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.back-link {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 16px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .lottery-grid { gap: 12px; }
    .red-packet { width: 118px; height: 156px; }
    .packet-icon { font-size: 26px; }
    .amount { font-size: 22px; }
}

@media (max-width: 480px) {
    .categories-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .category-card { padding: 16px 12px; }
    .category-name { font-size: 14px; }
    .lottery-grid { gap: 8px; }
    .red-packet { width: 100px; height: 132px; }
    .input-group { flex-direction: column; }
    .verify-btn { height: 46px; }
}
