/* tudou theme - 极简 CSS, 自定义类名 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px; line-height: 1.6; color: #333; background: #f5f5f5;
}
a { color: #333; text-decoration: none; }
a:hover { color: #8c4000; text-decoration: underline; }
img { max-width: 100%; vertical-align: middle; border: 0; }
ul { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 10px; }

/* 顶部 ===================================================== */
.topwrap { background: #fff; border-bottom: 1px solid #eee; }
.brand-row {
  display: flex; align-items: center; flex-wrap: wrap;
  padding: 18px 0; gap: 20px;
}
.brand { flex: 0 0 auto; }
.brand h1 { font-size: 22px; color: #8c4000; font-weight: 700; }
.brand h1 a { color: inherit; }
.user-acts { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.user-acts a { font-size: 13px; }
.s-bar { flex: 1 1 320px; max-width: 380px; margin-left: auto; }
.s-bar form { display: flex; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.s-bar input { flex: 1; border: 0; padding: 7px 10px; font-size: 13px; outline: none; }
.s-btn {
  background: #8c4000; color: #fff; border: 0;
  padding: 0 14px; cursor: pointer; font-size: 13px;
}
.s-btn:hover { background: #6b3000; }

/* 主导航 */
.main-nav { background: #8c4000; }
.main-nav .container { display: flex; flex-wrap: wrap; }
.main-nav a {
  display: block; padding: 12px 16px; color: #fff;
  font-size: 14px;
}
.main-nav .mn-act a, .main-nav a:hover {
  background: #6b3000; text-decoration: none;
}

/* 通用区块 ================================================ */
.section {
  background: #fff; margin-top: 10px;
  padding: 14px 16px; border: 1px solid #eee;
}
.section > h2 {
  font-size: 16px; color: #8c4000;
  padding-bottom: 8px; border-bottom: 2px solid #8c4000;
  margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline;
}
.section > h2 .more { font-size: 12px; font-weight: normal; }

/* 书图文列表（首页 / 分类页）============================== */
.book-grid > li, .book-grid > div.bg-item {
  display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 1px dashed #eee;
}
.book-grid > li:last-child, .book-grid > div.bg-item:last-child { border-bottom: 0; }
.bcover { flex: 0 0 75px; }
.bcover img { width: 75px; height: 100px; object-fit: cover; border-radius: 2px; }
.bmeta { flex: 1; min-width: 0; }
.bmeta h3 { font-size: 14px; margin-bottom: 4px; }
.bmeta p { color: #666; font-size: 13px; line-height: 1.8; }
.bmeta .syn { color: #444; font-size: 13px; line-height: 1.6; margin-top: 6px; }
.tag-on { background: #5cb85c; color: #fff; padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.tag-off { background: #5bc0de; color: #fff; padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.tag-cat { color: #0062ff; margin-right: 4px; }
/* 状态徽章（block 模板不支持 if/else, 用 data-s + CSS 伪元素分流） */
.st::before {
  display: inline-block; padding: 2px 6px; color: #fff;
  border-radius: 3px; font-size: 11px;
}
/* 兼容两种取值：数字 0/1 (fengmian/xs_phb 直接 SQL) 或中文 (sort 页) */
.st[data-s="1"]::before, .st[data-s="已完结"]::before { content: '已完结'; background: #5cb85c; }
.st[data-s="0"]::before, .st[data-s="连载中"]::before { content: '连载中'; background: #5bc0de; }

/* 阅读历史页 ============================================== */
.history-list { padding: 0; }
.history-list li {
  display: flex; align-items: center;
  padding: 12px 4px; border-bottom: 1px dashed #eee;
  font-size: 13px;
}
.history-list li:first-child {
  background: #fafafa; border-bottom: 2px solid #e8e8e8;
  font-weight: 600; color: #555; padding: 8px 4px;
}
.history-list .s1 { flex: 3; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.history-list .s1 a { color: #333; }
.history-list .s1 a:hover { color: #8c4000; }
.history-list .s2 { flex: 1.5; color: #888; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list .s3 { flex: 2.5; color: #555; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list .s5 {
  flex: 0 0 auto; display: flex; gap: 6px; white-space: nowrap;
}
.history-list .s5 a {
  padding: 4px 12px; border-radius: 3px; font-size: 12px;
  border: 1px solid #8c4000; color: #8c4000;
}
.history-list .s5 a:hover {
  background: #8c4000; color: #fff; text-decoration: none;
}
.history-list .s5 .xsdel { border-color: #ddd; color: #999; cursor: pointer; }
.history-list .s5 .xsdel:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }
/* 隐藏 yuedu.js 写死的"保存至会员书架"（不要登录功能） */
.history-list .s5 .a2 { display: none !important; }
.history-list .iconfont { display: none; }
.empty-tip { text-align: center; padding: 50px 0; color: #888; }
.empty-tip p { font-size: 15px; margin-bottom: 14px; }

@media (max-width: 768px) {
  .history-list li { flex-wrap: wrap; }
  .history-list li:first-child { display: none; }
  .history-list .s1 { flex: 100%; font-weight: 600; font-size: 14px; }
  .history-list .s2 { flex: auto; }
  .history-list .s3 { flex: auto; }
  .history-list .s5 { flex: 100%; margin-top: 6px; }
}

/* 搜索结果页 ============================================== */
.search-box-large {
  margin-bottom: 14px; padding: 12px;
  background: #fafafa; border-radius: 4px;
}
.search-box-large form { display: flex; max-width: 480px; }
.search-box-large input {
  flex: 1; padding: 8px 12px; border: 1px solid #ccc;
  border-radius: 3px 0 0 3px; font-size: 14px; outline: none;
}
.search-box-large .s-btn { border-radius: 0 3px 3px 0; }
/* 无 li 时降级为纯文本提示 */
.book-grid.search-list:not(:has(li)) {
  padding: 30px 16px; text-align: center;
  color: #888; font-size: 14px; background: #fafafa; border-radius: 4px;
}

/* 更新表（首页 / info 推荐）=============================== */
.update-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.update-table tr:nth-child(odd) { background: #fafafa; }
.update-table td { padding: 7px 10px; border: 0; }
.upd-c .tag-cat { font-weight: 500; }

/* 书详情页 ================================================ */
.detail { display: flex; gap: 18px; }
.detail .bcover { flex: 0 0 150px; }
.detail .bcover img { width: 150px; height: 200px; }
.detail-meta { flex: 1; min-width: 0; }
.detail-meta h1 { font-size: 22px; color: #8c4000; margin-bottom: 8px; }
.detail-meta p { color: #555; margin: 3px 0; }
.taglist { width: auto;height: 20px;overflow: hidden;}
.taglist a {
  display: inline-block; background: #f0f0f0;
  color: #555; padding: 2px 8px; border-radius: 3px;
  font-size: 12px; margin: 2px 4px 2px 0;
}
.taglist a:hover { background: #8c4000; color: #fff; text-decoration: none; }
.synopsis {
  margin-top: 10px; padding: 10px 12px;
  background: #fafafa; border-left: 3px solid #8c4000;
  color: #444; line-height: 1.7;
}
.detail-acts { margin-top: 12px; }
.btn-act {
  display: inline-block; background: #8c4000; color: #fff;
  padding: 7px 14px; border-radius: 3px; font-size: 13px; margin-right: 6px;
}
.btn-act:hover { background: #6b3000; color: #fff; text-decoration: none; }

/* 章节列表 ================================================ */
.cataloglist ul {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.cataloglist li { overflow: hidden; }
.cl-item {
  display: block; padding: 6px 8px;
  font-size: 13px; color: #555;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
  border-bottom: 1px dotted #eee;
}
.cl-item:hover { color: #8c4000; }
.bk-title-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid #eee; margin-bottom: 10px;
}
.bk-title-row h2 { color: #8c4000; font-size: 16px; }

/* 阅读页 ================================================== */
.read-bg { background: #f5f5f5; padding-top: 10px; }
.read-bg .content { background: #fff; padding: 24px 32px; border: 1px solid #eee; }
.read-ctrl {
  text-align: center; padding-bottom: 12px;
  border-bottom: 1px dashed #eee; margin-bottom: 12px;
}
.ctrl-btn {
  display: inline-block; padding: 5px 12px; margin: 0 3px;
  background: #fff; border: 1px solid #ddd; border-radius: 3px;
  cursor: pointer; font-size: 13px; color: #555;
}
.ctrl-btn:hover { background: #f5f5f5; }
.ctrl-btn.act { background: #8c4000; color: #fff; border-color: #8c4000; }
.ctrl-fs { font-size: 13px; color: #888; margin: 0 6px 0 18px; }

/* 护眼模式（body 加 .eye-on） */
body.eye-on { background: #c7edcc; }
body.eye-on .read-bg { background: #c7edcc; }
body.eye-on .read-bg .content { background: #c7edcc; }
body.eye-on .read-body { color: #4a4a4a; }
.read-head { text-align: center; padding-bottom: 14px; border-bottom: 1px solid #eee; }
.read-title h1 { font-size: 22px; color: #333; margin: 12px 0 6px; }
.read-meta { font-size: 12px; color: #999; }
.read-meta span { margin: 0 6px; }
.read-body { font-size: 16px; line-height: 1.9; color: #333; padding: 20px 0; }
.read-body p { margin: 0 0 0.9em; text-indent: 2em; }
.read-nav {
  display: flex; justify-content: center; align-items: center;
  gap: 12px; padding: 14px 0; border-top: 1px solid #eee;
}
.read-nav a {
  padding: 6px 18px; border: 1px solid #ddd; border-radius: 3px;
  color: #555; font-size: 13px;
}
.read-nav a:hover {
  background: #8c4000; color: #fff; border-color: #8c4000; text-decoration: none;
}
.read-nav span { color: #ccc; }

/* 分类筛选 ================================================ */
.filterbar { background: #fff; padding: 10px 16px; border: 1px solid #eee; }
.pillrow {
  display: flex; flex-wrap: wrap;
  border-bottom: 1px dashed #eee; padding: 6px 0;
}
.pillrow:last-child { border-bottom: 0; }
.pill {
  display: inline-block; padding: 4px 10px; margin: 2px;
  border-radius: 3px; font-size: 13px; color: #666;
}
.pill:hover, .pill-act {
  background: #8c4000; color: #fff !important; text-decoration: none;
}

/* 分页 ==================================================== */
.pager { padding: 16px 0; text-align: center; }
.pager a, .pager > li > a, .pager span {
  display: inline-block; padding: 6px 12px; margin: 0 2px;
  border: 1px solid #ddd; color: #555; font-size: 13px;
  border-radius: 3px;
}
.pager .act, .pager > .active > a {
  background: #8c4000; color: #fff; border-color: #8c4000;
}
.pager a:hover { background: #f0f0f0; text-decoration: none; }

/* 底部 ==================================================== */
.botwrap { margin-top: 18px; background: #fff; border-top: 2px solid #8c4000; padding: 16px 0; }
.flink { padding: 8px 0; font-size: 13px; }
.flink a { margin: 0 8px; color: #666; }
.copyr { text-align: center; padding: 10px 0; color: #888; font-size: 12px; }

/* 移动断点 ================================================ */
@media (max-width: 768px) {
  .brand-row { gap: 10px; padding: 12px 0; }
  .s-bar { flex: 1 1 100%; order: 3; max-width: none; }
  .main-nav .container { overflow-x: auto; flex-wrap: nowrap; }
  .main-nav a { padding: 10px 12px; white-space: nowrap; }
  .cataloglist ul { grid-template-columns: repeat(2, 1fr); }
  .detail { flex-direction: column; }
  .detail .bcover { align-self: center; }
  .read-bg .content { padding: 14px 16px; }
  .read-body { font-size: 15px; }
  .hidden-xs { display: none !important; }
  .update-table .hidden-xs { display: none !important; }
}
