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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

main.container {
    padding: 40px 20px;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #2980b9;
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: #27ae60;
    background-color: #e8f5e8;
}

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

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

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

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

/* 设置区域 */
.settings-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.size-inputs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group label {
    min-width: 80px;
    font-weight: 500;
    color: #555;
}

.input-group input,
.input-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    width: 100px;
    background: white;
}

.input-group input[type="range"] {
    width: 150px;
}

/* 模式选择器样式 */
.mode-selector {
    margin-bottom: 25px;
}

.mode-selector h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-btn:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

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

.mode-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.mode-text {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.mode-btn small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.mode-btn.active small {
    opacity: 1;
}

/* 缩放信息显示 */
.scale-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.scale-info p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}

.scale-info span {
    font-weight: 500;
    color: #2c3e50;
}

/* 提示信息样式 */
.size-hint {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 5px;
}

.size-hint small {
    color: #1976d2;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 输入框错误状态 */
.input-error {
    border-color: #f44336 !important;
    background-color: #ffebee !important;
}

.input-warning {
    border-color: #ff9800 !important;
    background-color: #fff8e1 !important;
}

.input-group span {
    color: #666;
    font-size: 0.9rem;
}

/* 编辑区域 */
.editor-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.editor-container {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.image-container {
    position: relative;
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: #f9f9f9;
}

#canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px solid #3498db;
    background: rgba(52, 152, 219, 0.1);
    cursor: move;
    pointer-events: all;
    min-width: 50px;
    min-height: 50px;
}

.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #3498db;
    border: 2px solid white;
    border-radius: 50%;
}

.crop-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.crop-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.crop-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.crop-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.crop-handle.n { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.crop-handle.s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.crop-handle.w { left: -5px; top: 50%; transform: translateY(-50%); cursor: w-resize; }
.crop-handle.e { right: -5px; top: 50%; transform: translateY(-50%); cursor: e-resize; }

.preview-container {
    flex: 0 0 300px;
    text-align: center;
}

.preview-container h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#previewCanvas {
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    max-width: 100%;
    height: auto;
}

.preview-info {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9rem;
}

.preview-info p {
    margin-bottom: 5px;
    color: #666;
}

/* 控制按钮 */
.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

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

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    main.container {
        padding: 20px 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .editor-container {
        flex-direction: column;
    }

    .preview-container {
        flex: none;
    }

    .size-inputs {
        flex-direction: column;
        gap: 10px;
    }

    .control-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* SEO内容响应式 */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .features-section h2,
    .how-to-use h2,
    .faq-section h2 {
        font-size: 1.5rem;
    }

    .how-to-use {
        padding: 20px;
    }

    .steps-list li {
        padding: 15px;
        margin-left: 20px;
    }

    .seo-content {
        padding: 40px 0 30px;
        margin-top: 40px;
    }

    /* 模式选择响应式 */
    .mode-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mode-btn {
        padding: 15px 12px;
    }

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

    .mode-text {
        font-size: 1rem;
    }

    /* 评论区域响应式 */
    .reviews-section h2 {
        font-size: 1.5rem;
    }

    .review-item {
        padding: 20px;
        margin-bottom: 15px;
    }

    .avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-right: 12px;
    }

    .review-content {
        margin-left: 52px;
    }

    .review-content p {
        font-size: 0.95rem;
    }
}

/* Header样式 */
header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 30px 0;
    margin-bottom: 0;
    text-align: center;
}

header h1 {
    margin-bottom: 10px;
    color: white;
    font-size: 2.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* SEO内容区域样式 */
.seo-content {
    background: #f8f9fa;
    padding: 60px 0 40px;
    margin-top: 60px;
    border-top: 1px solid #e9ecef;
}

.features-section {
    margin-bottom: 50px;
}

.features-section h2,
.how-to-use h2,
.faq-section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
}

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

.feature-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.feature-item h3 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

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

/* 使用步骤样式 */
.how-to-use {
    margin-bottom: 50px;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.steps-list {
    max-width: 600px;
    margin: 0 auto;
    padding-left: 0;
    counter-reset: step-counter;
}

.steps-list li {
    list-style: none;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    counter-increment: step-counter;
    position: relative;
}

.steps-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.steps-list strong {
    color: #2c3e50;
}

/* FAQ样式 */
.faq-section {
    margin-bottom: 50px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.faq-item h3 {
    background: #3498db;
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.1rem;
}

.faq-item p {
    padding: 15px 20px;
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* 用户评价样式 */
.reviews-section {
    margin-bottom: 50px;
}

.reviews-section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 2rem;
}

.reviews-list {
    max-width: 900px;
    margin: 0 auto;
}

.review-item {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.user-details h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.date {
    color: #666;
    font-size: 0.9rem;
}

.review-content {
    margin-left: 65px;
}

.rating {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.review-content p {
    color: #555;
    line-height: 1.7;
    margin: 0;
    font-size: 1rem;
}

/* 版权信息样式 */
.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #ddd;
    color: #666;
}

.copyright p {
    margin-bottom: 10px;
}

.copyright a {
    color: #3498db;
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

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

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