/* ============================================
   小说连载网站 - PC端样式
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f5f5f5; color: #333; font-size: 14px; line-height: 1.6; }
a { color: #333; text-decoration: none; }
a:hover { color: #2f5d50; }
ul, ol { list-style: none; }
img { max-width: 100%; }

/* 头部 */
.header { background: #2f5d50; color: #fff; padding: 0; }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 20px; }
.logo { font-size: 24px; font-weight: bold; color: #fff; }
.logo:hover { color: #a8d5c2; }
.nav { display: flex; gap: 25px; }
.nav a { color: #ecf0f1; font-size: 15px; }
.nav a:hover, .nav a.active { color: #a8d5c2; }
.header-right { display: flex; align-items: center; gap: 15px; }
.header-right a { color: #ecf0f1; font-size: 13px; }
.header-right a:hover { color: #a8d5c2; }
.btn-admin { background: #a8d5c2; color: #2f5d50 !important; padding: 4px 12px; border-radius: 3px; font-size: 12px; }
.btn-admin:hover { background: #fff; color: #2f5d50 !important; }

/* 管理后台顶栏（深色，与前台墨绿顶栏明显区分） */
.header-admin { background: #1c2833; color: #fff; padding: 0; border-bottom: 3px solid #e67e22; }
.header-admin .header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 20px; }
.admin-badge { background: #e67e22; color: #fff; font-size: 13px; font-weight: bold; padding: 4px 10px; border-radius: 3px; letter-spacing: 2px; flex-shrink: 0; }
.admin-logo { color: #fff; font-size: 16px; font-weight: bold; white-space: nowrap; }
.admin-logo:hover { color: #e67e22; }
.header-admin .header-right a { color: #b0bec5; font-size: 13px; }
.header-admin .header-right a:hover { color: #fff; }
.back-front { border: 1px solid #46586a; padding: 4px 10px; border-radius: 3px; }
.back-front:hover { border-color: #e67e22; color: #e67e22 !important; }

/* 主体 */
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
.main-content { min-height: 500px; }

/* 搜索栏 */
.search-bar { max-width: 1200px; margin: 0 auto; padding: 15px 20px; }
.search-form { display: flex; gap: 10px; max-width: 500px; }
.search-form input { flex: 1; padding: 8px 15px; border: 2px solid #ddd; border-radius: 4px; font-size: 14px; outline: none; }
.search-form input:focus { border-color: #3498db; }
.search-form button { padding: 8px 20px; background: #3498db; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.search-form button:hover { background: #2980b9; }

/* 榜单区域 */
.section { margin-bottom: 30px; }
.section-title { font-size: 20px; font-weight: bold; color: #2c3e50; border-left: 4px solid #2f5d50; padding-left: 12px; margin-bottom: 15px; }
.book-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.book-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.2s; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.book-card .cover { width: 100%; height: 200px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: bold; }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card .info { padding: 12px; }
.book-card .title { font-size: 16px; font-weight: bold; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-card .author { font-size: 12px; color: #999; margin-bottom: 5px; }
.book-card .desc { font-size: 12px; color: #666; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-card .meta { font-size: 11px; color: #999; margin-top: 8px; display: flex; justify-content: space-between; }

/* 列表样式 */
.book-list { background: #fff; border-radius: 8px; }
.book-list-item { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid #f0f0f0; }
.book-list-item:last-child { border-bottom: none; }
.book-list-item .rank { width: 30px; height: 30px; text-align: center; line-height: 30px; border-radius: 50%; font-size: 14px; font-weight: bold; margin-right: 15px; background: #eee; color: #666; }
.book-list-item:nth-child(1) .rank { background: #2f5d50; color: #fff; }
.book-list-item:nth-child(2) .rank { background: #e67e22; color: #fff; }
.book-list-item:nth-child(3) .rank { background: #f39c12; color: #fff; }
.book-list-item .title { flex: 1; font-size: 15px; }
.book-list-item .title a:hover { color: #2f5d50; }
.book-list-item .author { width: 100px; font-size: 13px; color: #999; text-align: center; }
.book-list-item .category { width: 60px; font-size: 12px; color: #3498db; background: #ebf5fb; padding: 2px 8px; border-radius: 3px; text-align: center; }
.book-list-item .views { width: 80px; font-size: 12px; color: #999; text-align: right; }

/* 书籍详情页 */
.book-detail { background: #fff; border-radius: 8px; padding: 30px; display: flex; gap: 30px; }
.book-detail .cover { width: 200px; height: 280px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 36px; font-weight: bold; flex-shrink: 0; overflow: hidden; }
.book-detail .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-detail .info { flex: 1; }
.book-detail .title { font-size: 26px; font-weight: bold; margin-bottom: 10px; }
.book-detail .meta { font-size: 13px; color: #999; margin-bottom: 15px; }
.book-detail .meta span { margin-right: 20px; }
.book-detail .desc { font-size: 14px; color: #666; line-height: 1.8; margin-bottom: 20px; }
.book-detail .actions { display: flex; gap: 15px; }
.btn { display: inline-block; padding: 10px 25px; border-radius: 5px; font-size: 14px; cursor: pointer; border: none; transition: 0.2s; }
.btn-primary { background: #2f5d50; color: #fff; }
.btn-primary:hover { background: #24483d; color: #fff; }
.btn-secondary { background: #3498db; color: #fff; }
.btn-secondary:hover { background: #2980b9; color: #fff; }
.btn-outline { background: #fff; color: #666; border: 1px solid #ddd; }
.btn-outline:hover { border-color: #2f5d50; color: #2f5d50; }
.btn-sm { padding: 5px 15px; font-size: 12px; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }

/* 章节列表 */
.chapter-section { background: #fff; border-radius: 8px; padding: 25px; margin-top: 20px; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chapter-grid a { padding: 8px 12px; font-size: 13px; color: #666; border-bottom: 1px dashed #eee; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-grid a:hover { color: #2f5d50; }

/* 阅读页 */
.reader-header { background: #2f5d50; padding: 15px 0; }
.reader-header .inner { max-width: 900px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.reader-header a { color: #ecf0f1; font-size: 14px; }
.reader-header a:hover { color: #a8d5c2; }
.reader-body { max-width: 900px; margin: 30px auto; padding: 30px; background: #fff; border-radius: 8px; min-height: 400px; }
.reader-body .chapter-title { text-align: center; font-size: 22px; font-weight: bold; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.reader-body .chapter-content { font-size: 16px; line-height: 2; color: #333; text-indent: 2em; }
.reader-body .chapter-content p { margin-bottom: 15px; }
.reader-nav { max-width: 900px; margin: 20px auto; padding: 0 20px; display: flex; justify-content: space-between; }
.reader-nav a { padding: 10px 25px; background: #fff; border-radius: 5px; border: 1px solid #ddd; }
.reader-nav a:hover { border-color: #2f5d50; color: #2f5d50; }

/* 表单 */
.form-page { max-width: 400px; margin: 60px auto; background: #fff; border-radius: 8px; padding: 40px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.form-page h2 { text-align: center; margin-bottom: 30px; font-size: 22px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: #555; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; outline: none; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #3498db; }
.form-group textarea { height: 120px; resize: vertical; }
.form-submit { text-align: center; }
.form-submit .btn { width: 100%; }
.form-link { text-align: center; margin-top: 15px; font-size: 13px; color: #999; }
.form-link a { color: #3498db; }

/* 个人中心 */
.profile-header { background: #fff; border-radius: 8px; padding: 25px; margin-bottom: 20px; display: flex; align-items: center; gap: 20px; }
.profile-header .avatar { width: 60px; height: 60px; border-radius: 50%; background: #3498db; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: bold; }
.profile-header .info h3 { font-size: 18px; margin-bottom: 5px; }
.profile-header .info p { font-size: 13px; color: #999; }
.profile-tabs { display: flex; gap: 0; background: #fff; border-radius: 8px; margin-bottom: 20px; overflow: hidden; }
.profile-tabs a { flex: 1; text-align: center; padding: 12px; font-size: 14px; border-bottom: 2px solid transparent; }
.profile-tabs a.active { color: #2f5d50; border-bottom-color: #2f5d50; }
.profile-tabs a:hover { background: #f9f9f9; }

/* 书架 */
.bookshelf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* 后台/管理 */
.admin-layout { display: flex; gap: 20px; }
.admin-sidebar { width: 200px; background: #fff; border-radius: 8px; padding: 15px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; padding: 10px 20px; font-size: 14px; color: #555; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #f0f0f0; color: #2f5d50; }
.admin-content { flex: 1; background: #fff; border-radius: 8px; padding: 25px; }
.admin-content h2 { font-size: 18px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.table th { background: #f9f9f9; font-weight: bold; color: #666; }
.table tr:hover { background: #fafafa; }
.status-tag { padding: 2px 8px; border-radius: 3px; font-size: 11px; }
.status-normal { background: #e8f8f5; color: #27ae60; }
.status-banned { background: #fdedec; color: #e74c3c; }
.status-pending { background: #fef9e7; color: #f39c12; }
.status-passed { background: #e8f8f5; color: #27ae60; }
.status-rejected { background: #fdedec; color: #e74c3c; }

/* 分页 */
.pagination { text-align: center; padding: 20px 0; }
.page-link { display: inline-block; padding: 6px 14px; margin: 0 3px; border: 1px solid #ddd; border-radius: 3px; font-size: 13px; }
.page-link.current { background: #2f5d50; color: #fff; border-color: #2f5d50; }
.page-link:hover { border-color: #2f5d50; color: #2f5d50; }
.page-link.current:hover { color: #fff; }

/* 页脚 */
.footer { text-align: center; padding: 30px; color: #999; font-size: 12px; margin-top: 30px; }

/* 分类筛选 */
.category-filter { background: #fff; border-radius: 8px; padding: 15px 20px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.category-filter a { padding: 5px 15px; border-radius: 20px; font-size: 13px; background: #f5f5f5; color: #666; }
.category-filter a:hover, .category-filter a.active { background: #2f5d50; color: #fff; }

/* 提示消息 */
.alert { padding: 12px 15px; border-radius: 5px; margin-bottom: 15px; font-size: 14px; }
.alert-success { background: #e8f8f5; color: #27ae60; }
.alert-error { background: #fdedec; color: #e74c3c; }
.alert-info { background: #ebf5fb; color: #3498db; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty p { font-size: 16px; margin-bottom: 15px; }

/* 角色徽章 */
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 3px; font-size: 12px; }
.role-admin { background: #fdedec; color: #e74c3c; }
.role-reader { background: #ebf5fb; color: #3498db; }

/* 响应式微调（仅PC） */
@media (max-width: 1200px) {
    .book-grid { grid-template-columns: repeat(4, 1fr); }
    .bookshelf-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .book-grid { grid-template-columns: repeat(3, 1fr); }
    .chapter-grid { grid-template-columns: repeat(2, 1fr); }
}
