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

body {
    font-family: 'Microsoft YaHei', Arial, 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;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 30px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.nav-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

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

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

.lang-btn {
    padding: 8px 15px;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.lang-btn:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页样式 */
.hero {
    text-align: center;
    margin-bottom: 50px;
}

.hero h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

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

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

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

.feature-card h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.feature-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

/* 示例展示 */
.examples {
    text-align: center;
}

.examples h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 30px;
}

.example-gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.example-item {
    text-align: center;
}

.example-item img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.example-item p {
    margin-top: 10px;
    color: #666;
    font-weight: bold;
}

.arrow {
    font-size: 2rem;
    color: #667eea;
    font-weight: bold;
}

/* 页面头部 */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h2 {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
}

/* 工具容器 */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #667eea;
}

.upload-area p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #999;
}

/* 控制区域 */
.controls {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.control-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-group label {
    font-weight: bold;
    color: #333;
    min-width: 100px;
}

.control-group input,
.control-group select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.control-group input[type="range"] {
    flex: 1;
    min-width: 200px;
}

.control-group input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.process-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.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;
    box-shadow: none;
}

/* 画布容器 */
.canvas-container {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
}

#textCanvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: crosshair;
}

.canvas-instructions {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

/* 结果区域 */
.result-area {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-header h3 {
    color: #333;
    font-size: 1.5rem;
}

.download-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.result-content {
    text-align: center;
}

.result-content canvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 10px;
}

/* 使用说明 */
.instructions {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.instructions h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
    color: #666;
    line-height: 1.6;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px;
        border-radius: 15px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .example-gallery {
        flex-direction: column;
        gap: 20px;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-group label {
        min-width: auto;
    }
    
    .control-group input,
    .control-group select {
        width: 100%;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .feature-card {
        padding: 15px;
    }
    
    .controls,
    .result-area,
    .instructions {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 10px;
    }
    
    .nav-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* 平板端适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .example-gallery {
        gap: 20px;
    }
    
    .example-item img {
        width: 180px;
        height: 135px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 隐藏元素 */
.hidden {
    display: none !important;
}
