/* 甜夜书单 · 主题样式(暖玫瑰+奶油底 / 可切暗色) */
:root {
  --pink: #e0507a;
  --deep: #b23a66;
  --rose: #f7a6b4;
  --cream: #fff7f3;
  --paper: #ffffff;
  --ink: #3f2e36;
  --muted: #8a737b;
  --line: #f0d9dd;
  --shadow: 0 8px 24px rgba(176, 58, 102, .09);
  --tag-bg: #fdeef2;
  --warn-bg: #fff4f0;
  --warn-line: #f2c8bd;
  --warn-ink: #b4523a;
  --fit-bg: #f2f8f4;
  --fit-line: #c7e3d2;
  --fit-ink: #34805f;
  --strip-bg: linear-gradient(135deg, #fff, #fdeef2);
  --topbar-bg: rgba(255, 247, 243, .92);
  --footer-bg: #3f2e36;
  --footer-ink: #d8c3ca;
  --footer-muted: #97808a;
  --btn-ink: #fff;
}
html[data-theme='dark'] {
  --pink: #ef82a8;
  --deep: #e06d98;
  --rose: #8a4a5f;
  --cream: #1a1418;
  --paper: #261d24;
  --ink: #f3e5ea;
  --muted: #b9a2ab;
  --line: #3a2d34;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --tag-bg: #3a2430;
  --warn-bg: #33201c;
  --warn-line: #54352c;
  --warn-ink: #f0a58e;
  --fit-bg: #1f2b26;
  --fit-line: #2c443a;
  --fit-ink: #8fd4b2;
  --strip-bg: linear-gradient(135deg, #241a20, #3a2430);
  --topbar-bg: rgba(26, 20, 24, .92);
  --footer-bg: #120d10;
  --footer-ink: #d8c3ca;
  --footer-muted: #97808a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  transition: background .25s, color .25s;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--deep); text-decoration: none; }
a:hover { color: var(--pink); }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-size: 20px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--pink), var(--deep));
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.nav { display: flex; gap: 22px; }
.nav a { color: var(--ink); font-size: 15px; padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.on { color: var(--deep); border-color: var(--pink); }
.theme-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  font-size: 15px; cursor: pointer; padding: 3px 11px; color: var(--ink);
  transition: border-color .2s;
}
.theme-btn:hover { border-color: var(--pink); }
.burger { display: none; background: none; border: none; font-size: 22px; color: var(--ink); cursor: pointer; }

/* 首页 hero */
.hero { padding: 72px 0 56px; text-align: center; }
.hero-tag { color: var(--pink); letter-spacing: 6px; font-size: 14px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 900; color: var(--ink); margin-bottom: 18px; }
.hero-sub { color: var(--muted); font-size: 16px; margin-bottom: 30px; }
.hero-cta .btn { background: linear-gradient(135deg, var(--pink), var(--deep)); color: var(--btn-ink); font-size: 16px; padding: 13px 34px; border-radius: 999px; box-shadow: var(--shadow); }
.hero-cta .btn:hover { filter: brightness(1.06); }

/* 区块 */
.section { padding: 26px 0 46px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.sec-head h2 { font-size: 26px; font-weight: 800; }
.sec-head h2::before { content: '❥'; color: var(--pink); margin-right: 10px; font-size: 20px; }
.sec-sub { color: var(--muted); font-size: 14px; }

/* 书单大卡片 */
.lists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.list-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px;
  box-shadow: var(--shadow); transition: transform .2s;
  display: block; color: inherit;
}
.list-card:hover { transform: translateY(-4px); }
.list-num { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.list-sub { color: var(--deep); font-size: 14px; margin-bottom: 10px; }
.list-desc { color: var(--muted); font-size: 14px; min-height: 44px; }
.list-go { margin-top: 14px; color: var(--deep); font-weight: 700; font-size: 14px; }

/* 书籍卡片 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid.mini { grid-template-columns: repeat(3, 1fr); }
.book-cell { display: flex; flex-direction: column; gap: 8px; }
.book-cell .book-card { flex: 1; }
.card-read {
  display: block; text-align: center; font-size: 12.5px; font-weight: 700;
  color: var(--deep); background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 7px 8px; transition: border-color .2s;
}
.card-read:hover { border-color: var(--pink); color: var(--pink); }
.book-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s; display: block; color: inherit;
}
.book-card:hover { transform: translateY(-4px); }
.cover {
  height: 150px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 900; color: #fff; letter-spacing: 6px; font-family: serif;
  overflow: hidden;
}
.cover .cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.c0 { background: linear-gradient(150deg, #f7a6b4, #b23a66); }
.cover.c1 { background: linear-gradient(150deg, #c9a7e8, #7d4bb5); }
.cover.c2 { background: linear-gradient(150deg, #f6c48c, #d97b29); }
.cover.c3 { background: linear-gradient(150deg, #9fd0c4, #3d8f7c); }
.cover.c4 { background: linear-gradient(150deg, #a8bdf0, #4a63b8); }
.cover.big { height: 210px; width: 150px; border-radius: 14px; font-size: 40px; flex-shrink: 0; }
.rank-cover { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 14px; letter-spacing: 2px; overflow: hidden; }
.rank-cover .cover-img { width: 100%; height: 100%; object-fit: cover; }
.book-info { padding: 14px 16px 18px; }
.book-title { font-size: 18px; font-weight: 800; }
.book-author { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.book-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { background: var(--tag-bg); color: var(--deep); font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.book-line { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 标签 chips */
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 8px 20px;
  color: var(--ink); font-size: 14px;
}
.chip:hover { border-color: var(--pink); color: var(--deep); }

/* 页头(书单页/关于) */
.page-head { padding: 46px 0 26px; }
.page-head h1 { font-size: 32px; font-weight: 900; }
.page-head .subtitle { color: var(--deep); margin-top: 8px; }
.page-head .intro { color: var(--muted); margin-top: 6px; }
.more-lists { margin: 40px 0 10px; }
.more-lists h2 { font-size: 20px; margin-bottom: 14px; }
.list-chip { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; margin: 0 10px 10px 0; color: var(--ink); font-size: 14px; }

/* 详情页 */
.crumbs { color: var(--muted); font-size: 13px; padding: 24px 0 6px; }
.detail { padding-bottom: 40px; }
.detail-head { display: flex; gap: 26px; align-items: flex-start; margin: 18px 0 30px; }
.detail-meta h1 { font-size: 32px; font-weight: 900; }
.detail-meta .book-author { font-size: 15px; margin: 6px 0 10px; }
.one-liner { color: var(--deep); font-size: 16px; margin: 8px 0 18px; }
.btn {
  display: inline-block; background: linear-gradient(135deg, var(--pink), var(--deep)); color: var(--btn-ink);
  padding: 10px 26px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow);
}
.btn:hover { filter: brightness(1.06); }
.btn-light { background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .35); color: #fff; }
.block { margin: 26px 0; }
.block h2 { font-size: 22px; margin-bottom: 14px; }
.block h2::before { content: '✦'; color: var(--pink); margin-right: 8px; }
.para { color: var(--muted); margin-bottom: 12px; }
.hl-list { display: grid; gap: 10px; }
.hl { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 15px; }
.hl span { color: var(--pink); margin-right: 8px; }
.blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0; }
.half { border-radius: 14px; padding: 18px; border: 1px solid var(--line); }
.half h3 { font-size: 16px; margin-bottom: 8px; }
.half p { font-size: 14px; color: var(--muted); }
.half-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.half-warn h3 { color: var(--warn-ink); }
.half-fit { background: var(--fit-bg); border-color: var(--fit-line); }
.half-fit h3 { color: var(--fit-ink); }

/* 关于 */
.about-body { max-width: 760px; padding-bottom: 40px; }
.about-body h2 { font-size: 20px; margin: 26px 0 10px; }
.about-body h2::before { content: '❥'; color: var(--pink); margin-right: 8px; }
.about-body ul { padding-left: 22px; color: var(--muted); }
.about-strip { background: var(--strip-bg); border: 1px solid var(--line); border-radius: 20px; padding: 26px 28px; }
.about-strip h2 { font-size: 20px; margin-bottom: 10px; }
.about-strip p { font-size: 15px; color: var(--muted); }
.about-strip .small { font-size: 13px; margin-top: 8px; }

/* 页脚 */
.footer { background: var(--footer-bg); color: var(--footer-ink); padding: 40px 0 30px; margin-top: 20px; }
.footer-brand { color: #fff; font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.footer-note { font-size: 13px; max-width: 640px; margin-bottom: 8px; }
.footer-plats { font-size: 13px; margin-bottom: 6px; }
.footer-plats a { color: var(--rose); margin: 0 6px; }
.footer-contact { font-size: 13px; margin-bottom: 8px; }
.footer-copy { font-size: 12px; color: var(--footer-muted); }

/* 搜索框(顶栏) */
.sform { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.sinput { border: none; outline: none; background: transparent; color: var(--ink); font-size: 14px; padding: 7px 12px; width: 170px; font-family: inherit; }
.sinput::placeholder { color: var(--muted); }
.sgo { border: none; background: none; cursor: pointer; font-size: 14px; padding: 0 12px; color: var(--deep); }
.sgo:hover { color: var(--pink); }

/* 搜索大表单(搜索页) */
.search-big { display: flex; gap: 12px; margin: 0 0 30px; }
.search-big .sinput.big { flex: 1; border: 2px solid var(--line); border-radius: 14px; padding: 12px 18px; background: var(--paper); font-size: 16px; }
.search-big .sinput.big:focus { border-color: var(--pink); }

/* 未找到反馈 */
.notfound { text-align: center; background: var(--paper); border: 1px dashed var(--pink); border-radius: 18px; padding: 40px 30px; margin-bottom: 30px; }
.notfound h2 { font-size: 24px; margin-bottom: 12px; }
.notfound p { color: var(--muted); }
.notfound .nf-tip { margin: 10px 0 22px; }
.notfound em { color: var(--deep); font-style: normal; font-weight: 700; }

/* 排行榜 */
.rank-list { display: grid; gap: 14px; }
.rank-wrap { display: flex; align-items: center; gap: 12px; }
.rank-badge {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, #b7a18c, #8a7561);
}
.rank-badge.r1 { background: linear-gradient(135deg, #f5c96b, #d8962e); }
.rank-badge.r2 { background: linear-gradient(135deg, #c3ccd6, #8b98a8); }
.rank-badge.r3 { background: linear-gradient(135deg, #d9a075, #a96b3f); }
.rank-item {
  flex: 1; display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); color: inherit;
}
.rank-item:hover { border-color: var(--pink); }
.rank-cover { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 14px; letter-spacing: 2px; }
.rank-info { flex: 1; min-width: 0; }
.rank-title { font-size: 16.5px; font-weight: 800; }
.rank-author { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.rank-tags { display: flex; gap: 6px; margin: 3px 0; flex-wrap: wrap; }
.rank-line { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-score { text-align: right; flex-shrink: 0; color: #e8a33e; font-size: 13.5px; letter-spacing: 1px; }
.rank-num { display: block; color: var(--deep); font-weight: 800; font-size: 14px; }
.rank-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rank-cat { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.rank-cat h3 { font-size: 16px; margin-bottom: 10px; }
.rank-mini { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--ink); font-size: 14px; }
.rank-mini:last-child { border-bottom: none; }
.cat-no { width: 20px; height: 20px; border-radius: 6px; background: var(--tag-bg); color: var(--deep); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; }
.cat-title { flex: 1; }
.cat-score { color: #e8a33e; font-weight: 700; font-size: 13px; }

/* 详情页阅读按钮 */
.read-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.btn-ghost { background: var(--paper); border: 1.5px solid var(--pink); color: var(--deep); box-shadow: none; }
.btn-ghost:hover { color: var(--pink); }
.read-tip { font-size: 12.5px; color: var(--muted); max-width: 520px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .lists { grid-template-columns: 1fr; }
  .sform { display: none; }
  .rank-cats { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grid, .grid.mini { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 62px; background: var(--cream); flex-direction: column; padding: 14px 20px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .burger { display: block; }
  .detail-head { flex-direction: column; align-items: center; text-align: center; }
  .blocks { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 38px; }
}
