/* ==========================================================================
   view 主题样式 theme-view.css
   --------------------------------------------------------------------------
   2026-11-08 补建：view 模板不引用 theme.css，但它的自定义布局类
   （welcome-banner、book-card、cate-header-card 等）在 Tabler 与
   /static/css/style.css（仅 321 字节，只定义了 .card-img-top 与
   .content img）里都没有定义，导致自定义层无样式。
   本文件只补自定义层；Tabler 负责基础组件。
   落点：public/static/css/theme-view.css，由 view/header.html 直接引用。
   ========================================================================== */

:root {
  --v-primary: #ff7d18;
  --v-primary-2: #ff9d2e;
  --v-green: #07c160;
  --v-blue: #1677ff;
  --v-text: #1f2430;
  --v-muted: #8a93a3;
  --v-border: #e8eaef;
  --v-bg: #f4f5f7;
  --v-radius: 10px;
}

body { background: var(--v-bg); color: var(--v-text); }
.page-body { padding-top: 0; padding-bottom: 24px; }

/* ---------- 导航 ---------- */
.navbar-modern { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; box-shadow: 0 2px 15px rgba(102,126,234,0.3); border-bottom: 0; }
.navbar-modern .navbar-brand a { font-size: 22px; font-weight: 700; color: #fff !important; text-decoration: none; letter-spacing: 1px; }
.navbar-modern .navbar-brand a:hover { color: #fff; }
.navbar-menu-modern { background: #fff; border-bottom: 1px solid var(--v-border); }
.navbar-menu-modern .nav-link { font-size: 15px; color: #333 !important; font-weight: 500; padding: 12px 16px !important; border-radius: 8px; margin: 0 2px; transition: all 0.2s; }
.navbar-menu-modern .nav-link:hover, .navbar-menu-modern .nav-item.active .nav-link { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff !important; }
.navbar-menu-modern .nav-link .icon { color: #667eea; }
.navbar-menu-modern .nav-link:hover .icon { color: #fff; }
.navbar-menu-modern .nav-link.show { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff !important; }
/* “更多”下拉按钮：图标离左边缘留点空 */
.navbar-menu-modern .nav-link.dropdown-toggle { padding-left: 20px; }
.navbar-menu-modern .nav-link .nav-link-icon { margin-right: 6px; }
.navbar-menu-modern .nav-link.show .icon { color: #fff; }

/* ---------- 欢迎横幅与搜索 ---------- */
.welcome-banner {
  background: linear-gradient(135deg, #fff3e6, #ffe1c2);
  border: 1px solid #ffe0bd; border-radius: var(--v-radius);
  padding: 24px 26px; margin-bottom: 20px;
}
.welcome-banner h2 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.welcome-banner p { margin: 0; font-size: 14px; color: #7a5a3a; }
.search-box-modern { display: flex; }
.search-box-modern input {
  height: 42px; padding: 0 14px 0 40px; border: 2px solid #eee;
  border-radius: 25px; outline: none; transition: all 0.3s;
}
.search-box-modern input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }
.search-box-modern button {
  height: 42px; padding: 0 18px; border: 0; border-radius: 0 8px 8px 0;
  background: var(--v-primary); color: #fff; font-weight: 700; cursor: pointer;
}

/* ---------- 分区与书卡 ---------- */
.category-section { margin-bottom: 24px; }
.section-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-title { font-size: 20px; font-weight: 800; margin: 0; }
.more-btn { margin-left: auto; font-size: 13px; color: var(--v-muted); white-space: nowrap; }
.more-btn:hover { color: var(--v-primary); }
.col-lg-fifth { flex: 0 0 auto; width: 20%; }
.book-card { height: 100%; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.book-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.img-wrapper { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #f0f1f4; }
.book-card .card-img-top { width: 100%; height: 100%; object-fit: cover; }
.book-card .card-body { padding: 12px 14px 14px; }
.book-title { font-size: 14px; line-height: 1.5; font-weight: 600; margin: 0 0 8px; }
.book-title a {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--v-text);
}
.book-title a:hover { color: var(--v-primary); }
.book-meta { font-size: 12px; color: var(--v-muted); }
.price-tag {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  padding: 3px 9px; font-size: 13px; font-weight: 800; color: #fff;
  background: var(--v-primary); border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
/* 注：price-tag 在 5 处模板里都放在 img-wrapper 内（图片之后），
   必须 absolute 定位成右下角徽章；否则会被 img-wrapper 的 aspect-ratio +
   overflow:hidden 裁掉，卡片上看不到价格（2026-11-08 复验发现）。 */
.book-tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.book-tag-item { padding: 3px 10px; font-size: 12px; color: #555; background: #f4f5f7; border-radius: 999px; }
.book-tag-item:hover { color: #fff; background: var(--v-primary); }

/* ---------- 栏目标头 ---------- */
.cate-header-card {
  background: #fff; border: 1px solid var(--v-border); border-radius: var(--v-radius);
  padding: 20px 22px; margin-bottom: 20px;
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.cate-header-left { flex: 1 1 300px; min-width: 0; }
.cate-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.cate-desc { margin: 0; font-size: 13px; color: var(--v-muted); }
.cate-header-stats { display: flex; gap: 24px; }
/* 栏目头卡片右侧：搜索框 + 统计上下叠放 */
.cate-header-right { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; flex: 0 1 420px; min-width: 280px; }
.cate-header-right .banner-search { width: 100%; }
.cate-header-right .cate-header-stats { align-self: flex-end; }

.stat-item { text-align: center; }
.stat-num { display: block; font-size: 22px; font-weight: 800; color: var(--v-primary); }
.stat-label { font-size: 12px; color: var(--v-muted); }

/* ---------- 热门与标签 ---------- */
.hot-section { margin-bottom: 20px; }
.hot-text-list { display: flex; flex-direction: column; }
.hot-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--v-border); font-size: 14px; }
.hot-item:last-child { border-bottom: 0; }
.hot-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-price { color: var(--v-primary); font-weight: 700; white-space: nowrap; }
.rank-num {
  flex: 0 0 auto; width: 24px; height: 24px; margin-right: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #888; background: #f0f1f4; border-radius: 6px;
}
.tag-cloud-section, .recommend-section { background: #fff; border: 1px solid var(--v-border); border-radius: 16px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.tag-cloud-section { margin-bottom: 20px; }
.tag-cloud, .tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  padding: 5px 12px; font-size: 13px; color: #555;
  background: #fff; border: 1px solid var(--v-border); border-radius: 999px;
}
.tag-item:hover { color: #fff; background: var(--v-primary); border-color: var(--v-primary); }
.list-section { margin-bottom: 20px; }

/* ---------- 详情页 ---------- */
.detail-card { margin-bottom: 20px; }
.detail-title { font-size: 22px; line-height: 1.5; font-weight: 800; margin: 0 0 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--v-muted); margin-bottom: 14px; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.markdown { font-size: 15px; line-height: 1.9; overflow-wrap: break-word; }
.markdown img { max-width: 100%; height: auto; border-radius: 8px; }
.markdown p { margin: 0 0 12px; }

/* ---------- 购买与各类卡片 ---------- */
.download-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.download-card, .modern-card, .order-card, .query-card, .form-card {
  background: #fff; border: 1px solid var(--v-border);
  border-radius: var(--v-radius); padding: 20px; margin-bottom: 20px;
}
.page-header-modern { margin-bottom: 16px; }
.page-pretitle { font-size: 12px; color: var(--v-muted); text-transform: uppercase; letter-spacing: .04em; }
.page-title { font-size: 22px; font-weight: 800; margin: 2px 0 0; }
.filter-card { background: #fff; border: 1px solid var(--v-border); border-radius: var(--v-radius); padding: 16px 18px; margin-bottom: 20px; }
.service-notice-container { margin-bottom: 16px; }
.seo-summary { background: #fff7ed; border-left: 3px solid var(--v-primary); border-radius: var(--v-radius); padding: 12px 14px; margin-bottom: 16px; }
.seo-summary h4 { font-size: 15px; color: var(--v-text); margin-bottom: 6px; }
.seo-summary p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--v-text); }
.expire-warning { font-size: 13px; }
.carousel-modern img { border-radius: var(--v-radius); }

/* ---------- 页脚 ---------- */
.footer-modern { background: #fff; border-top: 1px solid var(--v-border); padding: 28px 0 20px; margin-top: 32px; text-align: center; }
.footer-brand { margin-bottom: 12px; }
.footer-brand a { font-size: 18px; font-weight: 800; color: var(--v-text); }
.footer-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: #666; }
.footer-links a:hover { color: var(--v-primary); }
.footer-copyright { font-size: 12px; color: var(--v-muted); }
.icp-info a { color: var(--v-muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  .col-lg-fifth { width: 33.333333%; }
}
@media (max-width: 768px) {
  .col-lg-fifth { width: 50%; }
  .welcome-banner { padding: 18px; }
  .welcome-banner h2 { font-size: 19px; }
  .detail-title { font-size: 19px; }
  .cate-header-card { padding: 16px; }
}

/* ---------- 首页聚合 home.html（2026-11-09 补） ---------- */
/* home.html 在 default 模板里，用 125style 同款网格 class；view 的 theme-view.css 原先没有，首页卡片无样式成单列。只补缺的，hot/rank 已有不动。 */
.hero-section { background: linear-gradient(135deg, #fff3e6, #ffe1c2); border-bottom: 1px solid #ffe0bd; padding: 28px 0; }
.hero-inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.hero-text h2 { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.hero-text p { margin: 0; font-size: 14px; color: #7a5a3a; }
.hero-search { margin-left: auto; }
.hero-search form { display: flex; }
.hero-search input { width: 320px; max-width: 60vw; height: 44px; padding: 0 14px; border: 1px solid #f0c9a0; border-right: 0; border-radius: 8px 0 0 8px; outline: none; }
.hero-search button { width: 52px; height: 44px; border: 0; border-radius: 0 8px 8px 0; background: var(--v-primary); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.doc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.loop-1-box { background: #fff; border: 1px solid var(--v-border); border-radius: var(--v-radius); overflow: hidden; height: 100%; transition: box-shadow .15s ease, transform .15s ease; }
.loop-1-box:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.loop-1-box-img { position: relative; aspect-ratio: 4 / 3; background: #f0f1f4; overflow: hidden; }
.loop-1-box-img .thumb { display: block; width: 100%; height: 100%; }
.loop-1-box-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loop-1-box-img .down { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 999px; opacity: 0; transition: opacity .15s ease; }
.loop-1-box:hover .down { opacity: 1; }
.loop-1-box .content { padding: 12px 14px 14px; }
.loop-1-box .content h2 { font-size: 14px; line-height: 1.5; margin: 0 0 8px; font-weight: 600; }
.loop-1-box .content h2 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--v-text); }
.loop-1-box .content h2 a:hover { color: var(--v-primary); }
.loop-1-box .meta { font-size: 12px; color: var(--v-muted); }
.loop-1-box .price { margin-top: 6px; font-size: 16px; font-weight: 800; color: var(--v-primary); }
@media (max-width: 1200px) { .doc-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 992px) { .doc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .doc-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .hero-search { margin-left: 0; width: 100%; } .hero-search input { flex: 1; } }

/* ---------- 页脚深色（2026-11-09：照搬老站 .footer-modern 深藏青渐变） ---------- */
.footer-modern { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); color: #fff; border-top: 0; }
.footer-modern .footer-brand a { color: #fff; }
.footer-modern .footer-links a { color: rgba(255,255,255,.8); }
.footer-modern .footer-links a:hover { color: #667eea; }
.footer-modern .footer-copyright { color: rgba(255,255,255,.6); }
.footer-modern .footer-copyright a { color: rgba(255,255,255,.8); }
.footer-modern .icp-info a { color: rgba(255,255,255,.8); }

/* ---------- 首页一比一复刻老站（2026-11-09：照搬 jsbaike style.css 原值） ---------- */
@media (min-width: 992px) {
  .row > .col-lg-fifth {
    flex: 0 0 20% !important;
    max-width: 20% !important;
    width: 20% !important;
  }
}
.book-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  height: 100%;
}
.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}
.book-card .img-wrapper {
  overflow: hidden;
  position: relative;
  aspect-ratio: 3 / 4;
}
.book-card .card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.book-card:hover .card-img-top {
  transform: scale(1.05);
}
.book-card .card-body {
  padding: 12px;
}
.book-card .book-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.book-card .book-title:hover {
  color: #667eea;
}
.book-card .book-meta {
  font-size: 11px;
  color: #999;
}
.book-card .book-meta .icon {
  width: 14px;
  height: 14px;
}
/* 横幅：老站原值。h1/h2 同款（老站 HTML 用 h1、CSS 写 h2，此处两写都对齐）。 */
.welcome-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 25px 30px;
  color: white;
  margin: 0 0 20px;
}
.welcome-banner h1, .welcome-banner h2 {
  color: white;
  margin-bottom: 8px;
}
.welcome-banner p {
  color: #fff;
  opacity: 0.9;
  margin: 0;
}
.welcome-banner .btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
}
.welcome-banner .btn:hover {
  background: white;
  color: #667eea;
}
/* 栏目容器：老站原值（分隔线回 #f0f0f0 原值，更多按钮 13px）。 */
.category-section {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.category-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}
.category-section .section-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
}
.category-section .section-title .icon {
  margin-right: 8px;
  color: #667eea;
}
.category-section .more-btn {
  font-size: 13px;
  color: #667eea;
  text-decoration: none;
  white-space: nowrap;
}
.category-section .more-btn:hover {
  color: #764ba2;
}

/* 首页 book-card 卡片：悬停“立即下载”（左下）。价格角标用文件已有的全局 .price-tag。 */
.book-card .img-wrapper .down { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 12px; color: #fff; background: rgba(0,0,0,.55); border-radius: 999px; opacity: 0; transition: opacity .15s ease; }
.book-card:hover .img-wrapper .down { opacity: 1; }
.book-card .img-wrapper .down .icon { width: 14px; height: 14px; }

/* 横幅搜索：输入框 + “搜索”按钮合并成一个搜索功能（白底胶囊输入框 + 白底紫字按钮） */
.banner-search { margin: 0; }
.banner-search-row { display: flex; align-items: center; gap: 10px; }
.banner-search-box { flex: 1; min-width: 0; display: flex; align-items: center; background: #fff; border-radius: 25px; height: 44px; padding: 0 8px 0 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.15); }
.banner-search-box input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 14px; color: #333; height: 100%; padding: 0 8px; }
.banner-search-box input::placeholder { color: #999; }
.banner-search-icon { flex: 0 0 auto; color: #667eea; display: flex; align-items: center; justify-content: center; }
.banner-search-submit { flex: 0 0 auto; height: 44px; padding: 0 22px; border: 0; border-radius: 25px; background: #fff; color: #667eea; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.15); white-space: nowrap; }
.banner-search-submit:hover { background: #f0f0ff; color: #764ba2; }

/* 手机端：栏目头右侧一行排布——搜索在前、资源数紧凑跟在后面 */
@media (max-width: 768px) {
  .cate-header-right { flex-direction: row; align-items: center; flex: 1 1 100%; min-width: 0; }
  .cate-header-right .banner-search { flex: 1; min-width: 0; }
  .cate-header-right .cate-header-stats { align-self: center; flex: 0 0 auto; }
  .cate-header-right .stat-item { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
  .cate-header-right .stat-num { font-size: 18px; }
  .cate-header-right .stat-label { font-size: 12px; }
}

/* 分页：居中对齐、白底圆角按钮、当前页紫蓝渐变 */
ul.pagination { justify-content: center; gap: 4px; flex-wrap: wrap; margin: 24px 0 0 !important; }
.pagination .page-item .page-link {
  min-width: 36px; height: 36px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 8px; color: #333; font-size: 14px; text-decoration: none;
}
.pagination .page-item .page-link:hover { border-color: #667eea; color: #667eea; background: #f0f0ff; }
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent; color: #fff; font-weight: 700;
}
.pagination .page-item.disabled .page-link { color: #bbb; background: #f8f9fa; cursor: not-allowed; }

/* ---------- 上一篇 / 下一篇（两卡并排，同 125） ---------- */
.pager{display:flex;gap:14px;margin-top:22px;}
.pager a{flex:1;min-width:0;background:#fff;border:1px solid var(--v-border);border-radius:var(--v-radius);padding:14px 18px;text-decoration:none;}
.pager .sub{font-size:12px;color:var(--v-muted);}
.pager .ttl{font-size:14px;color:var(--v-text);margin-top:4px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;}
.pager a:hover{border-color:var(--v-primary);background:#fff7ed;}
.pager .next{text-align:right;}
.pager a.disabled{pointer-events:none;opacity:.6;}
@media (max-width:768px){.pager{flex-direction:column;}.pager .next{text-align:left;}}
