* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #0a0e27;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 动态背景 */
body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(168, 85, 247, 0.2) 0%, transparent 50%);
    animation: backgroundMove 20s ease infinite;
    z-index: 0;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-5%, -5%) rotate(120deg); }
    66% { transform: translate(5%, 5%) rotate(240deg); }
}

/* 网格背景 */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
}

/* 下雨效果 */
.rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.6), transparent);
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

.container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 50px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 0 60px rgba(99, 102, 241, 0.1);
    position: relative;
    z-index: 1;
    animation: containerFadeIn 0.8s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5)); }
    50% { filter: drop-shadow(0 0 30px rgba(118, 75, 162, 0.8)); }
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 40px;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.upload-area {
    border: 2px dashed rgba(102, 126, 234, 0.5);
    border-radius: 20px;
    padding: 60px 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.upload-area:hover::before {
    width: 400px;
    height: 400px;
}

.upload-area:hover {
    border-color: rgba(102, 126, 234, 0.8);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.upload-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
    box-shadow: 
        0 0 40px rgba(102, 126, 234, 0.4),
        inset 0 0 40px rgba(102, 126, 234, 0.2);
}

.upload-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.upload-area p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
    font-size: 18px;
    position: relative;
    z-index: 1;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.upload-btn:hover::before {
    width: 300px;
    height: 300px;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.upload-btn:active {
    transform: translateY(-1px);
}

.preview-section {
    margin-top: 40px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-section h2 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-section h2::before {
    content: '✨';
    font-size: 28px;
}

#previewImage {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    background: rgba(0, 0, 0, 0.2);
    animation: imageZoomIn 0.5s ease;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.url-section {
    margin-top: 25px;
}

.url-section label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 15px;
}

.url-display {
    display: flex;
    gap: 12px;
}

#imageUrl {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

#imageUrl:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.copy-btn::after {
    content: '📋';
    margin-left: 8px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.copy-btn:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    margin-top: 40px;
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 容器滚动条样式 */
.container::-webkit-scrollbar {
    width: 8px;
}

.container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 30px 20px;
        max-height: 90vh;
    }

    h1 {
        font-size: 32px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 60px;
    }

    .url-display {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }
}

/* 页面滚动条样式（隐藏） */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}
