/* ============================================
   现代化小说阅读器样式
   ============================================ */

:root {
    /* 颜色变量 - 日间模式 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    
    /* 尺寸变量 */
    --header-height: 56px;
    --toolbar-height: 70px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

/* 护眼模式 */
[data-theme="sepia"] {
    --bg-primary: #f4ecd8;
    --bg-secondary: #ebe4d0;
    --bg-tertiary: #e2d9c5;
    --text-primary: #5b4636;
    --text-secondary: #6d5749;
    --text-muted: #8a7968;
    --border: #d4c9b5;
}

/* 夜间模式 */
[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #e8e8e8;
    --text-secondary: #b8b8c8;
    --text-muted: #7a7a8a;
    --accent: #818cf8;
    --border: #2a2a4e;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ============================================
   App 容器
   ============================================ */
.app-container {
    width: 100%;
    height: 100%;
    max-width: 768px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ============================================
   页面通用样式
   ============================================ */
.page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    overflow: hidden;
}

.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 768px;
    margin: 0 auto;
    height: var(--header-height);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-placeholder {
    width: 40px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:active {
    background: var(--bg-tertiary);
}

.page-content {
    padding: calc(var(--header-height) + 16px) 16px calc(var(--safe-area-bottom) + 20px);
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   阅读页面
   ============================================ */
.reading-page {
    display: flex;
    flex-direction: column;
}

/* 阅读顶部栏 */
.reading-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 768px;
    margin: 0 auto;
    height: var(--header-height);
    background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-primary) 80%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.reading-header.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.header-left, .header-right {
    width: 48px;
    display: flex;
    justify-content: center;
}

.header-center {
    flex: 1;
    text-align: center;
    overflow: hidden;
}

.chapter-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    padding: 0 8px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--bg-tertiary);
}

/* 进度条 */
.progress-bar-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    max-width: 768px;
    margin: 0 auto;
    height: 3px;
    background: var(--bg-tertiary);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.progress-bar-container.visible {
    opacity: 1;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* 阅读内容区域 */
.reading-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: calc(var(--header-height) + 8px) 0 calc(var(--toolbar-height) + var(--safe-area-bottom) + 8px);
}

.content-wrapper {
    padding: 0 20px;
    max-width: 100%;
}

/* 文章内容 */
.article-content {
    font-size: 17px;
    line-height: 1.9;
    color: var(--text-primary);
    text-align: justify;
    word-break: break-word;
    letter-spacing: 0.3px;
    transition: font-size 0.3s ease, opacity 0.25s ease;
}

.article-content.page-turning {
    opacity: 0;
}

.article-content p {
    margin-bottom: 1.2em;
    text-indent: 2em;
}

.article-content p:first-child {
    margin-top: 0;
}

.article-content p:last-child {
    margin-bottom: 0;
}

/* 重置内嵌样式 */
.article-content * {
    all: unset;
    display: inline;
}

.article-content p {
    display: block;
    margin-bottom: 1.2em;
    text-indent: 2em;
}

/* 欢迎屏幕 */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    color: var(--text-muted);
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.welcome-screen h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-screen p {
    font-size: 15px;
    color: var(--text-muted);
}

/* 页码指示器 */
.page-indicator {
    position: fixed;
    bottom: calc(var(--toolbar-height) + var(--safe-area-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
    box-shadow: 0 2px 12px var(--shadow);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.page-indicator.visible {
    opacity: 1;
}

/* ============================================
   底部工具栏
   ============================================ */
.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 768px;
    margin: 0 auto;
    height: calc(var(--toolbar-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bottom-toolbar.show {
    transform: translateY(0);
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    padding: 6px 8px;
    min-width: 48px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.toolbar-btn:active {
    background: var(--bg-tertiary);
    transform: scale(0.95);
}

.toolbar-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.toolbar-btn:disabled:active {
    background: transparent;
    transform: none;
}

.toolbar-btn svg {
    flex-shrink: 0;
}

.toolbar-btn span {
    font-size: 11px;
    font-weight: 500;
}

/* 播放按钮特殊样式 */
.toolbar-btn.play-btn,
.toolbar-btn.pause-btn {
    color: var(--accent);
}

.toolbar-btn.play-btn svg,
.toolbar-btn.pause-btn svg {
    width: 28px;
    height: 28px;
}

/* ============================================
   快捷设置栏
   ============================================ */
.quick-settings {
    position: fixed;
    bottom: calc(var(--toolbar-height) + var(--safe-area-bottom));
    left: 0;
    right: 0;
    max-width: 768px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    z-index: 99;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: none;
}

.quick-settings.show {
    display: block;
    transform: translateY(0);
}

.quick-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.quick-settings-row:last-child {
    margin-bottom: 0;
}

.setting-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 字体大小按钮 */
.font-size-buttons {
    display: flex;
    gap: 8px;
}

.font-size-btn {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.font-size-btn:active {
    transform: scale(0.95);
}

.font-size-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* 主题按钮 */
.theme-buttons {
    display: flex;
    gap: 8px;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:active {
    transform: scale(0.95);
}

.theme-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* ============================================
   Toast 提示
   ============================================ */
.toast {
    position: fixed;
    bottom: calc(var(--toolbar-height) + var(--safe-area-bottom) + 80px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   搜索页面
   ============================================ */
.search-box {
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    margin-left: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:active {
    background: var(--accent-dark);
}

.divider-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 20px 0;
    position: relative;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 60px);
    height: 1px;
    background: var(--border);
}

.divider-text::before {
    left: 0;
}

.divider-text::after {
    right: 0;
}

.url-input-wrapper {
    display: flex;
    gap: 10px;
}

.url-input-wrapper input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.url-input-wrapper input:focus {
    border-color: var(--accent);
}

.load-btn {
    padding: 14px 24px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.load-btn:active {
    opacity: 0.8;
}

/* 搜索结果 */
.search-results {
    margin-top: 20px;
}

/* 结果容器 */
.results-container {
    padding-bottom: 20px;
}

.results-stats {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-stats svg {
    flex-shrink: 0;
}

/* 分类导航 */
.category-section {
    margin: 20px 0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding: 0 4px;
}

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

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 70px;
}

.category-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.category-btn:active {
    transform: translateY(0);
}

.category-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.category-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 推荐阅读 */
.recommend-section {
    margin: 24px 0;
}

.recommend-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.recommend-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recommend-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--shadow);
}

.recommend-item:active {
    transform: translateY(-2px);
}

.recommend-cover {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 600;
    color: white;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.recommend-cover .cover-text {
    display: block;
}

.recommend-info {
    padding: 8px;
}

.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 36px;
}

.recommend-author {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .recommend-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.book-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.book-item:active {
    transform: scale(0.98);
}

.book-cover {
    width: 70px;
    height: 94px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.book-cover-placeholder {
    width: 70px;
    height: 94px;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.book-cover-placeholder:hover {
    transform: scale(1.05);
}

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

.book-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author,
.book-status,
.book-update,
.book-latest {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-latest .latest-link {
    color: var(--accent);
}

/* ============================================
   设置页面
   ============================================ */
.settings-content {
    padding-bottom: 40px;
}

.settings-group {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 4px 0;
    margin-bottom: 20px;
}

.settings-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-group-title svg {
    color: var(--accent);
}

.setting-item {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}

.setting-item:first-of-type {
    border-top: none;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-name {
    font-size: 16px;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.setting-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
}

.setting-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle 开关 */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 32px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 32px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* 危险按钮 */
.danger-btn {
    width: 100%;
    padding: 14px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.danger-btn:active {
    background: #fecaca;
}

[data-theme="dark"] .danger-btn {
    background: rgba(220, 38, 38, 0.2);
}

/* ============================================
   目录弹窗
   ============================================ */
.catalog-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.catalog-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    width: 100%;
    max-width: 768px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.catalog-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:active {
    background: var(--bg-tertiary);
}

.catalog-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.chapter-list {
    padding: 0;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.chapter-item:active {
    background: var(--bg-secondary);
}

.chapter-number {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 14px;
    flex-shrink: 0;
}

.chapter-name {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ============================================
   加载动画
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-muted);
}

/* ============================================
   滚动条美化
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   响应式设计
   ============================================ */
@media (min-width: 768px) {
    .content-wrapper {
        padding: 0 40px;
    }
    
    .article-content {
        font-size: 18px;
        line-height: 2;
    }
    
    .toolbar-btn {
        min-width: 56px;
        padding: 8px 10px;
    }
    
    .toolbar-btn span {
        font-size: 11px;
    }
}

/* iOS 安全区域适配 */
@supports (padding: max(0px)) {
    .bottom-toolbar {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}
