/* =========================================================
   元一炁图书 · 用户端（仅手机端）
   DESIGN DNA
   - 气质：克制、清爽、可靠（工具感）× 一点点书卷气（衬线 Logo）
   - 字体：系统黑体做 UI/正文；宋体仅用于品牌字与大数字（签名细节）
   - 色板：60 中性底 / 30 面与线 / 10 品牌紫强调；状态色仅表状态
   - 布局：严格左对齐、16px 边距、4/8 间距体系、一屏一个主角
   - 签名：Duolingo 粗体按压按钮（硬阴影 + 下沉）；宋体「炁」
   - 层级：字号跳跃明显（27/22/18/17/15/13/12），字重 400/600/800
   ========================================================= */

:root {
  /* 色彩（按角色命名；带紫调的中性色，非纯灰） */
  --bg: #f5f4f9;
  --surface: #ffffff;
  --surface-2: #f0eef6;
  --surface-3: #e5e2ef;
  --ink: #221f33;
  --ink-2: #5c5872;
  --ink-3: #8d88a2;
  --line: #ebe8f4;
  --line-2: #d8d3e8;

  --brand: #6a5ae0;
  --brand-strong: #5847c7;
  --brand-shadow: #3f31a3;
  --brand-weak: #ece9fc;
  --brand-weak-2: #f4f2fd;

  --leaf: #4faa1e;
  --leaf-shadow: #367c0e;
  --leaf-weak: #e8f6d9;

  --danger: #d8485f;
  --danger-shadow: #a32a40;
  --danger-weak: #fbe7ea;
  --gold: #c07d16;

  --c-available: #3f8f5c;
  --c-borrowed: #4f6f96;
  --c-lost: #b8760f;
  --c-damaged: #a85656;

  /* 默认封面（无上传图时）：统一浅灰，不花哨 */
  --cover-bg: #e9e9ee;
  --cover-ink: #a3a2ad;

  /* 字体层级（模数 ~1.25，跳跃明显） */
  --fs-caption: 12px;
  --fs-meta: 13px;
  --fs-body: 15px;
  --fs-lead: 17px;
  --fs-h3: 18px;
  --fs-h2: 22px;
  --fs-h1: 27px;
  --lh-tight: 1.25;
  --lh-snug: 1.5;
  --lh-body: 1.78;

  /* 间距（4px 基准） */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px;

  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --gutter: 16px;
  --shadow-1: 0 1px 2px rgba(34,31,51,.05);
  --shadow-2: 0 2px 6px rgba(34,31,51,.06), 0 12px 28px rgba(34,31,51,.07);
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);          /* 弹簧回弹：带轻微过冲 */
  --ease-spring-soft: cubic-bezier(.2, 1.25, .4, 1);      /* 弹性缓冲：更柔的回弹 */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* 全站衬线：精致书卷气质（含中文宋体回退） */
  --font-sans: "Source Han Serif SC", "Songti SC", "STSong", "Noto Serif SC",
    "SimSun", "宋体", Georgia, "Times New Roman", serif;
  --font-serif: "Source Han Serif SC", "Songti SC", "STSong", "Noto Serif SC",
    "SimSun", "宋体", Georgia, "Times New Roman", serif;
  /* 底部导航（默认样式，非悬浮） */
  --tabbar-h: 62px;
  --nav-bottom: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--ink-2); font-size: var(--fs-meta); }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--brand-weak); outline-offset: 1px; border-radius: 6px; }

/* ============ 图标（极简线性，内联 sprite） ============ */
.icon {
  width: 22px; height: 22px; flex: none; display: block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.tab-ico .icon { width: 23px; height: 23px; }
.search-ico .icon { width: 18px; height: 18px; }
.set-ico { display: flex; align-items: center; justify-content: center; }
.set-ico .icon { width: 20px; height: 20px; }
.set-arrow { display: flex; }
.set-arrow .icon { width: 18px; height: 18px; }
.pact .ico { display: flex; }
.pact .ico .icon { width: 18px; height: 18px; }
.book-chip .bc-ico .icon { width: 16px; height: 16px; }
.fab .icon { width: 26px; height: 26px; }
.subpage-back .icon { width: 22px; height: 22px; }
.modal-close .icon { width: 20px; height: 20px; }
.share-icon .icon { width: 22px; height: 22px; }
.icon-round .icon { width: 18px; height: 18px; }
.pc-attach-btn .icon { width: 17px; height: 17px; }
.more-pop button { display: flex; align-items: center; gap: 8px; text-align: left; }
.more-pop button .icon { width: 17px; height: 17px; flex: none; }
.book-loc { display: flex; align-items: center; gap: 4px; }
.book-loc .loc-ico { width: 14px; height: 14px; }

/* ============ 按钮：Duolingo 粗体按压（签名） ============ */
.btn {
  appearance: none; border: none; border-radius: 14px;
  padding: 13px 18px; font-size: var(--fs-body); font-weight: 800; letter-spacing: .3px;
  color: var(--ink); background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .09s var(--ease), box-shadow .09s var(--ease), filter .15s;
  user-select: none;
}
.btn:hover { filter: brightness(1.04); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-shadow); }
.btn.leaf { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 var(--leaf-shadow); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 4px 0 var(--danger-shadow); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--line-2); }
.btn.primary:active, .btn.leaf:active, .btn.danger:active, .btn.ghost:active {
  transform: translateY(4px) scale(.975); box-shadow: 0 0 0 rgba(0,0,0,0);
}
.btn.block { width: 100%; }
.btn.big { font-size: var(--fs-lead); padding: 16px 20px; border-radius: 16px; }
.btn.sm { padding: 9px 14px; font-size: var(--fs-meta); border-radius: 11px; box-shadow: 0 3px 0 var(--line-2); }
.btn.sm.primary { box-shadow: 0 3px 0 var(--brand-shadow); }
.btn.sm.leaf { box-shadow: 0 3px 0 var(--leaf-shadow); }
.btn.sm.danger { box-shadow: 0 3px 0 var(--danger-shadow); }
.btn.sm:active { transform: translateY(3px) scale(.975); box-shadow: 0 0 0 rgba(0,0,0,0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ============ 表单 ============ */
.field { display: block; margin-bottom: var(--s4); }
.field > span { display: block; font-size: var(--fs-meta); color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: 12px 13px; font-size: var(--fs-body); line-height: 1.5; color: var(--ink);
  background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:focus, .field textarea:focus { outline: none; background: var(--surface); border-color: var(--brand); }
.form-actions { display: flex; gap: var(--s3); margin-top: var(--s3); }
.form-actions .btn { flex: 1; }
.form-title { font-size: var(--fs-h2); font-weight: 800; margin-bottom: var(--s2); letter-spacing: .2px; }
.form-hint { font-size: var(--fs-meta); color: var(--ink-2); margin-bottom: var(--s4); }

/* ============ 认证页 ============ */
.auth-screen {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s6);
  background: radial-gradient(130% 90% at 50% -12%, var(--brand-weak) 0%, rgba(0,0,0,0) 58%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s6) var(--s5); box-shadow: var(--shadow-2);
}
.brand { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s6); }
.brand-blob {
  width: 50px; height: 50px; border-radius: 15px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 26px; font-weight: 800; flex: none;
  font-family: var(--font-serif); box-shadow: 0 4px 0 var(--brand-shadow);
}
.wordmark { font-size: 21px; font-weight: 800; letter-spacing: 1px; font-family: var(--font-serif); }
.tagline { font-size: var(--fs-meta); color: var(--ink-2); margin-top: 2px; }
.seg { position: relative; display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: var(--s5); }
.seg-btn { flex: 1; position: relative; z-index: 1; border: none; background: transparent; padding: 10px 0; font-size: var(--fs-body); font-weight: 700; color: var(--ink-2); }
.seg-btn.active { color: var(--brand); }
.seg-thumb { position: absolute; top: 4px; left: 4px; bottom: 4px; width: calc(50% - 4px); background: var(--surface); border-radius: 9px; box-shadow: var(--shadow-1); transition: transform .28s var(--ease); }
.seg-thumb.right { transform: translateX(100%); }
.auth-form { display: flex; flex-direction: column; }
.auth-tip { font-size: var(--fs-caption); color: var(--ink-3); text-align: center; margin-top: var(--s3); }
.auth-foot { margin-top: var(--s5); font-size: var(--fs-caption); color: var(--ink-3); text-align: center; }
.msg { font-size: var(--fs-meta); color: var(--danger); margin-top: var(--s3); min-height: 16px; text-align: center; font-weight: 600; }

/* ============ 布局（手机唯一） ============ */
.app { min-height: 100dvh; background: var(--bg); }
.main {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--s5)) var(--gutter) calc(var(--tabbar-h) + var(--s7) + env(safe-area-inset-bottom));
}
/* 顶部滚动进度：一条极细的品牌色线，随阅读进度推进（深层动效，不抢戏） */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: linear-gradient(90deg, var(--brand), var(--leaf));
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .12s linear, opacity .3s var(--ease);
  opacity: 0; pointer-events: none;
}
.scroll-progress.on { opacity: 1; }
.view + .view { margin-top: 0; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
/* 页面主标题：软件名 / 页名（一屏唯一主标题） */
.page-title {
  font-size: var(--fs-h1); font-weight: 800; letter-spacing: .5px; line-height: var(--lh-tight);
  font-family: var(--font-serif); margin-bottom: var(--s4);
}
.view-head .page-title { margin-bottom: 0; }

/* 搜索 */
.search-bar {
  display: flex; align-items: center; gap: var(--s2); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; padding: 0 var(--s3); margin-bottom: var(--s3);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.search-bar:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 10%, transparent);
}
.search-ico { color: var(--ink-3); font-size: 15px; display: flex; transition: color .2s; }
.search-bar:focus-within .search-ico { color: var(--brand); }
.search-bar input { flex: 1; border: none; outline: none; background: transparent; padding: 11px 0; font-size: var(--fs-body); color: var(--ink); min-width: 0; }
.search-bar input::placeholder { color: var(--ink-3); }
.search-bar input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ============ 书架顶部搜索 + Banner ============ */
/* 搜索框：随内容流滚动（不吸顶），紧凑尺寸，聚焦时才「站起来」 */
.shelf-search { margin-bottom: var(--s4); padding: 0 12px; }
.shelf-search input { padding: 7px 0; font-size: 14px; line-height: 1.5; }
.shelf-search .search-ico .icon { width: 17px; height: 17px; }
/* 头图：仅为图片，不可点击、无阴影、无标题；图片按原始比例展示（限高） */
.shelf-hero {
  position: relative; width: 100%; aspect-ratio: 16 / 7; max-height: 200px; min-height: 116px;
  overflow: hidden; border-radius: var(--radius);
  background: var(--surface-3);
  margin-bottom: var(--s5);
  animation: heroIn .6s var(--ease) both;
}
.shelf-hero[hidden] { display: none; }
.shelf-hero-img, .shelf-hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-hero.has-img { aspect-ratio: auto; min-height: 0; max-height: none; background: var(--surface-3); }
.shelf-hero.has-img .shelf-hero-img { position: static; width: 100%; height: auto; max-height: 240px; object-fit: cover; }
.shelf-hero.has-video { aspect-ratio: 16 / 9; max-height: 236px; min-height: 150px; }
@keyframes heroIn { from { opacity: 0; transform: scale(1.02); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* 书架分区：不采用模块化卡片，扁平、留白、有主次 */
.shelf-section { margin-top: var(--s4); }
#shelf-home .shelf-section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.section-head .section-title { margin: 0; }
.link-btn {
  background: none; border: 0; color: var(--brand-strong); font-size: 13px; font-weight: 700;
  padding: 4px 2px; cursor: pointer; border-radius: 8px; transition: opacity .18s, transform .18s var(--ease);
}
.link-btn:active { opacity: .55; transform: translateX(2px); }

/* ============ 书籍卡片（一行三列，直角封面） ============ */
.book-grid { display: grid; gap: var(--s5) var(--s3); }
.book-grid.three { grid-template-columns: repeat(3, 1fr); }
.book-grid.two { grid-template-columns: repeat(2, 1fr); gap: var(--s4) var(--s3); }
.book-card { animation: cardIn .5s var(--ease) both; }
.book-card.grid-item {
  position: relative; display: flex; flex-direction: column; gap: 5px;
  background: transparent; border: 0; padding: 0; box-shadow: none; overflow: visible; cursor: pointer;
  transition: transform .22s var(--ease);
}
.book-card.grid-item:active { transform: scale(.965); }
.bc-cover-wrap {
  position: relative; overflow: hidden; background: var(--cover-bg);
  box-shadow: inset 0 0 0 1px rgba(34,31,51,.05), 0 1px 2px rgba(34,31,51,.06);
  transition: box-shadow .28s var(--ease), transform .28s var(--ease);
}
.book-card.grid-item:active .bc-cover-wrap { box-shadow: inset 0 0 0 1px rgba(34,31,51,.08), 0 6px 16px rgba(34,31,51,.12); }
.bc-cover {
  width: 100%; aspect-ratio: 3 / 4; border-radius: 0; overflow: hidden;
  background: var(--cover-bg); color: var(--cover-ink); display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 28px; letter-spacing: 1px;
  transition: transform .5s var(--ease);
}
/* 封面：默认浅灰统一底色 + 极淡纹理，避免「空白方块」的廉价感 */
.bc-cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(160deg, rgba(255,255,255,.5), rgba(255,255,255,0) 42%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.42) 0 1px, transparent 1px 10px);
  opacity: .34;
}
.bc-cover { position: relative; }
.bc-cover img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.bc-cover > span { position: relative; z-index: 1; }
.book-card.grid-item:active .bc-cover { transform: scale(1.03); }
.bc-badge { position: absolute; top: 6px; left: 6px; z-index: 2; display: flex; gap: 4px; flex-wrap: wrap; max-width: calc(100% - 12px); }
.bc-badge .bc-tag, .bc-badge .bc-flag { position: static; transform: none; animation: none; font-size: 10px; padding: 3px 7px; letter-spacing: 0; }
.bc-title {
  font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; word-break: break-word;
}
.bc-author { font-size: 11px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bc-rec { font-size: 11px; color: var(--brand-strong); font-weight: 700; display: flex; align-items: center; gap: 3px; }
.bc-rec::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }
.bc-due { font-size: var(--fs-caption); color: var(--ink-2); }
.bc-due.over { color: var(--danger); font-weight: 700; }
/* 状态角标（行卡片 / 封面角标共用） */
.bc-flag { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; animation: popSpring .42s var(--ease-spring) both; animation-delay: .18s; }
.bc-flag.borrowed { background: var(--brand-weak); color: var(--brand-strong); }
.bc-flag.lost { background: var(--danger-weak); color: var(--danger); }
.bc-flag.damaged { background: color-mix(in srgb, var(--c-damaged) 14%, #fff); color: var(--c-damaged); }
/* 借阅状态标签：可借=绿、借出=红；圆角与卡片统一，不抢戏 */
.bc-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 800; white-space: nowrap; letter-spacing: .3px;
  animation: tagPop .5s var(--ease-spring) both; animation-delay: .18s; z-index: 2;
}
.bc-tag.avail { color: var(--leaf); background: color-mix(in srgb, var(--leaf) 13%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--leaf) 32%, #fff); }
.bc-tag.borrowed { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 32%, #fff); }
/* 我的借阅：归还按钮 */
.bc-return { position: absolute; right: var(--s3); top: 50%; transform: translateY(-50%); }
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 7px; }
.badge.available { background: color-mix(in srgb, var(--c-available) 15%, #fff); color: var(--c-available); }
.badge.borrowed { background: color-mix(in srgb, var(--c-borrowed) 15%, #fff); color: var(--c-borrowed); }
.badge.lost { background: color-mix(in srgb, var(--c-lost) 18%, #fff); color: var(--c-lost); }
.badge.damaged { background: color-mix(in srgb, var(--c-damaged) 15%, #fff); color: var(--c-damaged); }

/* ============ 空状态（图标化） ============ */
.empty { text-align: center; padding: var(--s8) var(--s5); color: var(--ink-2); }
.empty.sm { padding: var(--s6) var(--s3) var(--s5); }
.empty.plain { padding: var(--s5) var(--s3); }
.empty-mark { width: 76px; height: 76px; margin: 0 auto var(--s4); border-radius: 50%; background: var(--brand-weak); display: grid; place-items: center; }
.empty-mark svg { width: 36px; height: 36px; stroke: var(--brand-strong); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.empty .btn { margin-top: var(--s4); }

/* ============ 区块标题 ============ */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: var(--s7) 0 var(--s4); }
.section-title { font-size: var(--fs-h3); font-weight: 800; letter-spacing: .2px; margin-top: var(--s6); margin-bottom: var(--s3); }
.count { font-size: var(--fs-caption); font-weight: 800; color: var(--ink-2); background: var(--surface-2); border-radius: var(--gutter); padding: 1px 9px; }
.sec-link { font-size: var(--fs-meta); font-weight: 700; color: var(--brand); background: none; border: none; }

/* ============ 广场 / 帖子 ============ */
.feed { display: flex; flex-direction: column; gap: var(--s3); }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow-1); }
.post-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.post-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-weak); color: var(--brand-strong); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; font-family: var(--font-serif); }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-who { flex: 1; min-width: 0; }
.post-name { font-size: var(--fs-body); font-weight: 700; }
.post-time { font-size: var(--fs-caption); color: var(--ink-3); }
.post-del { border: none; background: transparent; color: var(--ink-3); font-size: 16px; padding: var(--s1) var(--s2); border-radius: 8px; }
.post-del:hover { background: var(--danger-weak); color: var(--danger); }
.post-text { font-size: var(--fs-body); line-height: var(--lh-body); white-space: pre-wrap; word-break: break-word; }
.post-imgs { display: grid; gap: 6px; margin-top: var(--s3); }
.post-imgs.n1 { grid-template-columns: 1fr; }
.post-imgs.n2, .post-imgs.n3, .post-imgs.n4 { grid-template-columns: repeat(2, 1fr); }
.post-imgs img { width: 100%; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); display: block; }
.post-imgs.n1 img { max-height: 320px; }
.post-imgs.n2 img, .post-imgs.n3 img, .post-imgs.n4 img { aspect-ratio: 1; }
.book-chip {
  display: inline-flex; align-items: center; gap: var(--s2); margin-top: var(--s3); padding: 10px var(--s3);
  background: var(--brand-weak); color: var(--brand-strong); border-radius: var(--radius-sm);
  font-weight: 700; font-size: var(--fs-meta); border: none; max-width: 100%; text-align: left;
}
.book-chip .bc-ico { font-size: 16px; }
.book-chip .bc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-chip:active { filter: brightness(.97); }
.post-actions { display: flex; align-items: center; gap: var(--s1); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.pact { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; background: transparent; color: var(--ink-2); font-size: var(--fs-meta); font-weight: 700; padding: var(--s2); border-radius: 10px; transition: background .15s, color .15s; }
.pact:hover { background: var(--surface-2); }
.pact .ico { font-size: 17px; }
.pact.liked { color: var(--danger); }
.pact.liked .ico { animation: pop .3s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
/* 标签弹出：从上方小点弹入并轻微回弹 */
@keyframes tagPop {
  0%   { opacity: 0; transform: scale(.4) translateY(-8px); }
  60%  { opacity: 1; transform: scale(1.14) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}
/* 果冻弹跳：点赞 / 标记 / 角标出现 */
@keyframes popSpring {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  70%  { transform: scale(.9); }
  100% { transform: scale(1); }
}

/* 发帖弹窗 */
.pc-text { width: 100%; min-height: 116px; resize: none; }
.pc-attach { display: flex; gap: var(--s2); margin: var(--s2) 0 var(--s3); }
.pc-attach-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  border-radius: 12px; padding: 11px 12px; font-size: var(--fs-meta); font-weight: 700;
  transition: border-color .15s, color .15s, background .15s;
}
.pc-attach-btn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-weak-2); }
.pc-thumbs { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.pc-thumb { position: relative; width: 74px; height: 74px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-thumb .rm { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(34,31,51,.82); color: #fff; font-size: 13px; line-height: 1; display: grid; place-items: center; }
.pc-count { text-align: right; font-size: var(--fs-caption); color: var(--ink-3); margin-bottom: var(--s2); font-variant-numeric: tabular-nums; }

/* 关联书籍：封面 + 书名/作者 + 移除（一行对齐） */
.pc-bookcard {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  padding: var(--s2); margin-bottom: var(--s3);
}
.pc-bookcard-cover {
  width: 38px; height: 50px; border-radius: 8px; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--cover-bg); color: var(--cover-ink);
  font-weight: 800; font-family: var(--font-serif);
}
.pc-bookcard-cover img { width: 100%; height: 100%; object-fit: cover; }
.pc-bookcard-info { flex: 1; min-width: 0; }
.pc-bookcard-info b { display: block; font-size: var(--fs-body); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-bookcard-info span { display: block; font-size: var(--fs-caption); color: var(--ink-2); margin-top: 2px; }
.pc-bookcard-x {
  width: 30px; height: 30px; flex: none; border: none; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-2); font-size: 16px; display: grid; place-items: center;
}

/* 选书面板 */
.pc-picker { margin-bottom: var(--s3); }
.pc-picker .search-bar { margin-bottom: var(--s2); }
.pc-picker .picker-list { max-height: 34dvh; }
.pc-pick {
  display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--s2);
}
.pc-pick + .pc-pick { margin-top: 6px; }
.pc-pick:active { background: var(--surface-2); }
.pc-pick .pc-bookcard-cover { width: 32px; height: 42px; }
.pc-pick-info { flex: 1; min-width: 0; }
.pc-pick-info b { display: block; font-size: var(--fs-meta); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-pick-info span { display: block; font-size: 11px; color: var(--ink-3); }

/* 评论 */
.cmt { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: none; }
.cmt-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-weak); color: var(--brand-strong); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; font-size: 14px; font-family: var(--font-serif); }
.cmt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-name { font-size: var(--fs-meta); font-weight: 800; }
.cmt-text { font-size: var(--fs-body); line-height: 1.5; word-break: break-word; }
.cmt-time { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.cmt-input-row { display: flex; gap: var(--s2); margin-top: var(--s3); align-items: center; }
.cmt-input-row input { flex: 1; min-width: 0; }

/* ============ 个人中心 ============ */
.profile-head { text-align: center; padding: var(--s2) 0 var(--s1); }
.avatar-xl {
  width: 88px; height: 88px; margin: 0 auto var(--s3); border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); display: grid; place-items: center; font-size: 34px; font-weight: 700;
  position: relative; cursor: pointer; overflow: hidden; font-family: var(--font-serif);
}
.avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: var(--fs-h2); font-weight: 800; letter-spacing: .5px; }
.profile-head .btn { margin-top: var(--s3); }

/* ============ 元炁分（纵向节奏：标签 → 数值 → 进度 → 事实） ============ */
.points {
  margin-top: var(--s5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s5); box-shadow: var(--shadow-1);
}
.points-head { display: flex; align-items: center; justify-content: space-between; }
.points-label { font-size: var(--fs-meta); font-weight: 700; color: var(--ink-2); letter-spacing: .5px; }
.points-tag {
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  color: var(--c-available); background: color-mix(in srgb, var(--c-available) 12%, #fff);
}
.points-tag.warn { color: var(--danger); background: var(--danger-weak); }
.points-score { display: flex; align-items: baseline; gap: 6px; margin-top: var(--s2); }
.points-score b {
  font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.points-total { font-size: var(--fs-meta); color: var(--ink-3); font-weight: 700; }
.points-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: var(--s3); }
.points-bar span { display: block; height: 100%; border-radius: 999px; background: var(--leaf); transition: width .45s var(--ease); }
.points-bar span.is-low { background: var(--danger); }
.points-facts {
  display: flex; align-items: stretch; margin-top: var(--s4); padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
.pf { flex: 1; min-width: 0; text-align: center; }
.pf + .pf { border-left: 1px solid var(--line); }
.pf b { display: block; font-size: var(--fs-lead); font-weight: 800; font-variant-numeric: tabular-nums; }
.pf span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.points-warn {
  margin-top: var(--s3); font-size: var(--fs-caption); font-weight: 700; color: var(--danger);
  background: var(--danger-weak); border-radius: 10px; padding: 8px 10px; text-align: center;
}

/* 统计 */
.profile-stats { display: flex; margin-top: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.stat-pill { flex: 1; padding: var(--s3) 6px; text-align: center; }
.stat-pill + .stat-pill { border-left: 1px solid var(--line); }
.stat-pill b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-pill span { font-size: 11px; color: var(--ink-2); }

/* 当前借阅小卡（行对齐：固定头 + 弹性中 + 固定尾） */
.mini-list { display: flex; flex-direction: column; gap: var(--s2); }
.mini-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: left; width: 100%; box-shadow: var(--shadow-1); }
.mini-row:active { background: var(--surface-2); }
.mini-cover { width: 40px; height: 54px; border-radius: 8px; flex: none; display: grid; place-items: center; color: var(--cover-ink); font-weight: 800; background: var(--cover-bg); overflow: hidden; font-family: var(--font-serif); }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-info { flex: 1; min-width: 0; }
.mini-title { font-size: var(--fs-body); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { font-size: var(--fs-caption); color: var(--ink-2); margin-top: 2px; }
.mini-sub.over { color: var(--danger); font-weight: 700; }
.mini-arrow { color: var(--ink-3); font-size: 20px; flex: none; }

/* 设置列表 */
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.set-row {
  width: 100%; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
  border: none; background: var(--surface); border-bottom: 1px solid var(--line); text-align: left; transition: background .15s;
}
.set-row:last-child { border-bottom: none; }
.set-row:active { background: var(--surface-2); }
.set-ico { font-size: 18px; width: 26px; text-align: center; flex: none; }
.set-main { flex: 1; min-width: 0; }
.set-main b { font-size: var(--fs-body); font-weight: 700; display: block; }
.set-main small { font-size: var(--fs-caption); color: var(--ink-2); }
.set-arrow { color: var(--ink-3); font-size: 20px; flex: none; }
.set-count {
  font-size: 12px; font-weight: 800; color: var(--ink-2); background: var(--surface-2);
  border-radius: 999px; padding: 2px 9px; flex: none; font-variant-numeric: tabular-nums;
}
.set-row.danger .set-main b { color: var(--danger); }

/* ============ 账户编辑 / 当前借阅（二级页面内容） ============ */
.account-head {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s2) var(--s1) var(--s5);
}
.account-head .avatar-xl { margin: 0; flex: none; width: 64px; height: 64px; font-size: 26px; }
.account-id { min-width: 0; }
.account-id b { display: block; font-size: var(--fs-lead); font-weight: 800; }
.account-id span { display: block; font-size: var(--fs-meta); color: var(--ink-3); margin-top: 2px; }

.loan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); box-shadow: var(--shadow-1); margin-bottom: var(--s3);
}
.loan-top { display: flex; align-items: center; gap: var(--s3); }
.loan-info { flex: 1; min-width: 0; }
.loan-title { font-size: var(--fs-body); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loan-sub { font-size: var(--fs-caption); color: var(--ink-2); margin-top: 2px; }
.loan-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line);
}
.loan-due { font-size: var(--fs-meta); color: var(--ink-2); font-weight: 600; }
.loan-due.over { color: var(--danger); font-weight: 800; }

/* 编辑资料：头像 + 上传按钮 */
.avatar-edit { display: flex; flex-direction: column; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.avatar-edit .avatar-xl { margin: 0; cursor: default; }

/* ============ 时间线 ============ */
.timeline { display: flex; flex-direction: column; gap: var(--s3); padding-left: 2px; }
.tl-item { position: relative; display: flex; gap: var(--s3); }
/* 连接相邻记录的竖线：让「上一条 / 下一条」一目了然 */
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 6px; top: 20px; bottom: calc(-1 * var(--s3));
  width: 2px; background: var(--line-2); border-radius: 2px;
}
.tl-dot {
  position: relative; z-index: 1; width: 13px; height: 13px; border-radius: 50%;
  background: var(--line-2); margin-top: 4px; flex: none; box-shadow: 0 0 0 3px var(--surface);
}
.tl-item.ev-borrow .tl-dot, .tl-item.ev-return .tl-dot { background: var(--c-borrowed); }
.tl-item.ev-lost .tl-dot { background: var(--c-lost); }
.tl-item.ev-damage .tl-dot { background: var(--c-damaged); }
.tl-item.ev-added .tl-dot, .tl-item.ev-edit .tl-dot { background: var(--c-available); }
.tl-item.ev-borrow-return .tl-dot { background: var(--c-borrowed); }
.timeline .tl-item { animation: rise .5s var(--ease) both; }
/* 每条流转记录独立成卡，彼此分明 */
.tl-card {
  flex: 1; min-width: 0; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--s3) var(--s4);
}
.tl-title { font-size: var(--fs-body); font-weight: 800; color: var(--ink); }
.tl-sub { font-size: var(--fs-caption); color: var(--ink-2); margin-top: 3px; }
.tl-time { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

/* ============ 二级页面（当前借阅 / 历史 / 账户编辑 / 更多） ============ */
.subpage {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%); opacity: 0; pointer-events: none;
  transition: transform .28s var(--ease), opacity .2s var(--ease);
}
.subpage.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.subpage-head {
  display: flex; align-items: center; gap: var(--s2); flex: none;
  padding: calc(env(safe-area-inset-top) + var(--s3)) var(--gutter) var(--s3);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.subpage-back {
  width: 38px; height: 38px; flex: none; border: none; border-radius: 12px;
  background: var(--surface); color: var(--ink); font-size: 24px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 2px 0 var(--line-2);
}
.subpage-back:active { transform: translateY(2px); box-shadow: none; }
.subpage-head h2 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: .3px; }
.subpage-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: var(--s4) var(--gutter) calc(var(--s7) + env(safe-area-inset-bottom));
}
.subpage-body .section-title:first-child { margin-top: 0; }

/* ============ 底部导航 ============ */
/* ============ 底部导航：默认样式（贴合底边的标准标签栏） ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: space-evenly; align-items: center;
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -1px 0 rgba(34,31,51,.03), 0 -8px 24px rgba(34,31,51,.05);
  animation: tabbarIn .52s var(--ease) both;
}
.tab {
  flex: none; border: none; background: transparent; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 700;
  letter-spacing: .5px; position: relative; overflow: visible;
  transition: color .22s var(--ease);
}
.tab-ico { font-size: 21px; display: flex; transition: transform .3s var(--ease); }
.tab-ico .icon { transition: transform .3s var(--ease); }
.tab.active { color: var(--brand); }
.tab.active .tab-ico .icon { transform: scale(1.06); }
.tab.just-activated .tab-ico { animation: jelly .6s var(--ease-spring) both; }
.jelly { animation: jelly .6s var(--ease-spring) both; }
/* 滑动高亮药丸：加宽的水平胶囊，由 JS 计算位移与宽度（宽度 = 标签宽 + 22px） */
.tab-indicator {
  position: absolute; top: 50%; left: 0; height: 44px; width: 0;
  margin-top: -22px;
  background: var(--brand-weak); border-radius: 999px;
  pointer-events: none; z-index: 0; will-change: transform, width;
  transform: translateX(0);
  transition: transform .42s var(--ease-spring), width .42s var(--ease-spring), background .25s;
}
.tab { z-index: 1; }

/* ============ 发帖浮动按钮 ============ */
.fab {
  position: fixed; right: var(--s5); bottom: calc(var(--tabbar-h) + var(--s5) + env(safe-area-inset-bottom)); z-index: 45;
  width: 56px; height: 56px; border: none; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 30px; font-weight: 800; line-height: 1; box-shadow: 0 6px 0 var(--brand-shadow), 0 12px 24px rgba(63,49,163,.28);
  display: grid; place-items: center; transition: transform .1s var(--ease), box-shadow .1s;
}
.fab:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--brand-shadow); }
.fab.hidden { display: none; }
.fab { overflow: hidden; }
.fab:not(.hidden) { animation: fabIn .42s var(--ease) both; }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-end; justify-content: center; }
.modal.open { display: flex; }
/* 关闭：与打开对称地「落回底部」，而不是瞬间消失（深层交互细节） */
.modal.closing { display: flex; pointer-events: none; }
.modal.closing::before { animation: fadeOut .26s var(--ease) both; }
.modal.closing .modal-card { animation: sheetDown .32s var(--ease-in-out) both; }
.modal::before { content: ''; position: absolute; inset: 0; background: rgba(28,26,48,.5); animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheetDown { from { transform: translateY(0); opacity: 1; } to { transform: translateY(24px); opacity: 0; } }
.modal-card {
  position: relative; width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 90dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: var(--s6) var(--s5) calc(var(--s6) + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2);
}
.modal-close { position: absolute; top: var(--s3); right: var(--s3); width: 36px; height: 36px; border: none; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 21px; line-height: 1; z-index: 2; display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-3); }

/* ============ 书籍详情页（整页，从右滑入；不是弹窗） ============ */
.book-page { z-index: 55; }
.bp-head {
  display: flex; align-items: center; gap: var(--s2); flex: none;
  padding: calc(env(safe-area-inset-top) + var(--s2)) var(--gutter) var(--s1);
  background: var(--bg); position: relative; z-index: 3;
  transition: box-shadow .28s var(--ease), background .28s var(--ease);
}
.book-page.scrolled .bp-head { box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(28,26,48,.05); }
.bp-head-title { font-size: var(--fs-meta); font-weight: 800; letter-spacing: 1px; color: var(--ink-2); }
.bp-head-no { margin-left: auto; font-family: var(--font-num, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 11px; font-weight: 700; letter-spacing: .6px; color: var(--ink-3); }
.bp-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding-bottom: var(--s6);
}
/* 封面舞台：把封面图放大模糊做成背景，颜色从书本身生长出来 */
.bp-hero { position: relative; padding: var(--s3) var(--gutter) calc(var(--s5) + 6px); display: flex; justify-content: center; overflow: hidden; }
.bp-hero-bg {
  position: absolute; inset: -45% -18%; background-size: cover; background-position: center;
  filter: blur(42px) saturate(1.3); opacity: .34; transform: scale(1.06);
}
.bp-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--bg) 26%, transparent) 0%,
    transparent 34%,
    color-mix(in srgb, var(--bg) 72%, transparent) 76%,
    var(--bg) 97%);
}
/* 没有封面时别空着：一层极淡的紫气托住灰封面 */
.bp-hero.plain { background: radial-gradient(120% 86% at 50% -10%, var(--brand-weak) 0%, transparent 68%); }
.bp-cover {
  position: relative; z-index: 1; width: 136px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden;
  background: var(--cover-bg); color: var(--cover-ink); display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 46px;
  box-shadow: 0 10px 26px rgba(34,31,51,.16), 0 2px 5px rgba(34,31,51,.08), 0 0 0 .5px rgba(34,31,51,.05);
}
.bp-cover img { width: 100%; height: 100%; object-fit: cover; }
/* 借阅规则提示：一条安静的说明，不抢主操作 */
.bp-rule {
  display: flex; align-items: flex-start; gap: var(--s2);
  margin-top: var(--s3); padding: 11px var(--s3);
  background: var(--brand-weak-2); border-radius: var(--radius-sm);
  font-size: var(--fs-caption); color: var(--ink-2); line-height: 1.6;
}
.bp-rule .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--brand-strong); }
.bp-rule b { color: var(--ink); font-weight: 800; }
.bp-body { padding: 0 var(--gutter); }
.bp-title { font-family: var(--font-serif); font-size: 24px; font-weight: 800; line-height: 1.32; letter-spacing: .2px; overflow-wrap: anywhere; }
.bp-author { margin-top: 6px; font-size: var(--fs-meta); color: var(--ink-2); overflow-wrap: anywhere; }
.bp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3); }
/* 信息表：键值成对，右对齐数值，长文本可换行不溢出 */
.bp-facts {
  margin-top: var(--s4); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1);
}
.bp-fact { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px var(--s4); border-bottom: 1px solid var(--line); font-size: var(--fs-meta); }
.bp-fact:last-child { border-bottom: 0; }
.bp-fact span { color: var(--ink-2); flex: none; }
.bp-fact b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
/* 借出中：状态卡 */
.bp-due {
  margin-top: var(--s4); background: var(--brand-weak-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow-1);
}
.bp-due.over { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: var(--danger-weak); }
.bp-due-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: var(--fs-meta); }
.bp-due-row + .bp-due-row { margin-top: 6px; }
.bp-due-row b { font-weight: 800; }
.bp-due-note { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line-2); font-size: var(--fs-caption); color: var(--ink-2); }
/* 推荐的书友：头像叠在一起 + 一句说明 */
.bp-recs {
  display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3);
  padding: 10px var(--s3); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.bp-recs-avs { display: flex; flex: none; }
.bp-recs-av {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff; margin-left: -8px;
  border: 2px solid var(--surface); background: var(--brand);
}
.bp-recs-av:first-child { margin-left: 0; }
.bp-recs-av:nth-child(2) { background: #7c6bf0; }
.bp-recs-av:nth-child(3) { background: #9a8bf5; }
.bp-recs-txt { min-width: 0; font-size: var(--fs-caption); line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.bp-recs-txt b { color: var(--ink); font-weight: 800; }
.bp-empty {
  padding: var(--s4); text-align: center; font-size: var(--fs-caption); color: var(--ink-3);
  background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius);
}
.bp-sec { margin-top: var(--s6); }
.bp-bottom {
  flex: none; display: flex; gap: var(--s3);
  padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(28,26,48,.06);
}
.bp-bottom .btn { flex: 1; }
.bp-bottom[hidden] { display: none; }
.bp-bottom .btn.icon-only { flex: none; width: 54px; padding: 0; background: var(--surface-2); box-shadow: none; color: var(--ink-2); }
.bp-bottom .btn.icon-only:active { background: var(--surface-3); }
/* 进入时：封面先落位，信息自上而下依次浮现（只用位移，避免动画被节流时内容隐身） */
.book-page.open .bp-hero .bp-cover { animation: coverFloat .6s var(--ease) both; }
@keyframes coverFloat { from { transform: translateY(12px) scale(.97); } to { transform: none; } }

/* 飞入模式：页面原地淡入（不横滑），封面让位给「飞行替身」，落位后再显形 */
.book-page.flying { transform: none !important; transition: opacity .34s var(--ease) .1s !important; }
.book-page.flying .bp-hero .bp-cover { animation: none !important; opacity: 0; }
.book-page.flying.landed .bp-hero .bp-cover { opacity: 1; animation: coverSettle .44s var(--ease) both !important; }
@keyframes coverSettle { from { transform: scale(1.05); } to { transform: none; } }
/* 飞行替身：从卡片位置翻 360° 落到页面封面位 */
.bp-fly {
  position: fixed; z-index: 70; margin: 0; pointer-events: none;
  transform-origin: center; transform-style: preserve-3d; backface-visibility: visible;
  display: grid; place-items: center; font-family: var(--font-serif); font-weight: 700;
  box-shadow: 0 18px 44px rgba(34,31,51,.26);
}
.bp-fly img { width: 100%; height: 100%; object-fit: cover; display: block; }

.book-page.open .bp-body > * { animation: rise .5s var(--ease) both; }
.book-page.open .bp-body > *:nth-child(1) { animation-delay: .04s; }
.book-page.open .bp-body > *:nth-child(2) { animation-delay: .08s; }
.book-page.open .bp-body > *:nth-child(3) { animation-delay: .12s; }
.book-page.open .bp-body > *:nth-child(4) { animation-delay: .16s; }
.book-page.open .bp-body > *:nth-child(5) { animation-delay: .20s; }
.book-page.open .bp-body > *:nth-child(6) { animation-delay: .24s; }


#book-modal .modal-card {
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
}
#book-modal .modal-close { top: var(--s4); right: var(--s4); background: rgba(255,255,255,.86); backdrop-filter: blur(6px); }
.detail-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: var(--s6) var(--s5) var(--s5);
}
.detail-bottom {
  flex: none; border-top: 1px solid var(--line); background: var(--surface);
  padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(28,26,48,.06);
}
.detail-bottom .btn.big { width: 100%; }
.detail-head { display: flex; gap: var(--s4); align-items: flex-start; margin-bottom: var(--s4); }
.detail-cover { width: 84px; height: 116px; border-radius: var(--radius-sm); flex: none; display: grid; place-items: center; color: var(--cover-ink); font-size: 32px; font-weight: 800; background: var(--cover-bg); overflow: hidden; box-shadow: var(--shadow-1); font-family: var(--font-serif); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h2 { font-size: var(--fs-h2); font-weight: 800; line-height: 1.3; font-family: var(--font-serif); overflow-wrap: anywhere; }
.detail-info .author { color: var(--ink-2); font-size: var(--fs-body); margin-top: var(--s1); overflow-wrap: anywhere; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3); }
.tag { font-size: var(--fs-caption); color: var(--ink-2); background: var(--surface-2); border-radius: 7px; padding: 4px 9px; max-width: 100%; overflow-wrap: anywhere; }

.detail-tools { position: relative; display: flex; gap: var(--s3); margin: var(--s4) 0 var(--s2); }
.icon-round { flex: 1; height: 50px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: var(--fs-body); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease); }
#act-more { flex: none; width: 54px; padding: 0; }
.icon-round:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }
.icon-round:active { transform: scale(.97); }
.more-pop { position: absolute; right: 0; bottom: 62px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); overflow: hidden; min-width: 184px; z-index: 3; }
.more-pop[hidden] { display: none; }
.more-pop button { display: block; width: 100%; text-align: left; border: none; background: transparent; padding: var(--s3) var(--s4); font-size: var(--fs-body); font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.more-pop button:last-child { border-bottom: none; }
.more-pop button:active { background: var(--surface-2); }
.more-pop button.danger { color: var(--danger); }
.due-note { font-size: var(--fs-meta); color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s3); margin-bottom: var(--s4); line-height: 1.6; }
.due-note b { color: var(--ink); }

/* 补充信息 */
.cover-upload { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s4); }
.cover-prev { width: 68px; height: 92px; border-radius: 11px; background: var(--cover-bg); color: var(--cover-ink); display: grid; place-items: center; font-size: 26px; font-weight: 800; overflow: hidden; flex: none; border: 1px solid var(--line); font-family: var(--font-serif); }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.cover-upload .cu-main { flex: 1; min-width: 0; }

/* 分享卡 */
.share-card { display: flex; align-items: center; gap: var(--s3); background: var(--surface-2); border-radius: 14px; padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.share-icon { font-size: 22px; }
.share-url { font-size: var(--fs-caption); color: var(--ink-2); word-break: break-all; line-height: 1.6; }

/* 统计弹窗 */
.stats-pop { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s4); }
.stat-box { background: var(--surface-2); border-radius: 14px; padding: var(--s4); }
.stat-box b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-box span { font-size: var(--fs-caption); color: var(--ink-2); }
.stat-box.c-available b { color: var(--c-available); }
.stat-box.c-borrowed b { color: var(--c-borrowed); }
.stat-box.c-lost b { color: var(--c-lost); }
.stat-box.c-damaged b { color: var(--c-damaged); }

/* 列表弹窗 */
.list-rows { display: flex; flex-direction: column; gap: var(--s2); }
.list-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); background: var(--surface-2); border-radius: 14px; width: 100%; text-align: left; border: none; }
.list-row:active { background: var(--surface-3); }
.list-cover { width: 44px; height: 58px; border-radius: 8px; flex: none; display: grid; place-items: center; color: var(--cover-ink); font-weight: 800; background: var(--cover-bg); overflow: hidden; font-family: var(--font-serif); }
.list-cover img { width: 100%; height: 100%; object-fit: cover; }
.list-info { flex: 1; min-width: 0; }
.list-title { font-size: var(--fs-body); font-weight: 700; }
.list-sub { font-size: var(--fs-caption); color: var(--ink-2); margin-top: 2px; }


/* 书籍选择器（发帖关联 / 列表） */
.picker-list { display: flex; flex-direction: column; gap: var(--s2); max-height: 46dvh; overflow-y: auto; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--s6) + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff; font-size: var(--fs-body); font-weight: 600; padding: 11px 18px; border-radius: var(--gutter); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); animation: toastIn .45s var(--ease) both; }
.toast.err { background: var(--danger); }

/* ============ 入场与过渡动画 ============ */
/* 设计原则：视图外壳只做柔和淡入；内容卡片以「级联」形式逐一优雅上浮，
   形成清晰的主次节奏；弹窗以弹簧弹起呈现 —— 避免各元素各自为政、互相打架。 */
@keyframes viewIn {            /* 视图外壳：轻淡入 + 微上浮，仅作底色 */
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {             /* 子元素：轻上浮入场 */
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes cardIn {           /* 书卡：优雅上浮 + 极轻回弹，作为内容级联主角 */
  0%   { opacity: 0; transform: translateY(18px) scale(.985); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes postIn {           /* 帖子：轻上浮入场 */
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes modalPop {         /* 弹窗：从下方弹起（弹簧过冲），弹上来而非滑上来 */
  0%   { opacity: 0; transform: translateY(12px) scale(.93); }
  55%  { opacity: 1; transform: translateY(0) scale(1.02); }
  78%  { transform: translateY(0) scale(.992); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fabIn {
  from { opacity: 0; transform: scale(.4) rotate(-18deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastIn {
  0%   { opacity: 0; transform: translateX(-50%) translateY(26px) scale(.92); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floatY {           /* 空状态图标轻浮 */
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes ripple { to { transform: scale(2.8); opacity: 0; } }
@keyframes coverIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tabbarIn { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }

/* 果冻：弹性挤压回弹（导航 / 按钮 / FAB） */
@keyframes jelly {
  0%   { transform: scale(1, 1); }
  28%  { transform: scale(1.16, .84); }
  44%  { transform: scale(.88, 1.12); }
  60%  { transform: scale(1.08, .94); }
  76%  { transform: scale(.97, 1.03); }
  100% { transform: scale(1, 1); }
}
/* 共享元素转场：卡片从原位置弹起放大成详情，与 modalPop 同一语汇 */
@keyframes cardOpen {
  0%   { opacity: 0; transform: scale(.86) translateY(14px); }
  60%  { opacity: 1; transform: scale(1.02) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
/* 报错摇晃（物理反馈：摇晃碎裂） */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* 视图切换：外壳柔和淡入（内容由卡片级联承担，避免多层动画互相打架） */
.view.enter { animation: viewIn .42s var(--ease) both; }

/* 内容卡片级联入场（交错延迟由 JS 写入 style，制造主次分明的节奏） */
.book-card { animation: cardIn .52s var(--ease) both; transform-origin: center top; will-change: transform; }
.post      { animation: postIn .52s var(--ease) both; }

/* 弹窗：一律从底部平滑滑上来（无过冲），只有「推荐」保留弹跳的庆祝感 */
.modal.open .modal-card { animation: sheetUp .42s var(--ease) both; }
#recommend-modal.open .modal-card { animation: modalPop .46s var(--ease) both; }
.modal.open::before     { animation: fade .26s var(--ease) both; }

/* 详情页从底部滑出已改为整页右侧滑入（见 .book-page） */
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* FAB / Toast 出现 */
.fab:not(.hidden) { animation: fabIn .42s var(--ease) both; }
.toast.show       { animation: toastIn .5s var(--ease-spring) both; }

/* 空状态图标轻浮 */
.empty-mark { animation: floatY 3.8s ease-in-out infinite; }

/* 封面淡入（随元素插入播放，无需等待加载，避免缓存图不可见） */
.book-card .cover img,
.mini-cover img,
.detail-cover img,
.row-cover img { animation: coverIn .55s var(--ease) both; }

/* 二级页内容交错入场 */
.subpage.open .subpage-body > * { animation: rise .5s var(--ease) both; }
.subpage.open .subpage-body > *:nth-child(1) { animation-delay: .02s; }
.subpage.open .subpage-body > *:nth-child(2) { animation-delay: .06s; }
.subpage.open .subpage-body > *:nth-child(3) { animation-delay: .10s; }
.subpage.open .subpage-body > *:nth-child(4) { animation-delay: .14s; }
.subpage.open .subpage-body > *:nth-child(5) { animation-delay: .18s; }
.subpage.open .subpage-body > *:nth-child(6) { animation-delay: .22s; }

/* 详情抽屉：先是「壳」滑上来，随后内容自上而下逐级浮现（先空间、后信息） */
#book-modal.open .detail-scroll > * { animation: rise .48s var(--ease) both; }
#book-modal.open .detail-scroll > *:nth-child(1) { animation-delay: .08s; }
#book-modal.open .detail-scroll > *:nth-child(2) { animation-delay: .12s; }
#book-modal.open .detail-scroll > *:nth-child(3) { animation-delay: .16s; }
#book-modal.open .detail-scroll > *:nth-child(4) { animation-delay: .20s; }
#book-modal.open .detail-scroll > *:nth-child(5) { animation-delay: .24s; }
#book-modal.open .detail-bottom { animation: rise .52s var(--ease) both; animation-delay: .22s; }
#book-modal.open .detail-cover img { animation: coverIn .5s var(--ease) both, zoomSettle .8s var(--ease) both; }
@keyframes zoomSettle { from { transform: scale(1.06); } to { transform: scale(1); } }

/* 个人中心 / 分类页：整页骨架后的内容级联（比卡片级联更外一层，形成纵深） */
#view-profile.enter > *, #view-category.enter > * { animation: rise .46s var(--ease) both; }
#view-profile.enter > *:nth-child(2) { animation-delay: .04s; }
#view-profile.enter > *:nth-child(3) { animation-delay: .08s; }
#view-profile.enter > *:nth-child(4) { animation-delay: .12s; }
#view-profile.enter > *:nth-child(5) { animation-delay: .16s; }
#view-profile.enter > *:nth-child(6) { animation-delay: .20s; }
#view-profile.enter > *:nth-child(7) { animation-delay: .24s; }
#view-category.enter > *:nth-child(2) { animation-delay: .06s; }

/* 登录卡：从远处落入的柔和入场 */
.auth-screen:not(.hidden) .auth-card { animation: authIn .62s var(--ease) both; }
@keyframes authIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

/* 按钮 / 导航点击涟漪 */
.btn, .tab { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .22; pointer-events: none; animation: ripple .6s var(--ease) forwards; }

/* 加载：方块变换 */
.loader { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; padding: var(--s7) 0; }
.loader .sq {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--brand-weak); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

/* 桌面端：克制的悬停反馈（不抢戏、不与按压冲突） */
@media (hover: hover) {
  .book-card.grid-item:hover .bc-cover-wrap { box-shadow: inset 0 0 0 1px rgba(34,31,51,.08), 0 10px 22px rgba(34,31,51,.14); transform: translateY(-2px); }
  .book-card.grid-item:hover .bc-cover { transform: scale(1.045); }
  .book-card.grid-item:hover .bc-title { color: var(--brand-strong); }
  .set-row:hover { background: var(--surface-2); }
  .mini-row:hover { background: var(--surface-2); }
  .borrow-row:hover { box-shadow: var(--shadow-2); }
  .cat-tab:hover { background: var(--surface-2); color: var(--ink); }
  .cat-tab.active:hover { background: var(--surface); }
  .pact:hover { background: var(--surface-2); }
  .fab:hover { box-shadow: 0 8px 0 var(--brand-shadow), 0 16px 28px rgba(63,49,163,.32); }
}

/* ============ 确认对话框 ============ */
#confirm-modal .modal-card { max-width: 460px; }
.cd-book { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cd-cover {
  width: 46px; height: 60px; border-radius: 10px; flex: none; overflow: hidden;
  background: var(--cover-bg); color: var(--cover-ink); display: grid; place-items: center;
  font-weight: 800; font-family: var(--font-serif);
}
.cd-cover img { width: 100%; height: 100%; object-fit: cover; }
.cd-book b { font-size: 17px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.cd-text { font-size: var(--fs-body); line-height: 1.6; color: var(--ink); margin-bottom: 4px; }

/* ============ 物理反馈：摇晃 ============ */
.shake { animation: shake .42s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .view.enter, .view.enter > *, .book-card, .post, .auth-card, .modal.open .modal-card,
  .fab:not(.hidden), .toast.show, .empty-mark, .loader .sq, .subpage.open .subpage-body > *,
  .tabbar, .tab-indicator, .ripple, .shelf-hero, .crop-card,
  #book-modal.open .detail-scroll > *, #book-modal.open .detail-bottom,
  .cat-tab, .skel, .scroll-progress,
  .tab.just-activated .tab-ico, #book-modal.open .modal-card.from-card,
  .shake, .auth-card.shake { animation: none !important; }
  .book-card.grid-item:active, .book-card.grid-item:active .bc-cover { transform: none; }
}

/* ============ 借阅页：我的借阅 / 在借中 ============ */
.borrow-list { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s2); }
.borrow-row {
  position: relative; display: flex; align-items: center; gap: var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); overflow: hidden; box-shadow: var(--shadow-1);
  animation: cardIn .5s var(--ease) both; cursor: pointer;
}
.borrow-row:active { transform: scale(.99); }
.borrow-row.is-mine { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.borrow-row .bc-cover { width: 46px; height: 64px; border-radius: 8px; font-size: 22px; }
.borrow-row .bc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.borrow-row .bc-title { font-size: 14px; }
.borrow-row .bc-author { font-size: 12px; }
.borrow-row .bc-return { flex: none; }

/* ============ 分类页：左侧类别栏 + 右侧内容 ============ */
.cat-layout {
  display: grid; grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--s3); align-items: start;
}
.cat-side {
  position: sticky; top: calc(env(safe-area-inset-top) + var(--s2));
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100dvh - var(--tabbar-h) - 96px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 0; scrollbar-width: none;
}
.cat-side::-webkit-scrollbar { display: none; }
.cat-tab {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 11px 8px 11px 11px; border: 0; background: transparent; border-radius: 12px;
  color: var(--ink-2); font-size: 13px; font-weight: 700; text-align: left; min-width: 0;
  transition: background .24s var(--ease), color .24s var(--ease), transform .18s var(--ease), box-shadow .24s var(--ease);
  animation: slideInLeft .42s var(--ease) both;
}
.cat-tab::before {
  content: ""; position: absolute; left: 2px; top: 50%; width: 3px; height: 0;
  border-radius: 3px; background: var(--brand);
  transform: translateY(-50%);
  transition: height .3s var(--ease-spring);
}
.cat-tab b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cat-tab i { font-style: normal; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.cat-tab.active { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow-1); }
.cat-tab.active::before { height: 18px; }
.cat-tab.active i { color: var(--brand); opacity: .8; }
.cat-tab:active { transform: scale(.975); }
.cat-main { min-width: 0; display: flex; flex-direction: column; }
.cat-search { margin-bottom: var(--s3); border-width: 1px; }
.cat-search input { padding: 8px 0; font-size: 13px; }
.cat-count { font-size: 12px; color: var(--ink-3); margin-bottom: var(--s2); font-variant-numeric: tabular-nums; }
.cat-books-enter .book-card { animation: cardIn .46s var(--ease) both; }

/* ============ 骨架屏（加载态优于空白 / spinner） ============ */
.skel-card { pointer-events: none; }
.skel {
  border-radius: 8px; background: linear-gradient(100deg, var(--surface-2) 28%, var(--surface) 50%, var(--surface-2) 72%);
  background-size: 220% 100%; animation: shimmer 1.25s linear infinite;
}
.skel-cover { width: 100%; aspect-ratio: 3 / 4; border-radius: 0; }
.skel-line { height: 10px; margin-top: 8px; }
.skel-line.short { width: 60%; }
.skel-list { display: flex; flex-direction: column; gap: var(--s3); }
.skel-row { height: 78px; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* 裁剪器样式见 crop.css（用户端与后台共用一份） */

/* ============ 推荐弹窗（长按 3 秒） ============ */
.recommend-card { text-align: center; padding: 26px 22px 20px; }
.rec-emoji { font-size: 52px; line-height: 1; margin: 2px 0 4px; }
.rec-burst { position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--leaf) 30%, transparent), transparent 60%); }
.rec-burst.play { animation: burst .9s ease-out forwards; }
@keyframes burst { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
.rec-ring {
  --p: 0; width: 150px; height: 150px; margin: 14px auto 6px; border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(closest-side, var(--surface) 78%, transparent 79%),
    conic-gradient(var(--brand) calc(var(--p) * 1turn), var(--line) 0);
  transition: background .1s linear;
}
.rec-btn {
  width: 118px; height: 118px; border-radius: 50%; border: 0; cursor: pointer;
  user-select: none; -webkit-user-select: none; touch-action: none;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 800;
  display: grid; place-items: center; box-shadow: var(--shadow-2);
}
.rec-btn.filling { background: var(--brand-strong); transform: scale(.96); }
.rec-btn:disabled { opacity: .75; cursor: default; }
#rec-title { margin-top: 6px; }
#rec-hint { margin: 4px 0 0; }

/* ============ 说明弹窗 / 元炁分 ? ============ */
.info-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 12px; font-weight: 800; line-height: 1; cursor: pointer; margin-left: 6px; padding: 0;
  display: inline-grid; place-items: center; vertical-align: middle;
}
.info-body { margin-top: 10px; font-size: 14px; }
.info-body p { margin: 6px 0; }
.info-body ul { margin: 6px 0; }

