:root {
    --primary-color: #229934;
    --bg-color: #f5f6f8;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #888888;
    --border-color: #eeeeee;
}

body.dark-mode {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #cccccc;
    --text-muted: #888888;
    --border-color: #333333;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", sans-serif; background: var(--bg-color); color: var(--text-main); line-height: 1.6; transition: background 0.3s, color 0.3s; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary-color); }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Header */
.header-top { background: var(--primary-color); color: white; padding: 12px 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 40px; }
.search-bar { flex: 1; max-width: 300px; display: flex; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; margin: 0 30px; }
.search-bar input { border: none; background: transparent; color: white; padding: 8px 12px; flex: 1; outline: none; }
.search-bar input::placeholder { color: rgba(255,255,255,0.7); }
.search-bar button { background: transparent; border: none; padding: 8px 15px; color: white; cursor: pointer; }
.main-nav { display: flex; gap: 20px; font-size: 14px; align-items: center; }
.main-nav a { display: flex; align-items: center; gap: 5px; }
.main-nav a:hover { color: #a8e6b3; }
.user-actions { display: flex; align-items: center; gap: 10px; margin-left: 20px; font-size: 18px; }

.notice-bar { background: #fff8e1; color: #d84315; padding: 10px 15px; margin-top: 15px; border-radius: 4px; font-size: 14px; text-align: center; }

/* Homepage Hero */
.hero-section { text-align: center; padding: 40px 0; background: var(--card-bg); border-radius: 8px; margin-top: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.hero-section h1 { color: var(--primary-color); font-size: 36px; margin-bottom: 20px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.hero-section h1 span { font-size: 24px; color: var(--text-muted); font-weight: normal; }
.hero-search { display: inline-flex; width: 60%; max-width: 600px; border: 1px solid var(--border-color); border-radius: 30px; overflow: hidden; margin-bottom: 30px; background: var(--bg-color); }
.hero-search input { flex: 1; padding: 12px 20px; border: none; background: transparent; color: var(--text-main); outline: none; }
.hero-buttons { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.btn-green { background: var(--primary-color); color: white; padding: 10px 30px; border-radius: 4px; font-size: 15px; border: none; cursor: pointer; display: inline-block; text-align: center; }
.btn-green:hover { background: #1e7e2b; color: white; }
.btn-outline { border: 1px solid var(--primary-color); color: var(--primary-color); padding: 9px 29px; border-radius: 4px; font-size: 15px; display: inline-block; text-align: center; }
.btn-outline:hover { background: var(--primary-color); color: white; }

/* Sections */
.section { margin-top: 20px; background: var(--card-bg); padding: 20px; border-radius: 8px; }
.section-title { font-size: 18px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-top: 0; display: flex; align-items: center; }
.section-title span { color: var(--primary-color); margin-right: 8px; font-weight: bold; }
.book-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 15px; margin-top: 20px; }
.book-item { text-align: center; }
.book-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.book-item h3 { font-size: 14px; margin: 8px 0 4px; font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-item p { font-size: 12px; color: var(--text-muted); }

/* Reviews */
.reviews-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.review-card { border: 1px solid var(--border-color); padding: 15px; border-radius: 8px; background: var(--bg-color); display: flex; flex-direction: column; justify-content: space-between; }
.review-header { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 10px; }
.avatar { width: 24px; height: 24px; background: #ddd; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.username { font-weight: bold; }
.tag-jinghua { background: #ff9800; color: white; font-size: 11px; padding: 2px 6px; border-radius: 10px; }
.date { color: var(--text-muted); margin-left: auto; }
.review-content { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.5; }
.review-footer { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.book-link { color: var(--primary-color); }
.btn-reply { border: 1px solid var(--primary-color); color: var(--primary-color); padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.btn-reply:hover { background: var(--primary-color); color: white; }

/* Book Detail */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; }
.book-detail-wrapper { display: flex; gap: 20px; margin-top: 20px; }
.book-main { flex: 1; background: var(--card-bg); padding: 20px; border-radius: 8px; }
.book-sidebar { width: 300px; background: var(--card-bg); padding: 20px; border-radius: 8px; }
.book-info-box { display: flex; gap: 20px; margin-bottom: 20px; }
.cover-wrap { position: relative; width: 150px; flex-shrink: 0; }
.cover-wrap img { width: 100%; border-radius: 4px; }
.status-tag { position: absolute; top: 0; left: 0; background: var(--primary-color); color: white; font-size: 12px; padding: 2px 8px; border-radius: 4px 0 4px 0; }
.info-wrap h1 { font-size: 24px; margin-bottom: 10px; }
.info-wrap p { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.action-btns { margin-top: 15px; display: flex; gap: 10px; }

.book-tabs { border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; }
.tag { background: #e8f5e9; color: var(--primary-color); padding: 4px 10px; border-radius: 4px; font-size: 12px; }
.tab-head { display: flex; gap: 20px; font-size: 15px; }
.tab-head .active { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); padding-bottom: 9px; font-weight: bold; }

.chapter-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px; }
.chapter-list li a { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 15px; }
.chap-date { color: var(--text-muted); font-size: 13px; }

/* Rank List */
.book-sidebar h3 { font-size: 16px; border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; margin-bottom: 15px; }
.rank-list li { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px; }
.rank-num { width: 20px; height: 20px; background: #eee; color: #666; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 12px; margin-right: 10px; }
.rank-num.top3 { background: var(--primary-color); color: white; }
.rank-list li a { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-list li .status { font-size: 12px; color: var(--text-muted); margin-left: 10px; }

/* Reader Page */
.read-container { max-width: 900px; margin: 20px auto; background: var(--card-bg); padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.read-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.read-header h1 { font-size: 22px; }
.read-tools button { background: var(--bg-color); border: 1px solid var(--border-color); color: var(--text-main); padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; margin-left: 10px; }
.read-tools button:hover { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.read-content { font-size: 18px; line-height: 2; color: var(--text-main); min-height: 500px; }
.read-content p { margin-bottom: 20px; text-indent: 2em; }
.read-footer-nav { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.read-footer-nav a { padding: 10px 25px; background: var(--bg-color); border-radius: 4px; border: 1px solid var(--border-color); }
.read-footer-nav a:hover { background: var(--primary-color); color: white; border-color: var(--primary-color); }

/* List Page */
.filter-box { background: var(--card-bg); padding: 20px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.filter-row { display: flex; margin-bottom: 10px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-row span { color: var(--text-muted); width: 80px; }
.filter-row a { margin-right: 15px; }
.filter-row a.active { color: var(--primary-color); font-weight: bold; }

.novel-list { background: var(--card-bg); border-radius: 8px; padding: 20px; }
.novel-item { display: flex; gap: 20px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px dashed var(--border-color); }
.novel-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.novel-cover { width: 120px; flex-shrink: 0; }
.novel-cover img { width: 100%; border-radius: 4px; }
.novel-info { flex: 1; }
.novel-info h3 { font-size: 18px; margin-bottom: 8px; }
.novel-info .meta { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.novel-info .intro { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.novel-info .latest-chap { font-size: 13px; color: var(--primary-color); }
.novel-actions { display: flex; flex-direction: column; justify-content: center; gap: 10px; }

.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 30px; }
.pagination a { padding: 6px 12px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--card-bg); font-size: 14px; }
.pagination a.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

/* Footer */
.footer { text-align: center; padding: 30px 0; color: var(--text-muted); font-size: 13px; margin-top: 40px; border-top: 1px solid var(--border-color); }
.footer a { margin: 0 5px; }

@media (max-width: 768px) {
    .book-grid { grid-template-columns: repeat(4, 1fr); }
    .reviews-grid { grid-template-columns: 1fr; }
    .book-detail-wrapper { flex-direction: column; }
    .book-sidebar { width: 100%; }
    .novel-item { flex-direction: column; }
    .novel-cover { width: 100%; max-width: 150px; margin: 0 auto; }
    .novel-actions { flex-direction: row; justify-content: center; margin-top: 15px; }
}