:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --background-color: #f9fafb;
    --card-background: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --transition: all 0.3s ease;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #ff6b9d 0%, #ffa07a 25%, #ffd93d 50%, #6bcb77 75%, #4d96ff 100%);
    background-size: 400% 400%;
    animation: festivalGradient 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-brand img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    object-fit: cover;
}

.navbar-brand span {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-back {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.navbar-back:hover {
    color: var(--primary-hover);
}

.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 20px 60px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes confetti-fall {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.8), 0 0 60px rgba(139, 92, 246, 0.4); }
}

@keyframes bounce-in {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.15) rotate(3deg); }
    70% { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.page-header h1 {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.page-header p {
    font-size: 18px;
    color: rgba(255,255,255,0.85);
}

.card {
    background: var(--card-background);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: scaleIn 0.6s ease-out;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 30px 30px 0;
}

.step-item {
    display: flex;
    align-items: center;
    position: relative;
}

.step-number {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}

.step-label {
    margin-left: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
    transition: var(--transition);
}

.step-line {
    width: 80px;
    height: 2px;
    background: var(--border-color);
    margin: 0 16px;
    transition: var(--transition);
}

.step-item.active .step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step-item.completed .step-number {
    background: var(--success-color);
    color: #fff;
}

.step-item.completed .step-label {
    color: var(--success-color);
}

.step-item.completed + .step-item > .step-line,
.step-item.completed .step-line {
    background: var(--success-color);
}

.card-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    font-size: 16px;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
    background: var(--background-color);
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: #fff;
}

.form-input::placeholder {
    color: var(--text-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: var(--border-radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--background-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
}

.btn-send-code {
    flex-shrink: 0;
    min-width: 130px;
}

.btn-send-code.counting {
    background: var(--text-light);
    color: #fff;
    cursor: not-allowed;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius-lg);
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: fadeInUp 0.3s ease-out;
}

.alert.show {
    display: flex;
}

.alert-error {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning-color);
    border: 1px solid #fde68a;
}

.prizes-section {
    display: none;
}

.prizes-section.show {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

.user-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    padding: 18px 22px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 28px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.user-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.user-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.draw-status {
    text-align: right;
}

.draw-status-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.draw-status-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

.draw-status-value.can-draw {
    color: var(--success-color);
}

.draw-status-value.drawn {
    color: var(--warning-color);
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.prize-card {
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px 16px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.prize-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.prize-card.sold-out {
    opacity: 0.5;
}

.prize-card.sold-out::after {
    content: '已售罄';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: var(--error-color);
    color: #fff;
    padding: 4px 24px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}

.prize-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.prize-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.prize-probability {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 600;
    background: rgba(236, 72, 153, 0.1);
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
}

.prize-stock {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.draw-area {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(139, 92, 246, 0.04));
    border-radius: var(--border-radius-xl);
    border: 2px dashed rgba(99, 102, 241, 0.25);
}

.draw-btn-wrapper {
    position: relative;
    display: inline-block;
}

.draw-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
    letter-spacing: 2px;
}

.draw-btn:hover:not(:disabled):not(.drawing) {
    transform: scale(1.06);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}

.draw-btn:disabled:not(.drawing) {
    background: var(--text-light);
    cursor: not-allowed;
    box-shadow: none;
}

.draw-btn.drawing {
    animation: spin 1.5s ease-in-out;
    pointer-events: none;
}

.draw-btn.drawing::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite reverse;
}

.draw-hint {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 抽奖记录 - 融合在抽奖卡片内 */
.draw-history {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 2px dashed rgba(255,217,61,0.25);
}

.history-title {
    font-size: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-weight: 600;
}

#historyList {
    color: var(--text-light);
    font-size: 14px;
}

.result-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.result-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-background);
    border-radius: var(--border-radius-xl);
    padding: 50px 45px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: bounce-in 0.6s ease-out;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--background-color);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.result-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    margin: 0 auto 24px;
    animation: pulse-glow 2s infinite;
}

.result-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.result-prize {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.result-days {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 3s ease-out forwards;
}

.logout-btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--border-radius-md);
    white-space: nowrap;
}

#historyList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--background-color);
    border-radius: var(--border-radius-lg);
    border-left: 3px solid var(--success-color);
}

.history-item .history-prize {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.history-item .history-time {
    font-size: 12px;
    color: var(--text-light);
}

.result-deliver {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.08));
    color: #059669;
    padding: 10px 20px;
    border-radius: var(--border-radius-lg);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* 移动端触控优化 */
@media (hover: none) and (pointer: coarse) {
    .btn, .draw-btn, .form-input {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .btn-primary:hover::before,
    .btn-secondary:hover {
        display: none;
    }

    .prize-card:hover {
        transform: none;
    }

    .draw-btn:hover:not(:disabled):not(.drawing) {
        transform: none;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 80px 16px 40px;
        min-height: calc(100vh - 80px);
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 15px;
    }

    .step-indicator {
        padding: 20px 12px 0;
        gap: 0;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .step-line {
        width: 30px;
        margin: 0 8px;
    }

    .step-label {
        display: none;
    }

    .card-body {
        padding: 24px 18px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-input {
        padding: 13px 15px;
        font-size: 15px;
    }

    .btn {
        padding: 12px 22px;
        font-size: 14px;
    }

    .btn-send-code {
        min-width: unset;
        flex: 1;
        max-width: none;
    }

    .prizes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 24px;
    }

    .prize-card {
        padding: 16px 10px;
    }

    .prize-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .prize-name {
        font-size: 13px;
    }

    .prize-probability {
        font-size: 11px;
        padding: 2px 8px;
    }

    .user-info-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 14px 16px;
    }

    .user-avatar {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .draw-status {
        text-align: center;
    }

    .draw-area {
        padding: 32px 16px;
    }

    .draw-btn {
        width: 140px;
        height: 140px;
        font-size: 18px;
        letter-spacing: 1px;
        box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
    }

    .draw-hint {
        font-size: 13px;
        margin-top: 16px;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .modal-content {
        padding: 36px 28px;
        margin: 0 12px;
    }

    .result-icon {
        width: 72px;
        height: 72px;
        font-size: 34px;
        margin-bottom: 18px;
    }

    .result-title {
        font-size: 22px;
    }

    .result-prize {
        font-size: 18px;
    }

    .logout-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .draw-history {
        margin-top: 20px;
        padding-top: 18px;
    }

    .history-item {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .result-deliver {
        font-size: 13px;
        padding: 8px 16px;
        margin-bottom: 18px;
    }
}

@media (max-width: 480px) {
    .navbar-brand span {
        font-size: 17px;
    }

    .navbar-back {
        font-size: 14px;
    }

    .main-container {
        padding: 70px 12px 32px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header p {
        font-size: 14px;
    }

    .step-indicator {
        padding: 16px 8px 0;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-line {
        width: 22px;
        margin: 0 6px;
    }

    .card {
        border-radius: var(--border-radius-lg);
    }

    .card-body {
        padding: 20px 14px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 15px;
        border-radius: var(--border-radius-md);
    }

    .btn {
        padding: 11px 18px;
        font-size: 14px;
        border-radius: var(--border-radius-md);
    }

    .alert {
        padding: 12px 14px;
        font-size: 13px;
        margin-top: 12px;
    }

    .prizes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .prize-card {
        padding: 14px 8px;
        border-radius: var(--border-radius-md);
    }

    .prize-icon {
        font-size: 26px;
        margin-bottom: 6px;
    }

    .prize-name {
        font-size: 12px;
    }

    .prize-probability {
        font-size: 10px;
        padding: 1px 6px;
    }

    .draw-area {
        padding: 28px 12px;
        border-radius: var(--border-radius-lg);
    }

    .draw-btn {
        width: 130px;
        height: 130px;
        font-size: 17px;
        box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
    }

    .draw-btn.drawing::after {
        inset: -4px;
    }

    .modal-content {
        padding: 30px 22px;
        border-radius: var(--border-radius-lg);
    }

    .result-title {
        font-size: 20px;
    }

    .result-prize {
        font-size: 17px;
    }

    .result-days {
        font-size: 14px;
        margin-bottom: 22px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-container {
        max-width: 700px;
    }

    .prizes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ====== 六一儿童节主题样式 ====== */

@keyframes festivalGradient {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatUp {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 1; }
    50% { transform: translateY(-20px) rotate(8deg); opacity: 0.85; }
}

@keyframes floatDown {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 1; }
    50% { transform: translateY(15px) rotate(-6deg); opacity: 0.85; }
}

@keyframes bounceGentle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes shimmerFestival {
    0% { text-shadow: 0 0 10px rgba(255,107,157,0.5), 0 0 30px rgba(255,217,61,0.3); }
    33% { text-shadow: 0 0 15px rgba(255,160,122,0.5), 0 0 35px rgba(107,203,119,0.3); }
    66% { text-shadow: 0 0 12px rgba(77,150,255,0.5), 0 0 28px rgba(236,72,153,0.3); }
    100% { text-shadow: 0 0 10px rgba(255,107,157,0.5), 0 0 30px rgba(255,217,61,0.3); }
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.4; transform: scale(0.7) rotate(180deg); }
}

@keyframes swing {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

/* 节日横幅 */
.festival-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 18px 24px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,250,240,0.95));
    border-radius: var(--border-radius-xl);
    box-shadow: 0 8px 32px rgba(255,107,157,0.2), 0 4px 12px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    animation: fadeInDown 0.8s ease-out;
}

.festival-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,107,157,0.04) 10px,
        rgba(255,107,157,0.04) 20px
    );
    animation: shimmer 20s linear infinite;
}

.festival-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b9d, #ffa07a, #ffd93d, #ff6b9d);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerFestival 4s ease infinite, bounceGentle 3s ease infinite;
    letter-spacing: 2px;
    white-space: nowrap;
}

.festival-text {
    font-size: 28px;
    animation: swing 2s ease-in-out infinite;
    display: inline-block;
}

.festival-text:nth-child(even) {
    animation-delay: 0.3s;
    animation-duration: 2.5s;
}

.festival-text:nth-child(odd) {
    animation-delay: 0.7s;
}

/* 浮动装饰 */
.float-decor {
    position: fixed;
    left: var(--x);
    top: var(--y);
    font-size: 36px;
    z-index: 5;
    pointer-events: none;
    animation: floatUp 3s ease-in-out infinite;
    animation-delay: var(--delay);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.float-decor:nth-child(odd) {
    animation-name: floatDown;
    animation-duration: 3.5s;
}

/* 页面标题节日化 */
.page-header h1 {
    text-shadow: 0 2px 20px rgba(255,255,255,0.4), 0 4px 40px rgba(255,107,157,0.2);
    animation: bounceGentle 4s ease infinite;
}

/* 卡片节日效果 */
.card {
    box-shadow: var(--shadow-xl), 0 0 60px rgba(255,107,157,0.1);
    border: 2px solid rgba(255,255,255,0.6);
}

/* 抽奖按钮节日化 */
.draw-btn {
    background: linear-gradient(145deg, #ff6b9d, #ffa07a, #ffd93d, #ff6b9d);
    background-size: 300% 300%;
    animation: festivalGradient 4s ease infinite, pulse-glow 2s infinite;
    box-shadow: 0 8px 35px rgba(255,107,157,0.45), 0 0 80px rgba(255,217,61,0.2);
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.draw-btn:hover:not(:disabled):not(.drawing) {
    box-shadow: 0 14px 50px rgba(255,107,157,0.55), 0 0 100px rgba(255,217,61,0.3);
}

/* 奖品卡片节日化 */
.prize-card {
    border-color: rgba(255,217,61,0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prize-card:hover {
    transform: translateY(-8px) scale(1.03) rotate(1deg);
    box-shadow: 0 12px 28px rgba(255,107,157,0.25);
    border-color: #ffd93d;
}

/* 用户信息栏节日化 */
.user-info-bar {
    background: linear-gradient(135deg, rgba(255,217,61,0.12), rgba(255,107,157,0.1));
    border-color: rgba(255,217,61,0.3);
}

.user-avatar {
    background: linear-gradient(145deg, #ff6b9d, #ffd93d, #4d96ff);
    animation: bounceGentle 3s ease infinite;
}

/* 按钮节日化 */
.btn-primary {
    background: linear-gradient(135deg, #ff6b9d, #ffa07a, #ec4899);
    box-shadow: 0 4px 15px rgba(255,107,157,0.35);
}

.btn-primary::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(255,107,157,0.5);
}

/* 步骤指示器节日化 */
.step-item.active .step-number {
    background: linear-gradient(135deg, #ff6b9d, #ffa07a);
    box-shadow: 0 4px 15px rgba(255,107,157,0.4);
}

.step-item.completed .step-number {
    background: linear-gradient(135deg, #ffd93d, #f59e0b);
}

/* 弹窗节日化 */
.result-icon {
    background: linear-gradient(135deg, #fff7ed, #fef3c7, #fce7f3);
    animation: bounceGentle 2s ease infinite, pulse-glow 2s infinite;
}

.result-deliver {
    background: linear-gradient(135deg, rgba(255,217,61,0.15), rgba(107,203,119,0.1));
    color: #059669;
    border-color: rgba(255,217,61,0.3);
}

/* 导航栏节日化 */
.navbar {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,250,240,0.98));
    box-shadow: 0 4px 20px rgba(255,107,157,0.15);
}

/* 历史记录卡片节日化 */
.history-item {
    border-left-color: #ffd93d;
    background: linear-gradient(135deg, rgba(255,245,230,0.8), rgba(255,240,245,0.8));
}

/* 六一移动端适配 */
@media (max-width: 768px) {
    .festival-banner {
        padding: 14px 16px;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .festival-title {
        font-size: 17px;
        letter-spacing: 1px;
        width: 100%;
        order: -1;
        text-align: center;
        margin-bottom: 4px;
    }

    .festival-text {
        font-size: 22px;
    }

    .float-decor {
        font-size: 26px;
    }

    .page-header h1 {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .festival-banner {
        padding: 12px 12px;
        gap: 8px;
    }

    .festival-title {
        font-size: 15px;
    }

    .festival-text {
        font-size: 18px;
    }

    .float-decor {
        font-size: 22px;
    }
}

/* ====== 抽奖开箱动画 ====== */

.lottery-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

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

.lottery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.lottery-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: lotteryIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lotteryIn {
    from { opacity: 0; transform: scale(0.7) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Stage 1: 开箱动画 */
.lottery-box {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    position: relative;
    perspective: 600px;
}

.box-body {
    width: 160px;
    height: 140px;
    margin: 30px auto 0;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffd93d, #ffb347, #ff9500);
    box-shadow:
        0 12px 40px rgba(255, 153, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -4px 12px rgba(200, 120, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: boxPulse 1.2s ease-in-out infinite;
}

@keyframes boxPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.box-inner-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 80%, rgba(255,255,255,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.mystery-item {
    font-size: 56px;
    animation: mysteryBounce 0.8s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

@keyframes mysteryBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-12px) scale(1.15) rotate(-5deg); }
    75% { transform: translateY(-6px) scale(1.08) rotate(5deg); }
}

/* 盒子盖子 */
.box-lid {
    position: absolute;
    left: 20px;
    right: 20px;
    height: 36px;
    border-radius: 18px 18px 8px 8px;
    z-index: 2;
}

.lid-top {
    top: 0;
    background: linear-gradient(180deg, #ffe066, #ffc107, #e6a800);
    box-shadow:
        0 4px 16px rgba(230, 168, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -3px 8px rgba(180, 100, 0, 0.2);
    transform-origin: bottom center;
    animation: lidFloat 2s ease-in-out infinite;
}

@keyframes lidFloat {
    0%, 100% { transform: translateY(0) rotateX(0deg); }
    50% { transform: translateY(-6px) rotateX(-8deg); }
}

.lid-bottom {
    bottom: 28px;
    height: 14px;
    background: linear-gradient(180deg, #d99b00, #c68a00);
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* 开箱中状态 */
.lottery-stage-1.opening .box-body {
    animation: boxShake 0.15s ease-in-out infinite;
}

.lottery-stage-1.opening .mystery-item {
    animation: mysterySpin 0.3s linear infinite;
}

.lottery-stage-1.opening .lid-top {
    animation: lidOpen 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes boxShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-6px) rotate(-3deg); }
    75% { transform: translateX(6px) rotate(3deg); }
}

@keyframes mysterySpin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@keyframes lidOpen {
    0% { transform: translateY(0) rotateX(0deg); }
    60% { transform: translateY(-60px) rotateX(-45deg); opacity: 1; }
    100% { transform: translateY(-120px) rotateX(-70deg); opacity: 0; }
}

.lottery-hint {
    font-size: 17px;
    color: rgba(255, 217, 61, 0.95);
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.4);
    animation: hintPulse 1.5s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stage 2: 奖品揭晓 */
.prize-reveal {
    padding: 30px 20px;
    position: relative;
    animation: revealIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes revealIn {
    from { opacity: 0; transform: scale(0.5) rotate(-15deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.prize-icon-large {
    font-size: 72px;
    margin-bottom: 16px;
    animation: prizePop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 8px 24px rgba(255,107,157,0.4));
}

@keyframes prizePop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.3) rotate(10deg); opacity: 1; }
    80% { transform: scale(0.95) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.prize-name-large {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b9d, #ffa07a, #ffd93d);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 2s linear infinite;
    margin-bottom: 8px;
}

@keyframes shimmerText {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.prize-days-large {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 星星闪烁容器 */
.sparkle-container {
    position: absolute;
    inset: -20px;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    font-size: 20px;
    animation: sparkleAnim 1.2s ease-out forwards;
    pointer-events: none;
}

@keyframes sparkleAnim {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .lottery-box {
        width: 160px;
        height: 160px;
    }

    .box-body {
        width: 130px;
        height: 115px;
        margin-top: 22px;
    }

    .mystery-item {
        font-size: 44px;
    }

    .box-lid {
        left: 15px;
        right: 15px;
    }

    .lid-top {
        height: 28px;
    }

    .prize-icon-large {
        font-size: 56px;
    }

    .prize-name-large {
        font-size: 22px;
    }

    .lottery-hint {
        font-size: 15px;
    }
}
.draw-footer {
    text-align: center;
    padding: 12px 20px 20px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 6px;
}

.footer-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-md);
    object-fit: cover;
}

.footer-brand span {
    font-size: 17px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    letter-spacing: 1px;
}

.footer-slogan {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 6px;
    font-style: italic;
}

.footer-copyright {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin: 0;
}
