/* =========================================================
   儿童绘本推荐馆 · 糖果缤纷风格
   配色与规范严格遵循视觉设计规范，勿替换
   ========================================================= */

:root {
  /* ---- 色彩（视觉设计规范，禁止替换） ---- */
  --c-primary: #d30d60;   /* 主色 */
  --c-accent: #76e029;    /* 辅助色 */
  --c-highlight: #06f9e4; /* 强调色（CTA / 高亮） */
  --c-bg: #fbf8fa;        /* 页面背景 */
  --c-surface: #ffffff;   /* 卡片 / 表面 */
  --c-text: #2c1b22;      /* 正文文字 */
  --c-text-2: #7a5c69;    /* 次要文字 */
  --c-border: #e6dbdf;    /* 描边 */

  /* ---- 圆角 ---- */
  --r: 20px;             /* 标准圆角 20px */
  --r-lg: 30px;          /* 大圆角（用于主视觉区） */
  --r-sm: 14px;

  /* ---- 字体 ---- */
  --font-head: 'Quicksand', 'PingFang SC', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;

  /* ---- 阴影 ---- */
  --shadow: 0 10px 28px rgba(211, 13, 96, .10);
  --shadow-lg: 0 18px 42px rgba(211, 13, 96, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container { width: min(1180px, 92%); margin: 0 auto; }

/* 全页波点底纹（极淡，衬托糖果气质） */
.bg-deco {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(rgba(211, 13, 96, .055) 2px, transparent 2.6px);
  background-size: 34px 34px;
  background-position: 8px 8px;
}

/* =========================================================
   顶部导航
   ========================================================= */
.header-holder {
  position: sticky; top: 12px; z-index: 60;
  padding: 0 min(4vw, 40px);
}
.site-header {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: 22px;
  padding: 10px 14px 10px 18px;
  box-shadow: var(--shadow);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-badge {
  width: 44px; height: 44px; border-radius: 15px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-highlight));
  display: grid; place-items: center; font-size: 24px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .10);
  transition: transform .25s;
}
.logo:hover .logo-badge { transform: rotate(-10deg) scale(1.06); }
.logo-text {
  font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: .5px;
}
.logo-text span { color: var(--c-primary); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  color: var(--c-text-2); padding: 9px 16px; border-radius: 999px;
  transition: background .2s, color .2s, transform .2s;
}
.nav a:hover { color: var(--c-primary); transform: translateY(-2px); }
.nav a.active { background: var(--c-primary); color: #fff; box-shadow: 0 6px 16px rgba(211, 13, 96, .28); }
.nav .nav-candy { font-size: 18px; padding: 6px 10px; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   主视觉 Hero
   ========================================================= */
.hero {
  position: relative; overflow: hidden;
  margin-top: 26px;
  border-radius: var(--r-lg);
  border: 2px solid var(--c-border);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .75) 0 22%, transparent 23%),
    linear-gradient(135deg, #ffe6f1 0%, #f4fce8 52%, #e3fdf9 100%);
  padding: clamp(34px, 6vw, 64px) clamp(22px, 5vw, 56px);
}
.hero::before { /* 大圆波点装饰 */
  content: ''; position: absolute; top: -70px; right: -60px; width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(var(--c-primary) 7px, transparent 8px);
  background-size: 46px 46px;
  opacity: .5;
  pointer-events: none;
}
.hero::after { /* 半透明彩色块 */
  content: ''; position: absolute; bottom: -70px; left: 30%;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(118, 224, 41, .35), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: 680px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--c-surface); border: 2px solid var(--c-border);
  color: var(--c-primary); font-weight: 700; font-size: 14px;
  padding: 7px 16px; border-radius: 999px; font-family: var(--font-head);
  box-shadow: 0 6px 16px rgba(211, 13, 96, .10);
}
.hero h1 {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(34px, 5.4vw, 56px); line-height: 1.16; letter-spacing: .5px;
  margin: 20px 0 16px;
}
.hl-pink { color: var(--c-primary); position: relative; }
.hl-pink::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 10px;
  background: var(--c-accent); border-radius: 999px; opacity: .55; z-index: -1;
}
.hl-mint { color: var(--c-primary); }
.hero p { color: var(--c-text-2); font-size: 17px; max-width: 560px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.stat {
  background: var(--c-surface); border: 2px solid var(--c-border);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14px;
  color: var(--c-text-2); font-family: var(--font-head);
  box-shadow: 0 4px 12px rgba(211, 13, 96, .06);
}
.stat b { color: var(--c-primary); font-size: 17px; }

/* 漂浮的小糖果装饰 */
.hero-dot {
  position: absolute; z-index: 2; font-size: clamp(26px, 3.4vw, 42px);
  filter: drop-shadow(0 8px 14px rgba(44, 27, 34, .12));
  animation: floaty 5s ease-in-out infinite;
  user-select: none;
}
.d1 { top: 8%; right: 12%; animation-delay: 0s; }
.d2 { top: 42%; right: 26%; font-size: 22px; animation-delay: .6s; }
.d3 { bottom: 12%; right: 10%; animation-delay: 1.2s; }
.d4 { top: 16%; right: 34%; font-size: 22px; animation-delay: 1.8s; }
.d5 { bottom: 22%; right: 22%; animation-delay: .3s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(8deg); }
}

/* =========================================================
   区块标题
   ========================================================= */
.section-head {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 0 20px; flex-wrap: wrap;
}
.section-head .emoji {
  width: 46px; height: 46px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-size: 24px;
  background: var(--c-surface); border: 2px solid var(--c-border);
  box-shadow: 0 4px 12px rgba(211, 13, 96, .06);
}
.section-head .title {
  font-family: var(--font-head); font-weight: 700; font-size: 27px; position: relative;
}
.section-head .title::after {
  content: ''; position: absolute; left: 0; bottom: -7px;
  width: 46px; height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-highlight));
}
.section-head .sub { color: var(--c-text-2); font-size: 14px; font-weight: 600; }

/* =========================================================
   按钮
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  border-radius: 999px; padding: 14px 26px;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 10px 22px rgba(211, 13, 96, .3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 28px rgba(211, 13, 96, .38); }
.btn-mint { background: var(--c-highlight); color: #064d45; box-shadow: 0 10px 22px rgba(6, 249, 228, .38); }
.btn-mint:hover { transform: translateY(-3px); box-shadow: 0 16px 28px rgba(6, 249, 228, .45); }
.btn-ghost { background: var(--c-surface); color: var(--c-text); border: 2px solid var(--c-border); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--c-primary); color: var(--c-primary); }
.btn-sm { padding: 10px 18px; font-size: 14px; }

/* =========================================================
   卡片（绘本）
   ========================================================= */
.book-card {
  background: var(--c-surface); border: 2px solid var(--c-border);
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  animation: fadeUp .5s ease both;
}
.book-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); border-color: var(--c-primary); }
.book-cover { position: relative; aspect-ratio: 4 / 4.6; overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.book-card:hover .book-cover img { transform: scale(1.05); }
.feat-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--c-highlight); color: #064d45;
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(6, 249, 228, .5);
  font-family: var(--font-head);
}
.age-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(255, 255, 255, .92); color: var(--c-primary);
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  border: 1.5px solid #f6c4dc;
  font-family: var(--font-head);
}
.book-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.book-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--c-text); }
.book-author { color: var(--c-text-2); font-size: 13px; }
.book-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1.5px solid var(--c-border); color: var(--c-text-2); background: var(--c-surface);
  cursor: default;
}
.tag.theme { background: #f1fbe6; border-color: #d3f2ae; color: #3f7a00; }
.tag.age { background: #fdeef6; border-color: #f6c4dc; color: var(--c-primary); }
.book-desc { color: var(--c-text-2); font-size: 13.5px; line-height: 1.6; }
.book-more {
  margin-top: auto; color: var(--c-primary); font-weight: 700; font-size: 13.5px;
  font-family: var(--font-head); display: inline-flex; align-items: center; gap: 5px;
}
.book-card:hover .book-more { gap: 9px; transition: gap .2s; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 22px; margin-top: 6px;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* 横向滑动行（编辑推荐 / 主题书单） */
.feat-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 242px;
  gap: 20px; overflow-x: auto; padding: 6px 4px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin; scrollbar-color: var(--c-primary) var(--c-border);
}
.feat-row .book-card { scroll-snap-align: start; }
.feat-row::-webkit-scrollbar { height: 8px; }
.feat-row::-webkit-scrollbar-thumb { background: var(--c-primary); border-radius: 999px; }
.feat-row::-webkit-scrollbar-track { background: var(--c-border); border-radius: 999px; }

/* =========================================================
   筛选器
   ========================================================= */
.filter-card {
  background: var(--c-surface); border: 2px solid var(--c-border);
  border-radius: var(--r); padding: 22px 24px 24px;
  box-shadow: var(--shadow);
}
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter-label {
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  min-width: 74px; color: var(--c-text);
}
.chip {
  border: 2px solid var(--c-border); background: var(--c-surface);
  border-radius: 999px; padding: 8px 17px; font-weight: 600; font-size: 14px;
  color: var(--c-text-2); cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s, color .16s, border-color .16s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--c-primary); color: var(--c-primary); }
.chip.active-age {
  background: var(--c-primary); border-color: var(--c-primary); color: #fff;
  box-shadow: 0 6px 16px rgba(211, 13, 96, .3);
}
.chip.active-theme {
  background: var(--c-accent); border-color: var(--c-accent); color: #173000;
  box-shadow: 0 6px 16px rgba(118, 224, 41, .35);
}

.search-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }
.search-box input {
  width: 100%; border: 2px solid var(--c-border); border-radius: 999px;
  padding: 13px 20px 13px 46px; font-size: 15px; background: var(--c-surface);
  color: var(--c-text); outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-box input::placeholder { color: var(--c-text-2); opacity: .7; }
.search-box input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(211, 13, 96, .12); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }

.result-count { margin: 18px 2px 4px; color: var(--c-text-2); font-size: 14px; font-weight: 600; }
.result-count b { color: var(--c-primary); }

.empty {
  text-align: center; padding: 54px 20px; margin-top: 16px;
  background: var(--c-surface); border: 2px dashed var(--c-border); border-radius: var(--r);
  color: var(--c-text-2);
}
.empty .empty-emo { font-size: 52px; display: block; margin-bottom: 12px; }
.empty p { margin-top: 6px; }

/* =========================================================
   推荐列表页
   ========================================================= */
.page-hero {
  margin-top: 26px; border-radius: var(--r-lg); border: 2px solid var(--c-border);
  background: linear-gradient(135deg, #ffe6f1, #f4fce8 55%, #e3fdf9);
  padding: clamp(28px, 5vw, 48px) clamp(22px, 5vw, 48px); position: relative; overflow: hidden;
}
.page-hero::after {
  content: '📖'; position: absolute; right: 6%; top: 50%; transform: translateY(-50%);
  font-size: clamp(60px, 9vw, 110px); opacity: .5; filter: drop-shadow(0 10px 18px rgba(44,27,34,.12));
}
.page-hero h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(30px, 4.6vw, 46px); }
.page-hero p { color: var(--c-text-2); margin-top: 10px; max-width: 560px; }

/* =========================================================
   绘本详情页
   ========================================================= */
.crumb { margin: 26px 0 8px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--c-text-2); }
.crumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--c-primary); font-family: var(--font-head); font-weight: 700; }
.crumb a:hover { gap: 10px; transition: gap .2s; }

.detail-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 36px; margin-top: 18px; align-items: start; }
.detail-cover img {
  width: 100%; border-radius: var(--r); border: 2px solid var(--c-border);
  box-shadow: var(--shadow-lg);
}
.detail-cover .feat-badge { font-size: 14px; padding: 7px 14px; }

.detail-info h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(28px, 4vw, 40px); line-height: 1.2; }
.detail-tagline { color: var(--c-text-2); font-size: 17px; margin-top: 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.meta-item {
  background: var(--c-surface); border: 2px solid var(--c-border); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--c-text-2);
}
.meta-item b { color: var(--c-text); font-weight: 700; }
.detail-editor {
  background: linear-gradient(135deg, #eafffb, #f1fbe6);
  border: 2px solid #bdf7ef; border-radius: var(--r); padding: 16px 20px;
  display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.7;
  color: var(--c-text); margin-bottom: 18px;
}
.detail-editor .em { font-size: 22px; }
.detail-intro {
  background: var(--c-surface); border: 2px solid var(--c-border); border-radius: var(--r);
  padding: 20px 22px; font-size: 15.5px; line-height: 1.9; color: var(--c-text);
  box-shadow: var(--shadow);
}
.theme-link { cursor: pointer; }
.theme-link:hover { border-color: var(--c-accent); color: #3f7a00; transform: translateY(-2px); transition: all .16s; }

/* 阅读指导 */
.guide { margin-top: 34px; display: grid; gap: 20px; }
.guide-block {
  background: var(--c-surface); border: 2px solid var(--c-border);
  border-radius: var(--r); padding: 24px 26px; box-shadow: var(--shadow);
}
.guide-block h3 {
  font-family: var(--font-head); font-weight: 700; font-size: 21px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.guide-block .guide-sub { color: var(--c-text-2); font-size: 14px; margin-bottom: 14px; }
.q-list { list-style: none; }
.q-list li { position: relative; padding-left: 32px; margin: 11px 0; line-height: 1.75; font-size: 15px; }
.q-list li::before { content: '🍭'; position: absolute; left: 0; top: 0; font-size: 16px; }

.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
.act-item {
  border: 2px solid var(--c-border); border-radius: var(--r);
  padding: 17px 18px; background: linear-gradient(165deg, var(--c-surface), var(--c-bg));
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.act-item:hover { transform: translateY(-4px); border-color: var(--c-accent); box-shadow: 0 10px 22px rgba(118, 224, 41, .22); }
.act-num {
  width: 36px; height: 36px; border-radius: 13px; margin-bottom: 10px;
  background: var(--c-accent); color: #173000; font-weight: 800; font-size: 16px;
  display: grid; place-items: center; font-family: var(--font-head);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .10);
}
.act-item p { font-size: 14.5px; line-height: 1.7; }

.tips-box {
  background: linear-gradient(135deg, #eafffb, #f3fce9);
  border: 2px solid #bdf7ef; border-radius: var(--r);
  padding: 20px 24px; font-size: 15px; line-height: 1.8; display: flex; gap: 14px; align-items: flex-start;
}
.tips-box .em { font-size: 24px; }
.tips-box b { font-family: var(--font-head); color: var(--c-primary); }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  margin-top: 70px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  border: 2px solid var(--c-border); border-bottom: none;
  background:
    radial-gradient(var(--c-primary) 5px, transparent 5.5px) 0 0 / 40px 40px,
    linear-gradient(135deg, #ffe6f1, #eafffb);
  background-blend-mode: overlay;
  padding: 34px 0; text-align: center;
}
.footer-em { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.footer-sub { color: var(--c-text-2); font-size: 13.5px; margin-top: 8px; }

/* 回到顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: 50px; height: 50px; border-radius: 16px; border: none; cursor: pointer;
  background: var(--c-primary); color: #fff; font-size: 20px; font-weight: 700;
  box-shadow: 0 10px 22px rgba(211, 13, 96, .35);
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px) scale(1.05); }

/* 焦点可见 */
:focus-visible { outline: 3px solid var(--c-highlight); outline-offset: 2px; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 900px) {
  .detail-wrap { grid-template-columns: 240px 1fr; gap: 26px; }
}
@media (max-width: 760px) {
  .detail-wrap { grid-template-columns: 1fr; }
  .detail-cover { max-width: 280px; }
  .hero-dot { display: none; }
  .logo-text { font-size: 17px; }
  .nav a { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 520px) {
  .header-holder { top: 8px; padding: 0 10px; }
  .site-header { padding: 8px 10px; }
  .logo-badge { width: 38px; height: 38px; font-size: 20px; border-radius: 13px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
  .feat-row { grid-auto-columns: 190px; gap: 14px; }
  .book-title { font-size: 16px; }
  .filter-card { padding: 18px 16px; }
  .section-head .title { font-size: 22px; }
  .to-top { width: 44px; height: 44px; right: 14px; bottom: 14px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
