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

:root {
    --primary-red: #c62828;
    --bright-red: #d32f2f;
    --dark-red: #b71c1c;
    --gold: #ffb300;
    --light-gold: #ffe082;
    --warm-gold: #ff8f00;
    --orange: #f57c00;
    --deep-orange: #e65100;
    --cream: #fff3e0;
    --warm-bg: #ffebee;
    --text-dark: #1a1a1a;
    --text-light: #616161;
    --shadow: rgba(183, 28, 28, 0.2);
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #fff8e1 0%, #ffebee 25%, #ffcdd2 50%, #ef9a9a 75%, #e57373 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(211, 47, 47, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 193, 7, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 87, 34, 0.08) 0%, transparent 35%);
    pointer-events: none;
    z-index: 0;
}

.background-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 193, 7, 0.04) 35px, rgba(255, 193, 7, 0.04) 70px),
        radial-gradient(circle at 20% 30%, rgba(255, 87, 34, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(233, 30, 99, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.background-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(255, 152, 0, 0.03) 40px, rgba(255, 152, 0, 0.03) 80px);
    pointer-events: none;
}

.floating-lanterns {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.lantern {
    position: absolute;
    font-size: 48px;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(211, 47, 47, 0.3));
}

.lantern-1 {
    top: 8%;
    left: 5%;
    animation-delay: 0s;
}

.lantern-2 {
    top: 15%;
    right: 8%;
    animation-delay: 2s;
    font-size: 40px;
}

.lantern-3 {
    top: 25%;
    left: 12%;
    animation-delay: 4s;
    font-size: 36px;
}

.lantern-4 {
    top: 35%;
    right: 15%;
    animation-delay: 1.5s;
    font-size: 32px;
}

.lantern-5 {
    top: 45%;
    left: 8%;
    animation-delay: 3.5s;
    font-size: 28px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }
    50% {
        transform: translateY(-20px) rotate(3deg);
    }
}

.festive-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.decoration-item {
    position: absolute;
    font-size: 32px;
    animation: festivePulse 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(211, 47, 47, 0.2));
}

.decor-top-left {
    top: 5%;
    left: 3%;
    animation-delay: 0s;
}

.decor-top-right {
    top: 5%;
    right: 3%;
    animation-delay: 1s;
}

.decor-bottom-left {
    bottom: 8%;
    left: 5%;
    animation-delay: 2s;
}

.decor-bottom-right {
    bottom: 8%;
    right: 5%;
    animation-delay: 1.5s;
}

.decor-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    font-weight: 800;
    color: rgba(211, 47, 47, 0.08);
    animation: rotateFu 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes festivePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes rotateFu {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 16px;
    position: relative;
    z-index: 2;
}

.header-section {
    text-align: center;
    padding: 30px 20px 25px;
    position: relative;
}

.decorative-line {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.left-line {
    left: 20px;
}

.right-line {
    right: 20px;
}

.main-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-red);
    margin: 0;
    padding: 0 60px;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.title-decor {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    animation: twinkle 2s ease-in-out infinite;
}

.left-decor {
    left: 15px;
}

.right-decor {
    right: 15px;
    animation-delay: 1s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.2);
    }
}

.content-section {
    padding: 20px 0;
}

.fireworks-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.firework {
    width: 50px;
    height: 50px;
    position: relative;
}

.firework::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    border-radius: 50%;
    animation: firework 1.5s ease-out infinite;
}

.firework-1::before {
    animation-delay: 0s;
}

.firework-2::before {
    animation-delay: 0.5s;
}

.firework-3::before {
    animation-delay: 1s;
}

@keyframes firework {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.welcome-message {
    text-align: center;
    margin-bottom: 30px;
}

.main-greeting {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.sub-greeting {
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 500;
}

.limit-note {
    font-size: 13px;
    color: var(--primary-red);
    font-weight: 600;
    background: var(--light-gold);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 4px var(--shadow);
}

.upload-section {
    margin: 30px 0;
}

.upload-container {
    border: 2px dashed var(--primary-red);
    padding: 40px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(180deg, var(--cream) 0%, white 100%);
    position: relative;
    border-radius: 12px;
}

.upload-container:hover {
    border-color: var(--gold);
    background: linear-gradient(180deg, white 0%, var(--cream) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.15);
}

.upload-container:active {
    transform: translateY(0);
}

.upload-character {
    margin-bottom: 15px;
    pointer-events: none;
}

.character-wrapper {
    position: relative;
    display: inline-block;
    pointer-events: none;
}

.character-emoji {
    font-size: 56px;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

.character-face {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.eyes {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 4px;
}

.eye {
    width: 6px;
    height: 6px;
    background: var(--text-dark);
    border-radius: 50%;
    animation: blink 3s ease-in-out infinite;
}

@keyframes blink {
    0%, 45%, 55%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

.mouth {
    font-size: 12px;
    text-align: center;
}

.upload-text {
    margin: 15px 0;
    pointer-events: none;
}

.upload-main-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 6px;
}

.upload-sub-text {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.upload-hint {
    margin-top: 10px;
    pointer-events: none;
}

.hint-arrow {
    font-size: 28px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

.upload-decorations {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    pointer-events: none;
}

.decor {
    font-size: 16px;
}

.decor-1 {
    animation: sparkle 1.5s ease-in-out infinite;
}

.decor-2 {
    animation: heartbeat 1.2s ease-in-out infinite;
}

.decor-3 {
    animation: sparkle 1.5s ease-in-out infinite 0.75s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.15);
    }
}

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

.preview-section {
    margin: 20px 0;
}

.preview-wrapper {
    text-align: center;
}

.preview-frame {
    display: inline-block;
    padding: 12px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--warm-gold) 100%);
    border-radius: 12px;
    position: relative;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.preview-frame img {
    max-width: 180px;
    max-height: 180px;
    display: block;
    border-radius: 8px;
    background: white;
}

.preview-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 24px;
    animation: rotate 4s linear infinite;
}

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

.reupload-btn {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.reupload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4);
}

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

.draw-button {
    width: 100%;
    padding: 18px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--bright-red) 0%, var(--primary-red) 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.draw-button:hover:not(:disabled)::before {
    left: 100%;
}

.draw-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(211, 47, 47, 0.45);
}

.draw-button:active:not(:disabled) {
    transform: translateY(-1px);
}

.draw-button:disabled {
    background: linear-gradient(135deg, #bdbdbd 0%, #9e9e9e 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 24px;
}

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

.result-container {
    text-align: center;
    padding: 30px 20px;
}

.red-packet-wrapper {
    margin-bottom: 30px;
}

.red-packet {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 200px;
    background: linear-gradient(135deg, var(--bright-red) 0%, var(--primary-red) 100%);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(211, 47, 47, 0.4);
    animation: packetOpen 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes packetOpen {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.packet-top {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 30px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--warm-gold) 100%);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 12px rgba(255, 193, 7, 0.3);
}

.packet-body {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.packet-decoration {
    font-size: 48px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.amount-display {
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.result-message {
    margin: 25px 0;
}

.congrats-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 12px;
}

.amount-text {
    font-size: 48px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.15);
    margin: 18px 0;
    animation: amountPop 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes amountPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.waiting-text {
    font-size: 16px;
    color: var(--text-light);
    margin-top: 12px;
    font-weight: 500;
}

.status-container {
    margin-top: 25px;
    padding: 20px;
    background: var(--cream);
    border-radius: 12px;
    border-left: 4px solid var(--gold);
}

.status-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid var(--light-gold);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.status-success {
    color: #2e7d32;
    font-size: 18px;
    font-weight: 700;
}

.status-rejected {
    color: var(--primary-red);
    font-size: 16px;
    font-weight: 600;
}

.reject-reason {
    background: white;
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
    border-left: 3px solid var(--primary-red);
    border-radius: 4px;
}

.already-drawn-container {
    text-align: center;
    padding: 30px 20px;
}

.blocked-container {
    text-align: center;
    padding: 30px 20px;
}

.blocked-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.blocked-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 28px;
}

.blocked-details {
    background: #fff0f0;
    padding: 24px 20px;
    text-align: left;
    border-radius: 12px;
    border-left: 4px solid var(--primary-red);
}

.blocked-reason {
    font-size: 15px;
    color: var(--text-dark);
    margin: 12px 0;
    line-height: 1.8;
    font-weight: 500;
}

.reason-label {
    color: var(--text-light);
    margin-right: 8px;
}

.reason-text {
    font-weight: 700;
    color: var(--primary-red);
}

.blocked-message {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 16px;
    text-align: center;
}

.status-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: checkmark 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.status-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 28px;
}

.result-details {
    background: var(--cream);
    padding: 24px 20px;
    text-align: left;
    border-radius: 12px;
    border-left: 4px solid var(--gold);
}

.detail-item {
    font-size: 15px;
    color: var(--text-dark);
    margin: 12px 0;
    line-height: 1.8;
    font-weight: 500;
}

.detail-label {
    color: var(--text-light);
    margin-right: 8px;
}

.detail-value {
    font-weight: 700;
    color: var(--primary-red);
}

.footer-section {
    text-align: center;
    padding: 25px 20px;
    margin-top: 20px;
}

.footer-decor {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
}

.footer-decor span {
    font-size: 24px;
    animation: bounce 2s ease-in-out infinite;
}

.footer-decor span:nth-child(2) {
    animation-delay: 0.5s;
}

.footer-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 8px;
}

.footer-subtext {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.particle {
    position: absolute;
    font-size: 18px;
    animation: fall linear infinite;
    opacity: 0.5;
}

@keyframes fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.interactive-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.click-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    animation: clickRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes clickRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }

    .main-title {
        font-size: 24px;
        padding: 0 50px;
    }

    .lantern {
        font-size: 40px;
    }

    .lantern-2 {
        font-size: 34px;
    }

    .lantern-3 {
        font-size: 30px;
    }

    .main-greeting {
        font-size: 18px;
    }

    .sub-greeting {
        font-size: 14px;
    }

    .upload-container {
        padding: 35px 20px;
    }

    .character-emoji {
        font-size: 48px;
    }

    .upload-main-text {
        font-size: 16px;
    }

    .upload-sub-text {
        font-size: 13px;
    }

    .draw-button {
        font-size: 18px;
        padding: 16px;
    }

    .btn-icon {
        font-size: 22px;
    }

    .btn-text {
        font-size: 16px;
    }

    .amount-text {
        font-size: 42px;
    }

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

    .red-packet {
        width: 120px;
        height: 180px;
    }

    .packet-decoration {
        font-size: 40px;
    }

    .amount-display {
        font-size: 28px;
    }
}

@media (max-width: 360px) {
    .main-title {
        font-size: 22px;
        padding: 0 40px;
    }

    .title-decor {
        font-size: 18px;
    }

    .upload-container {
        padding: 30px 16px;
    }

    .character-emoji {
        font-size: 42px;
    }

    .amount-text {
        font-size: 36px;
    }

    .red-packet {
        width: 110px;
        height: 160px;
    }
}

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