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

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

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

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-link {
    display: inline-flex;
    text-decoration: none;
}

.social-icon {
    width: 24px;
    height: 24px;
}

.about-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.subtitle {
    max-width: 700px;
    margin: 0 auto;
    color: #555;
    font-size: 16px;
}

/* Converter Container */
.converter-container {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

/* Input Section */
.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #333;
}

.upload-area {
    width: 100%;
    border: 2px dashed #333;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background-color: transparent;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.upload-area.drag-over {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: #000;
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.upload-area p {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #555;
}

.plus-icon {
    font-weight: bold;
}

.or-divider {
    text-align: center;
    margin: 10px 0;
    color: #888;
    position: relative;
}

.or-divider::before, .or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: #ddd;
}

.or-divider::before {
    left: 0;
}

.or-divider::after {
    right: 0;
}

.code-input-container {
    position: relative;
    width: 100%;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-family: monospace;
    font-size: 14px;
    background-color: white;
}

.secondary-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background-color: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
}

.secondary-btn:hover {
    color: #333;
}

/* Size Controls */
.size-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.03);
}

.size-control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-control-item input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.size-control-item label {
    font-size: 14px;
    color: #555;
}

/* Optimize Button */
.optimize-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.optimize-btn:hover {
    background-color: #555;
}

/* Output Section */
.output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 调整结果容器的样式 */
.result-container {
    width: 100%;
    height: 400px; /* 增加高度 */
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* 添加滚动条以适应大图 */
    background-color: #f9f9f9;
    margin-bottom: 20px;
}

/* 调整结果图片的样式 */
.result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持图片比例并完整显示 */
}
    border: 1px solid #ddd;
    border-radius: 8px;
    height: 400px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background-color: white;
    overflow: hidden;
    padding: 10px;
}

.placeholder-text {
    color: #888;
    text-align: center;
}

.result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.download-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
    align-self: flex-start;
}

.download-btn:hover {
    background-color: #555;
}

.download-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Footer */
footer {
    text-align: center;
    color: #888;
    margin-top: 40px;
    font-size: 14px;
}

/* 微信二维码弹窗 */
.qrcode-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.qrcode-modal.active {
    display: flex;
}

.qrcode-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 300px;
    position: relative;
    text-align: center;
}

.qrcode-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.qrcode-title {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}

.close-btn:hover {
    color: #333;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    margin: 0 5px;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #4a6cf7;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #4a6cf7;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 生成器样式 */
.generator-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-weight: 500;
    color: #333;
}

.control-group input,
.control-group select,
.control-group textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.control-group textarea {
    min-height: 100px;
    resize: vertical;
}

.code-output-container {
    margin-top: 15px;
    position: relative;
}

.code-output-container textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

/* 加载指示器 */
.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.loading-indicator.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 108, 247, 0.2);
    border-radius: 50%;
    border-top-color: #4a6cf7;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.notification p {
    margin: 5px 0;
}

.notification .close-btn {
    background-color: #721c24;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 12px;
}

.notification .close-btn:hover {
    background-color: #5a171d;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-links {
        gap: 10px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    .converter-container {
        flex-direction: column;
    }
    
    .upload-area {
        padding: 20px 15px;
    }
    
    .upload-icon {
        width: 50px;
        height: 50px;
    }
}

/* AI生成SVG样式 */
.ai-generator {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-input-container textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}

.ai-result-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-generated-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-svg-code-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-svg-code-container textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    resize: vertical;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group button {
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button-group button:hover {
    background-color: #45a049;
}

.button-group button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#ai-copy-svg-btn {
    background-color: #2196F3;
}

#ai-copy-svg-btn:hover {
    background-color: #0b7dda;
}

#ai-download-svg-btn {
    background-color: #4CAF50;
}

#ai-download-svg-btn:hover {
    background-color: #45a049;
}

#ai-download-png-btn {
    background-color: #ff9800;
}

#ai-download-png-btn:hover {
    background-color: #e68a00;
}
