/* ============================================================
   StellarU AI快读 · components.css — 组件库
   ============================================================ */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 20px; height: 46px; border-radius: var(--r-full);
  font-size: var(--fs-15); font-weight: 600; letter-spacing: .01em;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast), opacity var(--dur-fast), background var(--dur);
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary {
  background: var(--grad-green); color: #fff;
  box-shadow: var(--sh-brand);
}
.btn-primary:active { box-shadow: 0 6px 16px rgba(22,101,52,.35); }
.btn-gold {
  background: var(--grad-gold); color: #5b3a00;
  box-shadow: var(--sh-gold);
}
.btn-ghost {
  background: var(--surface); color: var(--green-800);
  border: 1px solid var(--line); box-shadow: var(--sh-xs);
}
.btn-soft {
  background: var(--green-50); color: var(--green-800);
  border: 1px solid rgba(22,163,74,.18);
}
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: var(--fs-13); border-radius: var(--r-full); }
.btn-lg { height: 52px; font-size: var(--fs-17); }
.btn-icon { padding: 0; width: 46px; height: 46px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); border: 1px solid rgba(231,226,214,.6);
}
.card-pad { padding: var(--sp-5); }

/* ---------- 区块工具 ---------- */
.sec { padding: var(--sp-5) var(--sp-5) 0; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.sec-title {
  font-size: var(--fs-18); font-weight: 800; color: var(--ink-900);
  display: flex; align-items: center; gap: 8px; letter-spacing: .01em;
}
.sec-title::before {
  content: ""; width: 4px; height: 17px; border-radius: 4px;
  background: var(--grad-green); flex: none;
}
.sec-title.lined-gold::before { background: var(--grad-gold); }
.sec-more {
  font-size: var(--fs-13); color: var(--ink-500);
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
}
.sec-sub { font-size: var(--fs-13); color: var(--ink-500); margin-top: 2px; }

/* ---------- 分类标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-700); font-size: var(--fs-13); font-weight: 500;
  transition: all var(--dur-fast) var(--ease); white-space: nowrap;
}
.chip:active { transform: scale(.94); }
.chip.on { background: var(--green-900); border-color: var(--green-900); color: #fff; box-shadow: var(--sh-sm); }

/* ---------- 标签云 ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-pill {
  padding: 8px 16px; border-radius: var(--r-full); font-size: var(--fs-13);
  color: var(--green-800); background: var(--surface);
  border: 1px solid rgba(22,163,74,.15); box-shadow: var(--sh-xs);
  transition: all var(--dur-fast) var(--ease-spring);
}
.tag-pill:active { transform: scale(.94); background: var(--green-50); }

/* ---------- 金刚区 ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px 4px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 2px; }
.tile-ico {
  width: 46px; height: 46px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: var(--sh-sm);
  border: 1px solid rgba(231,226,214,.7);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.tile:active .tile-ico { transform: scale(.9) rotate(-4deg); }
.tile-ico svg { width: 24px; height: 24px; }
.tile-txt { font-size: var(--fs-11); color: var(--ink-700); font-weight: 500; }

/* ---------- 书籍封面（CSS 生成 · 无图片兜底） ---------- */
.book-cover {
  position: relative; flex: none; overflow: hidden;
  border-radius: var(--r-sm) 10px 10px var(--r-sm);
  box-shadow: var(--sh-md);
  background: var(--grad-ink);
  color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 10px;
  aspect-ratio: 3/4;
  isolation: isolate;
}
.book-cover::before { /* 书脊高光 */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.08) 5%, rgba(255,255,255,0) 18%);
  z-index: 2; pointer-events: none;
}
.book-cover::after { /* 底部光环 */
  content: ""; position: absolute; inset: auto -20% -30% -20%; height: 60%;
  background: radial-gradient(60% 100% at 50% 100%, rgba(255,255,255,.25) 0%, rgba(255,255,255,0) 70%);
  z-index: 1; pointer-events: none;
}
.book-cover-cat {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-size: 9px; letter-spacing: .12em; padding: 2px 7px;
  border-radius: var(--r-full); background: rgba(255,255,255,.16);
  backdrop-filter: blur(4px); color: rgba(255,255,255,.92);
}
.book-cover-title {
  position: relative; z-index: 3;
  font-size: 15px; font-weight: 800; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.book-cover-author {
  position: relative; z-index: 3; margin-top: 4px;
  font-size: 10px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.book-cover.deco-line::before { /* 古典横线装饰（用于经典类） */
  content: ""; position: absolute; left: 10px; right: 10px; top: 12%;
  height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  z-index: 3;
}
/* 封面色谱 */
.cover-forest  { background: linear-gradient(150deg, #14532d 0%, #166534 55%, #22c55e 130%); }
.cover-wine    { background: linear-gradient(150deg, #4a1d24 0%, #7f1d1d 60%, #b91c1c 135%); }
.cover-ocean   { background: linear-gradient(150deg, #0c2340 0%, #1e3a8a 60%, #2563eb 135%); }
.cover-night   { background: linear-gradient(150deg, #111827 0%, #1f2937 55%, #4b5563 135%); }
.cover-gold    { background: linear-gradient(150deg, #92400e 0%, #d97706 60%, #fbbf24 135%); }
.cover-plum    { background: linear-gradient(150deg, #3b0764 0%, #6b21a8 60%, #a855f7 135%); }
.cover-teal    { background: linear-gradient(150deg, #134e4a 0%, #0f766e 60%, #14b8a6 135%); }
.cover-rose    { background: linear-gradient(150deg, #881337 0%, #be123c 60%, #fb7185 135%); }
.cover-slate   { background: linear-gradient(150deg, #1e293b 0%, #334155 55%, #64748b 135%); }
.cover-ember   { background: linear-gradient(150deg, #431407 0%, #c2410c 60%, #f97316 135%); }
.cover-jade    { background: linear-gradient(150deg, #064e3b 0%, #059669 60%, #34d399 135%); }
.cover-indigo  { background: linear-gradient(150deg, #1e1b4b 0%, #4338ca 60%, #818cf8 135%); }
.cover-crimson { background: linear-gradient(150deg, #4c0519 0%, #9f1239 60%, #f43f5e 135%); }
.cover-olive   { background: linear-gradient(150deg, #3f4a14 0%, #65a30d 60%, #a3e635 135%); }
.cover-cyan    { background: linear-gradient(150deg, #164e63 0%, #0891b2 60%, #22d3ee 135%); }
.cover-brown   { background: linear-gradient(150deg, #3b2f2f 0%, #78350f 55%, #a16207 135%); }

/* ---------- 书籍横滑条 ---------- */
.hscroll {
  display: flex; gap: var(--sp-4); overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px var(--sp-5) var(--sp-4);
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }
.book-card { width: 104px; }
.book-card .book-cover { width: 104px; }
.book-card-title { font-size: var(--fs-13); font-weight: 600; margin-top: 8px; line-height: 1.4; }
.book-card-sub { font-size: var(--fs-11); color: var(--ink-500); margin-top: 2px; }
.book-card-big { width: 128px; }
.book-card-big .book-cover { width: 128px; }

/* ---------- 列表行 ---------- */
.list-cell {
  display: flex; align-items: center; gap: 12px;
  padding: 14px var(--sp-5); background: var(--surface);
  transition: background var(--dur-fast);
}
.list-cell:active { background: var(--bg-soft); }
.list-cell + .list-cell { border-top: 1px solid var(--line-soft); }
.list-cell-ico {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-50); color: var(--green-700);
}
.list-cell-ico svg { width: 20px; height: 20px; }
.list-cell-main { flex: 1; min-width: 0; }
.list-cell-title { font-size: var(--fs-15); font-weight: 600; color: var(--ink-900); }
.list-cell-sub { font-size: var(--fs-12); color: var(--ink-500); margin-top: 1px; }
.list-cell-arrow { color: var(--ink-300); font-size: 18px; flex: none; display: flex; }
.list-cell-badge {
  padding: 3px 9px; border-radius: var(--r-full); font-size: var(--fs-11);
  background: var(--gold-50); color: var(--gold-600); font-weight: 600; flex: none;
}

/* ---------- 分段器 / Tabs ---------- */
.seg {
  display: inline-flex; padding: 4px; border-radius: var(--r-full);
  background: var(--bg-soft); gap: 2px;
}
.seg button {
  padding: 7px 16px; border-radius: var(--r-full);
  font-size: var(--fs-13); font-weight: 600; color: var(--ink-500);
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--green-900); box-shadow: var(--sh-xs); }

.scroll-tabs::-webkit-scrollbar { display: none; }

/* ---------- Banner ---------- */
.banner-stage { position: relative; height: 170px; border-radius: var(--r-lg); overflow: hidden; }
/* P3-2 精简：banner 切换为显隐 + banner-in 动画（见 app.css .banner-slide.active），
   .banner-track 的 flex 平移过渡从未被 JS 驱动（home.js 只切 class），移除死样式，保留容器声明 */
.banner-track { position: relative; height: 100%; }
.banner-slide {
  min-width: 100%; height: 100%; padding: 24px 22px;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff; position: relative; overflow: hidden;
}
.banner-slide .bg-deco {
  position: absolute; inset: 0; z-index: 0;
  background: var(--grad-brand);
}
.banner-slide:nth-child(2) .bg-deco { background: linear-gradient(135deg, #0f3d22 0%, #065f46 55%, #065f46 100%); }
.banner-slide:nth-child(3) .bg-deco { background: linear-gradient(135deg, #3b2f0c 0%, #92400e 55%, #b45309 100%); }
.banner-slide:nth-child(4) .bg-deco { background: linear-gradient(135deg, #111827 0%, #1e40af 60%, #3730a3 100%); }
.banner-slide:nth-child(5) .bg-deco { background: linear-gradient(135deg, #3f3a10 0%, #854d0e 50%, #a16207 100%); }
.banner-slide .bg-ring {
  position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; border: 30px solid rgba(255,255,255,.06); z-index: 1;
}
.banner-slide .bg-ring2 { position: absolute; right: 30px; bottom: -90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.05); z-index: 1; }
.banner-slide * { position: relative; z-index: 2; }
.banner-kicker {
  align-self: flex-start; font-size: var(--fs-11); letter-spacing: .18em;
  padding: 4px 12px; border-radius: var(--r-full);
  background: rgba(255,255,255,.15); backdrop-filter: blur(6px);
  margin-bottom: 10px;
}
.banner-title { font-size: var(--fs-24); font-weight: 800; line-height: 1.3; }
.banner-desc { font-size: var(--fs-13); opacity: .85; margin-top: 6px; }
.banner-dots {
  position: absolute; bottom: 12px; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: center; gap: 6px;
}
.banner-dots i {
  width: 6px; height: 6px; border-radius: var(--r-full);
  background: rgba(255,255,255,.4); transition: all var(--dur-fast) var(--ease);
}
.banner-dots i.on { width: 18px; background: #fff; }

/* ---------- 页面头部 ---------- */
.page-head.scrolled { border-bottom-color: var(--line-soft); box-shadow: 0 4px 20px rgba(20,83,45,.05); }
.page-head-title { font-size: var(--fs-18); font-weight: 800; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-btn {
  width: 38px; height: 38px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: var(--sh-xs);
  border: 1px solid var(--line-soft); flex: none;
}
.head-btn svg { width: 19px; height: 19px; color: var(--ink-700); }

/* ---------- 首页品牌头部 ---------- */
.home-hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lock