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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: #2d3748;
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 0.95em;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #4a5568;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.upload-area:hover {
    border-color: #2d3748;
    background: #edf2f7;
}

.upload-area.dragover {
    border-color: #2d3748;
    background: #e2e8f0;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-area p {
    font-size: 1.1em;
    color: #2d3748;
    margin-bottom: 5px;
}

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

#fileInput {
    display: none;
}

.editor-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

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

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.editor-header h3 {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

#markdownInput {
    width: 100%;
    height: 500px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#markdownInput:focus {
    outline: none;
    border-color: #4a5568;
}

.preview-area {
    width: 100%;
    height: 500px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow-y: auto;
    background: white;
}

#previewArea {
    width: 100%;
    height: 500px;
    overflow-y: auto;
    background: white;
}

.preview-area h1, .preview-area h2, .preview-area h3,
.preview-area h4, .preview-area h5, .preview-area h6 {
    margin: 15px 0 10px 0;
    color: #333;
    font-weight: 600;
}

.preview-area h1 { font-size: 2em; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.preview-area h2 { font-size: 1.5em; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.preview-area h3 { font-size: 1.25em; }
.preview-area h4 { font-size: 1.1em; }
.preview-area h5 { font-size: 1em; }
.preview-area h6 { font-size: 0.9em; }

.preview-area p {
    margin: 10px 0;
    line-height: 1.8;
}

.preview-area ul, .preview-area ol {
    margin: 10px 0;
    padding-left: 30px;
}

.preview-area li {
    margin: 5px 0;
    line-height: 1.6;
}

.preview-area code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

.preview-area pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.preview-area pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.preview-area blockquote {
    border-left: 4px solid #4a5568;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

.preview-area a {
    color: #4a5568;
    text-decoration: none;
}

.preview-area a:hover {
    text-decoration: underline;
}

.preview-area table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

.preview-area th, .preview-area td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.preview-area th {
    background: #f7fafc;
    font-weight: 600;
}

.preview-area img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 4px;
}

.convert-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

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

.btn-primary {
    background: #4a5568;
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.batch-section {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

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

.batch-header h3 {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.batch-list {
    max-height: 300px;
    overflow-y: auto;
}

.batch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #4a5568;
}

.batch-item-name {
    flex: 1;
    font-weight: 500;
}

.batch-item-status {
    margin-right: 15px;
    font-size: 0.9em;
}

.status-pending {
    color: #ffc107;
}

.status-success {
    color: #28a745;
}

.status-error {
    color: #dc3545;
}

.batch-item-actions {
    display: flex;
    gap: 5px;
}

.error-section {
    background: #fff3f3;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

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

.error-header h3 {
    font-size: 1.1em;
    color: #dc3545;
    font-weight: 600;
}

.error-list {
    max-height: 300px;
    overflow-y: auto;
}

.error-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #dc3545;
}

.error-item-title {
    font-weight: 600;
    color: #dc3545;
    margin-bottom: 5px;
}

.error-item-message {
    color: #666;
    font-size: 0.9em;
}

footer {
    background: #f7fafc;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

@media (max-width: 1200px) {
    .editor-section {
        grid-template-columns: 1fr;
    }

    .convert-actions {
        padding: 20px 0;
    }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

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