/* 墨韵 · 样式分片 4/4（源：moyun.single.html，勿手改） */
/* ═══════════════════════════════════════════════
   Part 8 补丁：缺失的CSS
   ═══════════════════════════════════════════════ */

/* 设置面板内部Tab */
.settings-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-card);
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid var(--bd);
  position: sticky;
  top: 65px;
  z-index: 9;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  box-shadow: 0 1px 0 var(--bd), 0 8px 18px rgba(0,0,0,.06);
}
.settings-tab-bar::-webkit-scrollbar { display:none; }
.settings-tab-item {
  flex: 0 0 auto;
  min-width: max-content;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--tx3);
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.settings-tab-item.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--sh1);
}

/* Goal 4：统一弹窗、键盘焦点与触控热区 */
[data-moyun-modal-panel] { outline:none; }
[data-moyun-modal][data-moyun-modal-active="true"] { isolation:isolate; }
[data-moyun-modal] :focus-visible,
.moyun-icon-button:focus-visible,
.settings-tab-item:focus-visible,
.chapter-version-button:focus-visible {
  outline:3px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset:2px;
}
.moyun-icon-button {
  width:40px;
  height:40px;
  min-width:40px;
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border-radius:999px;
}
.chapter-version-controls {
  display:flex;
  align-items:center;
  gap:4px;
}
.chapter-version-button {
  width:36px;
  height:36px;
  min-width:36px;
  min-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  font-size:14px;
  font-weight:800;
}
.character-action-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.character-action-grid > button { min-height:44px; }
.moyun-new-character-highlight {
  animation:moyun-new-character-highlight 1.6s ease-out;
}
@keyframes moyun-new-character-highlight {
  0%,35% { box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), var(--sh2); border-color:var(--accent); }
  100% { box-shadow:var(--sh1); }
}
.sidebar-tab-shell { position:relative; flex-shrink:0; }
.sidebar-tab-more, .sidebar-tab-back {
  position:absolute;
  top:0;
  bottom:1px;
  z-index:20;
  width:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--bg-sidebar);
  color:var(--tx2);
  font-size:22px;
  font-weight:800;
}
.sidebar-tab-more { right:0; border-left:1px solid var(--bd); }
/* 页签行只放得下 7 个：选中右侧页签时会自动滚到右端，把「书架」推出左边界。
   原来只有向右的入口，往左没有任何指示，用户会以为书架入口不见了。 */
.sidebar-tab-back { left:0; border-right:1px solid var(--bd); }

/* 角色卡展开面板分区标题 */
.char-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: block;
}

/* MOD规则位置标签 */
.mod-position-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.mod-position-tag[data-pos="pre"] { background: var(--info-soft); color: var(--info); }
.mod-position-tag[data-pos="scene"] { background: var(--warn-soft); color: var(--warn); }
.mod-position-tag[data-pos="post"] { background: var(--err-soft); color: var(--err); }
.mod-position-tag[data-pos="writing"] { background: var(--ok-soft); color: var(--ok); }

/* 流水线层级指示器 */
.pipeline-layer-idx {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 生成速率闪烁 */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.gen-pulse { animation: pulse-glow 1.5s ease-in-out infinite; }

/* 空状态插画 */
.empty-illustration {
  opacity: 0.15;
  margin: 0 auto;
}

/* 图片加载占位 */
.img-loading-placeholder {
  background: var(--bg-inset);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--tx4);
  font-size: 12px;
  margin: 16px 0;
}

/* 确保深色模式下所有input可见 */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  color: var(--tx);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--tx3);
  opacity: 1;
}

/* 书评团三栏边框修复 */
[data-theme="dark"] .review-col-border {
  border-color: var(--bd) !important;
}

/* 平滑折叠过渡 */
.smooth-collapse {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   章节拖拽排序
   ═══════════════════════════════════════════════ */
.drag-handle {
  cursor: grab;
  opacity: 0.4;
  transition: opacity 0.15s;
  touch-action: none;
  padding: 4px;
}
.drag-handle:hover { opacity: 1; }
.drag-handle:active { cursor: grabbing; opacity: 1; }
.drag-source { opacity: 0.2 !important; background: var(--accent-soft) !important; }
.drag-ghost {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  border: 2px solid var(--accent);
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  opacity: 0.92;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  color: var(--tx);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drag-indicator {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-mid);
  transition: top 0.1s ease;
}

/* Phase D.2：关系图 */
.moyun-rel-modal{position:fixed;inset:0;z-index:85;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--overlay);box-sizing:border-box}
.moyun-rel-panel{width:min(1160px,100%);height:min(900px,calc(100dvh - 32px));display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--bd);border-radius:8px;background:var(--bg-card);box-shadow:var(--sh3)}
.moyun-rel-header{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid var(--bd);background:var(--bg-card)}
.moyun-rel-title{min-width:0}.moyun-rel-title h3{font-size:15px;font-weight:900;color:var(--tx)}.moyun-rel-title p{margin-top:2px;font-size:10px;color:var(--tx3)}
.moyun-rel-header-meta{display:flex;align-items:center;gap:8px;flex:0 0 auto}.moyun-rel-count{font-size:10px;font-weight:800;color:var(--tx3)}
.moyun-rel-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:8px;padding:10px 14px;border-bottom:1px solid var(--bd);background:var(--bg-inset)}
.moyun-rel-filter{display:flex;flex-direction:column;gap:4px;min-width:0}.moyun-rel-filter span{font-size:10px;font-weight:800;color:var(--tx3)}.moyun-rel-filter select{min-height:38px}
.moyun-rel-reset{align-self:end;min-height:38px;padding:7px 12px;white-space:nowrap}
.moyun-rel-legend{display:flex;align-items:center;gap:8px;min-height:30px;padding:5px 14px;border-bottom:1px solid var(--bd);overflow-x:auto;white-space:nowrap;background:var(--bg-card)}
.moyun-rel-legend-label{font-size:9px;font-weight:900;color:var(--tx4)}.moyun-rel-legend-item{display:inline-flex;align-items:center;gap:5px;font-size:9px;color:var(--tx3)}.moyun-rel-legend-dot{width:8px;height:8px;border-radius:50%;flex:0 0 8px}
.moyun-rel-scroll{flex:1;min-height:0;overflow:auto;padding:12px;background:var(--bg)}
.moyun-rel-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:12px;min-height:430px}
.moyun-rel-canvas{min-width:0;display:flex;flex-direction:column;border:1px solid var(--bd);border-radius:8px;overflow:hidden;background:var(--bg-card)}
.moyun-rel-canvas-head{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-bottom:1px solid var(--bd);font-size:10px;color:var(--tx3)}
.moyun-rel-svg-wrap{position:relative;flex:1;min-height:360px;overflow:hidden;background:var(--bg-inset)}
.moyun-rel-svg{position:absolute;inset:0;display:block;width:100%;height:100%;max-height:none;touch-action:manipulation}
.moyun-rel-svg [data-rel-edge],.moyun-rel-svg [data-rel-node]{cursor:pointer;outline:none}.moyun-rel-svg [data-rel-edge]:focus-visible line:last-child,.moyun-rel-svg [data-rel-node]:focus-visible circle:first-of-type{filter:drop-shadow(0 0 4px var(--accent));stroke:var(--accent);stroke-width:4}
.moyun-rel-empty{width:100%;padding:70px 20px;text-align:center;color:var(--tx3)}.moyun-rel-empty strong{display:block;font-size:13px;color:var(--tx)}.moyun-rel-empty span{display:block;margin-top:6px;font-size:10px;line-height:1.6}
.moyun-rel-detail{min-width:0;border:1px solid var(--bd);border-radius:8px;background:var(--bg-card);overflow:hidden}.moyun-rel-detail-inner{height:100%;max-height:560px;overflow:auto;padding:12px}
.moyun-rel-detail-title{font-size:13px;font-weight:900;color:var(--tx);overflow-wrap:anywhere}.moyun-rel-detail-sub{margin-top:4px;font-size:10px;line-height:1.55;color:var(--tx3)}
.moyun-rel-detail-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.moyun-rel-detail-actions button{min-height:38px;padding:7px 10px;font-size:10px}
.moyun-rel-fact{margin-top:10px;padding:10px;border:1px solid var(--bd);border-left:3px solid var(--rel-color,var(--bd));border-radius:6px;background:var(--bg-inset)}
.moyun-rel-fact-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;font-size:10px;font-weight:900;color:var(--tx2)}.moyun-rel-fact-state{font-size:9px;font-weight:800;white-space:normal;overflow-wrap:anywhere;max-width:52%;text-align:right}.moyun-rel-fact p{margin-top:6px;font-size:10px;line-height:1.55;color:var(--tx3);overflow-wrap:anywhere}
.moyun-rel-events{margin-top:12px;padding-top:10px;border-top:1px solid var(--bd)}.moyun-rel-events-title{font-size:10px;font-weight:900;color:var(--tx2)}.moyun-rel-event-list{display:flex;flex-direction:column;gap:6px;margin-top:7px}.moyun-rel-event-list button{min-height:38px;padding:8px 9px;border:1px solid var(--bd);border-radius:6px;text-align:left;font-size:10px;color:var(--tx2);background:var(--bg-inset)}
.moyun-rel-records{margin-top:12px;border:1px solid var(--bd);border-radius:8px;overflow:hidden;background:var(--bg-card)}.moyun-rel-records-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid var(--bd);font-size:10px;font-weight:900;color:var(--tx2)}
.moyun-rel-record{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--bd)}.moyun-rel-record:last-child{border-bottom:0}.moyun-rel-record-main{min-width:0}.moyun-rel-record-line{font-size:11px;font-weight:900;color:var(--tx);overflow-wrap:anywhere}.moyun-rel-record-meta{margin-top:4px;font-size:9px;line-height:1.5;color:var(--tx3);overflow-wrap:anywhere}.moyun-rel-record-actions{display:flex;align-items:center;gap:6px}.moyun-rel-record-actions button{min-height:38px;padding:7px 10px;font-size:10px;white-space:nowrap}
.moyun-rel-mobile-note{display:none}

@media(max-width:767px){
  .moyun-rel-modal{padding:0;align-items:stretch;background:var(--bg-card)}
  .moyun-rel-panel{width:100%;height:var(--moyun-visual-viewport-height,100dvh);max-height:none;border:0;border-radius:0;box-shadow:none}
  .moyun-rel-header{min-height:56px;padding:6px 8px 6px 12px;padding-top:max(6px,env(safe-area-inset-top))}.moyun-rel-title p{display:none}.moyun-rel-header-meta{gap:4px}.moyun-rel-count{max-width:110px;text-align:right;line-height:1.35}
  .moyun-rel-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:8px 10px}.moyun-rel-filter select,.moyun-rel-reset{min-height:44px}.moyun-rel-reset{width:100%;grid-column:1 / -1}
  .moyun-rel-legend{min-height:34px;padding:5px 10px}
  .moyun-rel-scroll{padding:8px 8px calc(16px + env(safe-area-inset-bottom) + var(--moyun-mobile-browser-bottom,0px))}
  .moyun-rel-layout{grid-template-columns:1fr;gap:8px;min-height:0}.moyun-rel-canvas-head{min-height:44px}.moyun-rel-svg-wrap{min-height:330px}
  .moyun-rel-detail-inner{max-height:none;padding:10px}.moyun-rel-detail-actions button,.moyun-rel-event-list button{min-height:44px}.moyun-rel-detail-actions .moyun-rel-edit-action{display:none}
  .moyun-rel-record{grid-template-columns:1fr;padding:10px}.moyun-rel-record-actions{display:grid;grid-template-columns:1fr 1fr}.moyun-rel-record-actions button{min-height:44px;width:100%}
  .moyun-rel-mobile-note{display:block;padding:9px 10px;border-bottom:1px solid var(--bd);font-size:10px;line-height:1.5;color:var(--tx3);background:var(--info-soft)}
}

/* ═══════════════════════════════════════════════
   手机端适配补丁
   ═══════════════════════════════════════════════ */
@media(max-width:767px) {
  /* 弹窗底部安全区域 */
  .modal-safe-bottom {
    padding-bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--moyun-mobile-browser-bottom, 0px)) !important;
  }
  /* 侧边栏内容区域触摸滚动 */
  .touch-scroll {
    -webkit-overflow-scrolling: touch;
  }
  /* 角色卡内textarea点击不穿透 */
  .card textarea { pointer-events: auto; }
  /* 底部控制栏不被键盘遮挡 */
  .bottom-bar-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
  }
  /* 各弹窗的圆角和间距优化 */
  .pop-enter-from, .pop-leave-to {
    transform: translateY(20px) scale(.98) !important;
  }
  .moyun-icon-button {
    width:44px;
    height:44px;
    min-width:44px;
    min-height:44px;
  }
  .chapter-card-header { flex-wrap:wrap; }
  .chapter-version-controls {
    width:100%;
    order:10;
    justify-content:flex-end;
  }
  .chapter-version-button {
    width:44px;
    height:44px;
    min-width:44px;
    min-height:44px;
  }
  .character-action-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  .character-action-grid > button { padding:6px 3px; font-size:10px; line-height:1.2; }
  .settings-tab-bar { top:65px; }
  /* 中断草稿的放弃/保存/继续/复制是生成失败后最常用的一组操作，移动端必须给足触控高度。 */
  .interrupted-draft-actions > button { min-height:44px; }
  .sidebar-tab-more, .sidebar-tab-back { bottom:0; }
}

/* 沉浸阅读模式 */
.immersive-mode > aside { display: none !important; }
.immersive-mode > .md\\:hidden.fixed { display: none !important; }
[data-theme] .immersive-mode > aside { display: none !important; }
.immersive-exit {
  position: fixed; bottom: 20px; right: 20px; z-index: 99;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh2); cursor: pointer; opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}
.immersive-exit:hover { opacity: 1; transform: scale(1.1); }

/* 加载旋转动画 */
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--bd2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

/* AI操作按钮加载态 */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.btn-loading::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: loading-spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════════
   MOD 聚合悬浮菜单 · v2.4.1
   ═══════════════════════════════════════════════ */
.mod-hub-root{position:fixed;top:max(16px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));width:48px;height:48px;z-index:86;pointer-events:none}
.mod-hub-trigger{width:48px;height:48px;border-radius:999px;display:flex;align-items:center;justify-content:center;pointer-events:auto;background:var(--bg-card);border:1px solid var(--bd);color:var(--tx);box-shadow:var(--sh3);transition:transform .18s ease,background .18s ease,border-color .18s ease;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
.mod-hub-trigger:hover{transform:translateY(-1px);background:var(--bg-sidebar-h);border-color:var(--bd2)}
.mod-hub-trigger:active{transform:scale(.96);cursor:grabbing}
.mod-hub-badge{position:absolute;right:-4px;top:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;background:var(--err);color:white;border:2px solid var(--bg)}
.mod-hub-menu{position:absolute;top:58px;right:0;width:380px;max-width:calc(100vw - 24px);max-height:74vh;max-height:min(74vh,640px);overflow-y:auto;overscroll-behavior:contain;pointer-events:auto;border-radius:24px;background:var(--bg-card);border:1px solid var(--bd);box-shadow:var(--sh3);color:var(--tx)}
.mod-hub-menu:before{content:"";position:absolute;right:20px;top:-9px;width:18px;height:18px;transform:rotate(45deg);background:var(--bg-card);border-left:1px solid var(--bd);border-top:1px solid var(--bd)}
.mod-hub-backdrop{position:fixed;inset:0;z-index:85;background:rgba(15,23,42,.18);backdrop-filter:blur(1px)}
.mod-hub-row{width:100%;display:flex;gap:12px;align-items:center;text-align:left;padding:12px;border-radius:16px;transition:background .18s ease,transform .18s ease}
.mod-hub-row:hover{background:var(--bg-inset);transform:translateX(-1px)}
.mod-hub-icon{width:40px;height:40px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex:none;background:var(--accent-soft);color:var(--accent);font-size:18px;font-weight:800}
.mod-hub-chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:800;background:var(--accent-soft);color:var(--accent)}
.mod-hub-muted-chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:999px;font-size:10px;background:var(--bg-inset);color:var(--tx3);border:1px solid var(--bd)}
@supports not (top:max(1px,2px)){.mod-hub-root{top:16px;right:16px}}
@supports not (max-height:74dvh){.mod-hub-menu{max-height:74vh}}
@media(max-width:767px){.mod-hub-root{top:calc(env(safe-area-inset-top) + 12px);right:12px;width:46px;height:46px}.mod-hub-trigger{width:46px;height:46px}.mod-hub-menu{top:56px;width:360px;max-width:88vw;max-height:74vh;max-height:min(74dvh,620px);border-radius:22px}.mod-hub-row{padding:11px}.mod-hub-backdrop{background:rgba(15,23,42,.24)}}
@media(pointer:coarse){.mod-hub-trigger{min-width:46px;min-height:46px}.mod-hub-row{min-height:58px}}
/* MOD 聚合悬浮菜单最终修正版：单根节点、小弹窗、可拖动、低于设置弹窗 */
.mod-hub-root{position:fixed!important;width:48px!important;height:48px!important;z-index:60!important;pointer-events:none!important;right:auto!important;bottom:auto!important}
.mod-hub-trigger{width:48px!important;height:48px!important;border-radius:999px!important;display:flex!important;align-items:center!important;justify-content:center!important;pointer-events:auto!important;background:var(--bg-card)!important;border:1px solid var(--bd)!important;color:var(--tx)!important;box-shadow:var(--sh3)!important;touch-action:none!important;user-select:none!important;-webkit-user-select:none!important;cursor:grab!important;position:relative!important}
.mod-hub-trigger:active{cursor:grabbing!important;transform:scale(.96)!important}
.mod-hub-menu{position:absolute!important;top:58px!important;width:340px!important;max-width:calc(100vw - 24px)!important;max-width:min(340px,calc(100vw - 24px))!important;max-height:min(70vh,560px)!important;overflow-y:auto!important;overscroll-behavior:contain!important;pointer-events:auto!important;border-radius:22px!important;background:var(--bg-card)!important;border:1px solid var(--bd)!important;box-shadow:var(--sh3)!important;color:var(--tx)!important;z-index:61!important}
.mod-hub-menu:before{content:"";position:absolute;top:-8px;width:16px;height:16px;transform:rotate(45deg);background:var(--bg-card);border-left:1px solid var(--bd);border-top:1px solid var(--bd)}
.mod-hub-menu[style*="left: 0px"]:before,.mod-hub-menu[style*="left: 0"]:before{left:16px;right:auto}
.mod-hub-menu[style*="right: 0px"]:before,.mod-hub-menu[style*="right: 0"]:before{right:16px;left:auto}
.mod-hub-backdrop{position:fixed!important;inset:0!important;z-index:59!important;background:rgba(15,23,42,.22)!important;backdrop-filter:none!important}
@media(max-width:767px){.mod-hub-root{width:46px!important;height:46px!important}.mod-hub-trigger{width:46px!important;height:46px!important}.mod-hub-menu{top:56px!important;width:320px!important;max-width:88vw!important;max-height:min(68dvh,560px)!important;border-radius:20px!important}}



.paragraph-comment-layer{position:relative}
.paragraph-comment-line{position:relative;margin:0 0 1.4em;line-height:2.05;color:var(--tx)}
.paragraph-comment-line :where(p){display:inline;margin:0;line-height:inherit}
/* 中文注释：段评组件样式，用于段落气泡、评论弹窗和移动端底部抽屉。 */
.paragraph-comment-line :where(img){display:block;margin:12px auto}
.paragraph-comment-bubble{display:inline-flex;align-items:center;gap:3px;vertical-align:middle;margin-left:10px;padding:2px 8px;border-radius:999px;border:1px solid var(--bd);background:var(--bg-card);color:var(--tx4);font-size:11px;line-height:1.2;cursor:pointer;box-shadow:var(--sh1);transition:transform .15s ease, color .15s ease, border-color .15s ease, background .15s ease}
.paragraph-comment-bubble:hover{transform:translateY(-1px);color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
/* 中文注释：段评组件样式，用于段落气泡、评论弹窗和移动端底部抽屉。 */
.paragraph-comment-bubble.generating{opacity:.65;cursor:wait}
.paragraph-comment-bubble svg{width:16px;height:16px;display:block}
.paragraph-comment-mask{position:fixed;inset:0;background:rgba(0,0,0,.52);z-index:92;display:flex;align-items:flex-end;justify-content:center;padding:0}
/* 中文注释：段评组件样式，用于段落气泡、评论弹窗和移动端底部抽屉。 */
.paragraph-comment-sheet{width:100%;max-width:760px;max-height:82vh;background:var(--bg-card);border-radius:24px 24px 0 0;box-shadow:var(--sh3);border:1px solid var(--bd);overflow:hidden;display:flex;flex-direction:column}
.paragraph-comment-head{position:sticky;top:0;background:var(--bg-card);z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--bd)}
.paragraph-comment-title{font-size:20px;font-weight:900;color:var(--tx);text-align:center;flex:1}
/* 中文注释：段评组件样式，用于段落气泡、评论弹窗和移动端底部抽屉。 */
.paragraph-comment-close{width:44px;height:44px;min-width:44px;min-height:44px;border-radius:999px;display:flex;align-items:center;justify-content:center;color:var(--tx2);background:transparent;cursor:pointer}
.paragraph-comment-body{overflow:auto;padding:14px 18px 88px;overscroll-behavior:contain}
.paragraph-comment-quote{font-size:12px;line-height:1.7;color:var(--tx3);background:var(--bg-inset);border:1px solid var(--bd);border-radius:14px;padding:10px 12px;margin-bottom:14px;max-height:96px;overflow:auto}
/* 中文注释：段评组件样式，用于段落气泡、评论弹窗和移动端底部抽屉。 */
.paragraph-comment-item{display:grid;grid-template-columns:40px 1fr;gap:12px;padding:12px 0;border-bottom:1px solid var(--bd)}
.paragraph-comment-avatar{width:38px;height:38px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-weight:800;color:white;background:linear-gradient(135deg,var(--accent),var(--info))}
.paragraph-comment-name{font-size:13px;font-weight:800;color:var(--tx3);margin-bottom:4px}
/* 中文注释：段评组件样式，用于段落气泡、评论弹窗和移动端底部抽屉。 */
.paragraph-comment-content{font-size:15px;line-height:1.7;color:var(--tx)}
.paragraph-comment-meta{margin-top:8px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:var(--tx4)}
.paragraph-comment-actions{position:sticky;bottom:0;background:var(--bg-card);border-top:1px solid var(--bd);padding:12px 18px calc(12px + var(--moyun-mobile-browser-bottom,0px) + env(safe-area-inset-bottom,0px));display:flex;gap:10px;align-items:center}
/* 中文注释：段评组件样式，用于段落气泡、评论弹窗和移动端底部抽屉。 */
.paragraph-comment-input{flex:1;border-radius:14px;background:var(--bg-inset);border:1px solid var(--bd);color:var(--tx3);padding:10px 12px;font-size:13px}
@media (min-width:768px){.paragraph-comment-mask{align-items:flex-end;padding:20px}.paragraph-comment-sheet{border-radius:22px 22px 0 0;max-height:78vh}.paragraph-comment-title{font-size:18px}.paragraph-comment-body{padding-bottom:18px}.paragraph-comment-actions{position:static}.paragraph-comment-line{margin-bottom:1.1em}}
@media (max-width:520px){.paragraph-comment-line{font-size:16px;line-height:2.15}.paragraph-comment-bubble{padding:2px 7px;margin-left:6px;font-size:10px}.paragraph-comment-sheet{max-height:84vh}.paragraph-comment-title{font-size:18px}.paragraph-comment-content{font-size:14px}}
.moyun-page-loader{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;overflow:hidden;background:#121a22;color:#f6f1e7;transition:opacity .42s ease,visibility .42s ease}.moyun-page-loader::before{content:"";position:absolute;width:min(72vw,560px);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,rgba(246,241,231,.08) 0,rgba(246,241,231,.025) 33%,transparent 68%);animation:moyun-loader-breathe 2.4s ease-in-out infinite}.moyun-page-loader.is-ready{opacity:0;visibility:hidden;pointer-events:none}.moyun-loader-brand{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:15px;text-align:center}.moyun-loader-mark{position:relative;width:82px;height:82px;filter:drop-shadow(0 12px 25px rgba(0,0,0,.34));animation:moyun-loader-rise .72s cubic-bezier(.22,1,.36,1) both}.moyun-loader-mark img{display:block;width:100%;height:100%;border-radius:20px}.moyun-loader-seal{position:absolute;right:-7px;bottom:-6px;width:22px;height:22px;border:2px solid #121a22;border-radius:50%;background:#b83a2e;box-shadow:0 0 0 5px rgba(184,58,46,.12);animation:moyun-loader-seal 1.65s ease-in-out infinite}.moyun-loader-wordmark{font-family:Arial,"Noto Sans SC",sans-serif;font-size:clamp(29px,5vw,43px);font-weight:700;letter-spacing:0;line-height:1;color:#f6f1e7;animation:moyun-loader-rise .72s .08s cubic-bezier(.22,1,.36,1) both}.moyun-loader-track{display:flex;gap:7px;margin-top:12px}.moyun-loader-track span{width:5px;height:5px;border-radius:50%;background:#f6f1e7;opacity:.22;animation:moyun-loader-ink 1.2s ease-in-out infinite}.moyun-loader-track span:nth-child(2){animation-delay:.14s}.moyun-loader-track span:nth-child(3){animation-delay:.28s}.moyun-loader-status{margin-top:2px;font-size:10px;letter-spacing:.16em;color:rgba(246,241,231,.42);animation:moyun-loader-rise .72s .22s cubic-bezier(.22,1,.36,1) both}@keyframes moyun-loader-rise{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes moyun-loader-breathe{0%,100%{transform:scale(.9);opacity:.56}50%{transform:scale(1.08);opacity:1}}@keyframes moyun-loader-seal{0%,100%{transform:scale(.9);box-shadow:0 0 0 5px rgba(184,58,46,.12)}50%{transform:scale(1);box-shadow:0 0 0 10px rgba(184,58,46,0)}}@keyframes moyun-loader-ink{0%,100%{transform:translateY(0);opacity:.22}50%{transform:translateY(-6px);opacity:1}}@media (prefers-reduced-motion:reduce){.moyun-page-loader,.moyun-page-loader::before,.moyun-loader-mark,.moyun-loader-seal,.moyun-loader-wordmark,.moyun-loader-track span,.moyun-loader-status{animation:none;transition-duration:.01ms}}
.moyun-loader-wordmark{font-family:Georgia,"Times New Roman","Noto Serif SC",serif;line-height:1.05}
