/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2330;
  --muted: #8a90a2;
  --primary: #4f6ef7;
  --primary-d: #3b56d9;
  --line: #e6e8ee;
  --shadow: 0 2px 10px rgba(31,35,48,.08);
  --radius: 12px;
  --nav-height: 56px;
  --reader-bar-height: 60px;
  --reader-shell-height: calc(100vh - var(--nav-height) - var(--reader-bar-height) - 32px);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

/* ===== 庭院首页（探书小栈门面） ===== */
.inn-shell { width: 100%; }
body.inn-mode { background: #0f1118; }
body.inn-mode .topnav{
  background: rgba(15,17,24,.28);
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: none;
  backdrop-filter: blur(12px);
}
body.inn-mode .topnav .brand{ color: rgba(255,255,255,.92); }
/* 庭院模式也保留完整导航入口 */
body.inn-mode .topnav .navlinks{ display:flex; flex-wrap: wrap; }
body.inn-mode .topnav .navlinks-right .navlink{ color: rgba(255,255,255,.72); }
body.inn-mode .topnav .navlinks-right .navlink:hover{ background: rgba(255,255,255,.10); color: rgba(255,255,255,.92); }

.inn-scene{
  position: relative;
  min-height: calc(100vh - var(--nav-height));
  overflow: hidden;
  background: #0f1118 url('/static/assets/inn/ink_inn_lake_bg_v1.jpg') center/cover no-repeat;
}
.inn-overlay{
  position:absolute; inset:0;
  background:
    radial-gradient(900px 520px at 20% 20%, rgba(255,255,255,.20), transparent 62%),
    radial-gradient(900px 520px at 70% 80%, rgba(0,0,0,.28), transparent 62%),
    linear-gradient(180deg, rgba(10,12,18,.06), rgba(10,12,18,.46));
  pointer-events:none;
}
.inn-scene::after{
  /* 纸感颗粒（纯 CSS，不依赖外部纹理） */
  content:"";
  position:absolute; inset:0;
  background-image:
    radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,.08) 1px, transparent 1px);
  background-size: 22px 22px, 26px 26px;
  background-position: 0 0, 8px 10px;
  opacity: .18;
  mix-blend-mode: overlay;
  pointer-events:none;
}
.inn-mist{
  position:absolute; left:-20%; right:-20%; bottom:-18%;
  height: 58%;
  background:
    radial-gradient(closest-side at 30% 60%, rgba(255,255,255,.52), rgba(255,255,255,0) 70%),
    radial-gradient(closest-side at 65% 55%, rgba(255,255,255,.44), rgba(255,255,255,0) 72%),
    radial-gradient(closest-side at 82% 65%, rgba(255,255,255,.30), rgba(255,255,255,0) 76%);
  filter: blur(10px);
  opacity: .62;
  transform: translate3d(var(--inn-parallax-x, 0px), calc(var(--inn-parallax-y, 0px) * .8), 0);
  pointer-events:none;
  animation: innMistDrift 18s ease-in-out infinite;
}
.inn-mist::after{
  content:"";
  position:absolute; inset: 0;
  background: url('/static/assets/inn/ink_mist_overlay.jpg') center/cover no-repeat;
  opacity: .10;
  mix-blend-mode: screen;
}
@keyframes innMistDrift{
  0%,100%{ transform: translate3d(calc(var(--inn-parallax-x,0px) - 10px), calc(var(--inn-parallax-y,0px) * .8), 0); opacity: .58; }
  50%{ transform: translate3d(calc(var(--inn-parallax-x,0px) + 10px), calc(var(--inn-parallax-y,0px) * .8 - 6px), 0); opacity: .66; }
}
/* 参考图云更像“雾气层”，不使用白色云块元素 */
.inn-cloud{ display:none; }

.inn-brand{
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 22px 0;
  color: rgba(255,255,255,.92);
}
.inn-brand-badge{
  display:inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  letter-spacing: .8px;
  font-weight: 700;
  font-size: 12px;
}
.inn-brand-title{
  margin-top: 12px;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: 2px;
  text-shadow: 0 18px 34px rgba(0,0,0,.35);
}
.inn-brand-sub{
  margin-top: 10px;
  color: rgba(255,255,255,.74);
  letter-spacing: 1.5px;
  font-weight: 600;
}
.inn-brand-tip{
  margin-top: 10px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}

/* 旧的卡片式牌匾入口不再使用 */
.inn-map, .inn-marker, .inn-marker-sub{ display:none; }

/* 人物装饰：由背景图统一呈现，不再额外贴人物 */
.inn-figure{ display:none; }

/* ===== 新增UI：庭院悬浮长条入口（可见、有文字、可交互） ===== */
.sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

/* 容器（只做定位，不挡交互） */
.inn-floats{
  position:absolute;
  inset:0;
  pointer-events:none;
}

/* 调试用：在 URL 加 ?debugFloats=1 */
body.debug-floats .inn-float-tab{
  outline: 2px dashed rgba(79,110,247,.65);
  background: rgba(79,110,247,.10);
}

/* 三块悬浮长条（可见、有文字） */
.inn-float-tab{
  pointer-events:auto;
  position:absolute;
  width: 66px;
  height: 210px;
  border-radius: 18px;
  text-decoration:none;
  cursor:pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 80px rgba(0,0,0,.40);
  transform: translate3d(var(--inn-parallax-x,0px), var(--inn-parallax-y,0px), 0);
  transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}
.inn-float-tab::before{
  /* 金色柔光（hover 时更明显） */
  content:"";
  position:absolute;
  inset:-18px;
  border-radius: 22px;
  background: radial-gradient(closest-side at 50% 55%, rgba(255,210,120,.55), rgba(255,210,120,.14) 55%, rgba(255,210,120,0) 72%);
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
  pointer-events:none;
  mix-blend-mode: screen;
}
.inn-float-text{
  position:absolute;
  inset: 16px 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  writing-mode: vertical-rl;
  text-align:center;
  color: rgba(255,255,255,.92);
  font-weight: 900;
  letter-spacing: 6px;
  text-shadow: 0 16px 34px rgba(0,0,0,.42);
}
.inn-float-tab:hover,
.inn-float-tab.hovering{
  transform: translate3d(var(--inn-parallax-x,0px), calc(var(--inn-parallax-y,0px) - 3px), 0);
  filter: brightness(1.05) saturate(1.03);
  border-color: rgba(255,220,140,.22);
}
.inn-float-tab:hover::before,
.inn-float-tab.hovering::before{
  opacity: 1;
  transform: scale(1.02);
}

/* 三块位置（先给一个接近“竖版悬浮板块”的布局；你看图再微调） */
.inn-float-tab.ft-guanshu{ right: 16%; top: 46%; }
.inn-float-tab.ft-xianjian{ right: 9.5%; top: 28%; }
.inn-float-tab.ft-fubi{ left: 58%; top: 20%; }

@media (max-width: 900px){
  .inn-float-tab{ width: 58px; height: 190px; }
  .inn-float-tab.ft-fubi{ left: 42%; top: 18%; }
}

/* 牌匾更“嵌入场景”：从卡片感改为“挂旗/木牌” */
.inn-marker{
  background: rgba(10,12,18,.38);
  border: 1px solid rgba(255,255,255,.18);
}
.inn-marker::after{
  content:"";
  position:absolute;
  left:-12px; top: 50%;
  width: 18px; height: 56px;
  transform: translateY(-50%);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(233,200,120,.80), rgba(180,140,70,.70));
  opacity: .70;
  filter: blur(.2px);
  box-shadow: 0 10px 18px rgba(0,0,0,.25);
}
.inn-marker:hover::after{ opacity: .92; }

/* 去掉“子菜单面板”相关样式（保留文件结构但不再使用） */
/* 已启用分组面板，不再强制隐藏 */

.inn-dock{ display:none; }
.inn-dock-item{
  display:flex; align-items:center; gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration:none;
  color: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.inn-dock-item:hover{
  transform: translateY(-1px);
  border-color: rgba(79,110,247,.55);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.94);
}
.inn-dock-icon{
  width: 34px; height: 34px;
  border-radius: 10px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}
.inn-dock-text{
  font-weight: 800;
  letter-spacing: 1px;
}

.inn-corner{
  position:absolute;
  right: 18px;
  bottom: 22px;
  display:flex;
  gap: 10px;
  align-items:center;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}
.inn-corner-link{
  color: rgba(255,255,255,.72);
  text-decoration:none;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(12,14,18,.32);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
}
.inn-corner-link:hover{
  color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.18);
}
.inn-corner-dot{ opacity: .5; }

/* 子菜单面板 */
.inn-panel-mask{
  position:absolute; inset:0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  z-index: 20;
}
.inn-panel{
  position:absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, calc(100% - 28px));
  border-radius: 22px;
  background: rgba(12,14,18,.62);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  backdrop-filter: blur(14px);
  z-index: 21;
  overflow:hidden;
}
.inn-panel::before{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(560px 240px at 18% 22%, rgba(255,255,255,.12), transparent 60%);
  pointer-events:none;
}
.inn-panel-close{
  position:absolute; right: 14px; top: 14px;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.82);
  cursor: pointer;
}
.inn-panel-close:hover{ background: rgba(255,255,255,.12); color: rgba(255,255,255,.92); }
.inn-panel-head{
  position:relative;
  padding: 22px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.inn-panel-title{
  color: rgba(255,255,255,.92);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
}
.inn-panel-sub{
  margin-top: 6px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}
.inn-panel-grid{
  position:relative;
  padding: 18px 22px 22px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.inn-panel-item{
  text-decoration:none;
  border-radius: 16px;
  padding: 14px 14px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.86);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.inn-panel-item:hover{
  transform: translateY(-1px);
  border-color: rgba(79,110,247,.55);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
}
.inn-panel-item-title{
  font-weight: 800;
  letter-spacing: 1px;
}
.inn-panel-item-desc{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.62);
}

@media (max-width: 900px){
  /* 新增UI：移动端庭院也保留“庭院”入口 */
  body.inn-mode .topnav .navlinks{ display:flex; }
  .inn-map{ height: 300px; }
  .inn-marker.m-read{ left: 22px; top: 110px; }
  .inn-marker.m-write{ left: 22px; top: 180px; }
  .inn-marker.m-blog{ left: 22px; top: 250px; right: auto; }
  .inn-dock{ left: 50%; bottom: 18px; width: calc(100% - 24px); justify-content: space-between; border-radius: 22px; }
  .inn-dock-item{ flex:1; justify-content:center; }
  .inn-dock-text{ display:none; }
  .inn-corner{ display:none; }
  .inn-brand-title{ font-size: 32px; }
  .inn-figure{ display:none; }
  .inn-panel-grid{ grid-template-columns: 1fr; }
}

/* ===== 顶部导航 ===== */
.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 56px;
  height: auto;
  padding: 8px 20px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topnav .brand { font-weight: 700; font-size: 17px; color: var(--primary); white-space: nowrap; }
.navlinks { display: flex; gap: 6px; flex-wrap: wrap; }
.navlinks-right { margin-left: auto; }
.navlink {
  padding: 7px 14px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-size: 15px; font-weight: 500;
}
.navlink:hover { background: #eef1fb; color: var(--primary); }
.navlink.active { background: var(--primary); color: #fff; }
.navlink-logout { color: #e0586b; }
.navlink-note {
  color: #4f6ef7;
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid #4f6ef7;
  border-radius: 16px;
  font-size: 13px;
  transition: all 0.2s;
}
.navlink-note:hover {
  background: #4f6ef7;
  color: #fff;
}

/* 已移除：分组页面内快捷入口条（避免与下方大模块重复） */

/* ===== 新增UI：分组总览页样式 ===== */
.group-overview{
  padding: 10px 0 28px;
}
.group-overview-hero{
  padding: 18px 18px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(79,110,247,.10), rgba(255,255,255,0));
  border: 1px solid var(--line);
}
.group-overview-title{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
}
.group-overview-sub{
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.group-overview-grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.group-card{
  display:block;
  text-decoration:none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .14s ease, border-color .14s ease;
}
.group-card-btn{
  width:100%;
  text-align:left;
  cursor:pointer;
}
.group-card:hover{
  transform: translateY(-1px);
  border-color: rgba(79,110,247,.45);
}
.group-card-title{
  font-weight: 800;
  letter-spacing: 2px;
}
.group-card-desc{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* ===== 布局 ===== */
.content { padding: 22px; max-width: 1200px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ===== 按钮 / 控件 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: .15s; text-decoration: none; user-select: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-d); color: #fff; }
.btn.ghost { background: transparent; }
.select {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); font-size: 14px; min-width: 160px;
}

/* ===== 书架 ===== */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.book-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s;
  position: relative;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(31,35,48,.14); }
.book-cover { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #eef1fb; display: block; }
.book-cover.ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-weight: 700; font-size: 15px; text-align: center; padding: 10px;
}
.book-info { padding: 10px 12px; }
.book-info .t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-info .a { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-progress { height: 4px; background: #eceef3; border-radius: 2px; margin: 8px 12px 12px; overflow: hidden; }
.book-progress > i { display: block; height: 100%; background: var(--primary); }
.book-del {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; border: none; cursor: pointer; font-size: 13px;
  display: none;
}
.book-card:hover .book-del { display: block; }

/* ===== 阅读器 ===== */
.content.reader-content {
  max-width: none;
  padding: 0 16px 16px;
}
.reader-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: var(--nav-height); z-index: 40;
  flex-wrap: wrap;
}
.reader-title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.progress-label { font-size: 13px; color: var(--muted); min-width: 38px; text-align: right; }

/* ===== 阅读进度条 ===== */
.reader-progress {
  display: flex; align-items: center; gap: 6px;
  min-width: 140px; max-width: 240px; flex: 1 1 180px; height: 22px;
}
.reader-progress-bar {
  flex: 1; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #4f6ef7, #7b9bff);
  transition: width .4s ease; min-width: 2px;
  box-shadow: 0 0 6px rgba(79,110,247,.3);
}
.progress-label { font-size: 13px; color: var(--muted); min-width: 38px; text-align: right; }
.viewer-wrap {
  position: relative; margin: 16px auto 0; width: min(1280px, calc(100vw - 48px));
}
.viewer {
  height: var(--reader-shell-height);
  min-height: 320px;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.pdf-viewer {
  width: 100%; height: var(--reader-shell-height); min-height: 320px;
  border: none; border-radius: var(--radius);
  box-shadow: var(--shadow); background: #525659;
}
.txt-viewer {
  width: 100%; height: var(--reader-shell-height); min-height: 320px;
  overflow: auto; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 20px;
  -webkit-overflow-scrolling: touch;
}
.txt-viewer pre {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px; line-height: 1.8; white-space: pre-wrap;
  word-break: break-word; color: var(--text);
  max-width: 800px; margin: 0 auto;
}
.side-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 64px; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); color: var(--primary);
  font-size: 30px; line-height: 62px; text-align: center;
  border-radius: 10px; cursor: pointer; z-index: 30;
  box-shadow: var(--shadow); padding: 0; user-select: none;
}
.side-arrow:hover { background: var(--primary); color: #fff; }
.side-left { left: 8px; }
.side-right { right: 8px; }
/* 滚动模式下隐藏侧边箭头 */
body.flow-scrolled .side-arrow { display: none; }
/* 滚动模式：viewer 需要可滚动以支持连续管理器无限滚动 */
body.flow-scrolled .viewer {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
}

/* ===== 目录面板 ===== */
.toc-panel {
  position: fixed; top: 56px; left: 0; bottom: 0; width: 280px;
  background: var(--card); border-right: 1px solid var(--line);
  box-shadow: 2px 0 14px rgba(31,35,48,.14); z-index: 55;
  transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.toc-panel.open { transform: translateX(0); }
.toc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.toc-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted); padding: 0 4px; }
.toc-list { overflow-y: auto; padding: 6px 0; flex: 1; }
.toc-item {
  display: block; padding: 8px 14px; font-size: 14px; color: var(--text);
  text-decoration: none; cursor: pointer; border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toc-item:hover { background: #eef1fb; color: var(--primary); }
.toc-item.active { background: #eef1fb; color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* ===== 回顾面板 ===== */
.review-panel {
  position: fixed; top: 56px; right: 0; bottom: 0; width: 320px;
  background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -2px 0 14px rgba(31,35,48,.14); z-index: 55;
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.review-panel.open { transform: translateX(0); }
.review-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.review-list { overflow-y: auto; padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.review-empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; line-height: 2; }
.review-empty small { font-size: 12px; color: var(--muted); }
.review-card {
  background: #fafbfd; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
  border-left: 3px solid transparent;
}
.review-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(79,110,247,.12); }
.review-card.current-chapter { border-left-color: var(--primary); background: #f0f4ff; }
.review-card.jump-target { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,110,247,.3); background: #eef1fb; }
.review-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
.review-chap { font-size: 12px; font-weight: 600; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.review-time { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.review-sketch { width: 100%; max-height: 100px; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--line); margin-bottom: 6px; }
.review-sketch-ph { height: 32px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; background: #fff; border-radius: 4px; border: 1px dashed var(--line); margin-bottom: 6px; }
.review-text { font-size: 13px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; max-height: 80px; overflow-y: auto; }

/* ===== 悬浮手绘画板 ===== */
.draw-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 318px; background: var(--card); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(31,35,48,.25); border: 1px solid var(--line);
  overflow: hidden; touch-action: none; transition: width .18s ease, box-shadow .18s ease, border-radius .18s ease;
}
.draw-panel.collapsed .draw-tools,
.draw-panel.collapsed canvas,
.draw-panel.collapsed textarea,
.draw-panel.collapsed .draw-actions { display: none; }
.draw-panel.collapsed {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(31,35,48,.18);
  overflow: visible;
}
.draw-panel.collapsed .draw-header {
  width: 56px;
  height: 56px;
  padding: 0;
  min-height: 56px;
  border-radius: 50%;
  justify-content: center;
  cursor: pointer;
}
.draw-panel.collapsed .draw-header > span:first-child {
  display: none;
}
.draw-panel.collapsed .draw-toggle-btn {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  background: transparent;
  position: relative;
}
.draw-panel.collapsed .draw-toggle-btn::before {
  content: '✎';
  font-size: 22px;
  line-height: 1;
  color: #fff;
}
.draw-panel.collapsed::after {
  content: '展开';
  position: absolute;
  right: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(31,35,48,.86);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: .92;
}
.draw-toggle-btn {
  background: rgba(255,255,255,.25); border: none; color: #fff; cursor: pointer;
  font-size: 12px; padding: 2px 10px; border-radius: 4px; font-weight: 400;
}
.draw-toggle-btn:hover { background: rgba(255,255,255,.4); }
.draw-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; background: var(--primary); color: #fff; cursor: move; font-size: 14px; font-weight: 600;
}
.draw-header .drag-hint { font-size: 11px; opacity: .8; font-weight: 400; }
.draw-tools { display: flex; align-items: center; gap: 6px; padding: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.draw-tools .tool {
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  font-size: 12px; cursor: pointer;
}
.draw-tools .tool.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.draw-tools input[type=color] { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: #fff; }
.size-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
#draw-canvas { display: block; width: 300px; height: 200px; background: #fafbfd; border-bottom: 1px solid var(--line); touch-action: none; }
#note-text { width: 100%; height: 70px; border: none; padding: 10px 12px; font-size: 13px; resize: none; outline: none; font-family: inherit; }
.draw-actions { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; gap: 8px; }
.chap-label { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 存档 ===== */
.note-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.note-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.note-card img.sketch { width: 100%; height: 160px; object-fit: contain; background: #fafbfd; border-bottom: 1px solid var(--line); }
.note-card .sketch-ph { height: 160px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.note-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.note-body .meta { font-size: 12px; color: var(--muted); }
.note-body .meta b { color: var(--primary); font-weight: 600; }
.note-body .txt { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.note-card .note-foot { padding: 0 14px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-card .note-foot .jump-hint { font-size: 12px; color: var(--primary); font-weight: 500; }
.note-card .note-foot .del { font-size: 12px; color: #e0586b; cursor: pointer; background: none; border: none; padding: 4px 8px; }
.note-card.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.note-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31,35,48,.14); }

/* ===== 选词翻译 ===== */
.translate-float-btn {
  position: fixed; z-index: 200; padding: 4px 12px; font-size: 13px;
  background: #4f6ef7; color: #fff; border: none; border-radius: 16px;
  cursor: pointer; box-shadow: 0 2px 8px rgba(79,110,247,.4);
  transition: transform .15s; user-select: none;
}
.translate-float-btn:hover { transform: scale(1.08); }
.translate-panel {
  position: fixed; top: 70px; right: 20px; width: 300px; max-height: 60vh;
  background: #fff; border-radius: 12px; box-shadow: -4px 4px 20px rgba(0,0,0,.12);
  z-index: 200; overflow-y: auto; border: 1px solid #e6e8ee;
  display: none;
}
.translate-panel.open { display: block; }
.translate-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #4f6ef7; color: #fff; font-weight: 600; font-size: 14px;
  cursor: move; user-select: none;
}
.translate-body { padding: 12px 14px; }
.translate-lang-row { margin-bottom: 10px; }
.translate-original {
  background: #f5f6f8; border-radius: 6px; padding: 8px 10px; font-size: 13px;
  line-height: 1.6; margin-bottom: 8px; max-height: 100px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; border-left: 3px solid #4f6ef7;
}
.translate-result {
  background: #f0f4ff; border-radius: 6px; padding: 10px 12px; font-size: 14px;
  line-height: 1.7; min-height: 50px; white-space: pre-wrap; word-break: break-word;
}
.translate-result.loading { color: #8a90a2; }
.translate-result.error { color: #e0586b; background: #fef0f1; }
.translate-result .engine-tag { font-size: 11px; color: #8a90a2; margin-top: 6px; display: block; }

/* ===== 输出 ===== */
.output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; min-height: 520px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.block-head h2 { font-size: 16px; }
.mini-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-tools .btn { padding: 4px 10px; font-size: 12px; }
.jsmind { width: 100%; height: 380px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: #fbfcfe; }
#editor { width: 100%; flex: 1; min-height: 320px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 14px; resize: none; outline: none; font-family: inherit; line-height: 1.7; }
.export-bar { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ===== 模块画布（自由拖拽卡片）===== */
.module-canvas-wrap {
  width: 100%; height: var(--module-h, 380px); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background-color: #fbfcfe; position: relative; min-height: 150px;
  background-image: radial-gradient(circle, #dfe2ea 1px, transparent 1px);
  background-size: 24px 24px; cursor: grab;
}
.module-canvas-wrap.panning { cursor: grabbing; }
.module-canvas {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0; pointer-events: none;
}
.module-svg {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px;
  overflow: visible; pointer-events: none; z-index: 0;
}
.module-canvas-wrap.draw-mode { cursor: crosshair; }
.module-canvas-wrap.connect-mode { cursor: crosshair; }
.module-canvas-wrap.connect-mode .mod-card { cursor: pointer; }
.module-canvas-wrap.connect-mode .mod-card-head { cursor: pointer; }
.mod-card.connect-source {
  outline: 3px solid var(--primary); outline-offset: 2px;
  box-shadow: 0 0 16px rgba(79,110,247,.4);
}
.btn.ghost.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.module-resize-handle {
  height: 10px; cursor: ns-resize; background: var(--line); border-radius: 0 0 8px 8px;
  border: 1px solid var(--line); border-top: none; margin-top: -1px;
  display: flex; align-items: center; justify-content: center; user-select: none;
}
.module-resize-handle::before {
  content: ''; width: 40px; height: 3px; border-radius: 2px; background: #b0b6c5; transition: background .15s;
}
.module-resize-handle:hover::before, .module-resize-handle.dragging::before { background: var(--primary); }
.module-resize-r {
  position: absolute; top: 0; right: -6px; width: 10px;
  height: var(--module-h, 380px); cursor: ew-resize; z-index: 10;
  background: var(--line); border-radius: 0 4px 4px 0;
  display: flex; align-items: center; justify-content: center; user-select: none;
}
.module-resize-r::before {
  content: ''; width: 3px; height: 40px; border-radius: 2px; background: #b0b6c5; transition: background .15s;
}
.module-resize-r:hover::before, .module-resize-r.dragging::before { background: var(--primary); }
.mod-card {
  position: absolute; width: 210px; background: var(--card); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(31,35,48,.12); border: 1px solid var(--line);
  overflow: hidden; z-index: 1; transition: box-shadow .15s; pointer-events: auto;
}
.mod-card:hover { box-shadow: 0 4px 16px rgba(31,35,48,.2); }
.mod-card.dragging { z-index: 100; box-shadow: 0 8px 28px rgba(31,35,48,.3); }
.mod-card-head {
  padding: 5px 10px; font-size: 11px; font-weight: 600; color: #fff;
  cursor: move; display: flex; justify-content: space-between; align-items: center;
  gap: 6px; user-select: none;
}
.mod-card-head .mod-card-chap {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.mod-card-head .del-card {
  background: rgba(255,255,255,.25); border: none; color: #fff; cursor: pointer;
  font-size: 12px; padding: 0 5px; border-radius: 4px; line-height: 18px; flex-shrink: 0;
}
.mod-card-head .del-card:hover { background: rgba(255,255,255,.45); }
.mod-card-body {
  padding: 8px 10px; font-size: 13px; line-height: 1.5; color: var(--text);
  word-break: break-word; white-space: pre-wrap; max-height: 120px; overflow-y: auto;
  cursor: text; min-height: 24px;
}
.mod-card-body[contenteditable="true"] {
  outline: 2px solid var(--primary); border-radius: 4px; background: #f8faff;
}
.mod-card-chap[contenteditable="true"] {
  outline: 2px solid rgba(255,255,255,.6); border-radius: 3px; background: rgba(0,0,0,.15);
}
.mod-card-resize {
  position: absolute; bottom: 0; right: 0; width: 16px; height: 16px;
  cursor: nwse-resize; display: flex; align-items: flex-end; justify-content: flex-end;
  font-size: 10px; color: #bbb; line-height: 10px; padding: 1px;
  user-select: none; pointer-events: auto; z-index: 2;
}
.mod-card-resize:hover { color: var(--primary); }
.mod-card.resizing { z-index: 200; }
.mod-card-head .mod-card-chap { cursor: text; }

/* ===== 书签列表 ===== */
.bm-item {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s;
}
.bm-item:hover { background: var(--bg); }
.bm-chap { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.bm-del { background: none; border: none; color: #e0586b; cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 3px; flex-shrink: 0; }
.bm-del:hover { background: rgba(224,88,107,.1); }

/* ===== 书宠 ===== */
.reading-pet {
  position: fixed; bottom: 16px; right: 16px; z-index: 9000;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; user-select: none; transition: transform .2s;
}
.reading-pet:hover { transform: scale(1.08); }
.reading-pet.pet-alert { transform: scale(1.12); }
.reading-pet.pet-clicked .pet-avatar { animation: pet-click-bounce .6s ease !important; }
@keyframes pet-click-bounce {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.3) rotate(-15deg); }
  60% { transform: scale(.9) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}
.pet-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: linear-gradient(135deg, #e8f0ff, #fce8f0);
  border: 3px solid #4f6ef7; box-shadow: 0 2px 12px rgba(79,110,247,.3);
  animation: pet-bounce 2.5s ease-in-out infinite;
  transition: transform .15s ease;
  overflow: hidden; position: relative;
}
.pet-avatar.mood-excited { animation: pet-bounce 1s ease-in-out infinite; border-color: #f5222d; }
.pet-avatar.mood-sleepy { animation: pet-sway 4s ease-in-out infinite; border-color: #bbb; }
.pet-avatar.mood-content { border-color: #52c41a; }

/* 自定义形象书宠（透明桌宠模式） */
.pet-avatar.pet-custom {
  width: 80px; height: 80px;
  border-radius: 0; border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: pet-float 3s ease-in-out infinite;
}
.pet-avatar.pet-custom img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.25));
  pointer-events: none;
  transition: transform .15s ease;
}
.pet-emoji { display: inline-block; transition: transform .15s ease; }
.pet-avatar.pet-custom.mood-excited { animation: pet-float 1.5s ease-in-out infinite; }
.pet-avatar.pet-custom.mood-sleepy { animation: pet-sway 5s ease-in-out infinite; }

@keyframes pet-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 书宠对话气泡 */
.pet-speech {
  position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%) translateY(8px);
  background: #fff; color: #333; border-radius: 14px; padding: 8px 14px;
  font-size: 13px; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.15);
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 10;
  border: 1px solid var(--line);
}
.pet-speech.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pet-speech::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}
/* 书宠设置小齿轮 */
.pet-settings-btn {
  position: absolute; top: -4px; right: -4px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--primary); color: #fff; border: 2px solid #fff;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); z-index: 5;
  opacity: 0; transition: opacity .2s;
}
.reading-pet:hover .pet-settings-btn { opacity: 1; }
@keyframes pet-bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pet-sway {
  0%,100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
.pet-info {
  background: rgba(255,255,255,.95); border-radius: 10px; padding: 3px 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,.12); text-align: center; min-width: 70px;
}
.pet-level { font-size: 11px; font-weight: 700; color: #4f6ef7; }
.pet-title { font-size: 9px; color: #999; }
.pet-progress-bar {
  width: 60px; height: 4px; background: #eee; border-radius: 2px;
  margin: 2px auto 0; overflow: hidden;
}
.pet-progress-fill {
  height: 100%; background: linear-gradient(90deg, #4f6ef7, #7b9bff);
  border-radius: 2px; transition: width .5s;
}
.pet-tooltip {
  position: absolute; top: -8px; left: 100%; margin-left: 10px; width: 180px;
  background: rgba(33,37,50,.95); color: #fff; border-radius: 10px;
  padding: 10px 14px; font-size: 12px; line-height: 1.6;
  opacity: 0; pointer-events: none; transition: opacity .15s;
  z-index: 20;
}
.pet-tooltip.show { opacity: 1; pointer-events: auto; }

/* 闪烁粒子 */
.pet-sparkles {
  position: absolute; top: -10px; left: 0; width: 100%; height: 30px;
  pointer-events: none; overflow: visible;
}
.sparkle {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #ffd700; box-shadow: 0 0 6px #ffd700;
  animation: sparkle-float 3s ease-in-out infinite;
}
@keyframes sparkle-float {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  50% { transform: translateY(-15px) scale(1); opacity: 1; }
  100% { transform: translateY(-30px) scale(0); opacity: 0; }
}

/* 书宠设置面板 */
.pet-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.4); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.pet-modal-content {
  background: #fff; border-radius: 16px; width: 460px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.pet-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-size: 16px; font-weight: 700;
}
.pet-modal-body { padding: 20px; }
.pet-showcase {
  display: flex; gap: 16px; align-items: center; padding: 16px;
  background: linear-gradient(135deg, #f0f4ff, #fef0f6);
  border-radius: 12px; margin-bottom: 20px;
}
.pet-showcase-avatar {
  width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: #fff; border: 3px solid #4f6ef7;
  box-shadow: 0 2px 12px rgba(79,110,247,.3);
  overflow: hidden;
}
.pet-showcase-info { flex: 1; }
.pet-realm { font-size: 18px; font-weight: 700; color: #4f6ef7; margin-bottom: 4px; }
.pet-exp-text { font-size: 12px; color: #999; margin-bottom: 4px; }
.pet-stats { font-size: 12px; color: #666; margin-top: 6px; }
.pet-section { margin-bottom: 20px; }
.pet-section-title {
  font-size: 14px; font-weight: 600; color: #333; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.pet-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pet-hint { font-size: 11px; color: #aaa; }
.pet-config-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 13px; color: #555;
}
.pet-input {
  width: 70px; padding: 4px 8px; border: 1px solid #d9d9d9;
  border-radius: 4px; font-size: 13px; text-align: center;
}
.pet-realm-list { max-height: 200px; overflow-y: auto; }
.pet-realm-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-radius: 6px; font-size: 13px;
  color: #ccc; margin-bottom: 2px;
}
.pet-realm-item.reached { color: #4f6ef7; font-weight: 600; background: #f0f4ff; }
.pet-realm-exp { font-size: 11px; color: #aaa; }
.pet-realm-item.reached .pet-realm-exp { color: #4f6ef7; }

/* 书宠图片画廊 */
.pet-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px; margin-top: 8px;
}
.pet-gallery-item {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  border: 2px solid #e6e8ee; cursor: pointer; background: #f5f6f8;
  display: flex; align-items: center; justify-content: center; transition: border-color .15s;
}
.pet-gallery-item:hover { border-color: #4f6ef7; }
.pet-gallery-item.active { border-color: #4f6ef7; box-shadow: 0 0 0 2px rgba(79,110,247,.2); }
.pet-gallery-item img { width: 100%; height: 100%; object-fit: contain; }
.pet-gallery-item .gallery-badge {
  position: absolute; top: 2px; left: 2px; background: #4f6ef7; color: #fff;
  font-size: 9px; padding: 1px 5px; border-radius: 4px; line-height: 1.3;
}
.pet-gallery-item .gallery-del {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #e0586b; color: #fff; border: none;
  font-size: 11px; cursor: pointer; display: none; align-items: center; justify-content: center;
}
.pet-gallery-item:hover .gallery-del { display: flex; }

/* 书宠语录管理 */
.pet-phrase-add { display: flex; gap: 6px; margin-bottom: 8px; }
.pet-phrase-list { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.pet-phrase-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: #f5f6f8; border-radius: 6px; font-size: 13px;
}
.pet-phrase-item .phrase-text { flex: 1; }
.pet-phrase-item .phrase-type-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 4px; color: #fff;
}
.pet-phrase-item .phrase-type-badge.click { background: #4f6ef7; }
.pet-phrase-item .phrase-type-badge.idle { background: #f5a623; }
.pet-phrase-item .phrase-del {
  background: none; border: none; color: #e0586b; cursor: pointer; font-size: 14px;
}
.pet-phrase-empty { color: #8a90a2; font-size: 13px; padding: 4px 0; }

/* ===== Toast 轻提示 ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-60px);
  z-index: 9999; padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: #fff; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #34a853; }
.toast-warn { background: #f5a623; }
.toast-error { background: #e0586b; }

/* ===== 书架标注数量徽章 ===== */
.note-badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(79,110,247,.3);
}
.type-badge {
  position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 10px;
  background: #e67e22; color: #fff; font-size: 11px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(230,126,34,.3);
}

/* ===== 模态弹窗 ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--card); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.3);
  max-width: 560px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-box.share-box { max-width: 640px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 16px;
}
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); justify-content: flex-end; }

/* ===== 翻译结果区域（输出页）===== */
.translate-result {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fafbfd;
}
.translate-result-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #f0f4ff; border-bottom: 1px solid var(--line);
}
.translate-result-title { font-size: 13px; font-weight: 600; color: var(--primary); }
.translate-result-tools { display: flex; gap: 6px; }
.translate-result-tools .btn { padding: 3px 10px; font-size: 12px; }
.translate-result-body {
  padding: 12px 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  max-height: 300px; overflow-y: auto; color: var(--text);
}

/* ===== 翻译弹窗结果文本（标注页）===== */
.translate-result-text {
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--text);
}

/* ===== 标注卡片翻译按钮 ===== */
.note-card .note-foot .translate-btn {
  font-size: 12px; color: var(--primary); cursor: pointer; background: none; border: none; padding: 4px 8px;
}
.note-card .note-foot .translate-btn:hover { text-decoration: underline; }

/* ===== 用户中心 ===== */
.stats-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 14px; text-align: center; transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-num { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--muted); }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid .block { min-height: auto; padding: 16px; }
.profile-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.profile-account-grid .block { min-height: auto; padding: 16px; }
.account-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.account-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #f7f8fc; border-radius: 10px; font-size: 13px; color: var(--muted); }
.account-row strong { color: var(--text); font-size: 14px; font-weight: 600; text-align: right; }
.account-form { display: flex; flex-direction: column; gap: 10px; }
.account-label { font-size: 13px; color: var(--muted); }
.account-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  box-sizing: border-box;
}
.account-input:focus { outline: none; border-color: var(--primary); }
.account-textarea { min-height: 120px; resize: vertical; font-family: inherit; line-height: 1.7; }
.account-message { font-size: 13px; min-height: 18px; }
.account-message.error { color: #e0586b; }
.account-message.success { color: #2e7d32; }
.admin-users-block { min-height: auto; margin-bottom: 16px; padding: 16px; }
.author-profile-form { max-width: 760px; }
.admin-users-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.admin-user-list { display: flex; flex-direction: column; gap: 12px; }
.admin-user-item {
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd;
}
.admin-user-main { flex: 1; min-width: 0; }
.admin-user-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.admin-user-meta { font-size: 12px; color: var(--muted); }
.user-role-badge {
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.user-role-badge.owner { background: #efe8ff; color: #7b1fa2; }
.user-role-badge.reader { background: #e8f5e9; color: #2e7d32; }
.admin-user-actions { display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
.inline-admin-form { display: flex; gap: 8px; align-items: center; }
.inline-admin-form.inline-danger { justify-content: flex-end; }
.account-input.small { min-width: 0; padding: 9px 10px; font-size: 13px; }
.btn.danger { color: #e0586b; border-color: #f2c9cf; }
.admin-user-lock { font-size: 12px; color: var(--muted); padding-top: 6px; }
.blog-manage-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.blog-manage-sidebar, .blog-manage-editor { min-height: 540px; padding: 16px; }
.blog-post-list { display: flex; flex-direction: column; gap: 10px; }
.blog-post-item {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px;
  background: #fafbfd; padding: 12px; cursor: pointer;
}
.blog-post-item.active { border-color: var(--primary); background: #f4f7ff; }
.blog-post-item-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.blog-post-item-meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.blog-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blog-editor-content { min-height: 340px; resize: vertical; font-family: inherit; line-height: 1.8; }
.blog-editor-meta { margin-top: 12px; font-size: 12px; color: var(--muted); }
.blog-editor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.blog-polish-panel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.blog-polish-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.blog-polish-section { margin-top: 12px; }
.blog-polish-box {
  margin-top: 6px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: #fafbfd; white-space: pre-wrap; word-break: break-word;
  font-size: 14px; line-height: 1.8;
}
.blog-polish-content { max-height: 320px; overflow: auto; }
.blog-public-body {
  background:
    radial-gradient(circle at top right, rgba(67, 86, 71, .08), transparent 30%),
    radial-gradient(circle at left 20%, rgba(79, 110, 247, .06), transparent 26%),
    linear-gradient(180deg, #f8f6f1 0%, #f4f5f7 100%);
  color: var(--text);
}
.blog-public-shell, .blog-detail-shell {
  max-width: 1040px; margin: 0 auto; padding: 28px 16px 56px;
}
.blog-hero-card, .blog-detail-hero {
  display: grid; grid-template-columns: 1.5fr .85fr; gap: 20px;
  padding: 24px; border-radius: 24px; background: rgba(255,255,255,.82);
  border: 1px solid rgba(50,56,70,.08); box-shadow: 0 16px 40px rgba(28,34,44,.08);
  backdrop-filter: blur(8px);
}
.blog-hero-kicker, .blog-section-kicker {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #7b8173; margin-bottom: 10px;
}
.blog-kicker-link{
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
.blog-kicker-link:hover{ text-decoration: underline; }
.blog-kicker-sep{ margin: 0 8px; color: #b7bdc8; }
.blog-hero-copy h1, .blog-detail-hero-main h1 {
  font-size: 38px; line-height: 1.22; margin-bottom: 12px;
}
.blog-hero-copy p { color: var(--muted); font-size: 15px; line-height: 1.9; max-width: 640px; }
.blog-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.blog-hero-side { display: flex; flex-direction: column; gap: 14px; }
.blog-ink-card, .blog-hero-note {
  border-radius: 20px; padding: 18px; background:
    linear-gradient(180deg, rgba(27,30,38,.92), rgba(53,58,72,.92));
  color: #f6f3ea;
}
.blog-ink-title { font-size: 13px; color: rgba(255,255,255,.72); margin-bottom: 10px; }
.blog-ink-num { font-size: 42px; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.blog-ink-label { font-size: 13px; color: rgba(255,255,255,.76); }
.blog-ink-card-soft {
  background: linear-gradient(180deg, rgba(242,244,239,.95), rgba(255,255,255,.95));
  color: #414958;
  border: 1px solid rgba(50,56,70,.08);
}
.blog-ink-card-soft .blog-ink-title { color: #7b8173; }
.blog-hero-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blog-hero-mini-stats div {
  padding: 12px 14px; border-radius: 16px; background: rgba(245,246,241,.95);
  border: 1px solid rgba(89,98,74,.08); display: flex; flex-direction: column; gap: 4px;
}
.blog-hero-mini-stats strong { font-size: 24px; line-height: 1; color: #2f3745; }
.blog-hero-mini-stats span { font-size: 12px; color: #6b7460; }
.blog-hero-note {
  background: rgba(255,255,255,.72); color: #5f6658; border: 1px solid rgba(50,56,70,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.blog-discovery-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px;
}
.blog-discovery-card {
  background: rgba(255,255,255,.9); border-radius: 22px; padding: 22px;
  border: 1px solid rgba(50,56,70,.08); box-shadow: 0 10px 26px rgba(28,34,44,.06);
}
.blog-stream-head-compact { margin: 0 0 12px; }
.blog-stream-head-compact h2 { font-size: 22px; }
.blog-discovery-list { display: flex; flex-direction: column; gap: 10px; }
.blog-discovery-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: #f7f8f4;
  border: 1px solid rgba(89,98,74,.08); text-decoration: none; color: inherit; transition: .18s ease;
}
.blog-discovery-row:hover {
  background: #eef2ea; border-color: rgba(89,98,74,.18); transform: translateY(-1px);
}
.blog-discovery-name { font-size: 15px; font-weight: 600; color: #2f3745; }
.blog-discovery-meta { font-size: 13px; color: #6d7567; text-align: right; }
.blog-post-tags-tight { margin-top: 0; }
.blog-discovery-empty { color: var(--muted); line-height: 1.9; font-size: 14px; }
.blog-author-entry-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.blog-author-entry-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  border-radius: 18px; background: linear-gradient(180deg, rgba(247,248,244,.98), rgba(255,255,255,.98));
  border: 1px solid rgba(89,98,74,.08); text-decoration: none; color: inherit; transition: .18s ease;
}
.blog-author-entry-card:hover {
  transform: translateY(-1px); border-color: rgba(89,98,74,.18); box-shadow: 0 10px 24px rgba(28,34,44,.06);
}
.blog-author-entry-head { display: flex; gap: 12px; align-items: center; }
.blog-author-entry-avatar {
  width: 52px; height: 52px; margin-bottom: 0; flex-shrink: 0; font-size: 22px;
}
.blog-author-entry-intro {
  color: #5c6558; font-size: 13px; line-height: 1.85; min-height: 48px;
}
.blog-author-entry-latest {
  color: #3f4856; font-size: 13px; font-weight: 500;
}
.blog-tag-browse-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.blog-tag-browse-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border-radius: 18px; background: #f7f8f4; border: 1px solid rgba(89,98,74,.08);
  text-decoration: none; color: inherit; transition: .18s ease;
}
.blog-tag-browse-card:hover {
  transform: translateY(-1px); background: #eef2ea; border-color: rgba(89,98,74,.18);
}
.blog-tag-browse-top {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.blog-tag-browse-count {
  font-size: 12px; color: #6d7567; white-space: nowrap;
}
.blog-tag-browse-note {
  color: #5c6558; font-size: 13px; line-height: 1.75;
}
.blog-stream-head {
  display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 26px 0 14px;
  flex-wrap: wrap;
}
.blog-stream-head h2 { font-size: 24px; }
.blog-public-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.blog-public-card {
  background: rgba(255,255,255,.9); border-radius: 20px; padding: 20px;
  border: 1px solid rgba(50,56,70,.08); box-shadow: 0 10px 26px rgba(28,34,44,.06);
  display: flex; flex-direction: column; min-height: 250px;
}
.blog-public-cover, .blog-detail-cover, .blog-cover-preview {
  position: relative; border-radius: 18px; overflow: hidden; min-height: 180px;
  margin-bottom: 16px; border: 1px solid rgba(255,255,255,.24);
}
.blog-detail-cover { min-height: 220px; margin-bottom: 20px; }
.blog-public-cover::before, .blog-detail-cover::before, .blog-cover-preview::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,0) 45%),
    radial-gradient(circle at top right, rgba(255,255,255,.22), transparent 28%);
  pointer-events: none;
}
.blog-public-cover.theme-ink, .blog-detail-cover.theme-ink, .blog-cover-preview.theme-ink {
  background: linear-gradient(135deg, #232730, #465060 58%, #6c7482);
}
.blog-public-cover.theme-pine, .blog-detail-cover.theme-pine, .blog-cover-preview.theme-pine {
  background: linear-gradient(135deg, #27413c, #4d6f62 60%, #9eb4a0);
}
.blog-public-cover.theme-amber, .blog-detail-cover.theme-amber, .blog-cover-preview.theme-amber {
  background: linear-gradient(135deg, #5d341f, #9f6541 58%, #e0bf82);
}
.blog-public-cover.theme-mist, .blog-detail-cover.theme-mist, .blog-cover-preview.theme-mist {
  background: linear-gradient(135deg, #7f8b96, #bcc6d0 58%, #eef2f4);
}
.blog-public-cover.theme-night, .blog-detail-cover.theme-night, .blog-cover-preview.theme-night {
  background: linear-gradient(135deg, #171a24, #2d3350 55%, #5264a0);
}
.blog-public-cover-inner, .blog-cover-preview-inner {
  position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between;
  min-height: inherit; padding: 18px; color: #fff;
}
.blog-public-cover-kicker { font-size: 12px; letter-spacing: .16em; opacity: .84; }
.blog-public-cover-title {
  font-size: 26px; line-height: 1.35; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,.18);
  max-width: 78%;
}
.blog-public-cover-tags, .blog-post-tags {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.blog-public-cover-tags span, .blog-post-tags span {
  display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; background: rgba(255,255,255,.16); color: inherit; border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(3px);
}
.blog-post-tags { margin-top: 14px; }
.blog-post-tags span {
  background: #f3f5ef; color: #5a644d; border-color: rgba(89,98,74,.08);
}
.blog-tag-link {
  display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; background: #f3f5ef; color: #5a644d; border: 1px solid rgba(89,98,74,.08);
  text-decoration: none; transition: all .18s ease;
}
.blog-tag-link:hover {
  background: #e9eee1; color: #46503d; border-color: rgba(89,98,74,.18);
}
.blog-public-card-top, .blog-public-meta, .blog-public-foot, .blog-detail-meta {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.blog-public-badge, .blog-panel-tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  background: #edf1e7; color: #59624d; font-size: 12px; font-weight: 600;
}
.blog-public-date, .blog-public-meta, .blog-detail-meta, .blog-detail-path {
  color: var(--muted); font-size: 13px;
}
.blog-public-title { font-size: 24px; line-height: 1.35; margin: 14px 0 10px; }
.blog-public-title a { color: inherit; text-decoration: none; }
.blog-public-title a:hover, .blog-read-link:hover { color: var(--primary); }
.blog-author-link { color: inherit; text-decoration: none; }
.blog-author-link:hover { color: var(--primary); }
.blog-public-meta span::after, .blog-detail-meta span::after {
  content: '·'; margin-left: 10px; color: #b7bdc8;
}
.blog-public-meta span:last-child::after, .blog-detail-meta span:last-child::after { content: ''; margin: 0; }
.blog-public-summary { white-space: pre-wrap; word-break: break-word; color: #414958; font-size: 14px; line-height: 1.9; }
.blog-public-foot { margin-top: auto; padding-top: 14px; }
.blog-read-link, .blog-detail-back { color: var(--primary); text-decoration: none; font-weight: 600; }
.blog-empty-card, .blog-detail-card {
  background: rgba(255,255,255,.9); border-radius: 22px; padding: 26px 22px;
  border: 1px solid rgba(50,56,70,.08); box-shadow: 0 10px 26px rgba(28,34,44,.06);
}
.blog-empty-title { font-size: 22px; margin-bottom: 8px; }
.blog-detail-backbar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap;
}
.blog-detail-backlinks{ display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.blog-detail-sep{ color: #b7bdc8; }
.blog-author-card {
  background: linear-gradient(180deg, rgba(242,244,239,.95), rgba(255,255,255,.95));
  border: 1px solid rgba(50,56,70,.08); border-radius: 22px; padding: 20px;
}
.blog-author-avatar {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2c3240, #5d6677); color: #fff; font-size: 24px; font-weight: 700; margin-bottom: 14px;
}
.blog-author-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.blog-author-title { color: #69715f; font-size: 14px; margin-bottom: 10px; }
.blog-author-bio { color: var(--muted); font-size: 14px; line-height: 1.85; }
.blog-author-shell { max-width: 1040px; margin: 0 auto; padding: 28px 16px 56px; }
.blog-author-hero {
  display: grid; grid-template-columns: 1.45fr .85fr; gap: 20px;
}
.blog-author-maincard, .blog-author-sidecard {
  background: rgba(255,255,255,.9); border-radius: 22px; padding: 24px;
  border: 1px solid rgba(50,56,70,.08); box-shadow: 0 10px 26px rgba(28,34,44,.06);
}
.blog-author-mainhead { display: flex; gap: 16px; align-items: center; }
.blog-author-avatar-lg {
  width: 72px; height: 72px; font-size: 28px; margin-bottom: 0; flex-shrink: 0;
}
.blog-author-maincard h1 { font-size: 34px; margin-bottom: 6px; }
.blog-author-title-lg { color: #69715f; font-size: 15px; margin-bottom: 6px; }
.blog-author-handle { color: var(--muted); font-size: 13px; }
.blog-author-intro {
  margin-top: 18px; color: #414958; line-height: 1.95; white-space: pre-wrap; word-break: break-word;
}
.blog-author-stat {
  border-radius: 18px; padding: 18px; background: linear-gradient(135deg, #232730, #465060 58%, #6c7482);
  color: #fff; margin-bottom: 14px;
}
.blog-author-stat-num { font-size: 40px; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.blog-author-stat-label { font-size: 13px; color: rgba(255,255,255,.76); }
.blog-author-sideitem {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(50,56,70,.08);
  color: #414958; line-height: 1.8;
}
.blog-author-sidekicker { font-size: 12px; color: #7b8173; margin-bottom: 6px; }
.blog-tag-hero {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px;
}
.blog-tag-maincard, .blog-tag-sidecard {
  background: rgba(255,255,255,.9); border-radius: 22px; padding: 24px;
  border: 1px solid rgba(50,56,70,.08); box-shadow: 0 10px 26px rgba(28,34,44,.06);
}
.blog-tag-maincard h1 { font-size: 34px; margin-bottom: 10px; }
.blog-tag-maincard p { color: #414958; line-height: 1.9; max-width: 620px; }
.blog-article-body {
  white-space: pre-wrap; word-break: break-word; font-size: 16px; line-height: 2; color: #2f3745;
}
.blog-workbench-page .hint { margin-bottom: 14px; }
.blog-workbench-hero {
  display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 8px; flex-wrap: wrap;
}
.blog-workbench-copy h1 { font-size: 28px; margin-bottom: 8px; }
.blog-workbench-copy p { max-width: 620px; color: var(--muted); line-height: 1.8; }
.blog-cover-preview-wrap { margin-top: 12px; }
.blog-cover-preview { min-height: 170px; margin-top: 6px; }

.book-stat-item { display: flex; flex-direction: column; gap: 4px; }
.bs-info { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bs-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-meta { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.bs-bar { height: 6px; background: #eceef3; border-radius: 3px; overflow: hidden; }
.bs-bar > i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }

/* 标注最多的章节 */
.chapter-stats { display: flex; flex-direction: column; gap: 10px; }
.chapter-stat-item { display: flex; align-items: center; gap: 10px; }
.cs-name { font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-bar { flex: 2; height: 6px; background: #eceef3; border-radius: 3px; overflow: hidden; }
.cs-bar > i { display: block; height: 100%; background: #34a853; border-radius: 3px; transition: width .3s; }
.cs-count { font-size: 13px; font-weight: 600; color: var(--primary); min-width: 24px; text-align: right; }

/* 分享卡片 */
.share-card { max-height: 60vh; overflow-y: auto; }

/* ===== 暂存区（输出页）===== */
.draft-section { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.draft-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.draft-head h3 { font-size: 14px; font-weight: 600; }
.draft-count { font-size: 12px; color: var(--muted); }
.draft-list { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.draft-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s;
}
.draft-item:hover { border-color: var(--primary); }
.draft-item-info { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }
.draft-item-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-item-meta { font-size: 11px; color: var(--muted); }
.draft-item-tools { display: flex; gap: 4px; flex-shrink: 0; }
.draft-item-tools .btn { padding: 3px 8px; font-size: 11px; }

/* ===== 书架分类 ===== */
.cat-badge {
  position: absolute; bottom: 8px; left: 8px; padding: 2px 8px; border-radius: 10px;
  color: #fff; font-size: 11px; font-weight: 600; z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.cat-add-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #fafbfd; border: 1px solid var(--line); border-radius: 8px;
}
.cat-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cat-name { font-size: 14px; font-weight: 500; flex: 1; }
.cat-count { font-size: 12px; color: var(--muted); }
.cat-item .cat-del { font-size: 12px; color: #e0586b; padding: 4px 10px; }
.book-cat-list { display: flex; flex-direction: column; gap: 6px; }
.book-cat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: .15s;
}
.book-cat-item:hover { border-color: var(--primary); background: #f0f4ff; }
.book-cat-item.active { border-color: var(--primary); background: #eef1fb; font-weight: 600; }

/* ===== 问题页 ===== */
.q-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.q-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.q-badges { display: flex; gap: 6px; }
.q-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.q-badge.gen { background: #e8f5e9; color: #2e7d32; }
.q-badge.manual { background: #e3f2fd; color: #1565c0; }
.q-badge.answered { background: #f3e5f5; color: #7b1fa2; }
.q-badge.unanswered { background: #fff3e0; color: #e65100; }
.q-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.q-meta { font-size: 12px; color: var(--muted); }
.q-answer { font-size: 13px; line-height: 1.6; color: var(--text); background: #f8f9fb; border-radius: 6px; padding: 8px 12px; border-left: 3px solid var(--primary); }
.q-foot { display: flex; gap: 8px; }
.q-foot .btn { padding: 4px 12px; font-size: 12px; }

/* ===== 成果页 ===== */
.work-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.work-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31,35,48,.14); }
.work-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.work-card-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-card-preview { font-size: 13px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.work-card-meta { font-size: 12px; color: var(--muted); }
.work-card-foot { padding: 0 14px 12px; display: flex; gap: 6px; }
.work-card-foot .btn { padding: 4px 10px; font-size: 12px; }

/* ===== 提问库侧边面板 ===== */
.ask-panel {
  position: fixed; top: 56px; left: 0; bottom: 0; width: 340px;
  background: var(--card); border-right: 1px solid var(--line);
  box-shadow: 2px 0 14px rgba(31,35,48,.14); z-index: 55;
  transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.ask-panel.open { transform: translateX(0); }
.ask-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 15px;
}
.ask-panel-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.ask-filter-select {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); font-size: 12px; flex: 1; min-width: 70px;
}
.ask-count-text { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ask-list { overflow-y: auto; padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ask-empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; line-height: 2; }
.ask-empty small { font-size: 12px; color: var(--muted); }

/* 单条问题卡片 */
.ask-item {
  background: #fafbfd; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
  border-left: 3px solid transparent;
}
.ask-item.answered { border-left-color: #34a853; }
.ask-item.expanded { border-color: var(--primary); box-shadow: 0 2px 8px rgba(79,110,247,.12); }
.ask-item-top { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.ask-badge {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 600;
}
.ask-badge.gen { background: var(--primary); color: #fff; }
.ask-badge.manual { background: #eef1fb; color: var(--primary); }
.ask-badge.done { background: #e6f4ea; color: #34a853; }
.ask-badge.pending { background: #fef3e2; color: #f5a623; }
.ask-badge.general { background: #fff3e0; color: #e65100; }
.ask-badge.linked { background: #e3f2fd; color: #1565c0; }
.ask-item-q {
  font-size: 13px; line-height: 1.6; color: var(--text); margin-bottom: 6px;
  white-space: pre-wrap; word-break: break-word;
}
.ask-item-answer {
  font-size: 12px; line-height: 1.5; color: var(--muted); background: #f0f9f4;
  border-radius: 4px; padding: 6px 8px; margin-bottom: 6px;
  border-left: 2px solid #34a853; max-height: 60px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.ask-a-label { font-weight: 700; color: #34a853; font-size: 11px; }
.ask-item-foot { display: flex; justify-content: flex-end; }
.ask-answer-btn {
  font-size: 12px; color: var(--primary); cursor: pointer; background: none;
  border: 1px solid var(--primary); padding: 3px 12px; border-radius: 6px;
  transition: .15s;
}
.ask-answer-btn:hover { background: var(--primary); color: #fff; }

/* 内联答题表单 */
.ask-inline-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.ask-inline-input {
  width: 100%; min-height: 100px; padding: 10px; font-size: 13px; line-height: 1.6;
  border: 1px solid var(--line); border-radius: 6px; resize: vertical; outline: none;
  font-family: inherit; background: #fff;
}
.ask-inline-input:focus { border-color: var(--primary); }
.ask-inline-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ask-inline-actions .btn { padding: 4px 14px; font-size: 12px; }

/* ===== 标注类型徽章（标注页）===== */
.note-type-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle;
}
.note-type-badge.note { background: #e3f2fd; color: #1565c0; }
.note-type-badge.answer { background: #fff3e0; color: #e65100; }

/* ===== 答案卡片样式（标注页）===== */
.note-card.answer-card { border-left: 3px solid #f5a623; }
.note-card.answer-card .sketch { background: #fff8e1; }
.note-card.answer-card .sketch-ph { background: #fff8e1; color: #f5a623; }
.note-question {
  font-size: 13px; line-height: 1.5; color: var(--muted);
  background: #fff8e1; border-radius: 6px; padding: 8px 10px;
  border-left: 3px solid #f5a623; margin-bottom: 4px;
}
.note-question .q-label, .note-body .q-label {
  font-weight: 700; color: #e65100; font-size: 12px;
}
.note-card.answer-card .txt { color: var(--text); }

/* ===== 回顾面板 · 答题区分 ===== */
.review-card-answer { border-left-color: #f5a623 !important; background: #fffdf5 !important; }
.review-card-answer.current-chapter { border-left-color: #f5a623 !important; background: #fff8e1 !important; }
.review-card-badges { margin-bottom: 4px; }
.review-type-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600;
}
.review-type-badge.note { background: #e3f2fd; color: #1565c0; }
.review-type-badge.answer { background: #fff3e0; color: #e65100; }
.review-question {
  font-size: 12px; line-height: 1.5; color: var(--muted);
  background: #fff8e1; border-radius: 4px; padding: 6px 8px;
  margin-bottom: 6px; border-left: 2px solid #f5a623;
}
.review-question b { color: #e65100; }
.review-answer-label { font-weight: 700; color: #e65100; font-size: 12px; }

/* ===== 移动端 ===== */
@media (max-width: 760px) {
  .topnav { gap: 10px; padding: 0 12px; }
  .topnav .brand { font-size: 15px; }
  .content { padding: 14px; }
  .content.reader-content { padding: 0 10px 10px; }
  .output-grid { grid-template-columns: 1fr; }
  .block { min-height: 360px; }
  .jsmind { height: 300px; }
  .viewer-wrap { width: calc(100vw - 20px); margin: 10px auto 0; }
  .viewer, .pdf-viewer, .txt-viewer { min-height: 240px; }
  .side-arrow { width: 38px; height: 54px; font-size: 26px; line-height: 52px; }
  .toc-panel { width: 240px; }
  .review-panel { width: 280px; }
  .ask-panel { width: 280px; }
  .draw-panel { width: 280px; right: 8px; bottom: 8px; }
  #draw-canvas { width: 264px; height: 180px; }
  .reader-bar { padding: 8px 12px; gap: 8px; }
  .reader-nav { gap: 6px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-account-grid { grid-template-columns: 1fr; }
  .admin-users-grid { grid-template-columns: 1fr; }
  .admin-user-item { flex-direction: column; }
  .admin-user-actions { min-width: 0; width: 100%; }
  .inline-admin-form { flex-direction: column; align-items: stretch; }
  .blog-manage-layout { grid-template-columns: 1fr; }
  .blog-editor-grid { grid-template-columns: 1fr; }
  .blog-hero-card, .blog-detail-hero, .blog-author-hero, .blog-tag-hero, .blog-discovery-grid, .blog-author-entry-grid, .blog-tag-browse-grid { grid-template-columns: 1fr; }
  .blog-public-list { grid-template-columns: 1fr; }
  .blog-hero-copy h1, .blog-detail-hero-main h1 { font-size: 30px; }
  .blog-author-maincard h1 { font-size: 28px; }
  .blog-tag-maincard h1 { font-size: 28px; }
  .blog-public-cover-title { max-width: 100%; font-size: 22px; }
  .stats-cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-card { padding: 14px 8px; }
  .stat-num { font-size: 24px; }
}

@media (max-width: 1024px) {
  .viewer-wrap { width: calc(100vw - 32px); }
  .reader-title { flex-basis: 100%; }
}
