/* ==========================================================================
   CPS 多站点前台样式  ·  5 layout × 10 palette = 50 模板
   - 基础组件
   - 移动端汉堡导航 / 搜索抽屉
   - 5 个 layout 各自风格化（起点 / 番茄 / 微信读书 / 七猫 / 单读）
   ========================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 14px; line-height: 1.6;
  background: var(--bg, #fff7f9); color: var(--text, #1f2937);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary); }

.front-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: #94a3b8; font-size: 12px; font-weight: normal; }

/* ==========================================================================
   Header（基础）
   ========================================================================== */
.front-header { background: var(--card); border-bottom: 1px solid #e5e7eb; position: relative; z-index: 50; }
.header-inner {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 20px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: 17px; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.front-nav {
  flex: 1; display: flex; gap: 4px; flex-wrap: wrap;
  align-items: center; min-width: 0;
}
.front-nav a {
  font-size: 14px; color: #4b5563;
  padding: 8px 12px; position: relative; border-radius: 6px;
  white-space: nowrap;
}
.front-nav a:hover { color: var(--primary); background: rgba(0,0,0,.03); }
.front-nav a.active { color: var(--primary); font-weight: 600; }
.front-nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: var(--primary); border-radius: 2px;
}

.front-search { display: flex; gap: 0; flex-shrink: 0; }
.front-search input {
  width: 220px; height: 36px; padding: 0 12px;
  border: 1px solid #e5e7eb; border-right: none;
  border-radius: 8px 0 0 8px; background: #f8fafc; font-size: 13px; outline: none;
}
.front-search input:focus { border-color: var(--primary); background: #fff; }
.front-search button {
  height: 36px; padding: 0 16px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; border-radius: 0 8px 8px 0;
  font-size: 13px; font-weight: 500;
}

/* 移动端：图标按钮、抽屉，PC 默认隐藏 */
.hdr-icon {
  display: none; background: transparent; border: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: 8px;
  align-items: center; justify-content: center; color: #4b5563;
}
.hdr-icon:hover { background: rgba(0,0,0,.05); color: var(--primary); }
.hdr-icon:active { background: rgba(0,0,0,.08); }
.hdr-mobile-search, .hdr-mobile-nav {
  border-top: 1px solid #eef0f4; padding: 14px 20px; background: var(--card);
}
.hdr-mobile-search form { display: flex; gap: 0; }
.hdr-mobile-search input {
  flex: 1; height: 40px; padding: 0 14px;
  border: 1px solid #e5e7eb; border-right: none;
  border-radius: 8px 0 0 8px; background: #f8fafc; font-size: 14px; outline: none;
}
.hdr-mobile-search input:focus { border-color: var(--primary); background: #fff; }
.hdr-mobile-search button {
  height: 40px; padding: 0 18px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; border-radius: 0 8px 8px 0;
  font-weight: 500;
}
.hdr-mobile-nav {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  max-height: calc(100vh - 64px); overflow-y: auto;
}
.hdr-mobile-nav a {
  padding: 12px 8px; text-align: center;
  background: #f8fafc; border-radius: 8px;
  font-size: 13px; color: #374151;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hdr-mobile-nav a.active,
.hdr-mobile-nav a:hover {
  background: var(--primary); color: #fff;
}

/* ---------- Header 风格变种 ---------- */
body.hdr-gradient .front-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
body.hdr-gradient .brand-name,
body.hdr-gradient .front-nav a { color: rgba(255,255,255,.95); }
body.hdr-gradient .brand-sub { color: rgba(255,255,255,.7); }
body.hdr-gradient .front-nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
body.hdr-gradient .front-nav a.active { color: #fff; }
body.hdr-gradient .front-nav a.active::after { background: #fff; }
body.hdr-gradient .brand-logo { background: rgba(255,255,255,.25); color: #fff; }
body.hdr-gradient .front-search input { background: rgba(255,255,255,.92); border-color: transparent; }
body.hdr-gradient .front-search button { background: rgba(0,0,0,.2); }
body.hdr-gradient .hdr-icon { color: rgba(255,255,255,.95); }
body.hdr-gradient .hdr-icon:hover { background: rgba(255,255,255,.15); color: #fff; }

body.hdr-banner .front-header {
  background: var(--card);
  border-bottom: 3px solid var(--primary);
}
body.hdr-banner .brand-name { color: var(--primary); font-size: 19px; }
body.hdr-banner .front-nav a.active::after { height: 3px; bottom: -2px; }

body.hdr-flat .front-header {
  background: var(--card);
  border-bottom: 1px solid #eef0f4;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
body.hdr-flat .brand-logo { border-radius: 8px; }

body.hdr-pill .front-header { background: var(--card); border-bottom: 1px solid #e5e7eb; }
body.hdr-pill .front-nav a {
  padding: 6px 16px; border-radius: 999px; background: transparent;
}
body.hdr-pill .front-nav a:hover { background: rgba(0,0,0,.04); }
body.hdr-pill .front-nav a.active {
  background: var(--primary); color: #fff;
}
body.hdr-pill .front-nav a.active::after { display: none; }

body.hdr-minimal .front-header { background: var(--bg); border-bottom: 1px solid rgba(0,0,0,.06); }
body.hdr-minimal .brand-logo { background: var(--text); border-radius: 50%; }
body.hdr-minimal .brand-name {
  color: var(--text);
  font-family: Georgia, "Songti SC", "STSong", serif;
  letter-spacing: 1px;
}
body.hdr-minimal .front-nav a {
  font-family: Georgia, "Songti SC", "STSong", serif;
  background: transparent;
}
body.hdr-minimal .front-nav a.active::after { background: var(--text); }

/* ==========================================================================
   Main / Layout
   ========================================================================== */
.front-main { padding: 24px 0 60px; min-height: 60vh; }
.front-wrap.with-side { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }

/* ==========================================================================
   Banner / Hero
   ========================================================================== */
.banner {
  background: var(--card); border-radius: 16px; padding: 28px 32px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.banner-text h1 { margin: 0 0 6px; font-size: 24px; color: var(--primary); }
.banner-text p { margin: 0; color: #6b7280; }
.banner-stats { display: flex; gap: 28px; flex-shrink: 0; }
.banner-stats span { text-align: center; font-size: 12px; color: #94a3b8; }
.banner-stats b { display: block; font-size: 22px; color: var(--primary); margin-bottom: 2px; }

.hero {
  display: grid; grid-template-columns: 1fr 280px; gap: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 20px; padding: 40px; margin-bottom: 28px;
  color: #fff; position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(255,255,255,.10), transparent 50%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow { font-size: 12px; opacity: .85; letter-spacing: 3px; text-transform: uppercase; }
.hero-inner h1 { margin: 12px 0; font-size: 32px; line-height: 1.3; font-weight: 700; }
.hero-inner p { opacity: .92; margin: 0 0 18px; font-size: 14px; max-width: 480px; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 26px; background: #fff; color: var(--primary);
  border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.hero-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.16); }
.hero-side { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.hero-mini {
  background: rgba(255,255,255,.16); padding: 12px 14px; border-radius: 10px;
  display: flex; flex-direction: column; backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background .15s;
}
.hero-mini:hover { background: rgba(255,255,255,.26); color: #fff; }
.hero-mini-title { font-weight: 600; font-size: 14px; }
.hero-mini-meta { font-size: 12px; opacity: .85; }

/* ==========================================================================
   Block / 标题
   ========================================================================== */
.block { margin-bottom: 32px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.block-head h2 {
  margin: 0; font-size: 18px; color: var(--text);
  border-left: 3px solid var(--primary); padding-left: 10px;
}
.more { color: #94a3b8; font-size: 12px; }
.more:hover { color: var(--primary); }

/* ==========================================================================
   Cat tabs
   ========================================================================== */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat-tab {
  padding: 6px 14px; background: var(--card); border: 1px solid #e5e7eb; border-radius: 16px;
  font-size: 12px; color: #4b5563;
}
.cat-tab:hover, .cat-tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==========================================================================
   Grid 系统
   ========================================================================== */
.grid { display: grid; gap: 16px; }
.grid-cover_top  { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid-cover_left { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.grid-list_row   { grid-template-columns: 1fr; gap: 0; }
.grid-minimal    { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* ==========================================================================
   Book card 变种
   ========================================================================== */
.bcard {
  display: flex; background: var(--card); border-radius: 12px; overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  border: 1px solid #f1f5f9; position: relative;
}
.bcard:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); border-color: var(--primary); }

.bcard-grid { flex-direction: column; padding: 12px; text-align: left; }
.bcard-grid .bcover { width: 100%; aspect-ratio: 3/4; border-radius: 8px; margin-bottom: 10px; }
.bcard-grid .btitle { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.bcard-grid .bmeta { font-size: 12px; color: #94a3b8; margin: 4px 0 8px; }

.bcard-row { padding: 14px; gap: 14px; align-items: stretch; }
.bcard-row .bcover { width: 80px; height: 110px; border-radius: 8px; flex-shrink: 0; }
.bcard-row .binfo { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bcard-row .btitle { font-weight: 600; font-size: 16px; margin-bottom: 4px; color: var(--text); }
.bcard-row .bmeta { font-size: 12px; color: #94a3b8; margin-bottom: 6px; }
.bcard-row .bintro { font-size: 12px; color: #6b7280; flex: 1; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard-row .btag-row { margin-top: 8px; }

.bcard-list {
  flex-direction: row; align-items: center; padding: 12px 14px; gap: 14px;
  border-radius: 0; border-left: none; border-right: none; border-top: none;
  border-bottom: 1px dashed #e5e7eb; background: transparent;
}
.bcard-list:hover { background: var(--card); transform: none; box-shadow: none; }
.bcard-list .bidx {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #94a3b8; font-size: 14px;
  background: #f1f5f9; border-radius: 50%;
}
.bcard-list:nth-child(-n+3) .bidx,
.bcard-list .bidx[data-top="1"] {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}
.bcard-list .binfo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bcard-list .btitle { font-weight: 600; font-size: 14px; color: var(--text); }
.bcard-list .bmeta { font-size: 12px; color: #94a3b8; }
.bcard-list .bcta { font-size: 12px; color: var(--primary); flex-shrink: 0; padding: 4px 12px; border: 1px solid var(--primary); border-radius: 999px; }
.bcard-list:hover .bcta { background: var(--primary); color: #fff; }

.bcard-min {
  flex-direction: column; padding: 22px 0; background: transparent; border: none;
  border-bottom: 1px solid rgba(0,0,0,.06); border-radius: 0;
}
.bcard-min:hover { transform: none; box-shadow: none; background: transparent; border-color: var(--text); }
.bcard-min .btitle {
  font-family: Georgia, "Songti SC", "STSong", serif; font-size: 19px;
  font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.bcard-min .bmeta { font-size: 12px; color: #94a3b8; margin-bottom: 10px; letter-spacing: 1px; }
.bcard-min .bintro { font-size: 13px; color: #6b7280; line-height: 1.8; }

.bcover {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
  text-align: center; word-break: break-all; padding: 8px;
  position: relative; overflow: hidden;
}
.bcover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 30%, transparent 70%, rgba(0,0,0,.12));
  pointer-events: none;
}
.bcover span { line-height: 1.2; position: relative; z-index: 1; }
.bcover-lg { font-size: 22px; }

.btag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.btag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 8px; font-size: 11px; border-radius: 10px;
  background: rgba(0,0,0,.05); color: #4b5563;
}
.bstatus-completed { background: rgba(16,185,129,.12); color: #047857; }
.bstatus-ongoing { background: rgba(14,165,233,.12); color: #0369a1; }
.bstatus-paused { background: rgba(148,163,184,.18); color: #475569; }
.btag-rating { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; font-weight: 600; }

/* 角标：完结 / 推荐 */
.bcorner {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.bcorner-completed { background: #10b981; }
.bcorner-hot      { background: linear-gradient(135deg, #f97316, #dc2626); }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.front-side { display: flex; flex-direction: column; gap: 16px; }
.side-card {
  background: var(--card); border-radius: 12px; padding: 16px;
  border: 1px solid #f1f5f9;
}
.side-title {
  font-weight: 600; font-size: 14px; color: var(--text);
  border-left: 3px solid var(--primary); padding-left: 8px; margin-bottom: 12px;
}
.side-rank { list-style: none; margin: 0; padding: 0; }
.side-rank li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.side-rank li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4b5563; }
.side-rank li a:hover { color: var(--primary); }
.rk {
  width: 20px; height: 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.rk-top { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.rk-norm { background: #cbd5e1; }
.side-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.side-tags a {
  padding: 4px 10px; background: #f8fafc; border-radius: 12px; font-size: 12px; color: #4b5563;
}
.side-tags a:hover { background: var(--primary); color: #fff; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed #f1f5f9; }
.side-list li:last-child { border-bottom: none; }
.side-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Book detail
   ========================================================================== */
.book-detail { background: var(--card); border-radius: 16px; padding: 28px; }
.book-head { display: grid; grid-template-columns: 200px 1fr; gap: 28px; margin-bottom: 28px; }
.book-cover-lg {
  width: 200px; height: 280px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 36px; padding: 16px; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.book-summary h1 { margin: 8px 0; font-size: 28px; color: var(--text); }
.book-author { color: #6b7280; margin: 0 0 16px; font-size: 13px; }
.book-crumbs { font-size: 12px; color: #94a3b8; }
.book-crumbs span { margin: 0 6px; }
.book-stats { display: flex; gap: 28px; margin: 18px 0; padding: 14px 0; border-top: 1px dashed #e5e7eb; border-bottom: 1px dashed #e5e7eb; flex-wrap: wrap; }
.book-stats > span { text-align: center; min-width: 60px; }
.book-stats b { color: var(--primary); font-size: 18px; }
.book-intro {
  background: var(--bg); padding: 14px 16px; border-radius: 8px;
  color: #4b5563; line-height: 1.8; font-size: 13px;
}
.book-actions { display: flex; gap: 12px; margin: 18px 0 12px; flex-wrap: wrap; }
.btn-read {
  padding: 12px 32px; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-radius: 10px; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 14px rgba(225,29,72,.25);
}
.btn-read:hover { color: #fff; opacity: .92; }
.btn-cat {
  padding: 12px 22px; background: var(--bg); color: var(--primary);
  border-radius: 10px; border: 1px solid var(--primary); font-size: 14px;
}
.book-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ==========================================================================
   Rank
   ========================================================================== */
.rank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rank-board { background: var(--card); border-radius: 12px; padding: 16px; border: 1px solid #f1f5f9; }
.rank-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
.rank-head h3 { margin: 0; font-size: 16px; color: var(--text); }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 24px 1fr 60px 50px; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; border-bottom: 1px dashed #f1f5f9; }
.rk-title { color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-meta { font-size: 11px; color: #94a3b8; text-align: right; }
.rk-val { font-size: 12px; color: var(--primary); font-weight: 600; text-align: right; }

/* ==========================================================================
   Empty / Footer
   ========================================================================== */
.empty { text-align: center; padding: 60px 20px; color: #94a3b8; font-size: 14px; }

.front-footer {
  background: var(--card); border-top: 1px solid #e5e7eb;
  padding: 28px 0; margin-top: 40px;
}
.footer-cats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed #e5e7eb; }
.footer-cats a { font-size: 12px; color: #6b7280; }
.footer-cats a:hover { color: var(--primary); }
.footer-friends { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:14px; padding-bottom:12px; border-bottom:1px dashed #e5e7eb; font-size:12px; }
.footer-friends a { color:#6b7280; }
.footer-friends a:hover { color: var(--primary); }
.footer-meta p { margin: 4px 0; font-size: 12px; color: #94a3b8; text-align: center; }

/* ==========================================================================
   Layout 风格化（让 5 个 layout 真正不同，而非仅换色）
   ========================================================================== */

/* ---------- layout-classic：起点中文风（厚重/传统/红黄）---------- */
body.layout-classic { background-image: linear-gradient(180deg, var(--bg) 0%, var(--card) 600px, var(--bg) 1200px); }
body.layout-classic .front-wrap.with-side { grid-template-columns: 1fr 260px; }
body.layout-classic .block-head h2 {
  border-left: 4px solid var(--primary); padding-left: 12px;
  font-weight: 700; font-size: 17px; position: relative;
}
body.layout-classic .block-head h2::after {
  content: ""; display: inline-block; width: 30px; height: 1px;
  background: var(--accent); margin-left: 10px; vertical-align: middle;
}
body.layout-classic .bcard { border: 1px solid #e5e7eb; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
body.layout-classic .bcard-row { background: var(--card); }
body.layout-classic .banner {
  border-left: 6px double var(--primary);
  background: linear-gradient(90deg, var(--card), var(--bg));
}
body.layout-classic .side-card {
  border-top: 3px solid var(--primary);
  border-radius: 4px;
}

/* ---------- layout-magazine：番茄阅读风（大图/圆角/沉浸）---------- */
body.layout-magazine { background: var(--bg); }
body.layout-magazine .block-head h2 { font-size: 22px; font-weight: 700; border-left: none; padding-left: 0; }
body.layout-magazine .block-head h2::before {
  content: ""; display: inline-block; width: 6px; height: 22px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 3px; vertical-align: -4px; margin-right: 10px;
}
body.layout-magazine .grid-cover_top { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
body.layout-magazine .bcard { border-radius: 16px; border: none; box-shadow: 0 2px 12px rgba(0,0,0,.04); }
body.layout-magazine .bcard:hover { box-shadow: 0 12px 32px rgba(0,0,0,.10); }
body.layout-magazine .bcard-grid .bcover { border-radius: 12px; }
body.layout-magazine .banner { border-radius: 20px; border-left: none; padding: 32px 36px; }

/* ---------- layout-grid：微信读书风（米色/方角/密集）---------- */
body.layout-grid { background: #faf8f3; }
body.layout-grid .front-header { background: var(--card); }
body.layout-grid .block-head h2 {
  font-weight: 600; font-size: 16px;
  border-left: none; padding-left: 0;
  color: var(--text);
}
body.layout-grid .block-head { border-bottom: 1px solid #eee5d7; padding-bottom: 8px; }
body.layout-grid .grid-cover_top { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
body.layout-grid .bcard {
  border-radius: 6px; border: 1px solid #ece5d6;
  background: #fffdf7; box-shadow: none;
}
body.layout-grid .bcard:hover { border-color: var(--primary); transform: none; box-shadow: 0 4px 12px rgba(0,0,0,.04); }
body.layout-grid .bcard-grid { padding: 10px; }
body.layout-grid .bcard-grid .bcover { border-radius: 4px; aspect-ratio: 3/4; }
body.layout-grid .banner { border-radius: 8px; background: var(--card); border-left: 3px solid var(--primary); }
body.layout-grid .side-card { border-radius: 6px; border-color: #ece5d6; background: #fffdf7; }

/* ---------- layout-list：七猫精选风（深色侧栏 / 圆形编号）---------- */
body.layout-list .front-wrap.with-side { grid-template-columns: 1fr 260px; }
body.layout-list .block-head h2 {
  font-size: 16px; font-weight: 700;
  border-left: none; padding-left: 0;
  display: inline-flex; align-items: center; gap: 10px;
}
body.layout-list .block-head h2::before {
  content: "▌"; color: var(--primary); font-size: 18px;
}
body.layout-list .grid-list_row .bcard-list {
  border-bottom: 1px solid #f1f5f9; padding: 14px 16px;
  background: var(--card); border-radius: 0;
}
body.layout-list .grid-list_row .bcard-list:first-child { border-radius: 12px 12px 0 0; }
body.layout-list .grid-list_row .bcard-list:last-child  { border-radius: 0 0 12px 12px; border-bottom: none; }
body.layout-list .grid-list_row .bcard-list:hover { background: var(--bg); }
body.layout-list .bcard-list .bidx {
  width: 36px; height: 36px; font-size: 15px;
}
body.layout-list .side-card {
  background: linear-gradient(180deg, var(--text), #1f2937);
  color: #e5e7eb; border-color: rgba(255,255,255,.1);
}
body.layout-list .side-card .side-title { color: #fff; border-left-color: var(--accent); }
body.layout-list .side-card .side-rank li a,
body.layout-list .side-card .side-list li a { color: #cbd5e1; }
body.layout-list .side-card .side-rank li a:hover,
body.layout-list .side-card .side-list li a:hover { color: var(--accent); }
body.layout-list .side-card .side-tags a { background: rgba(255,255,255,.08); color: #cbd5e1; }
body.layout-list .side-card .side-tags a:hover { background: var(--accent); color: var(--text); }
body.layout-list .side-card .muted { color: #64748b; }
body.layout-list .banner { border-radius: 6px; padding: 22px 26px; }

/* ---------- layout-minimal：单读 / 简书风（衬线/留白/极简）---------- */
body.layout-minimal {
  font-family: "Source Han Serif SC", "Noto Serif SC", Georgia, "Songti SC", "STSong", serif;
}
body.layout-minimal .front-wrap { max-width: 880px; }
body.layout-minimal .front-main { padding: 48px 0 80px; }
body.layout-minimal .block { margin-bottom: 56px; }
body.layout-minimal .block-head h2 {
  border-left: none; padding-left: 0;
  font-weight: 400; letter-spacing: 4px; font-size: 16px;
  text-align: center; padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.layout-minimal .block-head { display: block; }
body.layout-minimal .block-head .more { display: block; text-align: center; margin-top: 8px; }
body.layout-minimal .banner {
  background: transparent; border: none;
  border-top: 1px solid rgba(0,0,0,.1);
  border-bottom: 1px solid rgba(0,0,0,.1);
  border-radius: 0; padding: 32px 0; text-align: center;
  flex-direction: column; gap: 16px;
}
body.layout-minimal .banner-text h1 { font-size: 28px; font-weight: 400; letter-spacing: 2px; }
body.layout-minimal .banner-text { text-align: center; }
body.layout-minimal .grid-minimal { grid-template-columns: 1fr; gap: 0; }

/* ==========================================================================
   响应式 / 移动端
   ========================================================================== */

/* 平板（≤900px）：侧栏下移 */
@media (max-width: 900px) {
  .front-wrap.with-side { grid-template-columns: 1fr; }
  /* layout-list 特异性更高，需在媒体查询中显式覆盖，否则移动端仍保留 260px 侧栏导致水平溢出 */
  body.layout-list .front-wrap.with-side { grid-template-columns: 1fr; }
  .rank-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero-inner h1 { font-size: 26px; }
  .hero-side { flex-direction: row; flex-wrap: wrap; }
  .hero-mini { flex: 1 1 calc(50% - 5px); min-width: 140px; }
}

/* 移动（≤768px）：导航换汉堡 / 抽屉 */
@media (max-width: 768px) {
  .header-inner {
    gap: 8px; padding: 10px 14px; min-height: 56px;
    flex-wrap: nowrap;
  }
  .brand-logo { width: 36px; height: 36px; font-size: 16px; }
  .brand-name { font-size: 15px; }
  .brand-sub { display: none; }
  .brand { flex: 1; min-width: 0; }

  .front-nav, .front-search { display: none !important; }
  .hdr-icon { display: inline-flex !important; }

  .front-wrap { padding: 0 14px; }
  .front-main { padding: 16px 0 40px; }

  .banner {
    flex-direction: column; align-items: flex-start;
    padding: 20px 18px; gap: 16px;
  }
  .banner-text h1 { font-size: 20px; }
  .banner-stats { gap: 18px; width: 100%; justify-content: space-around; }
  .banner-stats b { font-size: 18px; }

  .hero { padding: 24px 18px; border-radius: 16px; }
  .hero-inner h1 { font-size: 22px; }
  .hero-cta { padding: 10px 22px; font-size: 13px; }

  .block { margin-bottom: 24px; }
  .block-head h2 { font-size: 16px; }

  .grid { gap: 12px; }
  .grid-cover_top  { grid-template-columns: repeat(2, 1fr); }
  .grid-cover_left { grid-template-columns: 1fr; }
  .grid-minimal    { grid-template-columns: 1fr; gap: 0; }

  .bcard-grid .btitle { font-size: 13px; }
  .bcard-row { padding: 10px; gap: 10px; }
  .bcard-row .bcover { width: 64px; height: 90px; }
  .bcard-row .btitle { font-size: 14px; }
  .bcard-row .bintro { -webkit-line-clamp: 2; }

  .bcard-list { padding: 10px 12px; gap: 10px; }
  .bcard-list .bidx { width: 28px; height: 28px; font-size: 13px; }
  .bcard-list .bcta { padding: 4px 10px; font-size: 11px; }

  .book-detail { padding: 18px; border-radius: 12px; }
  .book-head { grid-template-columns: 1fr; gap: 16px; }
  .book-cover-lg { width: 130px; height: 180px; margin: 0 auto; font-size: 22px; }
  .book-summary { text-align: center; }
  .book-summary h1 { font-size: 22px; }
  .book-stats { gap: 12px; justify-content: space-around; }
  .book-stats > span { min-width: 50px; }
  .book-actions { justify-content: center; }
  .btn-read { padding: 11px 24px; font-size: 14px; }

  /* layout-magazine 移动端：网格 2 列 */
  body.layout-magazine .grid-cover_top { grid-template-columns: repeat(2, 1fr); }
  /* layout-grid 移动端：网格 2 列 */
  body.layout-grid .grid-cover_top { grid-template-columns: repeat(2, 1fr); }
  /* layout-minimal 移动端：留白收紧 */
  body.layout-minimal .front-main { padding: 24px 0 60px; }
  body.layout-minimal .block { margin-bottom: 36px; }
  body.layout-minimal .block-head h2 { font-size: 14px; letter-spacing: 3px; }
}

/* 小屏（≤420px）：极致压缩 */
@media (max-width: 420px) {
  .grid-cover_top { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bcard-grid { padding: 8px; }
  .bcard-grid .btitle { font-size: 12.5px; }
  .bcard-grid .bmeta { font-size: 11px; }
  .hdr-mobile-nav { grid-template-columns: repeat(2, 1fr); }
}
