/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

header h1 {
    font-size: 2.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header h1 i {
    color: #3498db;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* 上传区域 */
.upload-area {
    background: white;
    border: 3px dashed #3498db;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #2980b9;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.upload-area.drag-over {
    border-color: #2ecc71;
    background: #e8f8f1;
}

.upload-icon {
    font-size: 4rem;
    color: #3498db;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.upload-area p {
    color: #7f8c8d;
    margin-bottom: 25px;
}

#fileInput {
    display: none;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    display: none;
}

.file-info.active {
    display: block;
}

/* 按钮样式 */
.processing-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1c6ea4);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-3px);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #27ae60, #219653);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.3);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 图片对比区域 */
.comparison-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.image-container {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.image-container h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.image-placeholder i {
    font-size: 4rem;
    margin-bottom: 15px;
}

.image-placeholder p {
    font-size: 1.1rem;
}

.image-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
}

/* 下载区域 */
.download-section {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.format-options {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.format-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s;
}

.format-options label:hover {
    background: #e9ecef;
}

/* 页脚样式 */
footer {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature {
    text-align: center;
    padding: 25px;
    border-radius: 15px;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    background: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.feature i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 15px;
}

.feature h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.feature p {
    color: #6c757d;
    font-size: 0.95rem;
}

.copyright {
    text-align: center;
    color: #7f8c8d;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* 加载遮罩层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.loading-content p {
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .comparison-section {
        grid-template-columns: 1fr;
    }
    
    .processing-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header, .upload-area, .image-container, .download-section, footer {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .image-wrapper {
        height: 250px;
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

/* 用户认证样式 */
.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #3498db;
}

#userName {
    font-weight: 600;
    color: #2c3e50;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
}

/* Google 登录按钮 */
.btn-google {
    background: linear-gradient(135deg, #4285f4, #34a853, #fbbc05, #ea4335);
    background-size: 300% 300%;
    animation: gradient-shift 8s ease infinite;
    color: white;
    border: none;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.4);
}

/* 登录遮罩 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-overlay.active {
    display: flex;
}

.login-modal {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.login-modal h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.login-modal p {
    color: #6c757d;
    margin-bottom: 25px;
}

.login-modal .btn {
    margin: 10px 0;
    width: 100%;
}

/* 已登录状态 */
.content-locked {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.content-locked::after {
    content: '🔒 请登录后使用完整功能';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    z-index: 100;
}

/* 会员标识 */
.premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
}

/* PayPal 支付样式 */
.pricing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.pricing-overlay.active {
    display: flex;
}

.pricing-modal {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.pricing-modal h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.pricing-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pricing-card.featured .price,
.pricing-card.featured h4 {
    color: white;
}

.pricing-card .badge {
    position: absolute;
    top: -10px;
    right: 15px;
    background: #f39c12;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-card h4 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.pricing-card .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.pricing-card .price span {
    font-size: 1rem;
    font-weight: 400;
}

.features-list {
    list-style: none;
    text-align: left;
    margin-bottom: 25px;
}

.features-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-list li i {
    color: #2ecc71;
}

.pricing-card.featured .features-list li i {
    color: #fff;
}

/* 升级按钮 */
.btn-upgrade {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    margin-left: 10px;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}