/* 全局样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* 后台管理样式 */
.admin-sidebar {
    background: #343a40;
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: #adb5bd;
    border-radius: 0.375rem;
    margin: 0.25rem 0;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: #495057;
}

.admin-header {
    background: #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-bottom: 1px solid #dee2e6;
}

/* 小说卡片 */
.novel-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.novel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 章节列表 */
.chapter-list {
    max-height: 400px;
    overflow-y: auto;
}

.chapter-item {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.chapter-item:hover {
    background-color: #f8f9fa;
}

.chapter-item:last-child {
    border-bottom: none;
}

/* 阅读界面 */
.reading-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dee2e6;
}

.reading-content {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #212529;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.reading-content p {
    margin-bottom: 1.5rem;
    text-indent: 2em;
}

/* 评论样式 */
.comment-card {
    border-left: 4px solid #007bff;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.comment-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.reply-card {
    border-left: 3px solid #28a745;
    margin-left: 2rem;
    margin-top: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .reading-content {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .reply-card {
        margin-left: 1rem;
    }
    
    .novel-card {
        margin-bottom: 1rem;
    }
}

/* 按钮增强 */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* 表单优化 */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 工具提示 */
.tooltip-inner {
    background-color: #212529;
    border-radius: 0.375rem;
}

/* 图片样式 */
.chapter-image {
    text-align: center;
    margin: 2rem 0;
}

.chapter-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 分页控件 */
.pagination-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.pagination-controls .btn {
    margin: 0 0.25rem;
    border-radius: 1.5rem;
}

/* 书签指示器 */
.bookmark-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #ffc107;
    font-size: 1.25rem;
}

/* 状态徽章 */
.status-badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* 进度条 */
.reading-progress {
    height: 4px;
    background: linear-gradient(90deg, #007bff 0%, #007bff var(--progress, 0%), #e9ecef var(--progress, 0%), #e9ecef 100%);
    transition: all 0.3s ease;
}

/* 夜间模式 */
.dark-mode {
    background-color: #1a1a1a;
    color: #e9ecef;
}

.dark-mode .card {
    background-color: #2d3748;
    border-color: #4a5568;
}

.dark-mode .reading-content {
    background-color: #1a1a1a;
    color: #e9ecef;
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid orange;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: orange; }
}
