/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
canvas {
    width: 100%;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.language-selector {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.language-selector label {
    font-size: 0.9rem;
    margin: 0;
}

.language-selector select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
}

.header-content h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* 主要内容样式 */
.main-content {
    padding: 50px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    align-items: start;
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.panel h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #667eea;
    position: relative;
    padding-bottom: 10px;
}

.panel h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* 步骤样式 */
.step {
    margin-bottom: 40px;
    position: relative;
}

.step:last-child {
    margin-bottom: 0;
}

.step-title {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.step-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.step-title span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

/* 文件上传样式 */
.file-upload {
    margin-bottom: 15px;
}

.file-upload-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.file-upload-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.file-upload input[type="file"] {
    display: none;
}

.file-name {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    color: #666;
    font-size: 0.9rem;
    min-height: 46px;
    display: flex;
    align-items: center;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-value {
    font-family: monospace;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* 范围控制 */
.range-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-control input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.range-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-family: monospace;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    min-width: 50px;
    text-align: center;
}

/* 格式选择器 */
.format-selector {
    display: flex;
    gap: 10px;
}

.format-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-option:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.format-option.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

/* 刷新控制 */
.refresh-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-control {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#refresh {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

#refresh:hover:not(:disabled) {
    background: #5a67d8;
}

#refresh:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 预览容器 */
.preview-container {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#graph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    text-align: center;
    color: #999;
    padding: 40px;
}

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

.preview-placeholder p {
            margin-bottom: 10px;
            font-size: 1.1rem;
        }

        .download-hint {
            text-align: center;
            color: #666;
            font-size: 0.9rem;
            margin-top: 15px;
            padding: 10px;
            background: rgba(0,0,0,0.02);
            border-radius: 8px;
        }

/* 特性部分 */
.features {
    background: white;
    padding: 60px 0;
    text-align: center;
}

.features h2 {
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: #333;
}

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

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #667eea;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

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

.feature-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
}

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

/* 页脚样式 */
footer {
    background: #333;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 20px;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

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

.footer-copyright {
    font-size: 0.9rem;
    color: #aaa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .header-content h1 {
        font-size: 2.2rem;
    }

    .header-subtitle {
        font-size: 1rem;
    }

    .language-selector {
        position: static;
        margin-bottom: 20px;
        justify-content: center;
    }

    .panel {
        padding: 20px;
    }

    .format-selector {
        flex-direction: column;
    }

    .refresh-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .color-picker,
    .range-control {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}