: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-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.logo-text h1 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-actions {
    display: flex;
    gap: 15px;
}

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

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 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);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.search-section {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s;
}

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

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

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

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group select, .filter-group input {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-white);
}

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

.chapters-count {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 12px;
    border-radius: 6px;
    background-color: var(--secondary-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

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

/* 表格视图样式 */
.chapters-table {
    width: 100%;
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 80px 120px 1fr 120px 100px 100px 120px 120px 120px 120px 120px;
    gap: 15px;
    padding: 15px 20px;
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table-row {
    display: grid;
    grid-template-columns: 80px 120px 1fr 120px 100px 100px 120px 120px 120px 120px 120px;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--secondary-color);
    transition: all 0.3s;
}

.table-row:hover {
    background-color: var(--bg-light);
}

.table-cell {
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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);
}

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

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

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background-color: var(--bg-light);
    color: var(--text-light);
    border: none;
}

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

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

.delete-btn:hover {
    color: var(--danger-color);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #cbd5e1;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 8px 12px;
    border-radius: var(--radius);
    background-color: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

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

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

/* 响应式设计 */
@media (max-width: 1400px) {
    .table-header, .table-row {
        grid-template-columns: 80px 120px 1fr 120px 100px 100px 120px 120px 120px;
    }

    .table-header .hide-on-large,
    .table-row .hide-on-large {
        display: none;
    }
}

@media (max-width: 1200px) {
    .table-header, .table-row {
        grid-template-columns: 80px 120px 1fr 120px 100px 120px 120px 120px;
    }

    .table-header .hide-on-medium,
    .table-row .hide-on-medium {
        display: none;
    }
}

@media (max-width: 992px) {
    .table-header, .table-row {
        grid-template-columns: 80px 1fr 120px 100px 120px 120px;
    }

    .table-header .hide-on-small,
    .table-row .hide-on-small {
        display: none;
    }

    .search-bar {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .table-header, .table-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }

    .table-header .hide-on-mobile,
    .table-row .hide-on-mobile {
        display: none;
    }

    .user-actions {
        width: 100%;
        justify-content: space-between;
    }
}

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

    .table-header, .table-row {
        grid-template-columns: 1fr 1fr;
    }

    .view-options {
        flex-direction: column;
    }

    .filters {
        grid-template-columns: 1fr;
    }
}