:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1800px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-container {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    padding: 40px;
    margin-bottom: 30px;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--secondary-color);
}

.form-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    background-color: #e0e7ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.form-title {
    font-size: 1.6rem;
    color: var(--text-primary);
}

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

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--secondary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.required::after {
    content: " *";
    color: var(--danger-color);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s;
    background-color: var(--bg-white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

.btn {
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.preview-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    padding: 30px;
    text-align: center;
}

.preview-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.book-preview {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 25px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-light);
    min-width: 250px;
}

.preview-cover {
    width: 150px;
    height: 200px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
}

.preview-title-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preview-author {
    color: var(--text-secondary);
}

.preview-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-top: 20px;
    display: none;
    align-items: center;
    gap: 10px;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

.word-count-display {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-public {
    background-color: #d1fae5;
    color: #065f46;
}

.status-private {
    background-color: #fef3c7;
    color: #92400e;
}

.content-type-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.type-text {
    background-color: #dbeafe;
    color: #1e40af;
}

.type-code {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.type-mixed {
    background-color: #fce7f3;
    color: #db2777;
}

.version-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--secondary-color);
    color: var(--text-secondary);
}

/* TinyMCE 编辑器样式调整 */
.tox-tinymce {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border-color) !important;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .form-container {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 10px;
    }

    .form-container {
        padding: 15px;
    }
}