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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color-dark);
    font-weight: bold;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-sizing: border-box;
    background-color: var(--input-background-color);
    color: var(--text-color-dark);
}

.form-group textarea {
    resize: vertical;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Markdown 编辑器样式 */
.editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.format-btn, .preview-btn {
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.format-btn:hover, .preview-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.preview-btn {
    margin-left: auto;
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.preview-btn:hover {
    background: #218838;
    border-color: #1e7e34;
}

.editor-container {
    position: relative;
    border: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    border-top: none;
}

.editor-container textarea {
    border: none;
    border-radius: 0 0 8px 8px;
    margin: 0;
}

.preview-content {
    min-height: 200px;
    padding: 10px;
    background: white;
    border-radius: 0 0 8px 8px;
    line-height: 1.6;
}

.editor-help {
    margin-top: 8px;
    color: #6c757d;
    font-size: 12px;
}

.editor-content {
    position: relative;
}

.editor-content textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: none;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.editor-content textarea:focus {
    outline: none;
}

#preview {
    display: none;
    padding: 15px;
    min-height: 300px;
    background: #fff;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

.editor-help {
    background: #f8f9fa;
    padding: 10px 15px;
    border-top: 1px solid #e1e5e9;
    font-size: 12px;
    color: #6c757d;
}

/* Markdown 内容样式 */
.markdown-content {
    line-height: 1.7;
    color: #2c3e50;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 1.2em 0 0.6em 0;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
}

.markdown-content h1 { font-size: 1.6em; }
.markdown-content h2 { font-size: 1.4em; }
.markdown-content h3 { font-size: 1.2em; }
.markdown-content h4 { font-size: 1.1em; }

.markdown-content p {
    margin: 0.6em 0;
    line-height: 1.6;
}

.markdown-content strong {
    font-weight: 600;
    color: #2c3e50;
}

.markdown-content em {
    font-style: italic;
    color: #495057;
}

.markdown-content code {
    background: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #e83e8c;
    border: 1px solid #e9ecef;
}

.markdown-content blockquote {
    border-left: 4px solid #007bff;
    padding: 0.4em 0.8em;
    margin: 0.8em 0;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
    color: #495057;
    font-style: italic;
}

.markdown-content ul {
    margin: 0.8em 0;
    padding-left: 1.5em;
}

.markdown-content li {
    margin: 0.2em 0;
    line-height: 1.5;
}

.markdown-content a {
    color: #007bff;
    text-decoration: none;
}

.markdown-content a:hover {
    color: #0056b3;
    text-decoration: underline;
}

#preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

#preview h1 {
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 10px;
}

#preview h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 8px;
}

#preview h3 {
    font-size: 1.25em;
}

#preview p {
    margin-bottom: 16px;
}

#preview code {
    background: #f6f8fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 85%;
}

#preview blockquote {
    margin: 0;
    padding: 0 16px;
    color: #6a737d;
    border-left: 4px solid #dfe2e5;
}

#preview ul, #preview ol {
    padding-left: 30px;
    margin-bottom: 16px;
}

#preview li {
    margin-bottom: 4px;
}

#preview a {
    color: #0366d6;
    text-decoration: none;
}

#preview a:hover {
    text-decoration: underline;
}

#preview img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
}

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

/* 图片上传样式 */
.image-upload-container {
    margin-top: 8px;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-area:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.upload-area.drag-over {
    border-color: #007bff;
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-placeholder {
    color: #6c757d;
}

.upload-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #007bff;
}

.upload-placeholder p {
    margin: 10px 0 5px 0;
    font-size: 16px;
    font-weight: 500;
}

.upload-placeholder small {
    font-size: 12px;
    color: #999;
}

.image-preview-container {
     display: flex;
     gap: 15px;
     flex-wrap: wrap;
 }

.image-preview-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 200px;
}

.image-preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-info {
    padding: 8px 12px;
    background: #f8f9fa;
}

.image-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size {
    font-size: 11px;
    color: #6c757d;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s ease;
}

.remove-image:hover {
    background: #dc3545;
}

.insert-image {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 3px;
}

.insert-image:hover {
    background: #28a745;
}

/* 上传进度样式 */
.image-upload-progress {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 200px;
    padding: 15px;
}

.upload-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.upload-filename {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    word-break: break-all;
}

.upload-status {
    font-size: 11px;
    color: #007bff;
}

.upload-progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% {
        width: 0%;
        opacity: 0.5;
    }
    50% {
        width: 70%;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0.8;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .editor-toolbar {
        padding: 8px;
        gap: 6px;
    }
    
    .format-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .preview-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .editor-content textarea {
        min-height: 250px;
        padding: 12px;
        font-size: 13px;
    }
    
    #preview {
        padding: 12px;
        min-height: 250px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-area i {
        font-size: 36px;
    }
    
    .upload-area h3 {
        font-size: 16px;
    }
    
    .image-preview-container {
        gap: 10px;
        padding: 15px;
    }
    
    .image-preview-item {
        width: 150px;
    }
    
    .image-preview-item img {
        height: 100px;
    }
    
    .image-upload-progress {
        width: 150px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .preview-btn {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .image-preview-container {
        justify-content: center;
    }
    
    .image-preview-item,
    .image-upload-progress {
        width: 100%;
        max-width: 200px;
    }
}