/* =====================================================================
   纸引文件箱 · PaperBox
   iOS 玻璃态（Liquid Glass）设计系统 —— 固定浅色主题
   ===================================================================== */

:root {
  /* 主题色 */
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, .12);
  --accent-2: #5e5ce6;
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9f0a;
  --pink: #ff2d55;

  /* 文本 */
  --t1: #10131a;
  --t2: #4b5160;
  --t3: #8a90a0;
  --t4: #b3b8c6;

  /* 玻璃 */
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-thin: rgba(255, 255, 255, .38);
  --glass-line: rgba(255, 255, 255, .78);
  --glass-line-soft: rgba(255, 255, 255, .5);
  --blur: saturate(180%) blur(24px);
  --blur-strong: saturate(200%) blur(34px);

  /* 阴影 */
  --sh-1: 0 2px 8px rgba(16, 24, 60, .05);
  --sh-2: 0 8px 24px rgba(16, 24, 60, .09);
  --sh-3: 0 18px 44px rgba(16, 24, 60, .16);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .85);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-xs: 9px;

  /* v2.2：安全区只在「独立全屏」（PWA 加到桌面）时才该留白。
     普通浏览器 / 微信内置浏览器会把 env(safe-area-inset-top) 回报成非零（微信常见 34px+），
     而状态栏本就由浏览器自带顶栏占据，再加 safe-t 就是双重留白 —— 这正是插件商店
     等页面头部出现一大块空白的原因。故：默认归零，仅独立全屏形态才取真实值，
     并用 min(...,44px) 钳制上限，防个别 ROM 回报超大值。 */
  --sat: 0px;
  --sab: 0px;
  --tab-h: 54px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --spring: cubic-bezier(.34, 1.42, .64, 1);
}

/* v2.2：仅独立全屏形态（PWA 桌面图标启动）启用真实安全区，并钳制上限 */
@media (display-mode: standalone),
(display-mode: fullscreen),
(display-mode: minimal-ui) {
  :root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
  }
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

/* 统一 hidden 语义（避免组件 display 覆盖导致隐藏失效） */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 根画布也要跟着主题走：body 是 100% 高度，但 iOS 地址栏伸缩、
   键盘弹起时根元素会露出来一条，浅色主题下不能是系统深色。 */
html {
  background: var(--paper);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--t1);
  background: #eef1f8;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.45;
}

input,
textarea,
button,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ============ 背景 ============ */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 12% 0%, #ffffff 0%, #eaf0ff 38%, #f3f0ff 68%, #fdf1f6 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  will-change: transform;
}

.blob-1 {
  width: 62vw;
  height: 62vw;
  left: -18vw;
  top: -12vh;
  background: radial-gradient(circle at 30% 30%, #7aa8ff, rgba(122, 168, 255, 0));
  animation: float1 22s ease-in-out infinite;
}

.blob-2 {
  width: 55vw;
  height: 55vw;
  right: -16vw;
  top: 8vh;
  background: radial-gradient(circle at 60% 40%, #c4a6ff, rgba(196, 166, 255, 0));
  animation: float2 26s ease-in-out infinite;
}

.blob-3 {
  width: 58vw;
  height: 58vw;
  left: -10vw;
  bottom: -14vh;
  background: radial-gradient(circle at 40% 60%, #ffb0d0, rgba(255, 176, 208, 0));
  animation: float1 30s ease-in-out infinite reverse;
}

.blob-4 {
  width: 42vw;
  height: 42vw;
  right: -8vw;
  bottom: 6vh;
  background: radial-gradient(circle at 50% 50%, #9be6ff, rgba(155, 230, 255, 0));
  animation: float2 24s ease-in-out infinite reverse;
}

.bg-grain {
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .7) 1px, transparent 1px);
  background-size: 4px 4px;
}

@keyframes float1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4vw, 5vh, 0) scale(1.08); }
}

@keyframes float2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50% { transform: translate3d(-5vw, -4vh, 0) scale(.95); }
}

/* 背景漂移改成离散步进（约 2 次/秒）。
   原因：这 4 个色块是页面上所有毛玻璃卡片（.fcard/.frow/.dash-panel…）的
   「背景样本」。它们以 60fps 连续移动时，每张卡片的 backdrop-filter 每帧都要
   重新取样重算模糊，整机常年卡在 30fps（空闲也一样）。
   步进之后，没有变化的帧不再触发重采样，空闲与滚动都能回到 60fps；
   视觉上看不出差别 —— 每步只移动不到 0.4px，还隔着 60px 模糊。 */
.blob-1,
.blob-2,
.blob-3,
.blob-4 {
  animation-timing-function: steps(48, end);
}

/* ============ 页面容器 ============ */
#app {
  position: relative;
  z-index: 1;
  height: 100%;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  animation: pageIn .28s var(--ease);
}

.page[hidden] {
  display: none;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* 方向感：二级页从右滑入，返回从左滑入（Tab 之间仍是淡入） */
.page[data-pgdir="f"] { animation-name: pageInR; }
.page[data-pgdir="b"] { animation-name: pageInL; }

@keyframes pageInR {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes pageInL {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 6px 14px 0;
  transform: translateZ(0);
}

.bottom-pad { height: calc(var(--tab-h) + var(--sab) + 34px); }
.bottom-pad-extra { height: calc(96px + var(--sab)); }

/* ============ 玻璃基类 ============ */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-2), var(--inset);
}

/* ============ 顶部导航（毛玻璃） ============ */
.glass-header {
  position: relative;
  z-index: 30;
  /* v2.2：头部留白。原来 padding-top 仅 calc(var(--sat))，普通浏览器下 --sat=0，
     标题直接顶到内容区顶端（「插件商店」几个字贴边）。现改为上下各留 10px 呼吸空间，
     并在有安全区时叠加 sat；标题行内垂直居中，各页面统一生效。 */
  padding: calc(10px + var(--sat)) 14px 10px;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 6px 20px rgba(16, 24, 60, .06);
  flex: none;
}

.hdr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.hdr-row+.hdr-row { margin-top: 8px; }

.hdr-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .2px;
}

.hdr-slot { width: 36px; flex: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: none;
  background: var(--brand-grad);
  box-shadow: 0 5px 14px rgba(90, 110, 255, .38), inset 0 1px 1px rgba(255, 255, 255, .7);
  display: grid;
  place-items: center;
  color: #fff;
}

.brand-logo svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text b { font-size: 18px; font-weight: 700; letter-spacing: .4px; }
.brand-text i { font-style: normal; font-size: 11px; color: var(--t3); margin-top: 2px; }

/* v1.13.6 更新胶囊：贴在「纸引文件箱」标题旁，点它才弹更新窗 */
.up-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 10px; padding: 3px 9px; border: 0; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  color: #fff; background: var(--brand-grad, linear-gradient(135deg,#ff9f0a,#ff6b3d));
  box-shadow: 0 2px 8px rgba(255,107,61,.28);
  cursor: pointer; flex: none;
  animation: upBadgePulse 2.4s ease-in-out infinite;
}
.up-badge svg { width: 13px; height: 13px; }
.up-badge:active { transform: scale(.94); }
@keyframes upBadgePulse {
  0%,100% { box-shadow: 0 2px 8px rgba(255,107,61,.28); }
  50% { box-shadow: 0 2px 14px rgba(255,107,61,.55); }
}
@media (prefers-reduced-motion: reduce) { .up-badge { animation: none; } }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--t1);
  transition: transform .18s var(--spring), background .2s;
}

.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.9); }
.icon-btn.danger { color: var(--danger); }

.text-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex: none;
}

.nav-back svg { width: 20px; height: 20px; }

/* ============ 搜索框 ============ */
.search-row { gap: 8px; }

.search-box {
  flex: 1;
  min-width: 0;
  height: 38px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-1), var(--inset);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 6px 0 10px;
}

.search-box .s-icon { display: grid; place-items: center; color: var(--t3); flex: none; }
.search-box .s-icon svg { width: 16px; height: 16px; }
.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}
.search-box input::-webkit-search-cancel-button { display: none; }

.s-clear {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--t2);
  background: rgba(255, 255, 255, .55);
}

.s-clear svg { width: 15px; height: 15px; }

/* ============ 排序栏 ============ */
.sort-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}

.sort-opt {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t2);
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .2s var(--ease);
}

.sort-opt .arrow { font-size: 11px; opacity: .75; }

.sort-opt.active {
  background: linear-gradient(135deg, rgba(10, 132, 255, .92), rgba(94, 92, 230, .92));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(10, 132, 255, .3);
}

/* ============ 筛选面板 ============ */
.filter-panel {
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-2), var(--inset);
  animation: sheetIn .22s var(--ease);
}

.fp-sec { margin-bottom: 14px; }
.fp-sec:last-child { margin-bottom: 4px; }

.fp-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--t3);
  margin-bottom: 8px;
  letter-spacing: .4px;
}

.fp-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.fp-chip {
  height: 29px;
  padding: 0 11px;
  border-radius: 15px;
  font-size: 12.5px;
  color: var(--t2);
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(180, 190, 215, .45);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .18s var(--ease);
}

.fp-chip .cnt { font-size: 10.5px; color: var(--t4); }

.fp-chip.on {
  background: var(--brand-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 5px 14px rgba(10, 132, 255, .32);
}

.fp-chip.on .cnt { color: rgba(255, 255, 255, .8); }
.fp-foot { display: flex; gap: 8px; margin-top: 12px; }

.fp-btn {
  flex: 1;
  height: 36px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(180, 190, 215, .45);
  color: var(--t2);
}

.fp-btn.primary {
  background: var(--brand-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(10, 132, 255, .3);
}

/* ============ 分类横滑 chips ============ */
.chip-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: none;
  height: 31px;
  padding: 0 13px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .2s var(--ease);
}

.cat-chip .cnt { font-size: 10.5px; color: var(--t4); }

.cat-chip.on {
  background: rgba(255, 255, 255, .95);
  color: var(--accent);
  border-color: rgba(10, 132, 255, .4);
  box-shadow: 0 5px 14px rgba(10, 132, 255, .18);
  font-weight: 600;
}

.cat-chip.on .cnt { color: var(--accent); }

/* ============ 文件列表 ============ */
.file-list { display: block; }

.file-list.view-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.file-list.view-list { display: flex; flex-direction: column; gap: 9px; }

/* 滑动容器：卡片不动，独立的「圆弧形」动作按钮显示在卡片右侧 */
.swipe-wrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-width: 0;
  touch-action: pan-y;
  -webkit-touch-callout: none; /* 禁止长按弹出系统菜单/选择，保障长按多选稳定触发 */
  -webkit-user-select: none;
  user-select: none;
}
.swipe-wrap.no-swipe { touch-action: pan-y; }

/* 独立「圆弧形」动作按钮：胶囊状悬浮在卡片右侧，默认藏在卡片右外侧 */
.swipe-act {
  --satx: 96px;                      /* 由 JS 实时写入：96=收起, 0=露出 */
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translate(var(--satx), -50%);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  min-width: 68px;
  padding: 0 13px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: transform .26s var(--ease), opacity .18s var(--ease);
  pointer-events: none;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  /* 圆弧形胶囊 + 悬浮阴影，视觉上与文件卡片完全独立 */
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.swipe-act .sa-ico { width: 16px; height: 16px; display: inline-flex; }
.swipe-act .sa-ico svg { width: 16px; height: 16px; }
.swipe-act .sa-txt { line-height: 1; white-space: nowrap; }

/* 拖动中：跟随手指，无过渡 */
.swipe-wrap.dragging .swipe-act {
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

/* 露出态：停在卡片右侧 */
.swipe-wrap.swiping .swipe-act {
  --satx: 0px;
  opacity: 1;
  pointer-events: auto;
}

.swipe-act:active { filter: brightness(.92); transform: translate(var(--satx), -50%) scale(.96); }

/* 卡片保持原位（不移动），仅放上层 */
.swipe-wrap .fcard,
.swipe-wrap .frow {
  position: relative;
  z-index: 1;
  background: var(--glass-strong);
}

/* 卡片（大图视图） */
.fcard {
  border-radius: var(--r-lg);
  padding: 0;
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-2), var(--inset);
  transition: transform .22s var(--spring), box-shadow .22s var(--ease), background .22s;
  position: relative;
  cursor: pointer;
}

.fcard:active,
.fcard.pressed {
  transform: translateY(-4px) scale(1.025);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  box-shadow: var(--sh-3), var(--inset);
}

.fc-thumb {
  height: 58px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .5), rgba(235, 240, 255, .6));
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, .6);
}

.fc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fc-thumb .big-icon { width: 26px; height: 26px; opacity: .92; }
.fc-thumb .big-icon svg { width: 100%; height: 100%; }

.fc-body { padding: 6px 6px 7px; }

.fc-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--t1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  min-height: 29px;
}

.fc-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  font-size: 9px;
  color: var(--t3);
  overflow: hidden;
  white-space: nowrap;
}

/* 四列窄卡片下空间有限，隐藏体积，只保留类型 + 时间 */
.file-list.view-grid .fc-meta .sz { display: none; }

.fc-ext {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(10, 132, 255, .12);
  color: var(--accent);
  flex: none;
}

.fc-meta .dot { opacity: .5; }
.fc-meta .time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fc-badges {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 3px;
  z-index: 3;
}

.file-list.view-grid .badge {
  width: 17px;
  height: 17px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

.file-list.view-grid .badge svg { width: 10px; height: 10px; }

.badge {
  width: 21px;
  height: 21px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}

.badge svg { width: 12px; height: 12px; }
.badge.pin { color: var(--warning); }
.badge.lock { color: var(--accent-2); }
.badge.fav { color: var(--pink); }
.badge.dup { color: #ff9f0a; }

.fc-check {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.4px solid rgba(120, 130, 155, .55);
  background: rgba(255, 255, 255, .7);
  display: grid;
  place-items: center;
  z-index: 3;
  transition: all .18s var(--ease);
}

.fc-check svg { width: 11px; height: 11px; color: #fff; opacity: 0; }

.fc-check.on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 3px 9px rgba(10, 132, 255, .4);
}

.fc-check.on svg { opacity: 1; }
.swipe-wrap:not(.select-mode) .fc-check,
.swipe-wrap:not(.select-mode) .fr-check { display: none; }

/* 列表（紧凑视图） */
.frow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-1), var(--inset);
  transition: transform .22s var(--spring), box-shadow .22s, background .22s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.frow:active,
.frow.pressed {
  transform: translateY(-3px) scale(1.01);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  box-shadow: var(--sh-3), var(--inset);
}

.fr-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.6px solid rgba(120, 130, 155, .5);
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(255, 255, 255, .6);
}

.fr-check svg { width: 13px; height: 13px; color: #fff; opacity: 0; }

.fr-check.on {
  background: var(--accent);
  border-color: var(--accent);
}

.fr-check.on svg { opacity: 1; }

.fr-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}

.fr-icon img { width: 100%; height: 100%; object-fit: cover; }
.fr-icon svg { width: 22px; height: 22px; }

.fr-main { flex: 1; min-width: 0; }

.fr-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fr-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--t3);
}

.fr-badges { display: flex; gap: 3px; flex: none; }
.fr-badges .badge { width: 18px; height: 18px; border-radius: 6px; background: rgba(255, 255, 255, .5); box-shadow: none; }
.fr-badges .badge svg { width: 11px; height: 11px; }

.fr-size { font-size: 11px; color: var(--t4); flex: none; }

/* 水波纹 */
.ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(160, 190, 255, .5) 60%, rgba(160, 190, 255, 0));
  pointer-events: none;
  animation: ripple .62s var(--ease) forwards;
  z-index: 2;
  mix-blend-mode: normal;
}

@keyframes ripple {
  to { transform: scale(2.6); opacity: 0; }
}

/* ============ 空状态 ============ */
.empty-state {
  padding: 26px 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeUp .3s var(--ease);
}

.empty-state .illus { width: 190px; max-width: 70vw; margin-bottom: 6px; }
.empty-state .illus svg { width: 100%; height: auto; }
.empty-state h3 { margin: 6px 0 4px; font-size: 15.5px; font-weight: 650; color: var(--t1); }
.empty-state p { margin: 0; font-size: 12.5px; color: var(--t3); line-height: 1.6; }

/* 空态主动作：整行居中、按钮不被压窄换行 */
.empty-state .empty-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.empty-state .empty-actions .btn {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 0 26px;
  white-space: nowrap;
}

.empty-state .hint {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 15px;
  font-size: 12.5px;
  color: var(--accent);
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(10, 132, 255, .22);
  box-shadow: var(--sh-1);
}

.empty-state .hint svg { width: 14px; height: 14px; }
.empty-state .btn {
  flex: none;
  width: min(240px, 72%);
  margin-top: 16px;
  height: 46px;
  padding: 0 22px;
  border-radius: 23px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 8px 20px rgba(10, 132, 255, .3);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============ 多选操作栏 ============ */
.multi-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--tab-h) + var(--sab) + 8px);
  border-radius: var(--r-lg);
  padding: 10px 8px 8px;
  z-index: 40;
  animation: barUp .26s var(--spring);
}

.multi-bar[hidden] { display: none; }

@keyframes barUp {
  from { transform: translateY(80px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.mb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
}

.mb-count { font-size: 13px; font-weight: 650; color: var(--t1); }
.mb-all { font-size: 12.5px; color: var(--accent); font-weight: 600; }

.mb-actions {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.mb-actions::-webkit-scrollbar { display: none; }

.mb-item {
  flex: 1 0 58px;
  min-width: 58px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--t2);
  background: rgba(255, 255, 255, .55);
  transition: transform .16s var(--spring), background .2s;
}

.mb-item svg { width: 19px; height: 19px; }
.mb-item:active { transform: scale(.92); background: rgba(255, 255, 255, .9); }
.mb-item.danger { color: var(--danger); }
.mb-item.accent { color: var(--accent); }

/* ============ 可拖动悬浮按钮 ============ */
.fab {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  right: 16px;
  bottom: calc(var(--tab-h) + var(--sab) + 16px);
  z-index: 45;
  border: 0;
  background: linear-gradient(145deg, #3b8dff, #6a5cff 60%, #a05cff);
  box-shadow: 0 10px 26px rgba(78, 100, 255, .42), inset 0 1.5px 1px rgba(255, 255, 255, .65), 0 0 0 5px rgba(255, 255, 255, .28);
  color: #fff;
  display: grid;
  place-items: center;
  touch-action: none;
  transition: transform .18s var(--spring), box-shadow .2s;
  -webkit-user-select: none;
  user-select: none;
}

.fab svg { width: 26px; height: 26px; pointer-events: none; }
.fab.pressed { transform: scale(.9); }
.fab.dragging { transition: none; box-shadow: 0 16px 34px rgba(78, 100, 255, .5), 0 0 0 8px rgba(255, 255, 255, .3); }

/* ============ 底部 Tab 栏 ============ */
.tabbar {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: max(8px, var(--sab));
  z-index: 50;
  height: calc(var(--tab-h) + var(--sab));
  padding-bottom: var(--sab);
  border-radius: 22px;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 14px 36px rgba(16, 24, 60, .22), 0 2px 6px rgba(16, 24, 60, .08), var(--inset);
  /* 兜底：即使在某些国产浏览器 position:fixed+backdrop-filter 解析异常时，
     也保证 tabbar 浮在最上层，避免被内容遮挡。 */
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  contain: layout style;
}

/* 不支持 backdrop-filter 的浏览器（部分 vivo 内置 / 老内核）使用更不透明背景 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar {
    background: #f6f8fc;
  }
}

.tabbar[hidden] { display: none; }

.tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--t3);
  transition: color .2s, transform .18s var(--spring);
  padding: 0 1px;
}

.tab svg { width: 21px; height: 21px; }
.tab span { font-size: 9.5px; font-weight: 500; letter-spacing: -.2px; white-space: nowrap; }
.tab:active { transform: scale(.88); }

.tab.on {
  color: var(--accent);
  font-weight: 600;
}

.tab.on svg { filter: drop-shadow(0 3px 7px rgba(10, 132, 255, .35)); }
.tab .dot-badge {
  position: absolute;
  transform: translate(13px, -13px);
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  font-weight: 700;
}

/* ============ 详情页 ============ */
.detail-actions {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 40;
  border-radius: 20px;
  padding: 8px 6px calc(8px + var(--sab));
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid var(--glass-line);
  box-shadow: 0 10px 30px rgba(16, 24, 60, .14), var(--inset);
}

.da-scroll {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 2px;
}

.da-scroll::-webkit-scrollbar { display: none; }

.da-item {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--t2);
  transition: transform .16s var(--spring), background .2s;
  text-align: center;
}

.da-item svg { width: 20px; height: 20px; }
.da-item:active { transform: scale(.9); background: rgba(255, 255, 255, .8); }
.da-item.on { color: var(--accent); font-weight: 600; }
.da-item.on svg { filter: drop-shadow(0 3px 6px rgba(10, 132, 255, .35)); }
.da-item.danger { color: var(--danger); }
.da-item[disabled] { opacity: .35; pointer-events: none; }

/* 预览块 */
.pv-block {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-2), var(--inset);
  margin-bottom: 12px;
}

.pv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .35);
}

.pv-head b { font-size: 13px; font-weight: 650; }
.pv-head .right { display: flex; gap: 6px; align-items: center; }

.mini-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(10, 132, 255, .2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mini-btn svg { width: 13px; height: 13px; }
.mini-btn:active { transform: scale(.94); }
.mini-btn.solid { background: var(--brand-grad); color: #fff; border-color: transparent; }

.pv-html { width: 100%; height: 420px; border: 0; display: block; background: #fff; }
.pv-pdf { width: 100%; height: 460px; border: 0; display: block; background: #fff; }
.pdf-host { background: #f3f4f6; border-radius: 12px; padding: 10px; max-height: 560px; overflow: auto; -webkit-overflow-scrolling: touch; }
.pdf-pages { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.pdf-page-wrap { background: #fff; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.08); overflow: hidden; max-width: 100%; }
.pdf-page { display: block; max-width: 100%; height: auto; }
.pdf-loading { text-align: center; }
.pv-img { width: 100%; display: block; background: #fff; cursor: zoom-in; }
.pv-media { width: 100%; display: block; background: #000; }
.pv-audio-wrap { padding: 16px 14px; }
.pv-wave {
  display: block;
  width: 100%;
  height: 120px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(120,130,160,.08), rgba(120,130,160,.02));
  border-radius: 14px;
}
.wave-styles {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.wave-styles button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  font-size: 12px;
  color: var(--t2);
  background: rgba(120,130,160,.12);
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.wave-styles button svg { width: 15px; height: 15px; }
.wave-styles button.on {
  color: #fff;
  background: var(--brand-grad);
  border-color: transparent;
}

/* 媒体进度条 */
.media-bar { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px; }
.media-time { font-size: 11px; color: var(--t3); font-variant-numeric: tabular-nums; flex: none; }

/* 「用播放器打开」次级按钮 */
.media-extra { padding: 0 12px 12px; }
.m-x-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px;
  font-size: 12.5px; font-weight: 600;
  color: var(--t2);
  background: rgba(120,130,160,.10);
  border: 1px solid rgba(120,130,160,.16);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s var(--ease, ease);
}
.m-x-btn svg { width: 15px; height: 15px; }
.m-x-btn:active { transform: scale(.97); background: rgba(120,130,160,.17); color: var(--t1); }
/* 本地上传的音频：说明为什么没有「用播放器打开」 */
.m-x-note {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(120,130,160,.06);
  font-size: 10.5px; line-height: 1.5; color: var(--t3);
}
.m-x-note svg { width: 13px; height: 13px; flex: none; margin-top: 1px; opacity: .8; }

.seek {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: rgba(120, 130, 160, .22);
  position: relative;
  overflow: hidden;
}

.seek-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 3px;
  background: var(--brand-grad-h);
}

.play-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 6px 16px rgba(10, 132, 255, .35);
}

.play-btn svg { width: 20px; height: 20px; }

/* 文档预览 */
.doc-preview {
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.75;
  color: #23262e;
  max-height: 460px;
  overflow-y: auto;
  background: rgba(255, 255, 255, .55);
  word-break: break-word;
}

.doc-preview h1, .doc-preview h2, .doc-preview h3 { line-height: 1.35; margin: 1.1em 0 .5em; font-weight: 700; }
.doc-preview h1 { font-size: 20px; }
.doc-preview h2 { font-size: 17.5px; }
.doc-preview h3 { font-size: 15.5px; }
.doc-preview p { margin: .55em 0; }
.doc-preview ul, .doc-preview ol { padding-left: 1.3em; margin: .5em 0; }
.doc-preview li { margin: .25em 0; }
.doc-preview code {
  background: rgba(120, 130, 160, .13);
  padding: 1.5px 5px;
  border-radius: 5px;
  font-size: 12.5px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.doc-preview pre {
  background: rgba(30, 34, 45, .9);
  color: #e8ecf5;
  padding: 12px;
  border-radius: 11px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
}

.doc-preview pre code { background: none; color: inherit; padding: 0; }
.doc-preview blockquote {
  margin: .6em 0;
  padding: 4px 0 4px 12px;
  border-left: 3px solid var(--accent);
  color: var(--t2);
  background: rgba(10, 132, 255, .05);
}

.doc-preview table { width: 100%; border-collapse: collapse; margin: .6em 0; font-size: 13px; }
.doc-preview th, .doc-preview td { border: 1px solid rgba(120, 130, 160, .25); padding: 6px 8px; }
.doc-preview th { background: rgba(120, 130, 160, .1); font-weight: 650; }
.doc-preview img { max-width: 100%; border-radius: 8px; }
.doc-preview hr { border: 0; border-top: 1px solid rgba(120, 130, 160, .2); margin: 1em 0; }
.doc-preview a { color: var(--accent); }

.editor-area {
  width: 100%;
  min-height: 320px;
  border: 0;
  outline: 0;
  resize: vertical;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  background: rgba(255, 255, 255, .7);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  display: block;
}

/* Word 段落级编辑器（保留原模板样式） */
.wp-editor { padding: 8px 0; }
.wp-block { margin: 8px 0; }
.wp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #8a90a6);
  letter-spacing: .04em;
  padding: 2px 12px;
  background: rgba(120, 130, 160, .08);
  border-radius: 8px 8px 0 0;
  display: inline-block;
}
.wp-ta {
  width: 100%;
  border: 1px solid rgba(120, 130, 160, .18);
  border-top: 0;
  outline: 0;
  resize: vertical;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.7;
  background: rgba(255, 255, 255, .72);
  display: block;
  border-radius: 0 0 10px 10px;
}
.wp-ta:focus { border-color: var(--accent, #4c7dff); background: #fff; }
.wp-h1 .wp-ta, .wp-h2 .wp-ta { font-weight: 700; }
.wp-h1 .wp-ta { font-size: 18px; }
.wp-h2 .wp-ta { font-size: 16px; }
.wp-h3 .wp-ta { font-size: 15px; font-weight: 600; }
.wp-list .wp-ta { padding-left: 28px; text-indent: -16px; }
.wp-note {
  font-size: 12px;
  color: var(--muted, #8a90a6);
  padding: 10px 12px;
  background: rgba(120, 130, 160, .06);
  border-radius: 10px;
  margin-top: 4px;
}

/* 链接卡片 */
.link-card { padding: 14px; display: flex; gap: 12px; align-items: flex-start; }

.link-fav {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  flex: none;
  overflow: hidden;
  background: rgba(255, 255, 255, .8);
  display: grid;
  place-items: center;
  box-shadow: var(--sh-1);
}

.link-fav img { width: 100%; height: 100%; object-fit: contain; }
.link-fav svg { width: 22px; height: 22px; color: var(--accent); }
.link-body { flex: 1; min-width: 0; }
.link-body h3 { margin: 0 0 3px; font-size: 15px; font-weight: 650; line-height: 1.35; }
.link-body p { margin: 0; font-size: 12.5px; color: var(--t2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.link-url {
  margin-top: 6px;
  font-size: 11px;
  color: var(--t3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 元数据 */
.meta-card {
  border-radius: var(--r-lg);
  padding: 4px 14px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-2), var(--inset);
  margin-bottom: 12px;
}

.meta-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: .5px solid rgba(120, 130, 160, .14);
  font-size: 13.5px;
}

.meta-row:last-child { border-bottom: 0; }
.meta-row .k { width: 74px; flex: none; color: var(--t3); font-size: 13px; }
.meta-row .v { flex: 1; min-width: 0; color: var(--t1); word-break: break-all; }
.meta-row .v.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tag-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-pill {
  height: 25px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 132, 255, .1);
  color: var(--accent);
  font-weight: 500;
}

.tag-pill.solid { background: var(--brand-grad); color: #fff; }
.tag-pill .x { opacity: .6; display: grid; place-items: center; }
.tag-pill .x svg { width: 11px; height: 11px; }

/* 版本 / 历史 */
.timeline { padding: 6px 14px 10px; }

.tl-item {
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-bottom: .5px solid rgba(120, 130, 160, .14);
}

.tl-item:last-child { border-bottom: 0; }

.tl-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-top: 1px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .14);
}

.tl-dot svg { width: 13px; height: 13px; display: block; }

.tl-dot.plain {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  background: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(10, 132, 255, .16);
}

.tl-body { flex: 1; min-width: 0; }
.tl-body .t { font-size: 13.5px; font-weight: 600; }
.tl-ico-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
  margin-right: 6px;
  color: #fff;
}
.tl-body .d { font-size: 11.5px; color: var(--t3); margin-top: 2px; }
.tl-action { font-size: 12px; color: var(--accent); font-weight: 600; flex: none; }

/* ============ 通用卡片 / 列表（设置等） ============ */
.card {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-2), var(--inset);
  margin-bottom: 12px;
}

.card-title {
  padding: 12px 14px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: .4px;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-bottom: .5px solid rgba(120, 130, 160, .14);
  cursor: pointer;
  transition: background .18s;
  min-height: 52px;
}

.row-item:last-child { border-bottom: 0; }
.row-item:active { background: rgba(255, 255, 255, .5); }

.row-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}

.row-ico svg { width: 17px; height: 17px; }
.row-main { flex: 1; min-width: 0; }
.row-main .t { display: block; font-size: 14.5px; font-weight: 500; }
.row-main .s { display: block; font-size: 11.5px; color: var(--t3); margin-top: 2px; line-height: 1.45; }
.row-right { flex: none; display: flex; align-items: center; gap: 6px; color: var(--t3); font-size: 13px; }
.row-right .chev { width: 15px; height: 15px; opacity: .4; }
.row-item.danger .row-main .t { color: var(--danger); }

/* 开关 */
.switch {
  width: 46px;
  height: 28px;
  border-radius: 15px;
  background: rgba(120, 130, 160, .28);
  position: relative;
  transition: background .26s var(--ease);
  flex: none;
  cursor: pointer;
}

.switch.on { background: var(--success); }

.switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .26s var(--spring);
}

.switch.on i { transform: translateX(18px); }

/* 进度条 */
.progress {
  height: 8px;
  border-radius: 5px;
  background: rgba(120, 130, 160, .2);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 5px;
  background: var(--brand-grad-h);
  transition: width .3s var(--ease);
}

/* ============ 分段控件 ============ */
.seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(120, 130, 160, .13);
  flex: 1;
}

.seg-item {
  flex: 1;
  height: 30px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  display: grid;
  place-items: center;
  transition: all .22s var(--ease);
}

.seg-item.on {
  background: #fff;
  color: var(--t1);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 24, 60, .12);
}

.sub-tabs { padding-top: 2px; }

/* ============ 统计页 ============ */
.stat-hero {
  border-radius: var(--r-lg);
  padding: 18px;
  background: linear-gradient(140deg, rgba(10, 132, 255, .92), rgba(94, 92, 230, .92));
  color: #fff;
  box-shadow: 0 12px 30px rgba(60, 90, 220, .3);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.stat-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -60px;
  top: -70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}

.stat-hero .lab { font-size: 12px; opacity: .85; }
.stat-hero .big { font-size: 32px; font-weight: 750; letter-spacing: -.5px; margin: 2px 0 10px; }
.stat-hero .grid { display: flex; gap: 14px; position: relative; z-index: 1; }
.stat-hero .grid div { flex: 1; }
.stat-hero .grid .n { font-size: 16px; font-weight: 700; }
.stat-hero .grid .l { font-size: 11px; opacity: .8; }

.chart-row { display: flex; align-items: center; gap: 12px; padding: 14px; }
.donut-wrap { position: relative; width: 128px; height: 128px; flex: none; }
.donut-wrap canvas { width: 128px; height: 128px; }

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center .n { font-size: 19px; font-weight: 750; }
.donut-center .l { font-size: 10px; color: var(--t3); }
.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.legend-item:active { background: rgba(255, 255, 255, .6); }
.legend-item .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t2); }
.legend-item .vl { font-weight: 650; font-size: 11.5px; }
.legend-item .pc { color: var(--t3); font-size: 11px; width: 34px; text-align: right; }

.bar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.bar-row .nm { width: 62px; flex: none; font-size: 12px; color: var(--t2); }
.bar-row .track { flex: 1; height: 16px; border-radius: 8px; background: rgba(120, 130, 160, .13); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 8px; transition: width .6s var(--ease); }
.bar-row .vl { width: 52px; text-align: right; font-size: 11.5px; font-weight: 600; flex: none; }
.line-chart { width: 100%; display: block; border-radius: 12px; }

/* ============ 底部弹层 Sheet ============
   层级说明：Sheet 永远比 Dialog 新（先弹 Dialog → 用户选择 → 再开 Sheet），
   所以 Sheet 必须盖过 .dialog-mask(340)。否则 Dialog 关闭动画的 150ms 内，
   残留的遮罩会把刚打开的 Sheet 全部盖住、点不动（表现为「点了没反应」）。 */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 380;
  background: rgba(20, 26, 45, .34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade .22s var(--ease);
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 381;
  max-height: 86vh;
  border-radius: 26px 26px 0 0;
  background: rgba(252, 252, 255, .88);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border-top: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 -12px 40px rgba(16, 24, 60, .2);
  display: flex;
  flex-direction: column;
  animation: sheetIn .3s var(--ease);
  padding-bottom: var(--sab);
}

@keyframes sheetIn {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.sheet-grip {
  width: 38px;
  height: 4px;
  border-radius: 3px;
  background: rgba(120, 130, 160, .35);
  margin: 8px auto 2px;
  flex: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 10px;
  flex: none;
}

.sheet-head h3 { margin: 0; font-size: 16.5px; font-weight: 650; }
.sheet-head .x { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(120, 130, 160, .13); color: var(--t2); }
.sheet-head .x svg { width: 14px; height: 14px; }
.sheet-body { overflow-y: auto; padding: 0 16px 8px; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 9px; padding: 8px 16px 14px; flex: none; }

/* sheet 页脚按钮（取消 / 保存 等） */
.sheet-btn {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(120, 130, 160, .13);
  color: var(--t2);
  transition: transform .16s var(--spring);
  touch-action: manipulation;
}
.sheet-btn:active { transform: scale(.97); }
.sheet-btn.main {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(10, 132, 255, .3);
}
.sheet-btn.danger { background: linear-gradient(135deg, #ff3b30, #ff6b60); color: #fff; }

.btn {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform .16s var(--spring);
}
.btn svg { width: 18px; height: 18px; flex: none; }

.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px rgba(10, 132, 255, .3); }
.btn.plain { background: rgba(120, 130, 160, .13); color: var(--t2); }
.btn.ghost { background: rgba(255, 255, 255, .8); color: var(--accent); border: 1px solid rgba(10, 132, 255, .25); }
.btn.danger { background: rgba(255, 59, 48, .1); color: var(--danger); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Sheet 内表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--t3); margin-bottom: 6px; font-weight: 500; }

.input {
  width: 100%;
  height: 44px;
  border-radius: 13px;
  border: 1px solid rgba(120, 130, 160, .22);
  background: rgba(255, 255, 255, .85);
  padding: 0 13px;
  font-size: 14.5px;
  outline: 0;
  transition: border-color .2s, box-shadow .2s;
}

.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 132, 255, .13); }
textarea.input { height: auto; min-height: 96px; padding: 11px 13px; line-height: 1.6; resize: vertical; }

.opt-list { display: flex; flex-direction: column; gap: 8px; }

.opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .18s var(--ease);
}

.opt:active { transform: scale(.985); }
.opt.on { border-color: var(--accent); background: rgba(10, 132, 255, .08); }
.opt .oi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.opt .oi svg { width: 18px; height: 18px; }
.opt .ot { flex: 1; min-width: 0; }
.opt .ot b { display: block; font-size: 14.5px; font-weight: 600; }
.opt .ot span { font-size: 11.5px; color: var(--t3); }
.opt .oc { width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid rgba(120, 130, 160, .4); display: grid; place-items: center; flex: none; }
.opt.on .oc { background: var(--accent); border-color: var(--accent); }
.opt .oc svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.opt.on .oc svg { opacity: 1; }

/* 配置弹窗内联的模型列表（不另开 sheet，避免弹窗被关掉） */
.ai-modellist { margin-top: 8px; }
.ai-modellist .opt .oi { background: linear-gradient(135deg,#5b8cff,#8a6bff); }

/* 技能面板：自定义技能删除按钮 + 新增按钮 */
.skill-del { width: 30px; height: 30px; border: none; background: transparent; color: var(--t3); display: grid; place-items: center; flex: none; border-radius: 9px; }
.skill-del:active { background: rgba(255, 59, 48, .12); color: #ff3b30; }
.skill-del svg { width: 17px; height: 17px; }
.opt.add-skill { border-style: dashed; border-color: rgba(52, 199, 89, .5); background: rgba(52, 199, 89, .06); }


/* 密码输入 */
.pin-display { display: flex; justify-content: center; gap: 14px; padding: 18px 0 22px; }

.pin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(120, 130, 160, .2);
  transition: all .2s var(--spring);
}

.pin-dot.on { background: var(--accent); transform: scale(1.18); box-shadow: 0 0 0 4px rgba(10, 132, 255, .15); }
.pin-dot.err { background: var(--danger); animation: shake .4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 6px; }

.key {
  height: 52px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .8);
  font-size: 22px;
  font-weight: 500;
  display: grid;
  place-items: center;
  box-shadow: var(--sh-1);
  transition: transform .12s;
}

.key:active { transform: scale(.93); background: rgba(255, 255, 255, .98); }
.key.fn { font-size: 14px; color: var(--t2); background: transparent; box-shadow: none; font-weight: 500; }
.pin-msg { text-align: center; font-size: 13px; color: var(--danger); min-height: 20px; }
.pin-tip { text-align: center; font-size: 12.5px; color: var(--t3); margin-bottom: 6px; }

/* 手势锁 */
.pattern-wrap { display: grid; place-items: center; padding: 14px 0 6px; }
.pattern-canvas { touch-action: none; border-radius: 20px; }
.pattern-tip { text-align: center; font-size: 13.5px; color: var(--t2); min-height: 22px; margin-bottom: 4px; }
.pattern-tip.err { color: var(--danger); }
.pattern-tip.ok { color: var(--success); }

/* ============ Dialog ============ */
.dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 340;   /* 必须盖过图片编辑器（.imedit 320），否则编辑器内关闭确认被压在下面、点不到 */
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 26, 45, .34);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fade .2s var(--ease);
}

.dialog {
  width: 100%;
  max-width: 320px;
  border-radius: 22px;
  background: rgba(252, 252, 255, .92);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: pop .26s var(--spring);
  text-align: center;
}

@keyframes pop {
  from { transform: scale(.86); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.dialog .d-icon { width: 46px; height: 46px; border-radius: 50%; margin: 20px auto 10px; display: grid; place-items: center; }
.dialog .d-icon svg { width: 24px; height: 24px; color: #fff; }
.dialog h3 { margin: 0 18px 6px; font-size: 16.5px; font-weight: 650; }
.dialog p { margin: 0 18px 18px; font-size: 13.5px; color: var(--t2); line-height: 1.6; }
.dialog .d-body { margin: 0 16px 14px; }
.dialog .d-actions { display: flex; border-top: .5px solid rgba(120, 130, 160, .2); }
.dialog .d-actions button { flex: 1; height: 48px; font-size: 15.5px; font-weight: 600; color: var(--accent); }
.dialog .d-actions button+button { border-left: .5px solid rgba(120, 130, 160, .2); }
.dialog .d-actions button.main { font-weight: 700; }
.dialog .d-actions button.danger { color: var(--danger); }
.dialog .d-actions.vertical { flex-direction: column; }
.dialog .d-actions.vertical button { width: 100%; border-left: 0; border-top: .5px solid rgba(120, 130, 160, .2); }

/* ============ 更新弹窗（v1.7.5 重构：头部固定 / 内容滚动 / 按钮常驻） ============
   旧版问题：长列表与长文件路径会把弹窗撑破、按钮被挤出可视区。
   现在统一为三段式布局：头部（图标+版本）+ 中部（可滚动）+ 底部（按钮常驻）。 */
.update-mask .up-dlg {
  width: 100%;
  max-width: 344px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: rgba(252, 252, 255, .96);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: pop .26s var(--spring);
  text-align: left;
}
.up-hd {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;          /* 百分比徽章绝不换行，避免溢出到弹窗外 */
  gap: 10px;
  padding: 16px 16px 12px;
  background: linear-gradient(180deg, rgba(91, 140, 255, .12), rgba(91, 140, 255, 0));
}
.up-hd-ico {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(91, 140, 255, .32);
}
.up-hd-ico svg { width: 21px; height: 21px; }
.up-hd-txt { flex: 1 1 auto; min-width: 0; }
.up-hd-tt {
  font-size: 16.5px; font-weight: 700; line-height: 1.3;
  color: var(--t1, #1f2430);
  /* 标题过长只省略，不撑破弹窗；百分比徽章因此始终有自己的位置 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-hd-sub {
  margin-top: 3px; font-size: 12.5px; color: var(--t2, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-hd-sub em { font-style: normal; font-weight: 700; color: var(--accent, #5b8cff); margin: 0 2px; }
.up-pill {
  flex: none; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #fff; line-height: 1.35;
  white-space: nowrap;        /* 关键：百分比不换行，不再挤出弹窗 */
  font-variant-numeric: tabular-nums;
  background: var(--brand-grad);
}
.up-bd {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 16px 12px;
}
.up-sec {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 13px; font-weight: 700; color: var(--t1, #1f2430);
}
.up-sec i {
  font-style: normal; font-size: 11.5px; font-weight: 600;
  color: var(--t2, #6b7280); background: rgba(120, 130, 160, .14);
  padding: 1px 7px; border-radius: 999px;
}
.up-ul { list-style: none; margin: 0; padding: 0; }
.up-ul li {
  display: flex; gap: 9px; padding: 8px 0;
  border-bottom: .5px solid rgba(120, 130, 160, .14);
}
.up-ul li:last-child { border-bottom: 0; }
.up-i {
  flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: #fff;
  display: grid; place-items: center;
  background: var(--brand-grad);
}
.up-t {
  flex: 1 1 auto; min-width: 0;
  font-size: 13.5px; line-height: 1.55; color: var(--t1, #1f2430);
  word-break: break-word;
}
.up-note { margin-top: 10px; font-size: 11.5px; line-height: 1.6; color: var(--t2, #6b7280); }

/* 底部按钮：常驻，不随内容滚动 */
.up-ft { flex: none; display: flex; gap: 10px; padding: 12px 16px 16px; }
.up-ft[hidden] { display: none !important; }
.up-btn {
  flex: 1; height: 42px; border: none; border-radius: 13px;
  font-size: 15px; font-weight: 650; font-family: inherit;
}
.up-btn.ghost { background: rgba(120, 130, 160, .14); color: var(--t1, #1f2430); }
.up-btn.main {
  color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(91, 140, 255, .3);
}
.up-btn:active { transform: scale(.97); }

/* 更新进度区 */
.up-row { display: flex; align-items: center; gap: 10px; }
.up-row .up-bar { flex: 1 1 auto; min-width: 0; }
.up-pct {
  flex: none; min-width: 40px; text-align: right;
  font-size: 12.5px; font-weight: 700; color: var(--accent, #5b8cff);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.up-bar { height: 8px; border-radius: 999px; background: rgba(120, 130, 160, .18); overflow: hidden; }
.up-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--brand-grad);
  transition: width .28s ease;
}
.up-step {
  margin-top: 12px; font-size: 13.5px; font-weight: 650; line-height: 1.5;
  color: var(--t1, #1f2430); word-break: break-word;
}
/* 长文件路径单独一行，超出省略，不再把弹窗撑宽 */
.up-log {
  margin-top: 6px; font-size: 11.5px; color: var(--t2, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-log[hidden] { display: none !important; }
/* ============ Toast（v1.9.8 重做：轻玻璃胶囊 + 彩色图标徽章） ============ */
.toast-root {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--sat) + 14px);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  padding: 0 22px;
  /* 顶部长文案兜底：最多占屏 40%，内部滚动 */
  max-height: 40vh;
}

.toast {
  --tc1: #8aa4ff;
  /* 图标徽章渐变：起 */
  --tc2: #5e5ce6;
  /* 图标徽章渐变：止（同类型光晕色） */
  position: relative;
  max-width: 100%;
  padding: 8px 18px 8px 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid rgba(255, 255, 255, .92);
  color: var(--t1);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .1px;
  line-height: 1.42;
  box-shadow:
    0 12px 30px rgba(16, 24, 60, .13),
    0 2px 6px rgba(16, 24, 60, .06),
    0 12px 28px -14px var(--tc2),
    inset 0 1px 0 rgba(255, 255, 255, .95);
  animation: toastIn .42s var(--spring);
  display: flex;
  align-items: center;
  gap: 9px;
}

.toast>span {
  min-width: 0;
}

/* 图标徽章：圆形渐变底 + 白色线性图标 */
.toast svg {
  width: 26px;
  height: 26px;
  flex: none;
  padding: 5.5px;
  box-sizing: border-box;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(150deg, var(--tc1), var(--tc2));
  box-shadow: 0 4px 10px -2px var(--tc2);
}

.toast.info {
  --tc1: #8aa4ff;
  --tc2: #5e5ce6;
}

.toast.ok {
  --tc1: #63e08a;
  --tc2: #24bd4e;
}

.toast.err {
  --tc1: #ff9a8b;
  --tc2: #ff453a;
}

.toast.warn {
  --tc1: #ffc86b;
  --tc2: #f59300;
}

/* 常驻加载提示：图标持续旋转 */
.toast.loading {
  --tc1: #8aa4ff;
  --tc2: #5e5ce6;
}

.toast.loading svg {
  animation: toastSpin .9s linear infinite;
}

.toast.out {
  animation: toastOut .26s var(--ease) forwards;
}

@keyframes toastSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toastIn {
  from {
    transform: translateY(-26px) scale(.88);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateY(-14px) scale(.94);
    opacity: 0;
  }
}

/* ============ 图片全屏查看器 ============ */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8, 10, 16, .96);
  display: flex;
  flex-direction: column;
  animation: fade .2s var(--ease);
  touch-action: none;
}

.viewer-close {
  position: absolute;
  top: calc(var(--sat) + 12px);
  right: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  display: grid;
  place-items: center;
}

.viewer-close svg { width: 18px; height: 18px; }

.viewer-stage {
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  will-change: transform;
  transition: transform .06s linear;
}

.viewer-tip {
  position: absolute;
  bottom: calc(var(--sab) + 16px);
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .5);
  font-size: 11.5px;
}

/* ============ 应用锁 ============ */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(247, 248, 252, .9);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px calc(30px + var(--sab));
  animation: fade .25s var(--ease);
}

.lock-logo {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: var(--brand-grad);
  box-shadow: 0 12px 28px rgba(90, 110, 255, .4), inset 0 1.5px 1px rgba(255, 255, 255, .7);
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 14px;
}

.lock-logo svg { width: 34px; height: 34px; }
.lock-title { font-size: 19px; font-weight: 700; }
.lock-sub { font-size: 12.5px; color: var(--t3); margin-top: 4px; margin-bottom: 8px; }

.lock-sw {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
}

/* ============ 杂项 ============ */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-title { font-size: 12px; font-weight: 600; color: var(--t3); margin: 14px 2px 8px; letter-spacing: .4px; }
.muted { color: var(--t3); }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; }

.loading-dots { display: inline-flex; gap: 4px; align-items: center; }
.loading-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: ld 1s infinite; }
.loading-dots i:nth-child(2) { animation-delay: .16s; }
.loading-dots i:nth-child(3) { animation-delay: .32s; }

@keyframes ld {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.copy-box {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(120, 130, 160, .1);
  font-size: 12px;
  word-break: break-all;
}

.copy-box .txt { flex: 1; min-width: 0; font-family: "SF Mono", Menlo, Consolas, monospace; }

/* ============ 桌面 / 平板适配 ============ */
/* 详情抽屉遮罩：仅在桌面抽屉态显示 */
#detailBackdrop {
  position: absolute;
  inset: 0;
  z-index: 39;
  display: none;
  background: rgba(18, 26, 52, .22);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

@media (min-width: 768px) {
  html:not(.mobile) #app {
    max-width: 720px;
    margin: 0 auto;
    height: 100%;
    position: relative;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 30px 90px rgba(20, 30, 70, .12);
  }
  /* 桌面端居中：必须显式给 width（calc(100% - 16px)），否则 left:50% + right:auto
     的固定定位会退化成 shrink-to-fit，底栏被压成 ~156px，五个 Tab 挤在一起重叠。 */
  html:not(.mobile) .tabbar {
    max-width: 700px;
    width: calc(100% - 16px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  html:not(.mobile) .file-list.view-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  html:not(.mobile) .scroll-area { padding: 14px 18px 0; }
  html:not(.mobile) .glass-header { padding-left: 18px; padding-right: 18px; }
  .fcard { transition: transform .22s var(--spring), box-shadow .22s var(--ease), background .22s; }
}

@media (min-width: 1024px) {
  html:not(.mobile) #app {
    max-width: 1040px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .55), 0 40px 110px rgba(20, 30, 70, .14);
  }
  html:not(.mobile) .tabbar { max-width: 1020px; }
  html:not(.mobile) .file-list.view-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
  html:not(.mobile) .scroll-area { padding: 18px 26px 0; }
  html:not(.mobile) .glass-header { padding-left: 26px; padding-right: 26px; }
  html:not(.mobile) .file-list.view-list { gap: 12px; }

  /* 详情页：右侧抽屉 + 遮罩（桌面端专属体验） */
  html:not(.mobile) #app.detail-open #detailBackdrop { display: block; }
  html:not(.mobile) #app.detail-open .tabbar,
  html:not(.mobile) #app.detail-open .fab { opacity: 0; pointer-events: none; transition: opacity .2s; }

  html:not(.mobile) .page[data-page="detail"] {
    left: auto;
    right: 0;
    width: min(480px, 46%);
    border-radius: 26px 0 0 26px;
    box-shadow: -24px 0 70px rgba(20, 30, 70, .22);
    animation: drawerIn .3s var(--ease);
    z-index: 40;
  }
  @keyframes drawerIn {
    from { transform: translateX(48px); opacity: .55; }
    to { transform: none; opacity: 1; }
  }
  html:not(.mobile) .page[data-page="detail"] .glass-header {
    border-radius: 26px 0 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============ 登录 / 注册弹层 ============ */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, rgba(58, 86, 180, .42), rgba(120, 90, 220, .34));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  animation: fade .22s ease;
}
.auth-modal[hidden] { display: none; }

/* 用户协议 / 隐私政策弹层：必须盖过登录框（auth-modal z-index 200），
   否则在登录页点击协议时弹层被压在下面，登录成功后才「一起冒出来」 */
.legal-dialog { z-index: 210; }
.legal-dialog .legal-body { text-align: left; }

/* 登录页品牌 logo：与首页顶栏左上角 brand-logo 同款
   （渐变圆角方块 + 白色线性立方体图标） */
.auth-logo {
  width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(90, 110, 255, .4), inset 0 1px 1px rgba(255, 255, 255, .7);
  display: grid; place-items: center;
  color: #fff;
}
.auth-logo svg { width: 26px; height: 26px; }

/* 登出态：隐藏背后的页面内容，避免旧数据在登录框后透出 */
body.logged-out #app { visibility: hidden; }
body.logged-out #tabbar { display: none; }

.auth-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 26px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(20, 30, 80, .28);
  animation: pop .26s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-brand-txt { display: flex; flex-direction: column; }
.auth-brand-txt b { font-size: 19px; letter-spacing: .5px; }
.auth-brand-txt i { font-style: normal; font-size: 12px; color: #6b7390; margin-top: 2px; }

.auth-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: rgba(120, 130, 160, .12); border-radius: 14px; margin-bottom: 16px;
}
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 9px 0;
  border-radius: 11px; font-size: 14px; font-weight: 600; color: #5a607a;
  cursor: pointer; transition: .18s;
}
.auth-tab.on { background: #fff; color: #2a2f45; box-shadow: 0 3px 10px rgba(40, 50, 100, .12); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field span { font-size: 12px; color: #6b7390; padding-left: 4px; }
.auth-field input {
  height: 46px; border-radius: 13px; border: 1px solid rgba(120, 130, 160, .25);
  background: rgba(255, 255, 255, .9); padding: 0 14px; font-size: 15px; color: #2a2f45;
  outline: none; transition: .18s;
}
.auth-field input:focus { border-color: #6a8bff; box-shadow: 0 0 0 3px rgba(106, 139, 255, .18); }

/* 重置码输入 + 发送按钮（倒计时） */
.auth-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-code-row input {
  flex: 1;
  height: 46px;
  border-radius: 13px;
  border: 1px solid rgba(120, 130, 160, .25);
  background: rgba(255, 255, 255, .9);
  padding: 0 14px;
  font-size: 15px;
  color: #2a2f45;
  outline: none;
  transition: .18s;
}
.auth-code-row input:focus { border-color: #6a8bff; box-shadow: 0 0 0 3px rgba(106, 139, 255, .18); }
.auth-code-send {
  flex: none;
  height: 46px;
  padding: 0 14px;
  border-radius: 13px;
  border: 0;
  background: var(--brand-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(106, 139, 255, .35);
  transition: transform .12s, opacity .2s;
  min-width: 72px;
}
.auth-code-send svg { width: 16px; height: 16px; }
.auth-code-send .txt { color: #fff; }
.auth-code-send:active { transform: scale(.96); }
.auth-code-send[disabled] {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auth-err {
  font-size: 12.5px; color: #e23a3a; background: rgba(226, 58, 58, .1);
  border-radius: 10px; padding: 8px 12px;
}
.auth-err[hidden] { display: none; }

/* 密码查看切换（眼睛图标） */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; box-sizing: border-box; padding-right: 42px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent; padding: 0; cursor: pointer;
  background-repeat: no-repeat; background-position: center; background-size: 20px 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7390' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  opacity: .55;
}
.pw-eye.on {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a84ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-7-11-7a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 7 11 7a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
  opacity: 1;
}

.auth-submit {
  height: 48px; border: 0; border-radius: 14px; margin-top: 4px;
  background: var(--brand-grad); color: #fff;
  font-size: 15.5px; font-weight: 700; cursor: pointer;
  box-shadow: var(--brand-glow);
  transition: transform .12s;
}
.auth-submit:active { transform: scale(.98); }

.auth-tip {
  font-size: 11.5px; color: #8089a4; line-height: 1.6; margin: 14px 2px 0; text-align: center;
}

.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.auth-remember { display: inline-flex; align-items: center; gap: 6px; color: #5a607a; cursor: pointer; }
.auth-remember input { width: 15px; height: 15px; accent-color: #6a8bff; }
.auth-link {
  background: none; border: 0; padding: 2px 0; color: #6a8bff; font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.auth-link:active { opacity: .7; }
.auth-form-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.auth-form-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px 6px 4px;
  border: 0;
  background: transparent;
  color: var(--t2, #6b7390);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.auth-form-back svg { width: 18px; height: 18px; }
.auth-form-back:active { opacity: .7; }
.auth-form-head .auth-form-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #2a2f45;
  margin: 0;
}
.auth-agree { font-size: 11.5px; color: #8089a4; text-align: center; margin: 2px 2px 0; }
.auth-reset-code {
  font-size: 12px; color: #2a7a4a; background: rgba(40, 180, 110, .12);
  border-radius: 10px; padding: 8px 12px; word-break: break-all;
}
.auth-reset-code[hidden] { display: none; }


/* ================= 账号页 ================= */
.account-card { padding: 4px 0 0; }
.account-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 6px;
}
.account-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, #34c759, #0a84ff);
  color: #fff; font-size: 18px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(10, 132, 255, .28);
}
.account-avatar-img { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; display: block; }
/* 头像按钮（可点击改头像） */
.account-avatar-btn {
  position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; flex: 0 0 auto;
}
.account-avatar-btn .account-avatar { width: 44px; height: 44px; }
.account-avatar-edit {
  position: absolute; right: -3px; bottom: -3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; color: #5e5ce6;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.2); border: 1px solid rgba(94,92,230,.35);
}
.account-avatar-edit svg { width: 11px; height: 11px; }
.account-info { flex: 1; min-width: 0; }
.account-name { font-size: 15.5px; font-weight: 700; color: #1c2030; }
.account-acc { font-size: 13px; color: #6b7390; margin-top: 3px; }
.account-acc b { color: #1c2030; }
.acc-edit {
  margin-left: 6px; font-size: 11px; line-height: 1; color: #0a84ff;
  background: rgba(10,132,255,.12); border: 0; border-radius: 10px; padding: 3px 9px; cursor: pointer;
}
.acc-edit:active { transform: scale(.96); }
.account-email {
  font-size: 12.5px; color: #8089a4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 「我的」页：账号主卡（v1.7.7 重构） ---------- */
.acct-hero { padding: 16px 14px 4px; }
.acct-edit-btn {
  -webkit-appearance: none; appearance: none; flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 11px; border: 0; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; font-family: inherit;
  color: var(--accent, #5b8cff); background: rgba(91, 140, 255, .12);
  transition: transform .14s var(--spring), background .18s;
}
.acct-edit-btn:active { transform: scale(.94); background: rgba(91, 140, 255, .2); }
.acct-edit-btn svg { width: 14px; height: 14px; }

/* 数据概览：4 个可点的小格子，点一下直达对应页 */
.acct-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; margin: 16px 0 0; padding: 12px 0 0;
  border-top: .5px solid rgba(120, 130, 160, .14);
}
.acct-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 12px; cursor: pointer;
  transition: background .16s, transform .16s var(--spring);
}
.acct-stat:active { background: rgba(120, 130, 160, .1); transform: scale(.95); }
.acct-stat b {
  font-size: 17px; font-weight: 750; color: var(--t1, #1f2430);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.acct-stat span { font-size: 11.5px; color: var(--t3, #8a90a0); }
.acct-sub {
  margin: 12px 2px 14px; font-size: 12px; color: var(--t3, #8a90a0);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.acct-sub b { color: var(--t1, #1f2430); font-weight: 700; }

/* 改头像面板 */
.avatar-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 6px 2px 14px;
}
.avatar-opt {
  height: 56px; border-radius: 16px; border: 0; cursor: pointer; position: relative;
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(40,40,90,.18); transition: transform .12s;
}
.avatar-opt svg { width: 22px; height: 22px; opacity: 0; transition: opacity .12s; }
.avatar-opt:active { transform: scale(.96); }
.avatar-opt:active svg, .avatar-opt:hover svg { opacity: 1; }
.wide-btn {
  width: 100%; height: 46px; border: 1px solid rgba(120,130,160,.28); border-radius: 13px;
  background: rgba(255,255,255,.7); color: #3a3f55; font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.wide-btn svg { width: 18px; height: 18px; }
.wide-btn:active { transform: scale(.98); }

/* 表单类 sheet */
.form-sheet { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 8px; }
.form-sheet .auth-field input { background: #fff; }

/* ============ 图片编辑器（全屏） ============ */
.imedit {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: #10131c;
  display: flex;
  flex-direction: column;
  animation: fade .2s var(--ease);
  color: #fff;
}
.im-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--sat) + 10px) 14px 10px;
}
.im-top b { flex: 1; font-size: 16px; font-weight: 650; }
.im-top-right { display: flex; gap: 8px; }
.im-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.im-btn svg { width: 16px; height: 16px; }
.im-btn:active { transform: scale(.96); }
.im-btn.main { background: var(--brand-grad); }

.im-stage { flex: 1; display: grid; place-items: center; overflow: hidden; padding: 6px 14px; }
.im-cwrap { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
.im-cwrap canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .5);
}

/* 裁剪层 */
.im-crop { position: absolute; inset: 0; line-height: 1.4; }
.im-crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58);
  touch-action: none;
  cursor: move;
}
.im-h {
  position: absolute;
  width: 26px; height: 26px;
  border: 3px solid #fff;
  background: rgba(10, 132, 255, .9);
  border-radius: 8px;
}
.im-h.nd { left: -9px; top: -9px; cursor: nwse-resize; }
.im-h.ne { right: -9px; top: -9px; cursor: nesw-resize; }
.im-h.sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.im-h.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.im-crop-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -54px;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

/* 工具栏 */
.im-tools {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 10px 12px calc(12px + var(--sab));
  background: rgba(255, 255, 255, .06);
}
.im-tool {
  border: 0;
  background: rgba(255, 255, 255, .1);
  color: #dfe4f2;
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.im-tool svg { width: 18px; height: 18px; }
.im-tool.on { background: var(--brand-grad); color: #fff; }
.im-tool:active { transform: scale(.95); }
.im-sep { width: 1px; height: 26px; background: rgba(255, 255, 255, .14); }
.im-color { display: inline-grid; place-items: center; }
.im-color input[type=color] {
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 9px; background: none; cursor: pointer;
}
.im-color input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.im-color input[type=color]::-webkit-color-swatch { border: 2px solid rgba(255, 255, 255, .85); border-radius: 7px; }
.im-slider { display: inline-flex; align-items: center; gap: 7px; }
.im-slider input[type=range] { width: 92px; accent-color: #0a84ff; }
.im-slider b { font-size: 11px; color: #cfd6e6; min-width: 14px; text-align: center; font-weight: 600; }
.im-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  padding: 0;
}
.im-dot.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.im-w {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 0;
  background: rgba(255, 255, 255, .1);
  display: inline-grid;
  place-items: center;
}
.im-w i { display: block; height: 3px; border-radius: 2px; background: #fff; }
.im-w.on { background: rgba(10, 132, 255, .75); }

/* ============ 工具箱 ============ */
.tool-cat-title {
  display: flex !important;
  align-items: center;
  gap: 10px;
}
.tool-cat-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.tool-cat-ico svg { width: 16px; height: 16px; }
.tool-cat-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tool-cat-txt b { font-size: 14.5px; color: var(--t1); }
.tool-cat-txt span { font-size: 11.5px; color: var(--t3); line-height: 1.35; }
.tool-cat-num { font-size: 12px; color: var(--t3); flex: none; }
.tool-cat-toggle {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  border: 0; background: rgba(120, 130, 160, .12); color: var(--t2);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .2s, background .2s;
}
.tool-cat-toggle svg { width: 16px; height: 16px; transition: transform .2s; }
.tool-cat-toggle.collapsed svg { transform: rotate(-90deg); }
.tool-cat-toggle:active { background: rgba(120, 130, 160, .22); }

.tool-grid-card { padding: 6px 8px 10px; }
.tool-grid-card.collapsed { display: none; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tool-item {
  -webkit-appearance: none; appearance: none;
  border: 0; background: transparent; padding: 10px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border-radius: 14px; transition: transform .16s var(--spring), background .2s;
  cursor: pointer; color: var(--t1);
}
.tool-item:active { transform: scale(.95); background: rgba(120, 130, 160, .1); }
.tool-ico {
  width: 46px; height: 46px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
}
.tool-ico svg { width: 23px; height: 23px; }
.tool-name { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.tool-desc {
  font-size: 10.5px; color: var(--t3); text-align: center; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 27px;
}
.tool-lv {
  font-size: 10px; color: var(--t3); background: rgba(120, 130, 160, .12);
  padding: 1px 6px; border-radius: 6px;
}
.tool-item.soon { opacity: .5; pointer-events: none; }

/* 工具箱方块错位进场：首屏更有"活"的感觉（AI 应用页复用同一套） */
.tool-grid .tool-item { animation: tileIn .34s var(--spring) backwards; }
.tool-grid .tool-item:nth-child(1) { animation-delay: .02s; }
.tool-grid .tool-item:nth-child(2) { animation-delay: .05s; }
.tool-grid .tool-item:nth-child(3) { animation-delay: .08s; }
.tool-grid .tool-item:nth-child(4) { animation-delay: .11s; }
.tool-grid .tool-item:nth-child(5) { animation-delay: .14s; }
.tool-grid .tool-item:nth-child(6) { animation-delay: .17s; }
.tool-grid .tool-item:nth-child(7) { animation-delay: .2s; }
.tool-grid .tool-item:nth-child(8) { animation-delay: .23s; }
.tool-grid .tool-item:nth-child(9) { animation-delay: .26s; }
/* 尊重系统「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  .tool-grid .tool-item, .ai-tool { animation: none; }
}

/* ---- 转换执行界面 ---- */
.tool-runner {
  /* 层级需低于底部弹层（100/101）、图片查看器（300）与确认框（340），
     否则「从纸引文件箱选择」等弹层会被整块执行页挡住、点不到 */
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg, #f2f4f8);
  display: flex; flex-direction: column;
  animation: fade .2s ease;
}
.tool-runner-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; flex: none;
  padding-top: calc(6px + var(--sat));
}
.tool-runner-head h3 { flex: 1; text-align: center; font-size: 17px; font-weight: 700; margin: 0; color: var(--t1); }
.tr-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(120, 130, 160, .14); color: var(--t1);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.tr-btn svg { width: 18px; height: 18px; }
.tool-runner-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 0; }
.tool-runner-foot {
  flex: none; padding: 10px 14px calc(10px + var(--sab));
  display: flex; gap: 10px;
}
.tool-runner-foot .btn { flex: 1; }
.tr-pick-row { display: flex; gap: 8px; }
.tr-pick-row .tr-pick { flex: 1 1 0; width: auto; min-width: 0; white-space: nowrap; }
.tr-files { margin-top: 8px; }
/* 已选文件：缩略图预览 */
.tr-fthumb {
  flex: none; width: 42px; height: 42px; border-radius: 9px; overflow: hidden;
  position: relative; background: rgba(120, 130, 160, .12); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tr-fthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-fthumb.is-ico { cursor: default; color: var(--t2); }
.tr-fthumb.is-ico svg { width: 18px; height: 18px; }
.tr-fthumb > i {
  position: absolute; right: 0; bottom: 0; width: 15px; height: 15px;
  background: rgba(0, 0, 0, .5); color: #fff; border-radius: 5px 0 0 0;
  display: flex; align-items: center; justify-content: center;
}
.tr-fthumb > i svg { width: 9px; height: 9px; }
.tr-fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-fmeta .tr-fname { flex: none; }
/* 结果预览 */
.tr-prev {
  position: relative; margin-top: 2px; border-radius: 14px; overflow: hidden;
  background: rgba(120, 130, 160, .08); cursor: pointer;
  max-height: 300px; display: flex; align-items: center; justify-content: center;
}
.tr-prev img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.tr-prev-tip {
  position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 4px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px;
  padding: 4px 9px; border-radius: 999px;
}
.tr-prev-tip svg { width: 12px; height: 12px; }
.tr-prev-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px;
}
.tr-prev-cell {
  border: 0; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: rgba(120, 130, 160, .1); display: flex; flex-direction: column;
}
.tr-prev-cell img { width: 100%; height: 74px; object-fit: cover; display: block; }
.tr-prev-cell span {
  font-size: 10.5px; color: var(--t3); padding: 3px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-sub button.mini { background: rgba(10, 132, 255, .12); color: var(--accent); margin-right: 4px; }
/* 纸引文件箱选文件面板 */
.vp-wrap { padding-bottom: 6px; }
.vp-kw { width: 100%; height: 40px; margin-bottom: 8px; }
.vp-list { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.vp-item {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border: 0; background: transparent; border-radius: 11px; cursor: pointer; text-align: left;
}
.vp-item:active { background: rgba(120, 130, 160, .1); }
.vp-item.on { background: rgba(10, 132, 255, .1); }
.vp-thumb {
  flex: none; width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  background: rgba(120, 130, 160, .12); display: flex; align-items: center; justify-content: center;
}
.vp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vp-thumb.is-ico svg { width: 17px; height: 17px; color: var(--t2); }
.vp-name {
  flex: 1; min-width: 0; font-size: 13px; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vp-size { flex: none; font-size: 11px; color: var(--t3); }
.vp-cb {
  flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(120, 130, 160, .35);
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.vp-cb svg { width: 12px; height: 12px; }
.vp-item.on .vp-cb { background: var(--accent); border-color: var(--accent); color: #fff; }
.tr-file {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px; background: rgba(120, 130, 160, .09);
  margin-bottom: 6px;
}
.tr-fname {
  flex: 1; min-width: 0; font-size: 13px; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-fsize { font-size: 11.5px; color: var(--t3); flex: none; }
.tr-fops { display: flex; gap: 2px; flex: none; }
.tr-fops button {
  width: 28px; height: 28px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(120, 130, 160, .12); color: var(--t2);
  display: flex; align-items: center; justify-content: center;
}
.tr-fops button svg { width: 14px; height: 14px; }
.tr-hint { margin: 8px 2px 0; }
.tr-opt { margin-bottom: 10px; }
.tr-opt label { display: block; font-size: 12.5px; color: var(--t2); margin-bottom: 5px; }
.tr-opt .input { width: 100%; height: 42px; }
/* 工具结果页操作按钮：两列网格自适应，避免单行挤压导致文字被截断 */
.tr-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.tr-acts .btn {
  min-width: 0;
  height: 44px;
  border-radius: 13px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 8px;
  gap: 5px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(10, 132, 255, .14);
}
/* 第 5 个按钮（如「复制结果」）独占一行，避免落单留半格 */
.tr-acts .btn:nth-child(odd):last-child { grid-column: 1 / -1; }
.tr-acts .btn svg { width: 17px; height: 17px; flex: none; }
.tr-acts .btn.plain { background: rgba(255, 255, 255, .78); color: var(--t1); border: 1px solid rgba(120, 130, 160, .22); }
.tr-acts .btn.ghost { background: #fff; color: var(--accent); border: 1px solid rgba(10, 132, 255, .28); }

/* ---- 工具箱：进度 / 结果消息支持多行（如 MD5 前后对比） ---- */
#trMsg {
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
}
.tr-acts .btn:active { transform: scale(.96); }
.tr-sublist { margin-top: 12px; }
.tr-sub {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px; background: rgba(120, 130, 160, .07); margin-bottom: 5px;
}
.tr-sub > span:first-child {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-sub button {
  flex: none; border: 0; background: var(--accent); color: #fff;
  font-size: 12px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
}

/* ---- 文档渲染（离屏用于生成 PDF） ---- */
.dt-doc, .dt-doc-page {
  background: #fff;
  color: #1f2430;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
}
.dt-doc { font-size: 15px; line-height: 1.75; }
.dt-doc-page { overflow: hidden; }
.dt-doc img, .dt-doc-page img { max-width: 100%; height: auto; }
.dt-doc h1, .dt-doc h2, .dt-doc h3 { line-height: 1.35; margin: 0 0 8px; }
.dt-doc p { margin: 0 0 8px; }
.dt-doc table, .dt-table { width: 100%; border-collapse: collapse; }
.dt-doc ul, .dt-doc ol { margin: 0 0 8px; padding-left: 22px; }
.dt-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; color: #1f2430; }
.dt-table { font-size: 13px; }
.dt-table th, .dt-table td {
  border: 1px solid rgba(120, 130, 160, .35);
  padding: 5px 8px; word-break: break-all; color: #1f2430;
}
.dt-table th { background: rgba(10, 132, 255, .09); font-weight: 700; }

/* ==================== v1.7.4：输入框一键粘贴按钮 ==================== */
.input-paste-wrap { position: relative; display: block; }
.input-paste-wrap .input { width: 100%; padding-right: 74px; }
.input-paste-wrap .paste-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  height: 30px; padding: 0 12px; border: 0; border-radius: 9px;
  background: rgba(10, 132, 255, .12); color: #0a84ff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.input-paste-wrap .paste-btn:active { background: rgba(10, 132, 255, .22); }

/* ==================== v1.7.4：用户名颜色选择 ==================== */
.color-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 2px 0; touch-action: manipulation; }
.color-dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55);
  -webkit-tap-highlight-color: transparent;
  /* 关键：避免移动端点按被「下拉关闭弹层」手势吞掉，导致「点颜色没反应、要再点一次」 */
  touch-action: manipulation;
}
.color-dot.on { border-color: var(--accent, #0a84ff); transform: scale(1.08); }

/* ============ 密码强度条（注册 / 重置密码） ============ */
.pw-strength {
  display: flex; align-items: center; gap: 4px; margin-top: 7px;
}
.pw-strength[hidden] { display: none; }
.pw-strength i {
  flex: 1; height: 4px; border-radius: 999px; background: rgba(120, 130, 160, .2);
  transition: background .2s;
}
.pw-strength em {
  flex: none; margin-left: 6px; font-style: normal; font-size: 11.5px; font-weight: 700;
}

/* ============ AI 应用页（v1.7.6 重做：接口可配 + 应用卡片） ============ */
.ai-banner {
  display: flex; align-items: center; gap: 10px; margin: 12px 14px 4px;
  padding: 11px 13px; border-radius: 14px; font-size: 12.5px; line-height: 1.55;
  color: var(--t1, #1f2430); background: rgba(91, 140, 255, .10);
  border: 1px solid rgba(91, 140, 255, .22);
}
.ai-banner.warn { background: rgba(255, 159, 10, .12); border-color: rgba(255, 159, 10, .3); }
.ai-banner.ok { background: rgba(52, 199, 89, .12); border-color: rgba(52, 199, 89, .28); }
.ai-banner-ico { flex: none; width: 20px; height: 20px; color: #5b8cff; }
.ai-banner.warn .ai-banner-ico { color: #ff9f0a; }
.ai-banner.ok .ai-banner-ico { color: #34c759; }
.ai-banner-ico svg { width: 20px; height: 20px; }
.ai-banner b { font-weight: 700; }
.ai-link { color: #5b8cff; font-weight: 700; cursor: pointer; }

/* AI 应用方块：复用工具箱 .tool-item 视觉，只加一层错位进场动画 */
.ai-tool {
  animation: tileIn .34s var(--spring) backwards;
}
.ai-tool:nth-child(1) { animation-delay: .02s; }
.ai-tool:nth-child(2) { animation-delay: .05s; }
.ai-tool:nth-child(3) { animation-delay: .08s; }
.ai-tool:nth-child(4) { animation-delay: .11s; }
.ai-tool:nth-child(5) { animation-delay: .14s; }
.ai-tool:nth-child(6) { animation-delay: .17s; }
.ai-tool:nth-child(7) { animation-delay: .2s; }
.ai-tool:nth-child(8) { animation-delay: .23s; }
.ai-tool .tool-desc { min-height: 27px; }
@keyframes tileIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 聊天界面 ---------- */
#aiBody.chat-mode {
  display: flex; flex-direction: column;
  height: calc(100vh - 132px); min-height: 380px;
}
.chat-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-top {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 4px 14px 10px;
}
.chat-title { flex: 1; min-width: 0; }
.chat-title b { display: block; font-size: 15px; font-weight: 700; color: var(--t1, #1f2430); }
.chat-title span {
  display: block; margin-top: 1px; font-size: 11.5px; color: var(--t2, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-apps {
  flex: none; display: flex; gap: 7px; padding: 0 14px 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.chat-apps::-webkit-scrollbar { display: none; }
.chat-app-chip {
  flex: none; padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(120, 130, 160, .22);
  font-size: 12.5px; font-weight: 600; font-family: inherit; color: var(--t2, #6b7280);
  background: rgba(255, 255, 255, .7); white-space: nowrap;
}
.chat-app-chip.on {
  color: #fff; border-color: transparent;
  background: var(--brand-grad);
}
.chat-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding: 4px 14px 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-empty {
  margin: auto; text-align: center; color: var(--t2, #6b7280);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.chat-empty svg { width: 34px; height: 34px; opacity: .4; }
.chat-empty p { font-size: 12.5px; margin: 0; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-bub {
  max-width: 82%; padding: 10px 13px; border-radius: 16px;
  font-size: 14px; line-height: 1.62; color: var(--t1, #1f2430);
  word-break: break-word; overflow-wrap: anywhere;
}
.chat-msg.user .chat-bub {
  color: #fff; border-bottom-right-radius: 5px;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(91, 140, 255, .26);
}
.chat-msg.assistant .chat-bub {
  background: rgba(255, 255, 255, .86); border: 1px solid rgba(120, 130, 160, .16);
  border-bottom-left-radius: 5px; box-shadow: var(--sh-1);
}
.chat-bub .chat-code {
  margin: 6px 0; padding: 9px 11px; border-radius: 10px;
  background: rgba(30, 34, 45, .06); font-size: 12.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-x: auto;
}
.chat-bub code {
  padding: 1px 5px; border-radius: 5px; font-size: 12.5px;
  background: rgba(30, 34, 45, .07);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.chat-bub h4 { margin: 6px 0 3px; font-size: 14px; font-weight: 700; }
.chat-bub .chat-li { padding-left: 2px; }
.chat-input {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 14px calc(10px + var(--sab));
  border-top: .5px solid rgba(120, 130, 160, .16);
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: var(--blur-strong); backdrop-filter: var(--blur-strong);
}
.chat-input textarea, textarea.chat-input {
  flex: 1; min-height: 40px; max-height: 120px; padding: 10px 12px;
  border: 1px solid rgba(120, 130, 160, .2); border-radius: 14px;
  font-size: 14px; line-height: 1.5; font-family: inherit; color: var(--t1, #1f2430);
  background: rgba(255, 255, 255, .9); resize: none; outline: none;
  overflow: hidden;   /* 高度自适应，禁止内部滚动条 / 溢出文字 */
}
.chat-input textarea:focus { border-color: rgba(91, 140, 255, .55); }
.chat-attach, .chat-send {
  flex: none; width: 40px; height: 40px; border: none; border-radius: 50%;
  display: grid; place-items: center; font-family: inherit;
}
.chat-attach {
  background: rgba(120, 130, 160, .14); color: var(--t1, #1f2430);
}
.chat-send {
  color: #fff; background: var(--brand-grad);
  box-shadow: 0 6px 16px rgba(91, 140, 255, .3);
}
.chat-send.busy { opacity: .55; }
/* 生成中：发送按钮变「停止」（红色方块 + 呼吸环），点一下即中断 */
.chat-send.stop {
  opacity: 1;
  background: linear-gradient(135deg, #ff5a5f, #ff8a5c);
  box-shadow: 0 4px 14px rgba(255, 90, 95, .34);
  animation: fcpulse 1.5s ease-in-out infinite;
}
.chat-send.stop svg { width: 14px; height: 14px; }
@keyframes fcpulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(255, 90, 95, .34); }
  50% { box-shadow: 0 4px 14px rgba(255, 90, 95, .34), 0 0 0 5px rgba(255, 90, 95, .13); }
}
.chat-stop {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  background: rgba(255, 90, 95, .13); color: #ff5a5f;
  font-size: 11.5px; line-height: 1;
}
.chat-stop svg { width: 10px; height: 10px; }
.chat-send svg, .chat-attach svg { width: 19px; height: 19px; }
.chat-send:active, .chat-attach:active { transform: scale(.94); }
/* ============ 历史版本记录（卡片式，每版本一张卡片） ============ */
.cl-list { display: flex; flex-direction: column; gap: 12px; }
.cl-item {
  position: relative; padding: 13px 14px 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(120, 130, 160, .16);
  box-shadow: 0 2px 10px rgba(120, 130, 160, .08);
}
/* 当前版本：高亮描边 + 左上角渐变点缀 */
.cl-item.cur {
  border-color: rgba(91, 140, 255, .5);
  background: linear-gradient(180deg, rgba(91, 140, 255, .10), rgba(255, 255, 255, .86));
  box-shadow: 0 6px 18px rgba(91, 140, 255, .18);
}
.cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.cl-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: rgba(120, 130, 160, .5);
}
.cl-item.cur .cl-dot {
  background: var(--brand-grad);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .2);
}
.cl-ver { font-size: 15px; font-weight: 750; color: var(--t1, #1f2430); letter-spacing: .2px; }
.cl-item.cur .cl-ver { color: #4a6ef0; }
.cl-tag {
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--brand-grad);
}
.cl-date { margin-left: auto; font-size: 11.5px; color: var(--t2, #6b7280); font-variant-numeric: tabular-nums; }
.cl-items { list-style: none; margin: 0; padding: 0; }
.cl-items li {
  position: relative; padding: 5px 0 5px 15px;
  font-size: 13px; line-height: 1.6; color: var(--t1, #1f2430);
  word-break: break-word;
}
.cl-items li::before {
  content: ''; position: absolute; left: 3px; top: 12px;
  width: 5px; height: 5px; border-radius: 50%; background: rgba(91, 140, 255, .55);
}
.cl-items li + li { border-top: .5px solid rgba(120, 130, 160, .12); }

/* ---------- 列表时间分组小标题（回收站） ---------- */
.list-group-hd {
  margin: 14px 2px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--t2, #6b7280);
}
.list-group-hd:first-child { margin-top: 4px; }

/* =====================================================================
   v1.7.9 新增组件
   ① 文件夹面包屑  ② Excel 预览  ③ 压缩包预览
   ④ AI 助手对话页 ⑤ 精简统计  ⑥ 用户名颜色实时预览
   ===================================================================== */

/* ---------- ① 文件夹面包屑 ---------- */
.folder-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin: 2px 0 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  background: rgba(120, 130, 160, .09);
  border: 1px solid var(--glass-line-soft);
}
.fb-crumb {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 40%; padding: 4px 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--t2);
  transition: background .18s, color .18s;
}
.fb-crumb svg { width: 13px; height: 13px; flex: none; }
.fb-crumb span, .fb-crumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-crumb.cur { color: var(--accent); background: var(--accent-soft); }
.fb-crumb:active { background: rgba(120, 130, 160, .18); }
.fb-sep { display: inline-flex; color: var(--t4); flex: none; }
.fb-sep svg { width: 12px; height: 12px; }

/* 文件夹卡片：名称后附加子项数量角标 */
.fcard-sub { font-size: 11px; color: var(--t3); font-weight: 500; }

/* ---------- ② Excel 预览 ---------- */
.xls-host { display: flex; flex-direction: column; gap: 10px; }
.xls-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}
.xls-tabs::-webkit-scrollbar { display: none; }
.xls-tab {
  flex: none; padding: 6px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--t2);
  background: rgba(120, 130, 160, .12);
  border: 1px solid transparent; white-space: nowrap;
  transition: background .18s, color .18s;
}
.xls-tab.on {
  color: #fff; background: linear-gradient(135deg, #21a366, #17a673);
  box-shadow: 0 4px 12px rgba(33, 163, 102, .28);
}
.xls-scroll {
  max-height: 56vh; overflow: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--r-sm); border: 1px solid rgba(120, 130, 160, .16);
  background: #fff;
}
.xls-table { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
.xls-table th, .xls-table td {
  border-right: 1px solid rgba(120, 130, 160, .14);
  border-bottom: 1px solid rgba(120, 130, 160, .14);
  padding: 6px 9px; text-align: left; white-space: nowrap;
  color: var(--t1); max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.xls-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f2f7f4; font-weight: 700; color: #146b43;
}
.xls-table tbody tr:nth-child(even) td { background: #fafcfb; }
.xls-idx {
  position: sticky; left: 0; z-index: 1;
  width: 38px; min-width: 38px; text-align: center !important;
  background: #f2f7f4 !important; color: var(--t3) !important;
  font-variant-numeric: tabular-nums; font-size: 11px;
}
.xls-table thead .xls-idx { z-index: 3; }

/* Excel 编辑模式：工具栏 + 可编辑单元格 */
.xls-tools {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; margin-bottom: 8px; overflow-x: auto;
  border-radius: var(--r-sm); border: 1px solid rgba(120, 130, 160, .16);
  background: rgba(255, 255, 255, .78);
  scrollbar-width: none;
}
.xls-tools::-webkit-scrollbar { display: none; }
.xt-btn {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 30px; padding: 0 10px; border-radius: 999px;
  background: rgba(120, 130, 160, .12); color: var(--t2);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.xt-btn svg { width: 13px; height: 13px; }
.xt-btn:active { transform: scale(.94); }
.xt-btn.danger { background: linear-gradient(135deg, #21a366, #17a673); color: #fff; }
.xt-sep { flex: none; width: 1px; height: 18px; background: rgba(120, 130, 160, .2); }
.xls-table.edit td.xls-cell { white-space: pre-wrap; word-break: break-word; }
.xls-table.edit td.xls-cell:focus {
  outline: 2px solid #21a366; outline-offset: -2px;
  background: #eefaf3 !important;
}

/* 重复文件清理 */
.dup-tip { margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; color: var(--t2); }
.dup-acts { display: flex; gap: 8px; margin-bottom: 12px; }
.dup-group {
  border-radius: var(--r-sm); overflow: hidden; margin-bottom: 10px;
  border: 1px solid rgba(120, 130, 160, .16); background: rgba(255, 255, 255, .72);
}
.dup-gh {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; background: rgba(120, 130, 160, .08);
  font-size: 12px; color: var(--t2);
}
.dup-gh b { font-size: 12.5px; color: var(--t1); }
.dup-gh span { font-size: 11.5px; color: var(--t3); }
.dup-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-top: 1px solid rgba(120, 130, 160, .1);
}
.dup-cb {
  display: grid; place-items: center; width: 20px; height: 20px; flex: none;
  border-radius: 6px; border: 1.5px solid rgba(120, 130, 160, .35);
  color: transparent; transition: background .16s, border-color .16s;
}
.dup-cb svg { width: 12px; height: 12px; }
.dup-row.sel .dup-cb { background: var(--danger, #ff3b30); border-color: var(--danger, #ff3b30); color: #fff; }
.dup-nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dup-nm b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-nm span { font-size: 11.5px; color: var(--t3); }
.meta-row .chev { display: inline-flex; margin-left: 5px; vertical-align: -1px; color: var(--t3); }
.meta-row .chev svg { width: 12px; height: 12px; }
.mini-dup-btn {
  display: flex; align-items: center; gap: 7px; width: 100%; margin-top: 10px;
  padding: 10px 12px; border-radius: var(--r-sm); text-align: left;
  background: rgba(255, 159, 10, .13); color: #b26a00; font-size: 13px;
}
.mini-dup-btn > svg:first-child { width: 15px; height: 15px; flex: none; }
.mini-dup-btn > svg:last-child { width: 13px; height: 13px; flex: none; margin-left: auto; }
.mini-dup-btn span { flex: 1; min-width: 0; }

/* 保存方式选择列表（表格编辑 / 通用） */
.sv-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sv-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: var(--r-sm); text-align: left;
  background: rgba(120, 130, 160, .08); color: var(--t1);
}
.sv-item:active { transform: scale(.985); }
.sv-item .si {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 10px; background: rgba(120, 130, 160, .16); color: var(--t2);
}
.sv-item .si.primary { background: linear-gradient(135deg, #21a366, #17a673); color: #fff; }
.sv-item .si svg { width: 16px; height: 16px; }
.sv-item .st { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sv-item .st b { font-size: 14px; font-weight: 600; }
.sv-item .st span { font-size: 12px; color: var(--t3); }

/* ---------- ③ 压缩包预览 ---------- */
.zip-host { display: flex; flex-direction: column; gap: 10px; }
.zip-list {
  display: flex; flex-direction: column;
  border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid rgba(120, 130, 160, .16); background: rgba(255, 255, 255, .7);
}
.zip-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; font-size: 13px; color: var(--t1);
}
.zip-row + .zip-row { border-top: 1px solid rgba(120, 130, 160, .12); }
.zip-row svg { width: 16px; height: 16px; flex: none; color: var(--t3); }
.zip-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zip-row .sz { font-size: 11.5px; color: var(--t3); flex: none; font-variant-numeric: tabular-nums; }

/* ---------- ④ AI 助手对话页 ---------- */
#page-assistant .scroll-area { padding-bottom: 0; }
.chat-wrap {
  display: flex; flex-direction: column; gap: 14px;
  padding: 6px 0 4px; min-height: 100%;
}
.chat-wrap:empty { display: none; }

.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg .chat-bub {
  max-width: 82%; padding: 10px 13px;
  border-radius: 18px; font-size: 14.5px; line-height: 1.68;
  word-break: break-word; overflow-wrap: anywhere;
  box-shadow: var(--sh-1);
}
.chat-msg.user .chat-bub {
  background: var(--brand-grad);
  color: #fff; border-bottom-right-radius: 6px;
}
.chat-msg.assistant .chat-bub {
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--glass-line);
  color: var(--t1); border-bottom-left-radius: 6px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.chat-ava {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center; margin-top: 2px;
  background: linear-gradient(135deg, #4E76FF, #C44AF0);
  color: #fff; box-shadow: 0 4px 12px rgba(110, 90, 250, .32);
}
.chat-ava svg { width: 17px; height: 17px; }

.chat-bub p { margin: 0 0 8px; }
.chat-bub p:last-child { margin-bottom: 0; }
.chat-bub strong { font-weight: 700; }
.chat-bub code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; padding: 1px 5px; border-radius: 5px;
  background: rgba(120, 130, 160, .16);
}
.ch-li { display: block; padding-left: 2px; }
.ch-pre {
  margin: 8px 0; padding: 10px 12px; overflow-x: auto;
  border-radius: 10px; background: rgba(16, 24, 60, .06);
  font-size: 12.5px; line-height: 1.6;
}
.ch-pre code { background: none; padding: 0; }
.chat-msg.user .ch-pre { background: rgba(255, 255, 255, .2); }

/* 流式光标 */
.chat-caret {
  display: inline-block; width: 7px; height: 15px; margin-left: 2px;
  vertical-align: -2px; border-radius: 2px; background: var(--accent);
  animation: caretBlink .9s steps(2, start) infinite;
}
@keyframes caretBlink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }

/* 空态欢迎 */
.chat-hello { text-align: center; padding: 26px 12px 6px; }
.chat-hello-ico {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 21px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4E76FF, #C44AF0);
  box-shadow: 0 12px 28px rgba(110, 90, 250, .35);
}
.chat-hello-ico svg { width: 30px; height: 30px; }
.chat-hello-tt { font-size: 18px; font-weight: 750; color: var(--t1); }
.chat-hello-desc { margin: 7px auto 0; max-width: 300px; font-size: 13px; line-height: 1.65; color: var(--t2); }
.chat-warn {
  display: inline-block; margin: 12px auto 0; padding: 8px 13px;
  border-radius: 12px; font-size: 12.5px; font-weight: 600; color: var(--warning);
  background: rgba(255, 159, 10, .12); border: 1px solid rgba(255, 159, 10, .28);
}
.chat-quicks {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 16px; padding: 0 6px;
}
.chat-quick {
  padding: 8px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--t2); background: rgba(255, 255, 255, .78);
  border: 1px solid var(--glass-line); box-shadow: var(--sh-1);
  transition: transform .16s var(--spring);
}
.chat-quick:active { transform: scale(.94); }

/* 底部输入栏：抬到 tabbar 上方，避免被底部导航遮住点不到。
   v1.8.1：加大间距 + 提高不透明度，修复与 tabbar 的玻璃层「重影」 */
.chat-bar {
  flex: none; margin: 0 2px calc(var(--tab-h) + var(--sab) + 20px);
  padding: 8px 10px 8px;
  border-radius: 20px;
  background: var(--card, rgba(255, 255, 255, .92));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 6px 24px rgba(16, 24, 60, .14), var(--inset);
}
.chat-att { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 8px; }

/* 已选技能 chip（AI 助手输入栏上方） */
.chat-skill { display: flex; padding: 2px 4px 0; }
.chat-skill[hidden] { display: none; }
.chat-skill-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 6px 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: rgba(91, 140, 255, .12); border: 1px solid rgba(91, 140, 255, .28);
}
.chat-skill-chip .si { display: inline-flex; }
.chat-skill-chip .si svg { width: 13px; height: 13px; }
.chat-skill-chip button { display: inline-flex; color: inherit; opacity: .7; }
.chat-skill-chip button:active { opacity: 1; }
.chat-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 4px 6px 4px 9px; border-radius: 999px;
  background: rgba(120, 130, 160, .13); font-size: 12px; color: var(--t1);
}
.chat-chip .ci { display: inline-flex; flex: none; }
.chat-chip .ci svg { width: 13px; height: 13px; }
.chat-chip .cn { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-chip button {
  display: grid; place-items: center; width: 17px; height: 17px; flex: none;
  border-radius: 50%; background: rgba(120, 130, 160, .3); color: #fff;
}
.chat-chip button svg { width: 10px; height: 10px; }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-icon-btn, .chat-send {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  transition: transform .16s var(--spring);
}
.chat-icon-btn { background: rgba(120, 130, 160, .22); color: var(--t2); }
.chat-send { background: var(--brand-grad); box-shadow: 0 4px 12px rgba(10, 132, 255, .3); }
.chat-icon-btn:active, .chat-send:active { transform: scale(.9); }
.chat-icon-btn svg, .chat-send svg { width: 18px; height: 18px; }
.chat-input {
  flex: 1; min-width: 0; max-height: 108px; min-height: 36px;
  padding: 8px 13px; border-radius: 18px; resize: none;
  font: inherit; font-size: 14.5px; line-height: 1.45; color: var(--t1);
  background: rgba(255, 255, 255, .82); border: 1px solid var(--glass-line);
  outline: none; overflow-y: auto;
}
.chat-input:focus { border-color: rgba(10, 132, 255, .5); }
.chat-input::placeholder { color: var(--t4); }

/* 文件选择（AI 助手附件） */
.asst-file-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 46vh; overflow-y: auto; margin-top: 10px;
}
.asst-file {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border-radius: var(--r-sm); background: rgba(120, 130, 160, .08);
  border: 1.5px solid transparent; font-size: 13.5px; color: var(--t1);
  transition: background .16s, border-color .16s;
}
.asst-file svg { width: 17px; height: 17px; flex: none; }
.asst-file .an { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-file .as { font-size: 11px; color: var(--t3); flex: none; }
.asst-file.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- ⑤ 精简统计（「我的」页） ---------- */
.mini-stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 4px 0 10px;
}
.mini-stat { text-align: center; padding: 6px 2px; }
.mini-stat b {
  display: block; font-size: 17px; font-weight: 750; color: var(--t1);
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.mini-stat span { font-size: 11px; color: var(--t3); }
.mini-bars { padding: 2px 2px 6px; }
.mini-bars .bar-row { padding: 5px 0; }
.mini-stat-more {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; margin-top: 8px; padding: 9px 0;
  border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  transition: opacity .18s;
}
.mini-stat-more:active { opacity: .65; }
.mini-stat-more svg { width: 13px; height: 13px; }

/* ---------- ⑥ 用户名颜色实时预览 ---------- */
.cun-preview {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm);
  background: rgba(120, 130, 160, .09);
  border: 1px solid var(--glass-line-soft);
  font-size: 16px; font-weight: 700; text-align: center;
  transition: color .18s var(--ease);
}

/* ---------- 底部导航：中间 AI 助手（凸起大按钮） ---------- */
.tab-ico { display: grid; place-items: center; }
.tab-lb { line-height: 1.2; }
.tab-center { position: relative; flex: 1 1 0; }
.tab-center .tab-ico {
  width: 42px; height: 42px; margin-top: -12px; border-radius: 50%;
  color: #fff; background: linear-gradient(135deg, #4E76FF, #C44AF0);
  box-shadow: 0 6px 16px rgba(110, 90, 250, .40), var(--inset);
  transition: transform .2s var(--spring), box-shadow .2s;
}
.tab-center .tab-ico svg { width: 22px; height: 22px; }
.tab-center .tab-lb { margin-top: 3px; font-size: 9.5px; }
.tab-center:active .tab-ico { transform: scale(.9); }
.tab-center.on .tab-ico {
  background: linear-gradient(135deg, #3B62F0, #B13BE0);
  box-shadow: 0 8px 20px rgba(110, 90, 250, .5), var(--inset);
}
.tab-center.on { color: var(--accent); font-weight: 600; }

/* ==================== v1.9.0 ==================== */

/* ---------- 用户消息里的附件展示 ---------- */
.chat-fchips {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.chat-fchip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 200px; padding: 6px 10px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line, rgba(0,0,0,.06));
  border-radius: 12px; border-bottom-right-radius: 4px;
  font-size: 12px; color: var(--ink);
  box-shadow: 0 1px 4px rgba(30, 30, 60, .06);
}
.chat-fchip .ci { display: inline-flex; width: 15px; height: 15px; flex: none; }
.chat-fchip .ci svg { width: 100%; height: 100%; }
.chat-fchip { overflow: hidden; }
.chat-fchip { white-space: nowrap; text-overflow: ellipsis; }
.chat-fimg img {
  display: block; max-width: 150px; max-height: 150px;
  border-radius: 12px; border-bottom-right-radius: 4px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(30, 30, 60, .12);
}

/* ---------- 技能选择卡片（一行 4 个） ---------- */
.skill-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 2px 0 6px;
}
.skill-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 74px; padding: 10px 4px 8px;
  background: var(--card, #fff);
  border: 1.5px solid var(--line, rgba(0,0,0,.06));
  border-radius: 14px;
  cursor: pointer; user-select: none;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.skill-card:active { transform: scale(.94); }
.skill-card .sci { display: inline-flex; width: 22px; height: 22px; }
.skill-card .sci svg { width: 100%; height: 100%; }
.skill-card b {
  font-size: 11.5px; font-weight: 600; color: var(--ink);
  text-align: center; line-height: 1.2;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.skill-card.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--card, #fff));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}
.skill-card.on b { color: var(--accent); }
.skill-card .sck {
  position: absolute; top: 5px; right: 5px;
  display: inline-flex; width: 14px; height: 14px;
  color: var(--accent);
}
.skill-card .sck svg { width: 100%; height: 100%; }
.skill-card.add b { color: var(--muted, #8a90a0); font-weight: 500; }
.skill-card.add { border-style: dashed; }
.skill-card .skill-x {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: #ff5b5b; color: #fff;
  border: none; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(255, 60, 60, .4);
  cursor: pointer;
}
.skill-card .skill-x svg { width: 10px; height: 10px; }

/* ---------- 自定义技能表单 ---------- */
.cs-row { display: flex; gap: 8px; align-items: flex-start; }
.cs-row textarea { flex: 1; }
.cs-gen {
  flex: none; padding: 8px 12px; font-size: 13px;
  border-radius: 10px;
}

/* ---------- 历史对话侧边栏 ---------- */
.hist-mask {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(20, 20, 40, 0);
  transition: background .24s ease;
}
.hist-mask.show { background: rgba(20, 20, 40, .38); }
.hist-drawer {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(82vw, 320px);
  background: var(--bg, #f4f6fb);
  border-radius: 0 22px 22px 0;
  box-shadow: 12px 0 40px rgba(20, 20, 50, .18);
  display: flex; flex-direction: column;
  transform: translateX(-102%);
  transition: transform .26s cubic-bezier(.32, .72, .35, 1);
  padding-top: var(--sat, 0px);
}
.hist-mask.show .hist-drawer { transform: translateX(0); }
.hist-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 12px;
}
.hist-hd b { font-size: 17px; }
.hist-new {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--brand-grad);
  border: none; border-radius: 999px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(100, 100, 255, .3);
}
.hist-new svg { width: 13px; height: 13px; }
.hist-list { flex: 1; overflow-y: auto; padding: 2px 10px 20px; }
.hist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 10px; margin-bottom: 4px;
  border-radius: 14px; cursor: pointer;
  transition: background .15s ease;
}
.hist-item:active { background: rgba(120, 120, 160, .1); }
.hist-item.on { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.hist-item.on .ht b { color: var(--accent); }
.hist-item .ht { flex: 1; min-width: 0; }
.hist-item .ht b {
  display: block; font-size: 14px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-item .ht span { display: block; font-size: 11.5px; color: var(--muted, #8a90a0); margin-top: 3px; }
.hist-del {
  flex: none; width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 9px;
  color: #b0b4c4; cursor: pointer;
}
.hist-del:active { background: rgba(255, 80, 80, .12); color: #ff5b5b; }
.hist-del svg { width: 15px; height: 15px; }

/* ---------- 启动页（首次预缓存） ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #eef1fb 0%, #e7ecfa 45%, #ece7fb 100%);
  transition: opacity .5s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-logo {
  width: 88px; height: 88px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: var(--brand-grad);
  border-radius: 26px;
  box-shadow: 0 14px 34px rgba(100, 100, 250, .38);
  animation: splashPop .7s cubic-bezier(.22, 1.2, .36, 1) both,
             splashFloat 2.6s ease-in-out .7s infinite;
}
.splash-logo svg { width: 46px; height: 46px; }
@keyframes splashPop {
  from { transform: scale(.4) translateY(24px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.splash-tt {
  margin-top: 26px; font-size: 21px; font-weight: 700; color: #2a2f45;
  letter-spacing: .04em;
  animation: splashUp .6s ease .25s both;
}
.splash-sub {
  margin-top: 8px; font-size: 13px; color: #7d84a0;
  animation: splashUp .6s ease .4s both;
}
@keyframes splashUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.splash-bar {
  width: 168px; height: 5px; margin-top: 30px;
  background: rgba(90, 100, 180, .16);
  border-radius: 99px; overflow: hidden;
  animation: splashUp .6s ease .55s both;
}
.splash-bar i {
  display: block; width: 0; height: 100%;
  background: linear-gradient(90deg, #5b8cff, #8a6bff);
  border-radius: 99px;
  transition: width .3s ease;
}
.splash-pct {
  margin-top: 9px; font-size: 11.5px; color: #9aa0b8;
  font-variant-numeric: tabular-nums;
  animation: splashUp .6s ease .6s both;
}

/* ============ 插件商店（v1.9.1） ============ */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 16px 8px; }
.sec-h b { font-size: 15px; }
.sec-h span { color: var(--t3, #8a90a0); font-size: 12px; }

/* 搜索框：浅色玻璃底 + 可见边框 + 深色文字（v1.9.3 修复文字不显示 / 边框消失） */
.store-search {
  display: flex; align-items: center; gap: 8px; margin: 12px 16px 4px;
  background: var(--glass, rgba(255, 255, 255, .58));
  border: 1.5px solid rgba(16, 24, 60, .16); border-radius: 14px; padding: 10px 12px;
  box-shadow: var(--sh-1); transition: border-color .18s;
}
.store-search:focus-within { border-color: var(--accent); }
.store-search .si { color: var(--t3, #8a90a0); display: flex; }
.store-search .si svg { width: 16px; height: 16px; }
.store-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  color: var(--t1, #10131a); font-size: 14px; }
.store-search input::placeholder { color: var(--t3, #8a90a0); }

/* 分类 tab：浅色胶囊 + 可见边框 */
.store-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
.store-tabs::-webkit-scrollbar { display: none; }
.store-tab {
  flex: 0 0 auto; padding: 7px 16px; border-radius: 999px;
  background: var(--glass-thin, rgba(255, 255, 255, .38));
  border: 1.5px solid rgba(16, 24, 60, .14);
  color: var(--t2, #4b5160); font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: all .18s;
}
.store-tab.on {
  background: var(--brand-grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(91, 140, 255, .35);
}

/* 插件网格（v2.1）：与工具箱 .tool-grid 同款——一行 4 个、无外框、等高对齐。
   原来卡片带边框且高度随描述文字长短变化，导致「大小不一」；现改为统一方块：
   图标(46) + 名称(单行) + 形态标签 + 一轮操作按钮，四列严格等宽等高。 */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px 6px 24px;
}
.plugin-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: transparent; border: 0; border-radius: 16px;
  padding: 10px 2px 8px; box-shadow: none;
  min-width: 0; cursor: pointer;
  transition: transform .16s var(--spring), background .2s;
}
.plugin-card:active { transform: scale(.95); background: rgba(120, 130, 160, .1); }
.plugin-card .plugin-cover {
  width: 46px; height: 46px; border-radius: 15px; margin: 0 0 6px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; position: relative;
  box-shadow: 0 3px 10px rgba(16, 24, 60, .14);
}
.plugin-card .plugin-cover svg { width: 23px; height: 23px; position: relative; z-index: 1; }
.plugin-card .plugin-cover::after {
  content: ""; position: absolute; inset: 0; border-radius: 15px;
  background: radial-gradient(120% 80% at 80% 0, rgba(255, 255, 255, .32), transparent);
}
/* 名称固定两行高度，保证所有卡片对齐 */
.plugin-card b {
  font-size: 12.5px; font-weight: 600; color: var(--t1, #10131a); line-height: 1.25;
  width: 100%; height: 2.5em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  word-break: normal; overflow-wrap: anywhere; padding: 0 1px;
}
.plugin-pill {
  position: absolute; top: 6px; right: 6px; z-index: 2; font-size: 8px; padding: 2px 5px;
  border-radius: 999px; background: rgba(16, 24, 60, .42); color: #fff; font-weight: 600;
}
.plugin-pill.on { background: var(--brand-grad); }
.plugin-pill.local { background: rgba(52, 199, 89, .85); }
.plugin-pill.sk { background: rgba(191, 90, 242, .85); }
.plugin-pill.gh { background: rgba(10, 132, 255, .92); }

/* 安装按钮（v2.1）：方块卡内的轻量小按钮，不抢图标视觉 */
.plugin-install {
  width: 100%; margin-top: 4px; border: 1.5px solid rgba(91, 140, 255, .5);
  background: rgba(91, 140, 255, .1); color: var(--accent); border-radius: 8px;
  padding: 3px 2px; font-size: 11px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: transform .15s, background .18s;
}
.plugin-install:active { transform: scale(.94); }
.plugin-install.done { color: var(--success); border-color: rgba(52, 199, 89, .45); background: rgba(52, 199, 89, .1); }
.plugin-install.loading { opacity: .78; pointer-events: none; }
.plugin-install .spin {
  width: 11px; height: 11px; flex: none; border-radius: 50%;
  border: 2px solid rgba(91, 140, 255, .3); border-top-color: var(--accent);
  animation: fc-spin .7s linear infinite;
}
.plugin-install.done svg { width: 11px; height: 11px; }
.plugin-install.done-pop { animation: fc-pop .5s var(--spring, cubic-bezier(.34, 1.42, .64, 1)); }
@keyframes fc-spin { to { transform: rotate(360deg); } }
@keyframes fc-pop { 0% { transform: scale(.8); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* 「我的」页：删除角标 + 本地上传卡 */
.plugin-card .pc-del {
  position: absolute; top: 5px; right: 5px; z-index: 3; width: 20px; height: 20px;
  border: 0; border-radius: 7px; background: rgba(16, 24, 60, .1); color: var(--t2, #4b5160);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.plugin-card .pc-del svg { width: 11px; height: 11px; }
.plugin-card.upload-card {
  border: 1.5px dashed rgba(91, 140, 255, .45); background: rgba(91, 140, 255, .05);
  border-radius: 16px; box-shadow: none; cursor: pointer;
}
.plugin-card.upload-card:active { transform: scale(.97); }
.plugin-card.upload-card .uc-plus {
  width: 46px; height: 46px; border-radius: 15px; margin: 0 0 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(91, 140, 255, .14); color: var(--accent);
}
.plugin-card.upload-card .uc-plus svg { width: 23px; height: 23px; }

/* 仓库连接栏（v1.9.5：名称/副标题单行截断，不再换行遮挡） */
.repo-bar {
  display: flex; align-items: center; gap: 8px; margin: 6px 12px 2px;
  padding: 10px 12px; border-radius: 14px;
  background: var(--glass, rgba(255, 255, 255, .58)); border: 1.5px solid rgba(16, 24, 60, .1);
  box-shadow: var(--sh-1);
}
.repo-bar .rb-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.repo-bar .rb-ico {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 132, 255, .14); color: var(--accent); line-height: 0;
}
.repo-bar .rb-ico svg { width: 18px; height: 18px; flex: none; display: block; }
.repo-bar .rb-info > div { flex: 1; min-width: 0; }
.repo-bar .rb-info b { font-size: 13px; color: var(--t1, #10131a); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-bar .rb-info span { font-size: 10.5px; color: var(--t3, #8a90a0); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-bar .rb-acts { display: flex; gap: 6px; flex: none; }

/* 标签 pill（技能 tags） */
.tag-row { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin: 2px 0 4px; }
.tag-pill {
  font-size: 8.5px; padding: 1px 6px; border-radius: 999px;
  background: var(--glass-strong, rgba(16, 24, 60, .06)); color: var(--t2, #4b5160); line-height: 1.5;
}
.plugin-pill.gh { background: rgba(10, 132, 255, .92); }

/* 技能卡描述（v2.1：方块卡内保持一行，避免高度参差） */
.plugin-card .skill-desc {
  margin: 0 0 4px; font-size: 9.5px; color: var(--t3, #8a90a0); line-height: 1.3;
  width: 100%; height: 1.3em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;
}

/* 发现页：加载 / 错误态 */
.store-loading, .store-err {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 30px 14px; text-align: center; color: var(--t3, #8a90a0); font-size: 13px;
}
.store-err svg { width: 30px; height: 30px; color: var(--warning); }
.store-loading .spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(91, 140, 255, .25); border-top-color: var(--accent);
  animation: fc-spin .7s linear infinite;
}

/* 技能应用运行界面（v1.9.5）—— 复用工具运行界面骨架，内容区为技能专属 */
.skill-runner .sr-hd { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.skill-runner .sr-hd .sr-ico {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.skill-runner .sr-hd .sr-ico svg { width: 15px; height: 15px; }
.skill-runner .sr-hd h3 { flex: none; max-width: 60%; margin: 0; font-size: 16px; font-weight: 700;
  color: var(--t1, #10131a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-desc {
  font-size: 12px; color: var(--t3, #8a90a0); line-height: 1.55;
  padding: 10px 13px; border-radius: 13px; margin-bottom: 2px;
  background: var(--glass, rgba(255, 255, 255, .58)); border: 1px solid rgba(16, 24, 60, .08);
}
/* ============ v2.1 数据型应用（dv-* 全新版式） ============
   结构：主卡(hero) → 指标网格(cells) → 明细列表(list) → 分区(sec)
   目标：信息密度高、层次清晰、与整体玻璃拟态风格统一。 */

.dv-wrap { padding-bottom: 4px; }

/* AI 创作型应用的输出容器（Markdown 渲染结果） */
.dv-wrap .sr-md {
  padding: 15px 16px; border-radius: 18px;
  background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(16, 24, 60, .07);
  font-size: 13.5px; line-height: 1.75; color: var(--t1, #10131a); overflow-wrap: anywhere;
}
.dv-wrap .sr-md h4 { margin: 6px 0 8px; font-size: 15.5px; line-height: 1.4; }
.dv-wrap .sr-md .chat-li { padding: 3px 0 3px 2px; }
.dv-wrap .sr-md .chat-li b { color: var(--accent, #5b8cff); }
.dv-wrap .sr-md blockquote.chat-quote {
  margin: 6px 0; padding: 8px 12px; border-left: 3px solid rgba(91, 140, 255, .5);
  background: rgba(91, 140, 255, .07); border-radius: 0 10px 10px 0; color: var(--t2, #4b5160);
}
.dv-wrap .sr-md pre.chat-code {
  margin: 8px 0; padding: 10px 12px; border-radius: 10px; overflow-x: auto;
  background: rgba(16, 24, 60, .06); font-size: 12px; line-height: 1.5;
}
.dv-wrap .sr-err { color: var(--danger, #ff3b30); }
.dv-wrap .sr-wait { display: flex; align-items: center; gap: 8px; color: var(--t3, #8a90a0);
  font-size: 13px; padding: 24px 4px; justify-content: center; }
.dv-wrap .sr-wait .spin {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid rgba(91, 140, 255, .3); border-top-color: var(--accent);
  animation: fc-spin .7s linear infinite;
}
.dv-wrap .sr-off { display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 34px 18px; text-align: center; color: var(--t3, #8a90a0); font-size: 13.5px;
  border-radius: 18px; background: var(--glass, rgba(255, 255, 255, .5));
  border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-wrap .sr-off svg { width: 28px; height: 28px; color: var(--warning, #ff9500); }
.dv-wrap .sr-off p { margin: 0; line-height: 1.6; }

/* —— 主卡 —— */
.dv-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; border-radius: 18px; margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(91, 140, 255, .14), rgba(138, 107, 255, .1));
  border: 1.5px solid rgba(91, 140, 255, .18);
}
.dv-hero-l { flex: 1; min-width: 0; }
.dv-hero-l b { display: block; font-size: 17px; font-weight: 750; color: var(--t1, #10131a); margin-bottom: 3px; }
.dv-hero-l span { display: block; font-size: 11.5px; color: var(--t3, #8a90a0); }
.dv-hero-r { flex: none; text-align: center; }
.dv-hero-r b { display: block; font-size: 22px; font-weight: 800; color: var(--accent, #5b8cff); line-height: 1.1; }
.dv-hero-r span { font-size: 10px; color: var(--t3, #8a90a0); }
.dv-hero-r.big b { font-size: 26px; }

/* —— 指标网格（天气/摸鱼等） —— */
.dv-cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 12px; }
.dv-cell {
  padding: 10px 6px; border-radius: 13px; text-align: center;
  background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(16, 24, 60, .07);
}
.dv-cell b { display: block; font-size: 15px; font-weight: 750; color: var(--t1, #10131a); line-height: 1.2; }
.dv-cell b.aq-1 { color: #1f9d6b; } .dv-cell b.aq-2 { color: #f0a020; } .dv-cell b.aq-3 { color: #ff6a3d; }
.dv-cell span { display: block; font-size: 9.5px; color: var(--t3, #8a90a0); margin-top: 3px; }

/* —— 通用列表 —— */
.dv-list { display: flex; flex-direction: column; gap: 7px; }
.dv-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 14px;
  background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(16, 24, 60, .07);
  transition: transform .15s var(--spring), box-shadow .18s;
}
.dv-row-link { cursor: pointer; }
.dv-row-link:active { transform: scale(.985); box-shadow: 0 4px 14px rgba(16, 24, 60, .1); }
.dv-idx, .dv-rank {
  flex: none; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 750; color: #fff;
  background: var(--brand-grad);
}
.dv-rank { background: rgba(120, 130, 160, .28); color: var(--t2, #4b5160); }
.dv-rank.top1 { background: linear-gradient(135deg, #ff4d4f, #ff7a45); color: #fff; }
.dv-rank.top2 { background: linear-gradient(135deg, #ff9500, #ffb340); color: #fff; }
.dv-rank.top3 { background: linear-gradient(135deg, #ffcc00, #ffd85e); color: #7a5a00; }
.dv-year { flex: none; min-width: 40px; font-size: 12.5px; font-weight: 750; color: var(--accent, #5b8cff); padding-top: 2px; }
.dv-tx { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.55; color: var(--t1, #10131a); }
.dv-tx b { font-weight: 650; }
.dv-desc { margin: 4px 0 0; font-size: 11.5px; color: var(--t3, #8a90a0); line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.dv-hot { display: inline-block; margin-top: 3px; font-size: 10.5px; font-weight: 600; color: #ff6a3d; }
.dv-go { flex: none; color: var(--t3, #8a90a0); display: flex; align-items: center; padding-top: 3px; }
.dv-go svg { width: 15px; height: 15px; }
/* 榜单 / 列表缩略图：改用真实 <img>（v2.4）才能享受 onerror 降级链路，
   否则接口图挂了就只留一个空灰块 */
.dv-cover { flex: none; width: 46px; height: 46px; border-radius: 10px;
  object-fit: cover; background-color: rgba(16, 24, 60, .06); }

/* —— 引言 / 提示卡 —— */
.dv-quote { position: relative; padding: 26px 22px 22px; border-radius: 18px; margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(91, 140, 255, .12), rgba(138, 107, 255, .08));
  border: 1.5px solid rgba(91, 140, 255, .16); }
.dv-quote p { margin: 0; font-size: 17px; line-height: 1.75; color: var(--t1, #10131a); text-align: center; }
.dv-q-mark { position: absolute; top: 4px; left: 12px; font-size: 44px; line-height: 1;
  color: rgba(91, 140, 255, .28); font-family: Georgia, serif; }
.dv-q-mark.end { top: auto; left: auto; bottom: -6px; right: 14px; }
.dv-q-tip { margin: 0; text-align: center; font-size: 11px; color: var(--t3, #8a90a0); }
.dv-kfc { padding: 15px 16px; border-radius: 16px; font-size: 13.5px; line-height: 1.75;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07);
  color: var(--t1, #10131a); }
.dv-tip-card { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 15px; margin-bottom: 10px;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-tip-card svg { width: 17px; height: 17px; flex: none; color: var(--accent, #5b8cff); margin-top: 2px; }
.dv-tip-card p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--t2, #4b5160); }
.dv-tip-card b { color: var(--t1, #10131a); }
.dv-src { margin-top: 10px; font-size: 10.5px; color: var(--t3, #8a90a0); text-align: center; }

/* —— 壁纸 —— */
.dv-bing img, .dv-bing-img { width: 100%; border-radius: 16px; display: block; margin-bottom: 10px;
  box-shadow: 0 8px 28px rgba(16, 24, 60, .16); }
.dv-bing-cap { padding: 0 2px 10px; }
.dv-bing-cap b { display: block; font-size: 14.5px; color: var(--t1, #10131a); margin-bottom: 4px; }
.dv-bing-cap p { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--t3, #8a90a0); }
.dv-dl { display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border-radius: 13px; font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--accent, #5b8cff); background: rgba(91, 140, 255, .1);
  border: 1.5px solid rgba(91, 140, 255, .28); }
.dv-dl svg { width: 16px; height: 16px; }

/* —— 天气 —— */
.dv-form { display: flex; gap: 8px; margin-bottom: 12px; }
.dv-input { flex: 1; display: flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 13px;
  background: var(--glass, rgba(255, 255, 255, .7)); border: 1.5px solid rgba(16, 24, 60, .1); }
.dv-input .dv-i-ico { color: var(--t3, #8a90a0); display: flex; flex: none; }
.dv-input svg { width: 15px; height: 15px; }
.dv-input input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  padding: 11px 0; font-size: 14px; color: var(--t1, #10131a); }
.dv-go-btn { flex: none; padding: 0 20px; border: 0; border-radius: 13px; cursor: pointer;
  font-size: 14px; font-weight: 650; color: #fff;
  background: linear-gradient(135deg, #4c7dff, #3b5bdb);
  box-shadow: 0 5px 16px rgba(59, 91, 219, .34); }
.dv-go-btn:active { transform: scale(.96); }

.dv-weather-hero { padding: 18px 16px 14px; border-radius: 20px; margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(10, 132, 255, .16), rgba(48, 176, 199, .1));
  border: 1.5px solid rgba(10, 132, 255, .18); }
.dv-w-loc { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  color: var(--t2, #4b5160); margin-bottom: 8px; }
.dv-w-loc svg { width: 14px; height: 14px; }
.dv-w-main { display: flex; align-items: center; gap: 14px; }
.dv-w-ico { width: 58px; height: 58px; flex: none; }
.dv-w-temp { font-size: 52px; font-weight: 800; line-height: .95; color: var(--t1, #10131a); letter-spacing: -1.5px; }
.dv-w-temp i { font-size: 26px; font-weight: 600; font-style: normal; vertical-align: top; }
.dv-w-side { flex: 1; min-width: 0; text-align: right; }
.dv-w-side b { display: block; font-size: 17px; font-weight: 700; color: var(--t1, #10131a); }
.dv-w-side span { display: block; font-size: 11.5px; color: var(--t3, #8a90a0); margin-top: 3px; }
.dv-w-meta { margin-top: 10px; font-size: 10.5px; color: var(--t3, #8a90a0); }
.dv-alert { display: flex; align-items: flex-start; gap: 9px; padding: 12px 13px; border-radius: 14px;
  margin-bottom: 10px; background: rgba(255, 149, 0, .1); border: 1.5px solid rgba(255, 149, 0, .24); }
.dv-alert svg { width: 16px; height: 16px; flex: none; color: #ff9500; margin-top: 2px; }
.dv-alert b { display: block; font-size: 12.5px; color: #a35c00; margin-bottom: 2px; }
.dv-alert p { margin: 0; font-size: 11.5px; line-height: 1.55; color: #a35c00; }
.dv-sun { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-sun-i { display: flex; align-items: center; gap: 5px; flex: none; }
.dv-sun-i svg { width: 14px; height: 14px; color: #ff9500; }
.dv-sun-i b { font-size: 12.5px; color: var(--t1, #10131a); }
.dv-sun-bar { flex: 1; height: 4px; border-radius: 999px; position: relative;
  background: linear-gradient(90deg, #ffd06b, #7cb6ff, #6a7bd8); opacity: .55; }
.dv-sec-tt { font-size: 12.5px; font-weight: 700; color: var(--t2, #4b5160); margin: 0 0 8px 2px; }
.dv-life { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 12px; }
.dv-life-i { padding: 11px 12px; border-radius: 14px;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-life-i b { font-size: 12.5px; color: var(--t1, #10131a); }
.dv-life-lv { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; color: var(--accent, #5b8cff); background: rgba(91, 140, 255, .13); }
.dv-life-i p { margin: 5px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--t3, #8a90a0);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* —— 汇率 —— */
.dv-fx-form { display: flex; align-items: center; gap: 7px; padding: 14px 14px; border-radius: 18px;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07);
  margin-bottom: 10px; flex-wrap: wrap; }
.dv-fx-amt { flex: 1.2; min-width: 84px; border: 0; background: transparent; outline: none;
  font-size: 22px; font-weight: 750; color: var(--t1, #10131a); padding: 2px 0; }
.dv-fx-sel { flex: 1; min-width: 72px; border: 1.5px solid rgba(16, 24, 60, .1); border-radius: 11px;
  padding: 9px 8px; font-size: 13px; font-weight: 650; color: var(--t1, #10131a);
  background: rgba(255, 255, 255, .8); outline: none; }
.dv-fx-arrow { flex: none; color: var(--accent, #5b8cff); display: flex; }
.dv-fx-arrow svg { width: 18px; height: 18px; }
.dv-fx-res { padding: 0 4px 12px; }
.dv-fx-big { font-size: 19px; font-weight: 750; color: var(--t1, #10131a); line-height: 1.4; }
.dv-fx-big i { font-style: normal; color: var(--accent, #5b8cff); margin: 0 2px; }
.dv-fx-rate { margin-top: 3px; font-size: 11.5px; color: var(--t3, #8a90a0); }
.dv-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.dv-quick-i { border: 1.5px solid rgba(16, 24, 60, .08); border-radius: 13px; padding: 9px 6px; cursor: pointer;
  background: var(--glass, rgba(255, 255, 255, .6)); display: flex; flex-direction: column; gap: 2px; }
.dv-quick-i:active { transform: scale(.96); }
.dv-quick-i b { font-size: 12.5px; color: var(--accent, #5b8cff); }
.dv-quick-i span { font-size: 11px; color: var(--t2, #4b5160); font-weight: 600; }
.dv-fx-table { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.dv-fx-row { display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 12px; background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-fx-c { font-size: 12px; font-weight: 650; color: var(--t3, #8a90a0); }
.dv-fx-row b { font-size: 13.5px; color: var(--t1, #10131a); }

/* 旧版 sr-* 保留（供 AI 型应用与兼容） */
.sr-out {
  padding: 14px 15px; border-radius: 14px;
  background: var(--glass, rgba(255, 255, 255, .58)); border: 1.5px solid rgba(16, 24, 60, .1);
  font-size: 13.5px; line-height: 1.7; color: var(--t1, #10131a); overflow-wrap: anywhere;
}
.sr-out h4 { margin: 4px 0 8px; font-size: 15.5px; line-height: 1.4; color: var(--t1, #10131a); }
.sr-out .chat-li { padding: 3px 0 3px 2px; }
.sr-out .chat-li b { color: var(--accent, #5b8cff); }
.sr-out blockquote.chat-quote {
  margin: 6px 0; padding: 8px 12px; border-left: 3px solid rgba(91, 140, 255, .5);
  background: rgba(91, 140, 255, .07); border-radius: 0 10px 10px 0; color: var(--t2, #4b5160);
}
.sr-out pre.chat-code {
  margin: 8px 0; padding: 10px 12px; border-radius: 10px; overflow-x: auto;
  background: rgba(16, 24, 60, .06); font-size: 12px; line-height: 1.5;
}
.sr-out .sr-wait { display: flex; align-items: center; gap: 8px; color: var(--t3, #8a90a0); font-size: 13px; padding: 6px 0; }
.sr-out .sr-wait .spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid rgba(91, 140, 255, .3); border-top-color: var(--accent);
  animation: fc-spin .7s linear infinite;
}
.sr-out .sr-err { color: var(--danger, #ff3b30); }
.sr-off { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 14px; text-align: center; color: var(--t3, #8a90a0); font-size: 13.5px; }
.sr-off svg { width: 26px; height: 26px; color: var(--warning, #ff9500); }
.sr-off p { margin: 0; line-height: 1.6; }
.sr-foot { margin-top: 10px; display: flex; justify-content: center; }
.sr-foot .btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; font-size: 13px; }
.sr-foot .btn svg { width: 14px; height: 14px; }
.sr-foot .btn.busy { opacity: .6; pointer-events: none; }
.sr-note { margin: 8px 0 0; }

/* —— v2.0 数据型应用（自带公开数据源，打开即渲染真实内容） —— */
.sr-tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; line-height: 1.4; white-space: nowrap; }
.sr-tag.tag-data { color: #1f9d6b; background: rgba(31, 157, 107, .13); }
.sr-tag.tag-ai { color: #5b6cff; background: rgba(91, 108, 255, .12); }

.sr-block { margin-bottom: 10px; }
.sr-block-tt { font-size: 13.5px; font-weight: 700; color: var(--t1, #10131a); margin: 2px 0 8px; }
.sr-date { font-size: 12px; color: var(--t3, #8a90a0); margin: 0 0 8px; }

.sr-list { display: flex; flex-direction: column; gap: 6px; }
.sr-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: 11px;
  background: var(--glass, rgba(255, 255, 255, .55)); border: 1px solid rgba(16, 24, 60, .07); }
.sr-row-link { cursor: pointer; transition: background .15s; }
.sr-row-link:active { background: rgba(91, 140, 255, .1); }
.sr-idx { flex: none; width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--brand-grad); }
.sr-year { flex: none; font-size: 12px; font-weight: 700; color: var(--accent, #5b8cff); padding-top: 1px; min-width: 38px; }
.sr-txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.55; }
.sr-desc { font-size: 12px; color: var(--t3, #8a90a0); margin-top: 4px; line-height: 1.5; }
.sr-hot { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: #ff6a3d; }
.sr-go { flex: none; color: var(--t3, #8a90a0); display: flex; align-items: center; }
.sr-go svg { width: 14px; height: 14px; }
.sr-cover { flex: none; width: 40px; height: 40px; border-radius: 9px; background-size: cover; background-position: center;
  background-color: rgba(16, 24, 60, .06); }

.sr-quote { font-size: 17px; line-height: 1.7; color: var(--t1, #10131a); padding: 18px 6px; text-align: center; font-style: normal; }
.sr-kfc { font-size: 13.5px; line-height: 1.7; color: var(--t2, #4b5160); }
.sr-luck-rank { font-size: 13px; color: var(--t3, #8a90a0); margin-bottom: 6px; }
.sr-luck-desc { font-size: 18px; font-weight: 700; color: var(--t1, #10131a); }
.sr-luck-tip { font-size: 13.5px; line-height: 1.6; color: var(--t2, #4b5160); margin-top: 6px; }
.sr-moyu-q { margin-top: 10px; font-style: italic; color: var(--t2, #4b5160); }

.sr-bing img { width: 100%; border-radius: 12px; display: block; margin-bottom: 8px; }
.sr-bing-cap { font-size: 13px; line-height: 1.6; color: var(--t2, #4b5160); }
.sr-bing-cap b { color: var(--t1, #10131a); display: block; margin-bottom: 2px; }

.sr-form { display: flex; gap: 8px; margin-bottom: 12px; }
.sr-form .input { flex: 1; }
.sr-wx { text-align: center; }
.sr-wx-main { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 10px; }
.sr-wx-ico { width: 46px; height: 46px; }
.sr-wx-temp { font-size: 38px; font-weight: 800; line-height: 1; }
.sr-wx-cond { font-size: 15px; font-weight: 600; }
.sr-wx-meta, .sr-wx-aq { font-size: 12.5px; color: var(--t2, #4b5160); margin-top: 4px; }

.sr-fx-form { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.sr-fx-form .input { flex: 1; min-width: 0; }
.sr-fx-form .input[type="number"] { flex: 1.2; }
.sr-fx-eq { color: var(--t3, #8a90a0); font-weight: 700; }
.sr-fx-res { font-size: 17px; font-weight: 700; color: var(--t1, #10131a); min-height: 24px; margin-bottom: 6px; }
.sr-raw { font-size: 11.5px; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }

/* 商店卡片上的「实时 / AI」形态标签（v2.1：移到名称下方，不遮挡图标） */
.skill-kind { display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 999px; line-height: 1.35; margin-bottom: 4px; }
.skill-kind.k-data { color: #1f9d6b; background: rgba(31, 157, 107, .15); }
.skill-kind.k-ai { color: #5b6cff; background: rgba(91, 108, 255, .14); }

/* 主题化下拉：触发按钮（替代原生 select） */
.sel-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; cursor: pointer; text-align: left;
  font-size: 14px; color: var(--t1, #10131a); font-family: inherit;
}
.sel-btn svg { width: 15px; height: 15px; color: var(--t3, #8a90a0); flex: none; }
.sel-btn:active { transform: scale(.985); }
select[hidden] { display: none !important; }

/* 主题化下拉：底部弹层选单（U.pickSelect） */
.pick-list { display: flex; flex-direction: column; padding-bottom: 4px; }
.pick-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; border: 0; background: none; padding: 13px 6px;
  font-size: 14.5px; color: var(--t1, #10131a); font-family: inherit;
  border-bottom: 1px solid rgba(16, 24, 60, .06); cursor: pointer; text-align: left;
}
.pick-item:last-child { border-bottom: 0; }
.pick-item:active { background: rgba(16, 24, 60, .05); }
.pick-item svg { width: 16px; height: 16px; color: var(--accent, #5b8cff); flex: none; }
.pick-item.on { color: var(--accent, #5b8cff); font-weight: 600; }

/* 工具插件运行界面 */
.tool-body { padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.tool-body .btn { width: 100%; }
.tool-out {
  background: var(--glass-strong, rgba(255, 255, 255, .78));
  border: 1px solid rgba(16, 24, 60, .08); border-radius: 12px;
  padding: 12px; font-size: 13.5px; color: var(--t1, #10131a); overflow: auto;
}
.tool-center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 0; }
.tool-badge {
  flex: none; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: rgba(10, 132, 255, .12); color: var(--accent);
}
.tool-badge.local { background: rgba(52, 199, 89, .14); color: var(--success); }
.tool-err { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 14px; }
.tool-err svg { width: 34px; height: 34px; color: var(--warning); }
.upload-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px;
  border: 1.5px dashed rgba(91, 140, 255, .45); border-radius: 14px; background: rgba(91, 140, 255, .05);
  color: var(--t2, #4b5160); font-size: 13px; cursor: pointer; text-align: center;
}
.upload-drop svg { width: 22px; height: 22px; color: var(--accent); }
.upload-drop:active { transform: scale(.98); }
.ttable { width: 100%; border-collapse: collapse; font-size: 12px; }
.ttable th, .ttable td { border: 1px solid rgba(16, 24, 60, .1); padding: 5px 7px; text-align: left; white-space: nowrap; }
.ttable th { background: rgba(16, 24, 60, .05); }
.md-prev h1, .md-prev h2, .md-prev h3, .md-prev h4 { margin: 10px 0 6px; line-height: 1.35; }
.md-prev h1 { font-size: 19px; } .md-prev h2 { font-size: 17px; } .md-prev h3 { font-size: 15px; }
.md-prev p { margin: 6px 0; line-height: 1.7; }
.md-prev code { background: rgba(16, 24, 60, .07); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.md-prev pre { background: rgba(16, 24, 60, .06); border-radius: 8px; padding: 10px; overflow: auto; }
.md-prev pre code { background: none; padding: 0; }
.md-prev blockquote { border-left: 3px solid rgba(91, 140, 255, .5); margin: 8px 0; padding: 2px 0 2px 10px; color: var(--t2); }
.md-prev ul, .md-prev ol { padding-left: 20px; margin: 6px 0; }
.md-prev a { color: var(--accent); }

/* AI 助手技能 chip 的删除叉（v1.9.3 修复叉号不显示） */
.chat-skill-chip button svg { width: 12px; height: 12px; }

/* ============ 插件商店改版（v1.9.7） ============
   内置货架 + 场景分类 + 精选位 + 技能详情 + 「⋯ 高级」技能源管理。
   原 4 列小卡太挤（描述几乎不可读），改为 2 列大卡并加入场动效。 */

/* 顶部：搜索 + 更多（仓库等开发者概念收进「⋯」） */
.store-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; }
.store-head .store-search { flex: 1; min-width: 0; margin: 0; }
.store-more {
  flex: none; width: 42px; height: 42px; border-radius: 13px; cursor: pointer;
  background: var(--glass, rgba(255, 255, 255, .58));
  border: 1.5px solid rgba(16, 24, 60, .16); color: var(--t2, #4b5160);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-1); transition: transform .15s, border-color .18s;
}
.store-more:active { transform: scale(.94); }
.store-more svg { width: 18px; height: 18px; }

/* 场景分类 chips */
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 8px; }
.pk-chip {
  flex: 0 0 auto; padding: 6px 15px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  background: var(--glass-thin, rgba(255, 255, 255, .38));
  border: 1.5px solid rgba(16, 24, 60, .12); color: var(--t2, #4b5160);
  white-space: nowrap; transition: all .18s;
}
.pk-chip.on {
  background: var(--brand-grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(91, 140, 255, .32); transform: translateY(-1px);
}

/* 横向滑动分类条（v2.3）：推荐这一排改为可左右滑动选择 */
.pk-chips.sw {
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
  padding: 6px 16px 10px; scroll-snap-type: x proximity;
}
.pk-chips.sw::-webkit-scrollbar { display: none; }
.pk-chips.sw .pk-chip { flex: 0 0 auto; scroll-snap-align: center; }

/* 收藏按钮（v2.3）：左上角星标 + 收藏计数，进入 / 退出「我的收藏」 */
.store-fav-btn {
  flex: none; position: relative; width: 42px; height: 42px; border-radius: 13px; cursor: pointer;
  background: var(--glass, rgba(255, 255, 255, .58));
  border: 1.5px solid rgba(16, 24, 60, .16); color: var(--t2, #4b5160);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-1); transition: transform .15s, border-color .18s, background .18s, color .18s;
}
.store-fav-btn svg { width: 18px; height: 18px; }
.store-fav-btn:active { transform: scale(.94); }
.store-fav-btn.on { color: #ffb020; border-color: rgba(255, 176, 32, .5); background: rgba(255, 176, 32, .12); }
.store-fav-btn .sfb-n {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #ff5b6e; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 2px 6px rgba(255, 91, 110, .4);
}

/* 精选位（v2.3：feat-banner 随机精选条已下线，规则移除） */

/* 在线技能源状态条 */
.store-note {
  display: flex; align-items: center; gap: 8px; margin: 2px 16px 6px; padding: 9px 12px;
  border-radius: 12px; font-size: 11.5px; color: var(--t3, #8a90a0); background: rgba(16, 24, 60, .04);
}
.store-note svg { width: 15px; height: 15px; flex: none; }
.store-note.warn { color: var(--warning, #ff9500); background: rgba(255, 149, 0, .1); }
.store-note.ok { color: #1f9d6b; background: rgba(31, 157, 107, .09); }
.store-note .mini-btn { margin-left: auto; }
.store-note .spin {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 2px solid rgba(91, 140, 255, .25); border-top-color: var(--accent);
  animation: fc-spin .7s linear infinite;
}

/* 在线技能源同步进度条（v2.1） */
.store-prog {
  margin: 2px 16px 6px; padding: 11px 13px; border-radius: 14px;
  background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(91, 140, 255, .16);
}
.store-prog .sp-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.store-prog .sp-ico { color: var(--accent); display: flex; flex: none; }
.store-prog .sp-ico svg { width: 15px; height: 15px; }
.store-prog .sp-tx { flex: 1; min-width: 0; font-size: 12.5px; color: var(--t1, #10131a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-prog .sp-pct { font-size: 12.5px; font-weight: 700; color: var(--accent); flex: none; }
.store-prog .sp-bar { height: 6px; border-radius: 999px; background: rgba(16, 24, 60, .08); overflow: hidden; }
.store-prog .sp-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, #5b8cff, #8a6bff);
  transition: width .22s var(--ease, ease);
  position: relative; overflow: hidden;
}
.store-prog .sp-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: sp-shine 1.1s linear infinite;
}
@keyframes sp-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.store-prog .sp-sub { margin-top: 7px; font-size: 10.5px; color: var(--t3, #8a90a0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 卡片入场 stagger（v2.1：不再覆盖网格/尺寸，只保留动画，
   避免与上方 4 列方块卡样式冲突导致卡片大小不一） */
.plugin-card {
  cursor: pointer;
  animation: fc-rise .34s var(--spring, cubic-bezier(.34, 1.42, .64, 1)) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}
/* 搜索输入时不做入场动画，避免每敲一个字整屏闪动 */
.plugin-grid.no-anim .plugin-card { animation: none; }
.tag-pill.hot { background: linear-gradient(135deg, #ff9f0a, #ff6b3d); color: #fff; }

@keyframes fc-rise {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* 空态 */
.store-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 34px 16px; text-align: center; color: var(--t3, #8a90a0); font-size: 13px;
}
.store-empty svg { width: 26px; height: 26px; opacity: .6; }
.store-empty p { margin: 0; }

/* 技能详情 */
.sd-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.sd-head .sd-ico {
  flex: none; width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.sd-head .sd-ico svg { width: 26px; height: 26px; }
.sd-head .sd-meta { flex: 1; min-width: 0; }
.sd-head .sd-meta b { display: block; font-size: 17px; color: var(--t1, #10131a); margin-bottom: 3px; }
.sd-head .sd-sub { font-size: 11.5px; color: var(--t3, #8a90a0); overflow-wrap: anywhere; }
.sd-head .sd-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.sd-desc { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: var(--t2, #4b5160); }
.sd-block { margin-bottom: 12px; }
.sd-block h5 { margin: 0 0 6px; font-size: 12.5px; color: var(--t3, #8a90a0); font-weight: 600; }
.sd-ex {
  margin: 0; padding: 12px 13px; border-radius: 13px; font-size: 12.5px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit;
  background: var(--glass, rgba(255, 255, 255, .58));
  border: 1.5px solid rgba(16, 24, 60, .1); color: var(--t1, #10131a);
}
.sd-list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.75; color: var(--t2, #4b5160); }

/* 高级 · 技能源管理 */
.adv-card {
  padding: 12px 13px; border-radius: 14px; margin-bottom: 10px;
  background: var(--glass, rgba(255, 255, 255, .58));
  border: 1.5px solid rgba(16, 24, 60, .1); box-shadow: var(--sh-1);
}
.adv-row { display: flex; align-items: center; gap: 10px; }
.adv-row .ar-i {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(91, 140, 255, .12); color: var(--accent);
}
.adv-row .ar-i svg { width: 17px; height: 17px; }
.adv-row .ar-t { flex: 1; min-width: 0; }
.adv-row .ar-t b { display: block; font-size: 13.5px; color: var(--t1, #10131a); }
.adv-row .ar-t span { display: block; font-size: 11px; color: var(--t3, #8a90a0); overflow-wrap: anywhere; }

/* 预设技能源列表（v2.1：一键切换开源仓库） */
.repo-presets { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.rp-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 13px; cursor: pointer;
  background: var(--glass, rgba(255, 255, 255, .58));
  border: 1.5px solid rgba(16, 24, 60, .1);
  transition: transform .15s var(--spring), border-color .18s, background .18s;
}
.rp-item:active { transform: scale(.98); }
.rp-item.on { border-color: rgba(91, 140, 255, .55); background: rgba(91, 140, 255, .09); }
.rp-item .rp-tag {
  flex: none; font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  color: var(--accent); background: rgba(91, 140, 255, .13);
}
.rp-item .rp-tx { flex: 1; min-width: 0; }
.rp-item .rp-tx b { display: block; font-size: 13px; color: var(--t1, #10131a); margin-bottom: 2px; }
.rp-item .rp-tx span { display: block; font-size: 10.5px; color: var(--t3, #8a90a0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-item .rp-on { flex: none; color: var(--accent); display: flex; }
.rp-item .rp-on svg { width: 16px; height: 16px; }
.adv-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

/* ============ v2.2 数据卡新增版式（RENDER 通用 / 特例渲染器配套） ============ */

/* —— 新闻头图 —— */
.dv-news-cover { width: 100%; border-radius: 14px; display: block; margin: 0 0 10px;
  box-shadow: 0 6px 22px rgba(16, 24, 60, .14); }

/* —— 键值卡（kv） —— */
.dv-kvs { display: flex; flex-direction: column; gap: 8px; }
.dv-kv { display: flex; align-items: baseline; gap: 10px; padding: 11px 13px; border-radius: 14px;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-kv.block { flex-direction: column; align-items: stretch; gap: 4px; }
.dv-kv-k { flex: none; min-width: 64px; font-size: 11.5px; color: var(--t3, #8a90a0);
  font-weight: 600; }
.dv-kv-v { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.6; color: var(--t1, #10131a);
  word-break: break-word; overflow-wrap: anywhere; }
.dv-kv-v.strong { font-size: 17px; font-weight: 750; }
.dv-kv-img { max-width: 120px; max-height: 120px; border-radius: 12px; display: block; margin-top: 4px; }
.dv-kv-link { color: var(--accent, #5b8cff); word-break: break-all; }
.dv-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px;
  margin-right: 6px; border: 1.5px solid rgba(16, 24, 60, .12); }
.dv-copyable { cursor: pointer; border-bottom: 1px dashed rgba(91, 140, 255, .45); }

/* —— 油价 / 金价行情列表 —— */
.dv-price { display: flex; flex-direction: column; gap: 6px; }
.dv-price-i { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 12px; background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-price-i span { font-size: 12.5px; color: var(--t2, #4b5160); }
.dv-price-i b { font-size: 14px; color: var(--t1, #10131a); font-weight: 700; }
.dv-price-i b i { font-style: normal; font-size: 11px; color: var(--t3, #8a90a0); margin-left: 3px; }

/* —— 翻译对照 —— */
.dv-tr { display: flex; align-items: stretch; gap: 8px; }
.dv-tr-side { flex: 1; min-width: 0; padding: 14px 14px; border-radius: 16px;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-tr-side.out { background: linear-gradient(135deg, rgba(91, 140, 255, .12), rgba(138, 107, 255, .08));
  border-color: rgba(91, 140, 255, .18); }
.dv-tr-lb { display: block; font-size: 11px; font-weight: 700; color: var(--t3, #8a90a0); margin-bottom: 6px; }
.dv-tr-tx { margin: 0; font-size: 15px; line-height: 1.7; color: var(--t1, #10131a); word-break: break-word; }
.dv-tr-tx.big { font-size: 16.5px; }
.dv-tr-pro { margin: 6px 0 0; font-size: 11.5px; color: var(--t3, #8a90a0); }
.dv-tr-arrow { flex: none; display: flex; align-items: center; color: var(--accent, #5b8cff); }
.dv-tr-arrow svg { width: 18px; height: 18px; }

/* —— 图片类（二维码） —— */
.dv-imgbox { text-align: center; }
.dv-imgbox img { max-width: 70%; border-radius: 14px; box-shadow: 0 6px 22px rgba(16, 24, 60, .14); }

/* —— 唱歌 —— */
.dv-user { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--t2, #4b5160); }
.dv-user img { width: 30px; height: 30px; border-radius: 50%; }
.dv-audio { width: 100%; margin: 8px 0 10px; }
.dv-lyrics { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.dv-lyrics p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--t1, #10131a); }

/* —— 天气预报：逐小时 + 7 天 —— */
.dv-hours { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; }
.dv-hour { flex: none; width: 56px; text-align: center; padding: 10px 4px; border-radius: 14px;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-hour span { display: block; font-size: 11px; color: var(--t3, #8a90a0); margin-bottom: 5px; }
.dv-hour img { width: 28px; height: 28px; margin: 0 auto 4px; display: block; }
.dv-hour b { font-size: 15px; font-weight: 700; color: var(--t1, #10131a); }
.dv-days { display: flex; flex-direction: column; gap: 7px; }
/* 5 个子元素（日期 / 图标 / 天气 / 温度 / AQI）就要 5 列，此前只有 4 列导致换行错位 */
.dv-day { display: grid; grid-template-columns: 52px auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(16, 24, 60, .07); }
.dv-day-d { font-size: 13px; font-weight: 700; color: var(--t1, #10131a); }
.dv-day-c { font-size: 11.5px; color: var(--t3, #8a90a0); }
.dv-day-t b { font-size: 14px; color: var(--t1, #10131a); }
.dv-day-t span { font-size: 11px; color: var(--t3, #8a90a0); }
.dv-day-aqi { font-size: 11px; color: var(--t2, #4b5160); margin-left: 8px; }

/* —— 精选位小条（v2.3：feat-inline 随机精选条已下线，规则移除） —— */

/* —— 发现页容器（v2.2）：#storeDiscover 本身不再是网格，真正的 4 列网格在分组内，
      否则分组会被当成「一个网格单元格」而塌陷成一条窄柱（卡片文字竖排堆叠）。 —— */
.store-body { display: block; }

/* —— 分类分组（v2.2：可折叠） —— */
.store-group { margin: 4px 12px 6px; }
.store-group-hd { display: flex; align-items: center; gap: 8px; padding: 8px 4px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--t1, #10131a); }
.store-group-hd::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: 2px;
  border-right: 2px solid var(--t3, #8a90a0); border-bottom: 2px solid var(--t3, #8a90a0);
  transform: rotate(45deg); transition: transform .2s; }
.store-group-hd b { flex: none; }
.store-group-hd span { font-size: 11px; font-weight: 600; color: var(--t3, #8a90a0); flex: none; }
.store-group-hd .sg-line { flex: 1; height: 1px; background: rgba(16, 24, 60, .08); }
/* v2.3 折叠：折叠态统一挂在 .store-group 上 —— 箭头收起 + 网格隐藏都跟随它 */
.store-group.collapsed > .store-group-hd::after { transform: rotate(-45deg); }
.store-group.collapsed > .plugin-grid { display: none; }
.plugin-grid.collapsed { display: none; }

/* —— 卡片收藏星标（v2.2） —— */
.plugin-card .pc-fav { position: absolute; top: 4px; left: 4px; z-index: 3; width: 22px; height: 22px;
  border: 0; border-radius: 7px; background: rgba(16, 24, 60, .12); color: rgba(255, 255, 255, .9);
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.plugin-card .pc-fav svg { width: 13px; height: 13px; }
.plugin-card .pc-fav.on { background: linear-gradient(135deg, #ffb340, #ff9500); color: #fff; }

/* —— 维护中的卡片（v2.4：接口巡检判定上游不可用） ——
   不做成「删除」，而是保留可见但明显降级：用户知道这个功能存在、只是暂时用不了，
   恢复后（下一次巡检）会自动变回来。 */
.plugin-pill.bad { display: inline-flex; align-items: center; gap: 2px;
  background: rgba(255, 149, 0, .95); }
.plugin-pill.bad svg { width: 8px; height: 8px; }
.plugin-card.is-down { opacity: .58; }
.plugin-card.is-down:active { transform: scale(.97); }
.plugin-card.is-down .plugin-cover { filter: grayscale(.85); }
.plugin-card .plugin-install.down { border-color: rgba(255, 149, 0, .42); color: #c67600;
  background: rgba(255, 149, 0, .1); }

/* —— 同步成功条淡出（v2.2：加载完成后短暂显示再自动消失） —— */
.store-note.ok.fade-out { opacity: 0; transform: translateY(-4px); }
.store-note.ok { transition: opacity .4s ease, transform .4s ease; }
.store-note.api-hl { justify-content: flex-start; }
.store-note.api-hl span { flex: 1; min-width: 0; }

/* —— 维护中说明卡（点开已标记维护中的功能时弹出） —— */
.api-down-card { text-align: center; padding: 6px 2px 2px; }
.adc-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 149, 0, .12); color: #ff9500; }
.adc-ico svg { width: 26px; height: 26px; }
.adc-t { margin: 0 0 8px; font-size: 14px; font-weight: 650; color: var(--t1, #10131a); }
.adc-sub { margin: 0 0 14px; line-height: 1.65; }
.adc-err { margin: 0 0 14px; padding: 8px 10px; border-radius: 10px; font-size: 11.5px;
  background: rgba(16, 24, 60, .05); color: var(--t3, #8a90a0); word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ============ 媒体播放 · 内置浏览器（v2.3） ============ */

/* —— 音频播放卡（唱鸭等）：图标 + 曲目信息 + 原生播放器 —— */
.dv-player { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0;
  padding: 12px; border-radius: 16px; background: var(--glass, rgba(255, 255, 255, .6));
  border: 1.5px solid rgba(16, 24, 60, .08); box-shadow: var(--sh-1); }
.dv-player-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-grad); }
.dv-player-ico svg { width: 18px; height: 18px; }
.dv-player-meta { flex: 1; min-width: 0; }
.dv-player-meta b { display: block; font-size: 14px; font-weight: 700; color: var(--t1, #10131a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-player-meta span { font-size: 11.5px; color: var(--t3, #8a90a0); }
.dv-audio { flex: 1 1 100%; width: 100%; height: 38px; margin-top: 4px; }

/* —— 视频卡：内嵌播放器 —— */
.dv-video { margin: 8px 0; border-radius: 16px; overflow: hidden;
  background: var(--glass, rgba(255, 255, 255, .6)); border: 1.5px solid rgba(16, 24, 60, .08);
  box-shadow: var(--sh-1); }
.dv-vplayer { display: block; width: 100%; max-height: 60vh; background: #000; }
.dv-vmeta { padding: 10px 12px; }
.dv-vmeta b { font-size: 14px; font-weight: 700; color: var(--t1, #10131a); }
.dv-vmeta p { margin: 4px 0 0; font-size: 12px; color: var(--t3, #8a90a0); }

/* ==================== 链接卡片 + 应用内浏览（v2.4 重新设计） ====================
   旧版一进来就挂 iframe，被 X-Frame-Options 拦住后只剩一张白底报错页。
   新版默认给一张精致的链接卡，把「打开」这件事一次点到位。 */
.inapp-browser .ib-body { position: relative; flex: 1; min-height: 0; background: #fff; }
.ib-ico { background: linear-gradient(135deg, #5b8cff, #8a6bff) !important; }

@keyframes fc-pop {
  from { transform: translateY(14px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* —— 卡片视图（v2.4.2：去掉顶部标题栏，返回 / 关闭浮动在卡片两端） —— */
.ls-wrap { position: relative; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(18px + 34px + var(--sat, 0px)) 16px calc(24px + var(--sab, 0px)); }
.ls-wrap[hidden] { display: none !important; }
.ls-card { width: 100%; max-width: 400px; margin: 0 auto; border-radius: 24px; overflow: hidden;
  background: var(--card, #fff); box-shadow: 0 18px 48px rgba(16, 24, 60, .14), 0 2px 8px rgba(16, 24, 60, .05);
  animation: fc-pop .34s var(--spring, cubic-bezier(.34, 1.42, .64, 1)) both; }

/* 悬浮圆形按钮：吸顶对齐卡片两角，`<` 最左、`×` 最右 */
.ls-fbtn { position: absolute; top: calc(18px + var(--sat, 0px)); z-index: 5; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--t2, #4b5160); border: 1.5px solid rgba(16, 24, 60, .1);
  background: var(--glass-solid, rgba(255, 255, 255, .82)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(16, 24, 60, .13); transition: transform .15s; }
.ls-fbtn:active { transform: scale(.92); }
.ls-fbtn svg { width: 19px; height: 19px; }
.ls-back { left: 16px; }
.ls-close { right: 16px; }

.ls-hero { position: relative; padding: 28px 20px 20px; text-align: center; color: #fff;
  background: linear-gradient(140deg,
    hsl(var(--h, 222) 88% 62%), hsl(calc(var(--h, 222) + 34) 82% 58%)); }
.ls-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -20%, rgba(255, 255, 255, .34), transparent 62%); }
.ls-fav { position: relative; width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px;
  overflow: hidden; background: rgba(255, 255, 255, .22); z-index: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(10, 18, 48, .18); }
.ls-letter { font-size: 25px; font-weight: 800; line-height: 1; }
.ls-fav img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  padding: 11px; background: #fff; opacity: 0; transition: opacity .22s; }
.ls-fav img.on { opacity: 1; }
.ls-host-big { position: relative; z-index: 1; display: block; font-size: 19px; font-weight: 750;
  letter-spacing: .2px; word-break: break-all; }
.ls-badge { position: relative; z-index: 1; display: inline-block; margin-top: 8px; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; background: rgba(255, 255, 255, .24); }

.ls-body { padding: 18px 20px 4px; }
.ls-title { margin: 0 0 12px; font-size: 15.5px; line-height: 1.55; font-weight: 700; color: var(--t1, #10131a); }
.ls-url { display: flex; align-items: center; gap: 7px; padding: 10px 12px; border-radius: 12px;
  background: rgba(16, 24, 60, .05); color: var(--t3, #8a90a0); font-size: 12px; }
.ls-url svg { width: 14px; height: 14px; flex: none; }
.ls-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-note { margin: 14px 0 0; font-size: 12px; line-height: 1.68; color: var(--t3, #8a90a0); }

.ls-acts { padding: 16px 20px 20px; }
.ls-primary { width: 100%; height: 50px; border: 0; border-radius: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15.5px; font-weight: 700; color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 10px 24px rgba(91, 140, 255, .34); transition: transform .15s; }
.ls-primary:active { transform: scale(.975); }
.ls-primary svg { width: 18px; height: 18px; }
.ls-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.ls-row button { height: 42px; border-radius: 13px; cursor: pointer; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--t2, #4b5160); background: rgba(16, 24, 60, .045);
  border: 1.5px solid rgba(16, 24, 60, .08); transition: transform .15s; }
.ls-row button:active { transform: scale(.96); }
.ls-row svg { width: 15px; height: 15px; }

/* 备选源提示条：主源不可用、当前展示的是替补内容 */
.dv-fallback-tip { display: flex; align-items: center; gap: 7px; margin: 0 0 10px;
  padding: 9px 12px; border-radius: 12px; font-size: 12.5px;
  color: #9a6b1f; background: rgba(245, 180, 60, .14); border: 1px solid rgba(245, 180, 60, .28); }
.dv-fallback-tip svg { width: 15px; height: 15px; flex: none; }

/* —— 应用内视图（用户主动触发） —— */
.ib-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ib-view[hidden] { display: none !important; }
.ib-host { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex: none;
  /* 顶部安全区：全屏运行时状态栏会覆盖在页面之上，不加 --sat 时地址栏正好躲在
     状态栏底下 —— 右上角的刷新 / 浏览器 / 关闭按钮点不到，看着像「点了没反应」。 */
  padding-top: calc(8px + var(--sat, 0px));
  background: rgba(255, 255, 255, .72); border-bottom: 1px solid rgba(16, 24, 60, .07); }
.ib-btn { flex: none; width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  background: var(--glass, rgba(255, 255, 255, .58)); border: 1.5px solid rgba(16, 24, 60, .14);
  color: var(--t2, #4b5160); display: flex; align-items: center; justify-content: center; }
.ib-btn:active { transform: scale(.94); }
.ib-btn svg { width: 16px; height: 16px; }
.ib-url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px;
  border-radius: 12px; background: rgba(16, 24, 60, .05); color: var(--t3, #8a90a0); font-size: 12px; }
.ib-url svg { width: 14px; height: 14px; flex: none; }
.ib-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.ib-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 13px; color: var(--t3, #8a90a0); background: #fff; z-index: 2; }
.ib-block[hidden], .ib-loading[hidden] { display: none !important; }
.ib-block { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 32px 24px; text-align: center;
  background: #fff; color: var(--t2, #4b5160); }
.ib-block svg { width: 34px; height: 34px; color: var(--warning, #ff9500); }
.ib-block p { margin: 0; font-size: 13.5px; }
.ib-block .btn { margin-top: 14px; }
.ib-block .btn + .mini-btn { margin-top: 8px; }

/* —— 歌词（v2.4：接口返回单个对象 + 逐行时间轴） —— */
.dv-lyric { max-height: 56vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 14px 14px; border-radius: 16px; background: rgba(16, 24, 60, .03);
  border: 1.5px solid rgba(16, 24, 60, .06); }
.dv-lyric p { display: flex; gap: 10px; margin: 0; padding: 7px 0; font-size: 14.5px; line-height: 1.6;
  color: var(--t1, #10131a); border-bottom: 1px dashed rgba(16, 24, 60, .06); }
.dv-lyric p:last-child { border-bottom: 0; }
.dv-lyric p i { flex: none; width: 42px; font-size: 11px; font-style: normal; padding-top: 3px;
  color: var(--t3, #8a90a0); font-variant-numeric: tabular-nums; }
.dv-lyric p span { flex: 1; min-width: 0; }
.dv-lyric.plain p { display: block; text-align: center; }

/* —— 不确定性进度条（v2.2：探测中，不显示卡死的 0%） —— */
.store-prog .sp-fill.indet { width: 60%; animation: sp-indet 1.1s ease-in-out infinite; }
@keyframes sp-indet {
  0% { margin-left: 0; width: 18%; } 50% { margin-left: 55%; width: 45%; } 100% { margin-left: 82%; width: 18%; }
}

/* ============ 更新弹窗 v1.6：环形进度 + 阶段轨道 + 文件流 ============
   旧版是一条横条 + 一行小字，用户看不出「到底在做什么」。
   现在三件事同时可见：进度环（还有多久）、阶段轨道（走到哪一步）、
   文件流（正在下载哪个文件）。动效只做 transform / opacity / stroke，
   不触发布局重排，弱机上也不会掉帧。 */
.up2 { max-width: 336px; }
.up2 .up-hd { padding: 18px 16px 10px; gap: 12px; }
/* v1.12.3：外框高度改回内容驱动。
   以前这里写死 height: 332px 防跳动，但下载中的实际内容只有约 220px，
   弹窗底部就永远空着一条（用户截图反馈「留白太多」）。
   现在稳定性改由「文件流固定三行高 + 步骤文案固定两行高」来保证 ——
   这两块高度不变，下载过程中卡片就不会呼吸；完成态再把文件流折叠、
   原地换出底部按钮，净高度几乎不变，同样不会整窗上下跳。 */
.up-dlg.up2 { height: auto; max-height: 82vh; }
.up2 .up-bd { display: flex; flex-direction: column; padding-bottom: 16px; }
/* 有底部按钮时把内边距收窄，避免按钮上方出现双份留白 */
.up-dlg.up2.is-done .up-bd,
.up-dlg.up2.is-fail .up-bd { padding-bottom: 8px; }
/* 步骤文案最多两行；外框高度已锁定，换行只影响内部，不会再带着整窗跳动 */
.up2 .up-step {
  margin-top: 10px; min-height: 22px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.up-ring {
  position: relative; flex: none;
  width: 54px; height: 54px;
  display: grid; place-items: center;
}
.up-ring > svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg);      /* 从 12 点方向开始长 */
}
.up-ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.rg-bg { stroke: rgba(120, 130, 160, .18); }
.rg-fg {
  stroke: url(#upGrad);
  transition: stroke-dashoffset .4s cubic-bezier(.3, .9, .3, 1);
  filter: drop-shadow(0 0 5px rgba(91, 140, 255, .45));
}
.rg-num {
  position: relative;
  font-size: 14px; font-weight: 800; letter-spacing: -.2px;
  color: var(--t1, #1f2430);
  font-variant-numeric: tabular-nums;
  transition: opacity .2s ease, transform .2s ease;
}
.rg-num i { font-style: normal; font-size: 9px; font-weight: 700; margin-left: 1px; color: var(--t2, #6b7280); }
.rg-done {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; opacity: 0; transform: scale(.55);
}
.rg-done svg { width: 20px; height: 20px; }

.up-dlg.is-done .rg-fg { stroke: #34C759; filter: drop-shadow(0 0 6px rgba(52, 199, 89, .45)); }
.up-dlg.is-done .rg-num { opacity: 0; transform: scale(.7); }
.up-dlg.is-done .rg-done { opacity: 1; transform: scale(1); transition: opacity .24s ease, transform .34s var(--spring); }
.up-dlg.is-fail .rg-fg { stroke: #FF9F0A; filter: drop-shadow(0 0 6px rgba(255, 159, 10, .4)); }

/* 阶段轨道 */
.up-stages { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px; }
.up-stg {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; color: #9AA3B5;
  transition: color .22s ease; flex: none;
}
.up-stg i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(120, 130, 160, .34);
  transition: background .22s ease, box-shadow .22s ease;
}
.up-stg:not(:last-child)::after {
  content: ''; width: 13px; height: 1px; margin-left: 1px;
  background: rgba(120, 130, 160, .26);
}
.up-stg em { font-style: normal; font-size: 10.5px; color: #8A93A8; font-variant-numeric: tabular-nums; }
.up-stg.on { color: #2F6BFF; }
.up-stg.on i { background: #2F6BFF; animation: upDot 1.5s ease-in-out infinite; }
.up-stg.done { color: #4A5568; }
.up-stg.done i { background: #34C759; }

/* 文件流：最近 3 个，新的从下面淡入，旧的淡出。
   高度固定成三行并底部对齐 —— 行数从 0 到 3 的过程中卡片不再长高，
   否则居中弹窗会跟着上下跳。 */
.up-stream {
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 3px; height: 58px; margin-bottom: 8px; overflow: hidden;
  transition: height .2s ease, margin-bottom .2s ease, opacity .16s ease;
}
/* 一个文件都还没下完时不留空槽：整块收起，避免「阶段条和文案之间空一条」 */
.up-stream:empty { height: 0; margin-bottom: 0; }
/* 完成态：文件流已经没用了，折叠掉把高度让给底部按钮。
   58(+8) 收起、按钮 70 撑开，一进一出几乎相等 —— 卡片总高不跳。 */
.up-dlg.is-done .up-stream { height: 0; margin-bottom: 0; opacity: 0; }
.up-f {
  display: flex; align-items: center; gap: 7px; flex: none;
  font-size: 11.5px; color: var(--t2, #6b7280);
  animation: upIn .16s ease both;
}
.up-f em { font-style: normal; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-f-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #34C759; }
.up-f.out { animation: upOut .28s ease forwards; }

/* 只淡入淡出，不做纵向位移：上下滑动配着内容高度变化，看起来就是「闪」 */
@keyframes upIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes upOut { to { opacity: 0; } }
@keyframes upDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(47, 107, 255, .14); }
  50% { box-shadow: 0 0 0 6px rgba(47, 107, 255, .05); }
}

/* 系统开了「减少动态效果」就只留颜色，不做位移 */
@media (prefers-reduced-motion: reduce) {
  .up-f, .up-f.out, .up-stg.on i { animation: none !important; }
  .up-ring circle { transition: none !important; }
}

/* 完成态：环内收成一个绿色圆底 + 白色对勾（只描边时对勾几乎看不见） */
.up-ring::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  background: #34C759; opacity: 0; transform: scale(.4);
  transition: opacity .26s ease, transform .34s var(--spring);
}
.up-dlg.is-done .up-ring::before { opacity: 1; transform: scale(1); }
.up-ring > svg { z-index: 1; }
.rg-num, .rg-done { z-index: 2; }
