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

:root {
    --primary: #4a90d9;
    --primary-dark: #3a7bc8;
    --success: #52c41a;
    --warning: #faad14;
    --error: #f5222d;
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border: #e8e8e8;
    --bg: #f5f5f5;
    --white: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

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

.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

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

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.main {
    padding: 30px 0;
    min-height: calc(100vh - 60px);
}

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

.page-header h2 {
    font-size: 1.8rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.novel-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.novel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.novel-cover {
    height: 160px;
    background: linear-gradient(135deg, var(--primary) 0%, #667eea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
}

.novel-info {
    padding: 20px;
}

.novel-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.novel-meta {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.novel-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novel-progress {
    margin-top: 15px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 5px;
}

.novel-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 10px;
}

.status-planning { background: #e6f7ff; color: var(--primary); }
.status-writing { background: #fff7e6; color: var(--warning); }
.status-completed { background: #f6ffed; color: var(--success); }
.status-paused { background: #f5f5f5; color: var(--text-light); }
.status-published { background: #d9f7be; color: var(--success); }

.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-light);
}

.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

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

.workspace-header {
    background: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.workspace-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-btn:hover {
    color: var(--primary);
}

.workspace-title {
    font-size: 1.5rem;
}

.workspace-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: var(--white);
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.3s;
}

.tab:hover {
    background: var(--bg);
}

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

.content-area {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.step-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.3s;
}

.step-header:hover {
    background: #eee;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.step-number.completed {
    background: var(--success);
}

.step-info {
    flex: 1;
}

.step-name {
    font-weight: 500;
}

.step-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.step-toggle {
    font-size: 1.25rem;
    color: var(--text-light);
    transition: transform 0.3s;
}

.step-item.open .step-toggle {
    transform: rotate(180deg);
}

.step-content {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.step-item.open .step-content {
    display: block;
}

.step-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
}

.step-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg);
    font-weight: 500;
}

.data-table tr:hover {
    background: var(--bg);
}

.table-actions {
    display: flex;
    gap: 10px;
}

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.role-protagonist { background: #fff7e6; color: var(--warning); }
.role-antagonist { background: #fff1f0; color: var(--error); }
.role-supporting { background: #e6f7ff; color: var(--primary); }
.role-mentor { background: #f6ffed; color: var(--success); }

.satisfaction-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.type-face-slap { background: #fff1f0; color: var(--error); }
.type-counterattack { background: #fff7e6; color: var(--warning); }
.type-show-off { background: #e6f7ff; color: var(--primary); }
.type-revenge { background: #f6ffed; color: var(--success); }
.type-harvest { background: #f9f0ff; color: #722ed1; }
.type-recognition { background: #f9f0ff; color: #722ed1; }

.type-rose { background: #草莓; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.data-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.data-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 500;
}

.card-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.card-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.card-field {
    margin-bottom: 10px;
}

.card-field-label {
    color: var(--text-light);
    font-size: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.editor-area {
    width: 100%;
    min-height: 500px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
}

.editor-area:focus {
    outline: none;
    border-color: var(--primary);
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.chapter-item:hover {
    border-color: var(--primary);
    background: #fafafa;
}

.chapter-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 20px;
}

.chapter-info {
    flex: 1;
}

.chapter-title {
    font-weight: 500;
}

.chapter-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.chapter-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.status-draft { background: #f5f5f5; color: var(--text-light); }
.status-writing { background: #fff7e6; color: var(--warning); }
.status-revising { background: #e6f7ff; color: var(--primary); }
.status-finished { background: #f6ffed; color: var(--success); }

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

.dashboard-card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.dashboard-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.dashboard-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.dashboard-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .novel-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}
