* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #6278dc 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
    min-height: calc(100vh - 200px);
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

.input-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.file-actions {
    display: flex;
    gap: 10px;
}

#inputArea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

#inputArea:focus {
    outline: none;
    border-color: #667eea;
}

.export-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.export-section h2 {
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.export-modes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.export-mode {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.export-mode:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.export-mode.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.mode-icon {
    font-size: 2em;
}

.mode-title {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 1em;
}

.mode-desc {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

.btn-large {
    width: 100%;
    padding: 18px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 239, 125, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.format-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.format-section h2 {
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.format-actions {
    display: flex;
    gap: 8px;
}

.format-settings {
    max-height: 400px;
    overflow-y: auto;
}

.format-group {
    margin-bottom: 20px;
}

.format-group h3 {
    font-size: 1em;
    color: #555;
    margin-bottom: 12px;
    font-weight: 600;
}

.format-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.format-row label {
    font-size: 14px;
    color: #666;
}

.format-row input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.format-row input:focus {
    outline: none;
    border-color: #667eea;
}

.heading-format {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 80px;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.heading-format label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.heading-format input {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
}

.list-mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: #667eea;
}

.radio-option input[type="radio"] {
    margin-top: 4px;
}

.radio-option span {
    font-size: 14px;
    color: #333;
    display: block;
}

.radio-option small {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: block;
}

.preview-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-section h2 {
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.file-management {
    display: flex;
    gap: 8px;
}

.preview-content {
    flex: 1;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    min-height: 400px;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.preview-placeholder p {
    margin-bottom: 10px;
}

.preview-hint {
    font-size: 0.9em;
    color: #bbb;
}

.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.preview-content h1 {
    font-size: 2em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.preview-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.preview-content h3 {
    font-size: 1.25em;
}

.preview-content p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #333;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.preview-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.preview-content th,
.preview-content td {
    border: 1px solid #dee2e6;
    padding: 10px;
    text-align: left;
}

.preview-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.preview-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.preview-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.preview-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.preview-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin: 20px 0;
    color: #666;
    font-style: italic;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

.files-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.files-section h3 {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.files-list {
    max-height: 200px;
    overflow-y: auto;
}

.files-empty {
    text-align: center;
    color: #999;
    padding: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.file-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.file-time {
    font-size: 12px;
    color: #999;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.help-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.help-section h3 {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.help-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.help-link:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.help-icon {
    font-size: 1.5em;
}

.help-qq {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #333;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .preview-content {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .export-modes {
        gap: 8px;
    }
    
    .export-mode {
        padding: 12px;
    }
    
    .heading-format {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
