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

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding-top: 70px; /* 为固定导航栏留出空间 */
}

/* 顶部导航栏样式 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn {
    color: #667eea;
    border: 1px solid #667eea;
}

.login-btn:hover {
    background: #667eea;
    color: white;
}

.signup-btn {
    background: #667eea;
    color: white;
}

.signup-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* 广告横幅样式 */
.ad-banner {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    text-align: center;
    padding: 15px 20px;
    margin-bottom: 0;
}

.ad-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ad-text {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.ad-button {
    background: white;
    color: #ff6b6b;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ad-button:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

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

/* 主要内容区域布局 */
main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 40px;
}

.main-content {
    min-width: 0; /* 防止内容溢出 */
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-ad {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-ad h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.ad-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.ad-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.ad-icon {
    font-size: 2rem;
    min-width: 40px;
}

.ad-info h4 {
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.ad-info p {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.ad-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
}

.ad-link:hover {
    text-decoration: underline;
}

.news-item {
    padding: 15px;
    border-left: 4px solid #667eea;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.news-item h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.news-item p {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.news-date {
    color: #999;
    font-size: 0.75rem;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

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

.upload-area {
    border: 3px dashed #fff;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.upload-area:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ff6b6b;
}

.upload-area.dragover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #4ecdc4;
}

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

.upload-area p {
    font-size: 1.2rem;
    font-weight: 500;
}

.controls-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.control-group input[type="range"] {
    width: 80%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.control-group input[type="range"]:hover {
    opacity: 1;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.control-group span {
    margin-left: 15px;
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
    display: inline-block;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.process-btn, .reset-btn, .download-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.process-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.process-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    background: #ff6b6b;
    color: white;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.download-btn {
    background: #4ecdc4;
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.image-container {
    text-align: center;
}

.image-container h3 {
    margin-bottom: 15px;
    color: #555;
    font-size: 1.2rem;
}

.image-container canvas {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.progress-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 1.1rem;
    color: #555;
    font-weight: 600;
}

/* 底部广告样式 */
.bottom-ads {
    background: white;
    padding: 40px 20px;
    border-top: 1px solid #e0e0e0;
}

.ad-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.ad-box {
    text-align: center;
    padding: 30px 20px;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    transition: all 0.3s ease;
}

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

.ad-box h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.ad-box p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.cta-button {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* 网站尾部样式 */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #667eea;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.social-link {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #667eea;
}

.contact-info p {
    color: #bdc3c7;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
    color: #95a5a6;
}

.footer-bottom p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    /* 导航栏响应式 */
    .nav-menu {
        display: none;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-buttons {
        gap: 5px;
    }
    
    .nav-btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
    
    /* 主要布局响应式 */
    main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        order: -1; /* 在移动设备上将侧边栏移到顶部 */
    }
    
    .sidebar-ad {
        padding: 15px;
    }
    
    .ad-item {
        padding: 10px;
        gap: 10px;
    }
    
    .ad-icon {
        font-size: 1.5rem;
        min-width: 30px;
    }
    
    /* 广告内容响应式 */
    .ad-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .ad-text {
        font-size: 1rem;
    }
    
    .ad-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ad-box {
        padding: 20px 15px;
    }
    
    /* 原有样式 */
    .image-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .control-group input[type="range"] {
        width: 70%;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    /* 尾部响应式 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .social-links {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}