/* ==========================================================================
   在线工具箱 · 统一设计系统 v1.3
   风格：玻璃拟态 Glassmorphism + 紫蓝 Indigo 主色 + 亮/暗双主题
   --------------------------------------------------------------------------
   用法：每页在各自 <style> 之前引入本文件，
        然后页内私有样式只写「本页特有」的部分，通用组件沿用本文件。
   主题：<html data-theme="light|dark">，由 static/theme.js 控制并记忆。
   ========================================================================== */

/* ---------- 1. 设计令牌（亮色，默认）---------- */
:root {
  color-scheme: light;

  /* 底色与文字 */
  --bg: #eef1f9;
  --bg-2: #f5f7fd;
  --text: #1f2430;
  --text-2: #4a5064;
  --muted: #7a8299;
  --border: rgba(255, 255, 255, .65);
  --border-line: rgba(120, 130, 170, .16);

  /* 主色（紫蓝 Indigo，全站统一） */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: rgba(99, 102, 241, .1);
  --c-img: #0ea5e9;
  --c-pdf: #8b5cf6;

  /* 语义色 */
  --success: #10b981;
  --danger: #e5484d;
  --warn: #f59e0b;

  /* 玻璃材质 */
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-soft: rgba(255, 255, 255, .42);
  --blur: 18px;
  --blur-lg: 26px;

  /* 阴影（多层柔和投射，玻璃质感的关键） */
  --shadow-s: 0 2px 8px rgba(30, 41, 90, .05);
  --shadow: 0 8px 28px rgba(30, 41, 90, .08);
  --shadow-l: 0 18px 48px rgba(30, 41, 90, .13);
  --shadow-indigo: 0 8px 24px rgba(99, 102, 241, .22);

  /* 页面背景光斑（亮色：柔和马卡龙） */
  --spot-1: rgba(99, 102, 241, .26);
  --spot-2: rgba(14, 165, 233, .22);
  --spot-3: rgba(139, 92, 246, .20);
  --spot-4: rgba(16, 185, 129, .16);
  --spot-mid: rgba(99, 102, 241, .10);
  --bg-grad-top: #f2f4fb;
  --bg-grad-bottom: #eef1f9;

  /* Hero 深色底（两个主题下都偏深，故单独定义） */
  --hero-grad: linear-gradient(150deg, #232a44 0%, #2f3a5c 46%, #35305e 78%, #3a3070 100%);
  --hero-fade: rgba(238, 241, 249, .5);

  /* 圆角 */
  --radius: 16px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  /* 过渡 */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 1b. 设计令牌（深色）----------
   行业实践（2026）：暗色不是简单反色，需要独立灰阶层级。
   背景用 #0b0d16（非纯黑，避免刺眼），卡片比背景略亮做层级。 */
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0d16;
  --bg-2: #0f1220;
  --text: #eef0f8;
  --text-2: #b8bed4;
  --muted: #8a93ad;
  --border: rgba(255, 255, 255, .10);
  --border-line: rgba(255, 255, 255, .09);

  /* 深色下强调色略降亮，避免刺眼 */
  --primary: #818cf8;
  --primary-hover: #6d78f5;
  --primary-soft: rgba(129, 140, 248, .14);
  --c-img: #38bdf8;
  --c-pdf: #a78bfa;

  --success: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;

  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(255, 255, 255, .085);
  --glass-soft: rgba(255, 255, 255, .035);

  --shadow-s: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-l: 0 20px 52px rgba(0, 0, 0, .55);
  --shadow-indigo: 0 10px 30px rgba(99, 102, 241, .34);

  /* 深色背景下的光斑：中等饱和，避免卡片透光后过亮 */
  --spot-1: rgba(99, 102, 241, .30);
  --spot-2: rgba(14, 165, 233, .24);
  --spot-3: rgba(139, 92, 246, .24);
  --spot-4: rgba(16, 185, 129, .17);
  --spot-mid: rgba(99, 102, 241, .11);
  --bg-grad-top: #0c0e1a;
  --bg-grad-bottom: #08090f;

  --hero-grad: linear-gradient(150deg, #1a1f38 0%, #232a4c 46%, #292554 78%, #2d2560 100%);
  --hero-fade: rgba(11, 13, 22, .6);
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
  /* 主题切换时的平滑过渡（仅颜色，不动布局） */
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

/* 切换瞬间给全局加过渡，避免元件颜色跳变（JS 在切换时挂 .theming，结束后移除） */
html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color .28s var(--ease), color .28s var(--ease),
              border-color .28s var(--ease), box-shadow .28s var(--ease) !important;
}

/* ---------- 3. 背景光斑（玻璃拟态的灵魂）----------
   固定在视口上的几团柔光，卡片在它之上做 backdrop-filter，
   透过卡片能看到光斑，形成「磨砂玻璃」观感。 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(760px 520px at 10% 4%, var(--spot-1), transparent 64%),
    radial-gradient(680px 480px at 90% 2%, var(--spot-2), transparent 64%),
    radial-gradient(820px 620px at 78% 82%, var(--spot-3), transparent 66%),
    radial-gradient(620px 500px at 18% 90%, var(--spot-4), transparent 68%),
    radial-gradient(700px 560px at 50% 50%, var(--spot-mid), transparent 70%),
    linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg-grad-bottom) 100%);
  pointer-events: none;
}
/* 一层极淡的噪点，避免大面积渐变出现色带 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  pointer-events: none;
}
[data-theme="dark"] body::after { opacity: .5; }

/* ---------- 4. 顶部 Header ---------- */
.header {
  position: relative;
  color: #fff;
  padding: 38px 24px 62px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, .92), rgba(139, 92, 246, .88));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.header::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 255, 255, .22), transparent 46%),
    radial-gradient(circle at 84% 30%, rgba(14, 165, 233, .3), transparent 46%);
  pointer-events: none;
}
.header h1, .header p, .header .inner { position: relative; z-index: 1; }
.header h1 { font-size: 26px; margin-bottom: 8px; letter-spacing: .3px; }
.header p { opacity: .92; font-size: 13.5px; }

/* 首页专用 Hero（更大、更深） */
/* 首页 Hero：底部留出空间，供下方玻璃卡片上浮叠压 */
.hero {
  position: relative;
  padding: 62px 24px 150px;
  text-align: center;
  color: #fff;
  background: var(--hero-grad);
}
/* 底部渐隐，让深色 hero 与页面背景自然衔接 */
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(180deg, transparent, transparent 60%, var(--hero-fade));
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  /* 光斑层：铺满 hero，圆角/裁剪不影响上浮的搜索框 */
  content: '';
  position: absolute; inset: 0;
  clip-path: inset(0);
  background:
    radial-gradient(circle at 16% 18%, rgba(99, 102, 241, .55), transparent 44%),
    radial-gradient(circle at 84% 24%, rgba(14, 165, 233, .45), transparent 44%),
    radial-gradient(circle at 52% 108%, rgba(139, 92, 246, .42), transparent 50%),
    radial-gradient(circle at 30% 60%, rgba(16, 185, 129, .22), transparent 46%);
  pointer-events: none;
  z-index: 0;
}
.hero .inner { position: relative; z-index: 2; }
.hero h1 {
  font-size: 38px; margin-bottom: 15px; letter-spacing: 1.5px;
  text-shadow: 0 2px 24px rgba(99, 102, 241, .5);
}
.hero p { opacity: .86; font-size: 15px; max-width: 580px; margin: 0 auto; line-height: 1.75; }

/* ---------- 5. 容器 ---------- */
/* 容器：向上叠压 hero 底部空白（z-index 高于 hero 背景） */
.container { max-width: 1200px; margin: -106px auto 60px; padding: 0 20px; position: relative; z-index: 2; }
.container.narrow { max-width: 920px; margin: -34px auto 44px; }

/* ---------- 6. 玻璃卡片（核心组件）---------- */
.card, .glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
/* 顶部高光描边：模拟玻璃厚度 */
.card::before, .glass::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  border-top: 1px solid rgba(255, 255, 255, .9);
  border-left: 1px solid rgba(255, 255, 255, .5);
  pointer-events: none;
}
.card { padding: 24px; }

/* ---------- 7. 顶部标签页 ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.tab {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: all .22s var(--ease);
  box-shadow: var(--shadow-s);
}
.tab:hover { border-color: rgba(99, 102, 241, .45); color: var(--primary); transform: translateY(-1px); }
.tab.active {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-indigo);
}

/* ---------- 8. 面板 ---------- */
.panel { display: none; }
.panel.active { display: block; animation: fade-up .34s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel h2 { font-size: 18px; margin-bottom: 10px; letter-spacing: -.2px; }

/* ---------- 9. 说明信息块 ---------- */
.info-box {
  background: var(--glass-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, .16);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.85;
}
.info-box .row-line { display: flex; gap: 8px; }
.info-box .k { color: var(--primary); font-weight: 600; flex-shrink: 0; min-width: 62px; }
.info-box .v { color: var(--text-2); }
.info-box .tip { color: var(--warn); }

/* ---------- 10. 拖拽上传区 ---------- */
.dropzone {
  border: 2px dashed rgba(120, 130, 170, .3);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .22s var(--ease);
  color: var(--muted);
  background: var(--glass-soft);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, .08);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .18);
}
.dropzone input { display: none; }
.dropzone .big { font-size: 15px; margin-bottom: 4px; }
.dropzone .small { font-size: 12px; opacity: .82; }

/* ---------- 11. 文件列表 ---------- */
.filelist { margin-top: 16px; }
.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.file-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.file-card.dragging { opacity: .4; }
.file-icon {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: rgba(99, 102, 241, .1);
}
.file-icon img { width: 100%; height: 100%; object-fit: cover; }
.file-icon .pdf-ico { font-size: 20px; }
.file-icon .ext-txt {
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.file-meta { flex: 1; min-width: 0; }
.file-meta .fname { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta .fsize { font-size: 11px; color: var(--muted); margin-top: 2px; }
.file-meta .fpages { font-size: 11px; color: var(--primary); margin-top: 2px; }
.file-ops { display: flex; align-items: center; gap: 4px; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 16px; padding: 4px 6px; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.del-btn { color: var(--danger); cursor: pointer; font-size: 16px; padding: 4px 6px; }
.order-num {
  font-size: 11px; color: var(--primary);
  background: rgba(99, 102, 241, .12);
  border-radius: 50%; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- 12. 按钮 ---------- */
.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.btn {
  background: linear-gradient(135deg, var(--primary), #7c6bf5);
  color: #fff; border: none; border-radius: 12px;
  padding: 12px 26px; font-size: 14px; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s;
  box-shadow: var(--shadow-indigo);
  font-weight: 500;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(99, 102, 241, .32); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.btn-ghost {
  background: var(--glass); color: var(--muted);
  border: 1px solid var(--border); box-shadow: var(--shadow-s);
}
.btn-ghost:hover { background: #fff; color: var(--text); transform: translateY(-1px); }

/* ---------- 13. 表单控件 ---------- */
input[type=number], input[type=text], input[type=password], select, textarea {
  border: 1px solid var(--border-line);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, .78);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
input[type=text], input[type=password], textarea { width: 190px; }
input[type=number] { width: 100px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}
label.inline { font-size: 13px; color: var(--text-2); }

/* ---------- 14. 状态提示 ---------- */
.status { margin-top: 14px; font-size: 14px; min-height: 20px; }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }

.spinner {
  display: none; width: 18px; height: 18px;
  border: 2px solid rgba(99, 102, 241, .25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.prog-bar { width: 100%; height: 6px; background: rgba(99, 102, 241, .12); border-radius: 4px; margin-top: 10px; overflow: hidden; display: none; }
.prog-bar .inner { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #8b5cf6); transition: width .2s; }

/* ---------- 15. 徽标与页脚 ---------- */
.badge {
  display: inline-block; background: rgba(16, 185, 129, .16);
  color: var(--success); font-size: 11px; padding: 2px 8px;
  border-radius: var(--radius-pill); margin-left: 6px;
}
/* Header 内的徽标位于深色/彩色底上，用统一的浅色玻璃底更清晰 */
.header .badge, .hero .badge {
  background: rgba(255, 255, 255, .2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
}
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; line-height: 1.8; }

/* 备案号：工信部要求「在网站首页底部显著位置标明」。
   单独一行、不缩小字号、带下划线，避免被判定为「刻意隐藏」。
   链接指向工信部备案查询系统（规定动作，rel 加 nofollow 不影响人工核查）。 */
.footer .icp { margin-top: 4px; font-size: 12px; }
.footer .icp a {
  color: var(--muted); text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.footer .icp a:hover { color: var(--text); border-bottom-style: solid; }

/* ---------- 15b. 页面下方说明区（SEO 可见文本 + 相关工具内链） ----------
   目的有二：搜索引擎要「页面里有字」才能判断主题；用户滑到底部时
   也能顺带看到下一个工具。默认折叠为三个 <details>，不占首屏。 */
.seo-block {
  max-width: 980px; margin: 28px auto 0; padding: 0 4px;
  font-size: 13.5px; color: var(--text); line-height: 1.85;
}
.seo-block h2 {
  font-size: 15px; margin: 0 0 2px; font-weight: 600; letter-spacing: -.1px;
}
.seo-block details {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--glass); margin-bottom: 10px; overflow: hidden;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.seo-block summary {
  cursor: pointer; padding: 13px 16px; font-size: 14px; font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.seo-block summary::-webkit-details-marker { display: none; }
.seo-block summary::after {
  content: "▾"; margin-left: auto; color: var(--muted); font-size: 12px;
  transition: transform .2s var(--ease);
}
.seo-block details[open] summary::after { transform: rotate(180deg); }
.seo-block .sd { padding: 0 16px 14px; color: var(--muted); }
.seo-block .sd p { margin: 0 0 8px; }
.seo-block .sd p:last-child { margin-bottom: 0; }
.seo-block .sd strong { color: var(--text); }
.seo-block ol, .seo-block ul { margin: 6px 0 10px; padding-left: 20px; }
.seo-block li { margin-bottom: 5px; }
.seo-block .faq-q { font-weight: 600; color: var(--text); margin: 12px 0 3px; }
.seo-block .faq-q:first-child { margin-top: 2px; }
.seo-related { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.seo-related a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-pill); font-size: 13px;
  text-decoration: none; color: var(--text);
  background: var(--glass-soft);
  border: 1px solid var(--border);
  transition: transform .16s var(--ease), border-color .16s;
}
.seo-related a:hover { transform: translateY(-1px); border-color: var(--primary); }
@media (max-width: 640px) {
  .seo-block { font-size: 13px; margin-top: 18px; padding-right: 50px; }
  .seo-block summary { padding: 12px 14px; }
  .seo-block .sd { padding: 0 14px 12px; }
}

/* ---------- 16. 返回链接 ---------- */
.back-link {
  position: absolute; left: 20px; top: 18px; z-index: 2;
  color: rgba(255, 255, 255, .9); text-decoration: none;
  font-size: 13px; padding: 7px 14px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .28);
  transition: background .2s, transform .2s var(--ease);
}
.back-link:hover { background: rgba(255, 255, 255, .28); transform: translateX(-2px); }

/* ---------- 17. 主题切换按钮 ---------- */
.theme-toggle {
  /* 右侧自上而下：版本徽标(12) → 主题按钮(52) → 反馈按钮(106) */
  position: fixed; right: 20px; top: 52px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  box-shadow: var(--shadow);
  font-size: 19px; line-height: 1;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
  padding: 0;
}
.theme-toggle:hover { transform: scale(1.08) rotate(-8deg); box-shadow: var(--shadow-l); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-toggle .ico-sun, .theme-toggle .ico-moon { display: none; }
[data-theme="light"] .theme-toggle .ico-moon { display: block; }
[data-theme="dark"] .theme-toggle .ico-sun { display: block; }

/* ---------- 18. 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 130, 170, .28);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, .5); background-clip: padding-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); background-clip: padding-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(129, 140, 248, .5); background-clip: padding-box; }

/* ---------- 19. 响应式 ---------- */
@media (max-width: 560px) {
  /* 小屏 Hero 收窄，让工具卡片尽快进入视野 */
  .hero { padding: 34px 18px 84px; }
  .hero h1 { font-size: 24px; }
  /* 副标题避开右侧固定的 版本徽标/主题/反馈 按钮列 */
  .hero p { font-size: 13.5px; line-height: 1.65; padding-right: 62px; }
  .header { padding: 32px 18px 56px; }
  .container { margin-top: -58px; padding: 0 12px; }
  .card { padding: 18px; border-radius: 18px; }
}

/* ---------- 20. 无障碍：尊重「减少动态效果」偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 21. 打印 ---------- */
@media print {
  body::before, body::after { display: none; }
  .card, .glass { background: #fff; box-shadow: none; backdrop-filter: none; }
}

/* ---------- 22. App 壳内（Capacitor / Android WebView）适配 ---------- */
/* 打包后的 App 自带图标与启动图，无需「安装到桌面」引导，也避免顶部重复留白 */
html.in-app-shell .pwa-bar { display: none !important; }
html.in-app-shell body { padding-top: env(safe-area-inset-top, 0); }
html.in-app-shell .header { padding-top: calc(32px + env(safe-area-inset-top, 0)); }

/* ---------- 23. 保存成功提示条（含「打开下载位置」按钮） ---------- */
.saved-bar {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 11px 14px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(34,197,94,.13), rgba(16,185,129,.09));
  border: 1px solid rgba(34,197,94,.32);
  animation: savedIn .3s cubic-bezier(.22,.61,.36,1);
}
@keyframes savedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.saved-bar .saved-ic { font-size: 15px; line-height: 1; }
.saved-bar .saved-txt { flex: 1; min-width: 140px; font-size: 13px; color: var(--text, #1f2430); font-weight: 600; }
.saved-bar .saved-txt #savedPath { font-weight: 400; color: var(--muted, #7a8299); font-size: 12px; }
.saved-bar .saved-btn {
  font-size: 12.5px; font-weight: 700; padding: 8px 14px; border-radius: 10px;
  cursor: pointer; border: none; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #22c55e, #10b981);
  box-shadow: 0 5px 14px rgba(34,197,94,.32); transition: .16s;
}
.saved-bar .saved-btn:hover { filter: brightness(1.06); }
[data-theme="dark"] .saved-bar .saved-txt { color: #e8ecf5; }

/* ==========================================================================
   24. 全站公告条（由 sitecopy 的 announce.* 驱动）
   网页版：服务端直接渲染；App 版：site-copy.js 动态插入。样式一致。
   ========================================================================== */
.site-announce {
  position: relative; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  max-width: 1180px; margin: 12px auto 0;
  padding: 10px 42px 10px 15px;
  font-size: 13px; line-height: 1.55;
  border-radius: 12px; border: 1px solid;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
}
.site-announce .sa-ic { flex-shrink: 0; font-size: 15px; }
.site-announce .sa-txt { flex: 1; color: var(--text); text-decoration: none; }
.site-announce a.sa-txt { text-decoration: underline; text-underline-offset: 2px; }
/* 版本号徽标：始终显示在信息栏右侧 */
.site-announce .sa-ver {
  flex-shrink: 0; margin-left: auto;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
  color: var(--muted); background: rgba(122,130,153,.14);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 无公告时：不保留横栏，改为右上角一枚小徽标（脱离文档流，不占位、不遮挡） */
.site-announce.sa-slim {
  position: fixed; top: 12px; right: 12px;
  left: auto; bottom: auto;
  max-width: none; width: auto; min-height: 0;
  margin: 0; padding: 3px 9px; gap: 0;
  border-color: transparent;
  background: rgba(122,130,153,.16);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: none;
  pointer-events: none;
}
.site-announce.sa-slim .sa-ic,
.site-announce.sa-slim .sa-txt,
.site-announce.sa-slim .sa-close { display: none !important; }
.site-announce.sa-slim .sa-ver { margin-left: 0; }
/* 有公告时恢复正常横栏布局，覆盖上面的 fixed */
.site-announce:not(.sa-slim) .sa-ver { margin-left: auto; }

/* 更新模式：App 里非最新版时常驻显示，优先级高于普通公告 */
.site-announce[data-type="update"] {
  border-color: rgba(99,102,241,.42); color: var(--c-doc);
  background: linear-gradient(90deg, rgba(99,102,241,.16), rgba(139,92,246,.10), var(--glass));
  box-shadow: 0 6px 22px rgba(99,102,241,.18);
}
.site-announce[data-type="update"] .sa-ic { font-size: 16px; }
.site-announce[data-type="update"] .sa-txt { font-size: 13px; }
.site-announce[data-type="update"] .sa-txt b { font-weight: 700; }
/* 「去下载」按钮：替代普通公告的关闭按钮位置 */
.site-announce .sa-close.sa-go {
  position: static; transform: none;
  width: auto; height: auto; padding: 5px 13px; border-radius: 999px;
  margin-left: 10px; flex-shrink: 0;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99,102,241,.34);
  white-space: nowrap;
}
.site-announce .sa-close.sa-go:hover {
  color: #fff; filter: brightness(1.08);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
/* 更新模式下整条栏需要右侧留白给按钮 */
.site-announce[data-type="update"] { padding-right: 15px; }

[data-theme="dark"] .site-announce[data-type="update"] { color: #c7cbff; }

.site-announce .sa-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 8px; cursor: pointer;
  border: none; background: transparent; color: var(--muted);
  font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, color .18s;
}
.site-announce .sa-close:hover { background: rgba(0,0,0,.06); color: var(--text); }

.site-announce[data-type="info"] {
  border-color: rgba(99,102,241,.28); color: var(--c-doc);
  background: linear-gradient(90deg, rgba(99,102,241,.09), var(--glass));
}
.site-announce[data-type="warn"] {
  border-color: rgba(245,158,11,.34); color: #b45309;
  background: linear-gradient(90deg, rgba(245,158,11,.12), var(--glass));
}
.site-announce[data-type="success"] {
  border-color: rgba(34,197,94,.30); color: #15803d;
  background: linear-gradient(90deg, rgba(34,197,94,.11), var(--glass));
}
[data-theme="dark"] .site-announce[data-type="info"] { color: #c7cbff; }
[data-theme="dark"] .site-announce[data-type="warn"] { color: #fcd486; }
[data-theme="dark"] .site-announce[data-type="success"] { color: #86efac; }
[data-theme="dark"] .site-announce .sa-close:hover { background: rgba(255,255,255,.1); }

/* 页脚里的低存在感管理入口 */
.admin-link {
  display: inline-block; margin-left: 8px;
  color: var(--muted); opacity: .38; text-decoration: none;
  font-size: 12px; transition: opacity .2s, transform .3s;
}
.admin-link:hover { opacity: 1; transform: rotate(60deg); }

@media (max-width: 560px) {
  .site-announce { margin: 10px 12px 0; font-size: 12.5px; }
}

/* ==========================================================================
   25. 管理面板 · 页面文案编辑器
   ========================================================================== */
.cf-row { margin-bottom: 14px; }
.cf-label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.cf-row input[type="text"], .cf-row textarea, .cf-row select {
  width: 100%; padding: 10px 12px; font-size: 13.5px;
  font-family: inherit; color: var(--text);
  border-radius: 10px; border: 1px solid var(--border-line);
  background: var(--glass-soft); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.cf-row textarea { resize: vertical; min-height: 54px; line-height: 1.55; }
.cf-row input:focus, .cf-row textarea:focus, .cf-row select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.cf-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.cf-bool { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cf-bool .cf-label { margin-bottom: 0; }
.cf-switch {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none;
}
.cf-switch input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

#pane-copy .card h2 { margin-bottom: 16px; }
#pane-copy .card { padding-bottom: 10px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ==========================================================================
   26. App 更新提示横条（仅 App 内置版出现）
   ========================================================================== */
.app-update-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px calc(11px);
  padding-top: calc(11px + env(safe-area-inset-top, 0px));
  background: linear-gradient(100deg, #4f46e5, #7c3aed 55%, #0ea5e9);
  color: #fff; font-size: 13px; line-height: 1.4;
  box-shadow: 0 6px 22px rgba(79, 70, 229, .34);
  animation: aubDrop .34s cubic-bezier(.22,.9,.3,1);
}
@keyframes aubDrop { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.app-update-bar .aub-ic { flex-shrink: 0; font-size: 17px; }
.app-update-bar .aub-txt { flex: 1; min-width: 0; }
.app-update-bar .aub-txt b { font-weight: 700; }
.app-update-bar .aub-go {
  flex-shrink: 0; padding: 7px 14px; border: none; border-radius: 9px;
  background: #fff; color: #4f46e5; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: transform .15s, opacity .2s;
}
.app-update-bar .aub-go:disabled { opacity: .72; cursor: default; }
.app-update-bar .aub-go:active { transform: scale(.96); }
.app-update-bar .aub-later {
  flex-shrink: 0; width: 26px; height: 26px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.18); color: #fff; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.app-update-bar .aub-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255,255,255,.26);
}
.app-update-bar .aub-bar {
  height: 100%; width: 3%; background: #fff;
  transition: width .3s ease;
}

.app-update-toast {
  position: fixed; left: 50%; bottom: 42px; transform: translate(-50%, 14px);
  z-index: 10000; max-width: 84vw;
  padding: 11px 18px; border-radius: 12px;
  background: rgba(23, 27, 45, .94); color: #fff; font-size: 13px;
  opacity: 0; transition: opacity .25s, transform .25s;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.app-update-toast.on { opacity: 1; transform: translate(-50%, 0); }
