/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 汉堡菜单按钮 - 移动端 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-btn {
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    font-size: 0.9rem;
    border-radius: 20px;
}

.lang-toggle {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* 主要内容 */
.main {
    margin-top: 80px;
}

/* 英雄区域 */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>') repeat;
    background-size: 32px 32px;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

/* 像素艺术演示 */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pixel-grid {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.pixel-demo {
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect x="0" y="0" width="2" height="2" fill="%23ff6b6b"/><rect x="2" y="0" width="2" height="2" fill="%234ecdc4"/><rect x="4" y="0" width="2" height="2" fill="%23ffe66d"/><rect x="6" y="0" width="2" height="2" fill="%23ff6b6b"/><rect x="0" y="2" width="2" height="2" fill="%234ecdc4"/><rect x="2" y="2" width="2" height="2" fill="%23a8e6cf"/><rect x="4" y="2" width="2" height="2" fill="%234ecdc4"/><rect x="6" y="2" width="2" height="2" fill="%23ffe66d"/><rect x="0" y="4" width="2" height="2" fill="%23ffe66d"/><rect x="2" y="4" width="2" height="2" fill="%23ff6b6b"/><rect x="4" y="4" width="2" height="2" fill="%23a8e6cf"/><rect x="6" y="4" width="2" height="2" fill="%234ecdc4"/><rect x="0" y="6" width="2" height="2" fill="%23a8e6cf"/><rect x="2" y="6" width="2" height="2" fill="%23ffe66d"/><rect x="4" y="6" width="2" height="2" fill="%23ff6b6b"/><rect x="6" y="6" width="2" height="2" fill="%23a8e6cf"/></svg>') repeat;
    background-size: 64px 64px;
    border-radius: 8px;
    animation: pixelFloat 3s ease-in-out infinite;
}

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

/* 功能特色 */
.features {
    padding: 6rem 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.feature-desc {
    color: #666;
    line-height: 1.6;
}

/* 画廊展示 */
.gallery {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.pixel-art-sample {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    image-rendering: pixelated;
}

.sample-1 {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

.sample-2 {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.sample-3 {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.sample-4 {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* 关于我们 */
.about {
    padding: 6rem 0;
    background: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-desc {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 编辑器区域 */
.editor {
    padding: 6rem 0;
    background: white;
}

/* 第三级按钮样式 */
.btn-tertiary {
    background: #1abc9c;
    color: white;
}

.btn-tertiary:hover {
    background: #16a085;
}

.upload-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.upload-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

#imageUpload {
    display: none;
}

/* 中文页面上传提示 */
.upload-section::after {
    content: '点击上传图像或拖拽到此处';
    display: block;
    background: #667eea;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 1rem;
}

/* 英文页面上传提示 - 当页面语言为英文时覆盖中文提示 */
html[lang="en"] .upload-section::after {
    content: 'Click to upload or drag and drop here';
}

.upload-section:hover::after {
    background: #5a6fd8;
}

.upload-info {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.editor-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    width: 100%;
}

.preview-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

.preview-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
}

.image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.image-wrapper img, .image-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.no-image-placeholder {
    color: #999;
    font-size: 0.9rem;
}

.settings-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
}

.settings-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-container input[type="range"] {
    flex: 1;
}

.slider-container span {
    min-width: 30px;
    text-align: right;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.download-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
}

.btn-small {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-small.download-size {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-small.download-size:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-small.download-size.large {
    background: #f39c12;
    color: white;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.btn-small.download-size.large:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-desc {
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-link {
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    text-align: center;
}

.copyright {
    color: #95a5a6;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* 移动端导航菜单 */
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem 0;
        gap: 1rem;
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* 编辑器区域响应式 */
    .editor-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .preview-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .image-wrapper {
        min-height: 200px;
    }
    
    /* 功能区响应式 */
    .features-grid, 
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .steps-grid, 
    .editor-benefits {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .pixel-grid {
        width: 250px;
        height: 250px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
}