:root {
    --primary: #e8590c;
    --primary-hover: #d14d07;
    --primary-light: #fff8f1;
    --text: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --bg: #fff;
    --bg-secondary: #f8f9fa;
    --bg-gray: #f5f5f5;
    --border: #eee;
    --border-dark: #ddd;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

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

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    padding: 0 4px 0 16px;
    height: 34px;
    background: var(--bg);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 160px;
    font-size: 13px;
    color: var(--text);
}

.search-box input::placeholder {
    color: #bbb;
}

.search-box button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-muted);
    font-size: 16px;
    display: flex;
    align-items: center;
}

.search-box button:hover {
    color: var(--primary);
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-dark);
}

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

.auth-links a {
    color: var(--text);
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: var(--primary);
}

.user-menu {
    position: relative;
    cursor: pointer;
}

.user-menu-name {
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-menu-name::after {
    content: '▾';
    font-size: 12px;
    color: var(--text-muted);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-width: 140px;
    overflow: hidden;
    z-index: 110;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    transition: background 0.15s;
}

.user-dropdown a:hover {
    background: var(--bg-gray);
    color: var(--primary);
}

.main-content {
    padding-top: 80px;
    min-height: calc(100vh - 140px);
}

.filter-section {
    padding: 30px 0;
}

.filter-row {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

.filter-label {
    width: 60px;
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 4px 16px;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.filter-option:hover {
    color: var(--primary);
}

.filter-option.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
}

.sort-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 25px;
    gap: 30px;
}

.sort-tab {
    padding-bottom: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
    background: none;
    border: none;
}

.sort-tab:hover {
    color: var(--primary);
}

.sort-tab.active {
    color: var(--primary);
    font-weight: 500;
}

.sort-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(540px, 1fr));
    gap: 25px;
}

.book-card {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.book-cover {
    width: 120px;
    height: 160px;
    flex-shrink: 0;
    border-radius: 4px;
    background: #f0f0f0;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.book-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.book-title a:hover {
    color: var(--primary);
}

.book-author {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.book-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.book-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-time {
    font-size: 12px;
    color: #ccc;
    margin-top: 8px;
}

.book-detail-page {
    padding-bottom: 40px;
}

.breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    margin: 0 6px;
}

.book-detail {
    display: flex;
    gap: 40px;
    padding: 30px 0;
}

.detail-left {
    display: flex;
    gap: 30px;
    flex: 1;
}

.detail-cover {
    width: 240px;
    flex-shrink: 0;
}

.detail-cover img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.detail-info {
    flex: 1;
    min-width: 0;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    padding: 2px 12px;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.tag.status {
    border-color: var(--primary);
    color: var(--primary);
}

.detail-wordcount {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 15px;
}

.detail-wordcount .count-num {
    font-size: 24px;
    font-weight: 600;
}

.detail-wordcount .count-unit {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 4px;
}

.detail-update {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 20px;
}

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

.author-card {
    width: 180px;
    flex-shrink: 0;
    text-align: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-gray);
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 10px;
}

.author-name {
    margin-top: 8px;
    font-size: 16px;
    font-weight: 600;
}

.author-bio {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.book-section {
    padding: 40px;
    margin-top: 30px;
    background: var(--bg);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.book-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.book-section .desc-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.volume-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.chapter-link {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    transition: color 0.2s;
}

.chapter-link:hover {
    color: var(--primary);
}

.reader-page {
    background: #d5d5d5;
    min-height: 100vh;
}

.reader-page .header {
    display: none;
}

.reader-header {
    padding: 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    background: var(--bg);
}

.reader-back {
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

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

.reader-login {
    color: var(--text);
    text-decoration: none;
}

.reader-login:hover {
    color: var(--primary);
}

.reader-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg);
    min-height: calc(100vh - 52px);
}

.reader-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 30px 80px;
}

.chapter-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.chapter-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.chapter-meta span {
    margin-right: 20px;
}

.reader-content {
    font-size: 17px;
    line-height: 2;
    color: var(--text);
}

.reader-content p {
    text-indent: 2em;
    margin-bottom: 15px;
}

.reader-toolbar {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}

.toolbar-btn {
    width: 56px;
    height: 56px;
    background: var(--bg);
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    gap: 4px;
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none;
}

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

.toolbar-btn svg {
    width: 22px;
    height: 22px;
}

.toolbar-btn .tb-icon {
    font-size: 20px;
    line-height: 1;
}

.next-chapter {
    text-align: center;
    padding: 40px 0;
}

.next-chapter-btn {
    display: inline-block;
    padding: 14px 80px;
    background: var(--primary);
    color: #fff;
    border-radius: 30px;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.2s;
}

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

.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

.chapter-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.chapter-nav a:hover {
    color: var(--primary);
}

.chapter-nav a.disabled {
    color: #ccc;
    pointer-events: none;
}

body.night-mode {
    background: #1a1a1a;
    color: #ccc;
}

.night-mode .header {
    background: #222;
    border-color: #333;
}

.night-mode .reader-header {
    background: #222;
    border-color: #333;
}

.night-mode .reader-wrapper {
    background: #1e1e1e;
}

.night-mode .reader-content {
    color: #b0b0b0;
}

.night-mode .chapter-title {
    color: #ddd;
}

.night-mode .toolbar-btn {
    background: #222;
    border-color: #444;
    color: #aaa;
}

.night-mode .toolbar-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.night-mode .reader-back,
.night-mode .reader-login {
    color: #ccc;
}

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 10px 30px;
    border-radius: 25px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-outline {
    display: inline-block;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-dark);
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: border-color 0.2s, color 0.2s;
}

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

.btn-small {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-danger {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    padding: 6px 16px;
    border-radius: 25px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c82333;
}

.auth-page {
    background: var(--bg-gray);
    min-height: 100vh;
    padding-top: 80px;
}

.auth-container {
    max-width: 420px;
    margin: 60px auto;
    padding: 40px;
    background: var(--bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text);
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg);
    color: var(--text);
}

.form-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.1);
}

.form-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.form-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.upload-page {
    padding: 30px 0;
}

.upload-page .page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed var(--border-dark);
    border-radius: 12px;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

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

.upload-text {
    font-size: 15px;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.upload-form {
    max-width: 600px;
    margin: 30px auto;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.file-info .file-icon {
    font-size: 24px;
}

.file-info .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info .file-size {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.file-info .file-remove {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
}

.file-info .file-remove:hover {
    color: #dc3545;
}

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

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

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

.progress-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.my-books {
    margin-top: 40px;
}

.my-books .section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.my-books-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.my-book-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
}

.my-book-cover {
    width: 60px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-gray);
}

.my-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-book-info {
    flex: 1;
    min-width: 0;
}

.my-book-info .title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-book-info .title a {
    color: var(--text);
    text-decoration: none;
}

.my-book-info .title a:hover {
    color: var(--primary);
}

.my-book-info .meta {
    font-size: 13px;
    color: var(--text-muted);
}

.my-book-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.bookshelf-page {
    padding: 30px 0;
}

.bookshelf-page .page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 30px;
}

.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

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

.shelf-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    background: var(--bg-gray);
    position: relative;
}

.shelf-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shelf-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    padding: 20px;
    word-break: break-all;
}

.shelf-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shelf-title a {
    color: var(--text);
    text-decoration: none;
}

.shelf-title a:hover {
    color: var(--primary);
}

.shelf-author {
    font-size: 12px;
    color: var(--text-muted);
}

.shelf-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state .empty-text {
    font-size: 15px;
    margin-bottom: 20px;
}

.alert {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    font-size: 14px;
    animation: slideDown 0.3s ease;
    white-space: nowrap;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg);
    border-radius: 12px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-close {
    float: right;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0;
}

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

.chapter-modal-list {
    max-height: 60vh;
    overflow-y: auto;
}

.chapter-modal-list a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
}

.chapter-modal-list a:hover {
    color: var(--primary);
}

.chapter-modal-list a.current {
    color: var(--primary);
    font-weight: 500;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.page-link {
    padding: 8px 14px;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-link.disabled {
    color: #ccc;
    pointer-events: none;
}

.footer {
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }

.auth-card {
    max-width: 420px;
    margin: 0 auto;
    padding: 40px;
    background: var(--bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.form-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.form-success {
    color: #28a745;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary);
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 12px;
    }

    .nav-links {
        display: none;
    }

    .search-box {
        display: none;
    }

    .header-divider {
        display: none;
    }

    .main-content {
        padding-top: 70px;
    }

    .container {
        padding: 0 15px;
    }

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

    .book-card {
        gap: 12px;
    }

    .book-cover {
        width: 90px;
        height: 120px;
    }

    .filter-section {
        padding: 15px 0;
    }

    .filter-row {
        flex-wrap: wrap;
    }

    .filter-label {
        width: 50px;
        font-size: 13px;
    }

    .filter-option {
        padding: 3px 10px;
        font-size: 13px;
    }

    .book-detail {
        flex-direction: column;
        gap: 20px;
    }

    .detail-left {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .detail-cover {
        width: 160px;
    }

    .detail-title {
        font-size: 22px;
        text-align: center;
    }

    .detail-tags {
        justify-content: center;
    }

    .detail-actions {
        justify-content: center;
    }

    .author-card {
        width: 100%;
    }

    .chapter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .book-section {
        padding: 20px;
    }

    .bookshelf-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .reader-toolbar {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        transform: none;
        flex-direction: row;
        width: 100%;
        background: var(--bg);
        border-top: 1px solid var(--border);
        padding: 6px 0;
        justify-content: space-around;
        gap: 0;
    }

    .toolbar-btn {
        width: auto;
        height: auto;
        padding: 6px 12px;
        border: none;
        border-radius: 0;
        font-size: 10px;
    }

    .toolbar-btn:hover {
        border-color: transparent;
    }

    .reader-body {
        padding: 30px 16px 100px;
    }

    .reader-content {
        font-size: 16px;
    }

    .next-chapter-btn {
        padding: 12px 60px;
    }

    .auth-container {
        margin: 30px auto;
        padding: 30px 20px;
    }

    .upload-area {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .detail-cover {
        width: 140px;
    }

    .book-cover {
        width: 80px;
        height: 106px;
    }
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    border-radius: 4px;
}

.cover-placeholder.large {
    font-size: 48px;
    border-radius: 8px;
}

.cover-placeholder.small {
    font-size: 18px;
}

.book-detail-left {
    flex-shrink: 0;
}

.book-detail-center {
    flex: 1;
    min-width: 0;
}

.book-detail-right {
    width: 180px;
    flex-shrink: 0;
}

.uploader-card {
    text-align: center;
}

.uploader-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-gray);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
}

.uploader-label {
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 12px;
}

.uploader-name {
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

.uploader-bio {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.section-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 20px;
}

.detail-word-count {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text);
}

.tag-status,
.tag.tag-status {
    border-color: var(--primary);
    color: var(--primary);
}

.detail-latest {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 20px;
}

.update-time {
    color: var(--text-muted);
    margin-left: 10px;
}

.page-heading {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 30px;
}

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

.upload-dropzone {
    border: 2px dashed var(--border-dark);
    border-radius: 12px;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone-inner p {
    margin-top: 15px;
    color: var(--text-secondary);
}

.upload-browse {
    color: var(--primary);
    cursor: pointer;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.dropzone-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-top: 10px;
}

.file-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}

.file-remove:hover {
    color: #dc3545;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
}

.required {
    color: #dc3545;
}

.my-books-section {
    margin-top: 40px;
}

.my-books-list {
    display: flex;
    flex-direction: column;
}

.my-book-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
}

.my-book-cover {
    width: 60px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-gray);
}

.my-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-book-info {
    flex: 1;
    min-width: 0;
}

.my-book-info h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.my-book-info h3 a {
    color: var(--text);
    text-decoration: none;
}

.my-book-info h3 a:hover {
    color: var(--primary);
}

.my-book-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

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

.shelf-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.shelf-card:hover {
    box-shadow: var(--shadow);
}

.shelf-card .shelf-cover {
    width: 80px;
    height: 107px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-gray);
    display: block;
}

.shelf-card .shelf-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shelf-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.shelf-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shelf-info h3 a {
    color: var(--text);
    text-decoration: none;
}

.shelf-info h3 a:hover {
    color: var(--primary);
}

.shelf-progress {
    font-size: 12px;
    color: var(--primary);
    margin-top: 4px;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 36px;
    font-size: 16px;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.reader-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 15px 30px;
}

.reader-header-divider {
    height: 1px;
    background: var(--border);
}

.reader-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg);
    min-height: calc(100vh - 52px);
}

.chapter-content {
    font-size: 17px;
    line-height: 2;
    color: var(--text);
}

.chapter-content p {
    text-indent: 2em;
    margin-bottom: 15px;
}

.reader-auth {
    font-size: 15px;
}

.reader-auth a {
    color: var(--text);
    text-decoration: none;
}

.reader-auth a:hover {
    color: var(--primary);
}

.font-size-panel {
    position: fixed;
    right: 100px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 51;
    background: var(--bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 12px;
}

.font-size-inner {
    display: flex;
    gap: 8px;
}

.fs-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    background: var(--bg);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

.book-status {
    color: var(--primary);
    margin-right: 10px;
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 20px;
}

.night-mode .chapter-content {
    color: #b0b0b0;
}

.night-mode .font-size-panel {
    background: #222;
    border-color: #444;
}

.night-mode .fs-btn {
    background: #333;
    border-color: #555;
    color: #aaa;
}

.night-mode .shelf-card {
    background: #222;
    border-color: #333;
}

.night-mode .upload-dropzone {
    border-color: #444;
}

.night-mode .reader-container {
    background: #1e1e1e;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .book-detail-right {
        display: none;
    }

    .font-size-panel {
        right: 10px;
        top: auto;
        bottom: 70px;
        transform: none;
    }
}
