/* ============================================================
   PDF助手 - 全局样式 main.css
   设计原则：CSS 变量驱动主题、移动优先、组件化类名（pz- 前缀）
   响应式断点：<768px 手机(2列) / 768-1023px 平板(3列) / ≥1024px 桌面(4-5列)
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --brand-soft: rgba(79, 70, 229, .1);

  --c-convert: #f59e0b;   /* 转换类 */
  --c-edit: #2563eb;      /* 编辑类 */
  --c-security: #ef4444;  /* 安全类 */
  --c-extract: #10b981;   /* 提取类 */
  --c-organize: #8b5cf6;  /* 重组类 */
  --c-forms: #ec4899;     /* 表单类 */
  --c-misc: #6b7280;      /* 辅助类 */

  --bg: #f6f7fb;
  --bg-card: #ffffff;
  --bg-elev: #ffffff;
  --bg-hover: #f1f3f9;
  --bg-inset: #eef0f6;
  --border: #e5e8f0;
  --border-strong: #d5daea;

  --text-1: #111528;
  --text-2: #4b5265;
  --text-3: #8a90a5;

  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(17, 21, 40, .05), 0 1px 6px rgba(17, 21, 40, .04);
  --shadow: 0 6px 24px -8px rgba(17, 21, 40, .12), 0 2px 6px rgba(17, 21, 40, .05);
  --shadow-lg: 0 24px 60px -16px rgba(17, 21, 40, .22);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;

  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-1);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { max-width: 100%; vertical-align: middle; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text-1); }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

.app-main { flex: 1; outline: none; padding-bottom: 48px; }

/* 图标尺寸工具 */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-xs { width: 13px; height: 13px; }
.ic-lg { width: 26px; height: 26px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-card) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-1); font-weight: 800; font-size: 18px; }
.brand-text em { display: block; font-style: normal; font-weight: 500; font-size: 11px; color: var(--text-3); letter-spacing: .04em; line-height: 1.1; }
.brand-mark { display: inline-flex; filter: drop-shadow(0 2px 6px rgba(79, 70, 229, .35)); }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.hot-wrap { position: relative; }
@media (max-width: 1180px) { .brand-text em { display: none; } }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; font-weight: 600;
  border: 0; background: transparent; cursor: pointer;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-link.active { color: var(--text-2); background: var(--bg-hover); }

/* 所有导航文字统一使用同一颜色与字重 */
.nav-link-strong { color: var(--text-2); font-weight: 600; }
.nav-link {
  position: relative;
  transition: color .2s ease, background .2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s ease;
}
.nav-link:hover::after,
.nav-link.active::after,
.mega-trigger.open::after { transform: scaleX(1); }

/* ---------- Mega 菜单（按内容宽度显示） ---------- */
.mega-trigger.open { background: var(--bg-hover); color: var(--text-1); }
.mega-trigger .ic { transition: transform .22s ease; }
.mega-trigger.open .ic { transform: rotate(180deg); }
.nav-link .ic-xs { margin-left: 2px; }

.mega-panel {
  position: absolute; top: 100%; left: 50%; right: auto; z-index: 90;
  width: max-content; max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  animation: megaIn .18s ease;
  max-height: calc(100vh - var(--header-h) - 16px);
  overflow-y: auto;
}
@keyframes megaIn { from { opacity: 0; transform: translate(-50%, -6px); } }
.mega-inner {
  padding: 18px 20px 22px; display: grid; gap: 16px;
  grid-template-columns: repeat(4, minmax(140px, max-content));
}
@media (min-width: 1100px) {
  .mega-inner { grid-template-columns: repeat(5, minmax(140px, max-content)); }
}
@media (min-width: 1340px) {
  .mega-inner { grid-template-columns: repeat(7, minmax(140px, max-content)); }
}

/* 热门工具面板：定位到“热门PDF工具”按钮下方，并按内容收缩宽度 */
.hot-panel {
  left: 0;
  transform: none;
  top: calc(100% + 0px);
}
.hot-inner {
  width: max-content; max-width: calc(100vw - 72px); margin-inline: 0;
  grid-template-columns: repeat(2, max-content); gap: 2px;
}

.mm-head {
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  color: var(--text-3); margin-bottom: 10px;
}
.mm-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; margin-bottom: 2px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--text-1); cursor: pointer;
}
.mm-item:hover { background: var(--bg-hover); }
.mm-item.active { color: var(--brand); background: var(--brand-soft); }
.mm-item .mm-icon {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--ic, var(--brand));
  background: color-mix(in srgb, var(--ic, var(--brand)) 14%, transparent);
}
.mm-item .mm-icon .ic { width: 15px; height: 15px; }

/* 移动端抽屉内的扁平分类列表（桌面隐藏） */
.mobile-nav-list { display: none; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-1); cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--brand); }
.icon-btn.open { background: var(--bg-hover); color: var(--brand); }

/* ---------- 右上角弹出面板（最近工具 / 最近文档） ---------- */
.pop-wrap { position: relative; }
.pop-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 95;
  width: 320px; max-width: calc(100vw - 24px);
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; overflow: hidden auto;
  animation: megaIn .16s ease;
}
.pop-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px 6px; font-size: 13px; font-weight: 800; color: var(--text-3);
}
.pop-clear {
  border: 0; background: transparent; color: var(--text-3);
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.pop-clear:hover { background: var(--bg-hover); color: var(--err); }
.pop-list { max-height: min(60vh, 420px); overflow: auto; }
.pop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; color: var(--text-1); font-size: 13px;
}
.pop-item:hover { background: var(--bg-hover); }
.pop-item .pi-icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); background: var(--brand-soft);
}
.pop-item .pi-body { flex: 1; min-width: 0; }
.pop-item .pi-name {
  font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.pop-item .pi-meta { color: var(--text-3); font-size: 11.5px; display: block; }
.pop-item .pi-dl {
  flex: none; width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: transparent; color: var(--text-3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pop-item .pi-dl:hover { background: var(--bg-hover); color: var(--ok); }
.pop-empty { padding: 26px 14px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* 主题图标：仅显示当前模式对应的图标（日间/夜间） */
.theme-icon-light, .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: block; }
html[data-theme="dark"] .theme-icon-dark { display: block; }

.nav-toggle { display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px -6px rgba(79, 70, 229, .5); }
.btn-primary:hover:not([disabled]) { box-shadow: 0 10px 26px -6px rgba(79, 70, 229, .65); }
.btn-outline { background: var(--bg-card); border-color: var(--border-strong); color: var(--text-1); }
.btn-outline:hover:not([disabled]) { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }
.btn-danger { background: #fee2e2; color: var(--err); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 56px;
  background:
    radial-gradient(700px 320px at 15% 0%, rgba(124, 58, 237, .14), transparent 60%),
    radial-gradient(700px 320px at 85% 10%, rgba(79, 70, 229, .16), transparent 60%),
    radial-gradient(520px 260px at 50% 100%, rgba(236, 72, 153, .07), transparent 65%);
}
.hero-inner { text-align: center; max-width: 780px; margin-inline: auto; }
.hero h1 {
  font-size: clamp(30px, 5vw, 46px); font-weight: 900; letter-spacing: -.02em;
  margin-bottom: 14px;
}
.hero h1 .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-2); font-size: clamp(15px, 2vw, 17px); margin-bottom: 26px; }

.privacy-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(22, 163, 74, .09); color: var(--ok);
  font-weight: 700; font-size: 13.5px; margin-bottom: 26px;
  border: 1px solid rgba(22, 163, 74, .25);
}

/* 搜索框 */
.search-box { position: relative; max-width: 640px; margin: 0 auto 18px; }
.search-box .ic-search { position: absolute; left: 18px; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.search-input {
  width: 100%; padding: 16px 96px 16px 48px;
  font-size: 15.5px; border-radius: 999px;
  border: 1.5px solid var(--border-strong); outline: none;
  background: var(--bg-card); color: var(--text-1);
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }
.search-kbd {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%;
  font-size: 11px; color: var(--text-3); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 2px 7px; background: var(--bg-inset);
}
.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; text-align: left;
}
.search-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; color: var(--text-1); }
.search-item:hover, .search-item.sel { background: var(--bg-hover); }
.search-item b { color: var(--brand); }
.search-empty { padding: 14px 16px; color: var(--text-3); font-size: 13.5px; }

.hot-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.hot-chips .chip-label { color: var(--text-3); font-size: 13px; align-self: center; margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 统计条 */
.stats-row { display: flex; justify-content: center; gap: clamp(20px, 6vw, 72px); margin-top: 38px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat b { display: block; font-size: clamp(20px, 3vw, 28px); font-weight: 900; color: var(--text-1); font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-3); font-size: 12.5px; }

/* ---------- 通用 section ---------- */
.section { padding: 44px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(19px, 2.6vw, 25px); font-weight: 800; letter-spacing: -.01em; margin: 0; }
.section-head p { color: var(--text-3); font-size: 13.5px; margin: 0; }

/* ---------- 工具卡片网格 ---------- */
.tool-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.tool-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .tool-grid, .tool-grid.cols-5 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .tool-grid.cols-5 { grid-template-columns: repeat(5, 1fr); } .tool-grid { grid-template-columns: repeat(4, 1fr); } }

.tool-card {
  position: relative; display: block;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px 16px;
  color: var(--text-1); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .22s ease, border-color .2s;
  overflow: hidden;
}
.tool-card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: var(--cat-color, var(--brand));
  opacity: 0; transition: opacity .2s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--cat-color, var(--brand)) 45%, var(--border)); }
.tool-card:hover::after { opacity: 1; }
.tool-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cat-color, var(--brand));
  background: color-mix(in srgb, var(--cat-color, var(--brand)) 12%, transparent);
  margin-bottom: 12px;
}
.tool-name { font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.tool-desc { color: var(--text-3); font-size: 12.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge-hot {
  position: absolute; top: 12px; right: 12px;
  font-size: 10.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  padding: 2px 8px; border-radius: 999px;
}

/* 分类组（首页） */
.cat-group { margin-bottom: 34px; }
.cat-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cat-group-head .cat-dot { width: 12px; height: 12px; border-radius: 4px; }
.cat-group-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.cat-group-head small { color: var(--text-3); font-weight: 500; }

/* 特色优势条 */
.trust-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 36px; }
@media (min-width: 900px) { .trust-strip { grid-template-columns: repeat(4, 1fr); } }
.trust-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.trust-item .ic { color: var(--brand); margin-top: 2px; }
.trust-item b { display: block; font-size: 14px; }
.trust-item span { font-size: 12.5px; color: var(--text-3); }

/* 步骤 */
.steps { display: grid; gap: 14px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-grad); color: #fff; font-weight: 900; font-size: 14px;
  margin-bottom: 12px;
}
.step b { display: block; margin-bottom: 4px; font-size: 15px; }
.step p { color: var(--text-3); font-size: 13px; margin: 0; }

/* FAQ 手风琴 */
.faq-list { display: grid; gap: 10px; max-width: 820px; }
details.faq {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 18px; box-shadow: var(--shadow-sm);
}
details.faq summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: 14.5px;
  padding: 15px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .ic { transition: rotate .2s; color: var(--text-3); }
details.faq[open] summary .ic { rotate: 180deg; }
details.faq .faq-a { color: var(--text-2); font-size: 13.5px; padding: 0 0 15px; }

/* 最近处理 */
.history-list { display: grid; gap: 10px; }
.history-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: var(--radius);
}
.history-item .hi-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .hi-meta { color: var(--text-3); font-size: 12px; }

/* ---------- 面包屑 ---------- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 18px 0 4px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--brand); }
.crumbs .ic { width: 13px; height: 13px; }
.crumbs .cur { color: var(--text-1); font-weight: 600; }

/* ---------- 工具页 ---------- */
.tz-head { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0 18px; }
.tz-head .tool-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0; }
.tz-title { font-size: clamp(22px, 3.4vw, 30px); font-weight: 900; letter-spacing: -.01em; margin: 0 0 6px; }
.tz-desc { color: var(--text-2); font-size: 14.5px; margin: 0; }
.tz-note {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--brand-soft); color: var(--brand);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  margin: 0 0 18px;
}
.tz-note.warn { background: rgba(217, 119, 6, .1); color: var(--warn); }
.tz-note .ic { margin-top: 2px; }

.tz-layout { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .tz-layout { grid-template-columns: 340px 1fr; align-items: start; } }

.tz-layout > * { min-width: 0; }

.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 20px;
  min-width: 0;
  overflow: hidden;
}
.panel h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* 上传拖拽区 */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg-card); padding: 44px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}
.dropzone:hover { border-color: var(--brand); }
.dropzone.dragging {
  border-color: var(--brand); background: var(--brand-soft);
  transform: scale(1.01); box-shadow: inset 0 0 0 1px var(--brand);
}
.dz-icon {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.dz-icon .ic { width: 30px; height: 30px; }
.dz-title { font-weight: 800; font-size: 16px; margin-bottom: 6px; }
.dz-hint { color: var(--text-3); font-size: 13px; }
.dz-hint kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--bg-inset); }

/* 文件列表 */
.file-list { display: grid; gap: 10px; margin-top: 14px; max-height: min(56vh, 640px); overflow: auto; padding-right: 2px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  transition: box-shadow .2s, opacity .2s;
}
.file-item.drag-over { box-shadow: 0 0 0 2px var(--brand); }
.fi-thumb {
  width: 52px; height: 66px; border-radius: 8px; object-fit: cover;
  background: var(--bg-inset); border: 1px solid var(--border); flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--text-3);
}
.fi-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.fi-info { flex: 1; min-width: 0; }
.fi-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-meta { color: var(--text-3); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.fi-meta .enc { color: var(--err); font-weight: 700; }
.fi-acts { display: flex; align-items: center; gap: 2px; }
.fi-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); cursor: pointer;
}
.fi-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.fi-btn.del:hover { background: #fee2e2; color: var(--err); }
.fi-order { color: var(--text-3); font-size: 12px; font-weight: 800; width: 18px; text-align: center; }
.grip { cursor: grab; touch-action: none; }
.list-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.list-foot .sum { color: var(--text-3); font-size: 12.5px; }

/* 参数表单 */
.opt-field { margin-bottom: 16px; }
.opt-field > label, .opt-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 13.5px; margin-bottom: 8px; color: var(--text-1); }
.opt-field .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.opt-input, .opt-select, .opt-textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--border-strong); background: var(--bg-card); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.opt-input:focus, .opt-select:focus, .opt-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.opt-input.err { border-color: var(--err); }
.field-err { color: var(--err); font-size: 12px; margin-top: 5px; }
.seg-group { display: grid; gap: 6px; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-inset); padding: 4px; border-radius: 11px; }
.seg-item {
  border: 0; background: transparent; padding: 8px 6px; border-radius: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.seg-item.on { background: var(--bg-card); color: var(--brand); box-shadow: var(--shadow-sm); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.range-val { min-width: 46px; text-align: center; font-weight: 800; font-size: 13px; color: var(--brand); font-variant-numeric: tabular-nums; }
.chk-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.chk-row input { width: 17px; height: 17px; accent-color: var(--brand); }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] { width: 42px; height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px; background: var(--bg-card); cursor: pointer; }

/* 九宫格位置选择器 */
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; width: 132px; }
.pos-cell { aspect-ratio: 1.35; border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--bg-card); cursor: pointer; padding: 0; }
.pos-cell.on { background: var(--brand); border-color: var(--brand); box-shadow: 0 2px 8px -2px rgba(79, 70, 229, .6); }

/* 进度区 */
.progress-wrap { margin-top: 18px; display: none; }
.progress-wrap.show { display: block; }
.progress-bar { height: 12px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--brand-grad); transition: width .25s ease;
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 10px, transparent 10px 20px);
  animation: stripe 1s linear infinite;
}
@keyframes stripe { to { background-position: 28px 0; } }
.progress-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.run-row { display: flex; gap: 10px; margin-top: 18px; }

/* 结果区 */
.result-wrap { margin-top: 18px; display: none; }
.result-wrap.show { display: block; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.result-head .ok-line { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 800; }
.result-list { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .result-list { grid-template-columns: 1fr 1fr; } }
.result-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; background: var(--bg-card);
  animation: pop .25s ease both;
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.result-item .ri-ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(22,163,74,.1); color: var(--ok); display: flex; align-items: center; justify-content: center; flex: none; }
.result-item .ri-info { flex: 1; min-width: 0; }
.result-item .ri-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-item .ri-size { color: var(--text-3); font-size: 12px; }
.result-item .ri-acts { display: flex; gap: 4px; }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 12, 24, .55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--bg-elev); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: min(860px, 100%);
  max-height: min(88vh, 900px); display: flex; flex-direction: column;
  animation: rise .22s ease;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head b { font-size: 15px; }
.modal-body { padding: 18px; overflow: auto; }
.viewer-stage { display: grid; place-items: center; background: #525659; border-radius: 12px; min-height: 300px; padding: 14px; }
.viewer-stage canvas { max-width: 100%; height: auto; box-shadow: 0 4px 20px rgba(0,0,0,.4); background: #fff; }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 12px; color: var(--text-2); font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.table-preview { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.table-preview th, .table-preview td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-preview th { background: var(--bg-inset); }

/* 签名板 */
.sign-pad { border: 2px dashed var(--border-strong); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; width: 100%; }

/* 编辑器画布容器 */
.editor-stage { position: relative; display: grid; place-items: center; background: var(--bg-inset); border-radius: 12px; padding: 14px; user-select: none; }
.editor-stage canvas.page-cv { box-shadow: var(--shadow); background: #fff; max-width: 100%; height: auto; cursor: crosshair; }
.edit-ghost {
  position: absolute; pointer-events: none;
  background: rgba(79, 70, 229, .18); border: 1.5px dashed var(--brand);
  border-radius: 4px; font-size: 12px; color: var(--brand); font-weight: 800;
  display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 2px;
}
.edit-chip-list { display: grid; gap: 8px; margin-top: 12px; }
.edit-chip { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: var(--bg-inset); padding: 7px 10px; border-radius: 9px; }
.edit-chip .ec-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 页面缩略图网格（创建表单/页面选择） */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.thumb-cell { border: 2px solid var(--border-strong); border-radius: 9px; overflow: hidden; cursor: pointer; position: relative; background: #fff; }
.thumb-cell.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.thumb-cell .tn-no { position: absolute; top: 4px; left: 4px; background: rgba(17,21,40,.75); color: #fff; border-radius: 5px; font-size: 10.5px; padding: 0 5px; }

/* 字段行表格（创建表单） */
.mini-table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.mini-table th, .mini-table td { border-bottom: 1px solid var(--border); padding: 7px 6px; text-align: left; }
.mini-table input, .mini-table select { width: 100%; min-width: 60px; padding: 5px 7px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--bg-card); }

/* 元数据展示 */
.meta-table { width: 100%; font-size: 13.5px; border-collapse: collapse; }
.meta-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.meta-table td:first-child { color: var(--text-3); width: 40%; font-weight: 600; }

/* 比较结果图 */
.diff-img { width: 100%; border: 1px solid var(--border); border-radius: 10px; }

/* 查看器搜索面板 */
.viewer-search { display: flex; gap: 8px; padding-bottom: 12px; }
.vsearch-hit { padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 12.5px; border: 1px solid var(--border); margin-bottom: 6px; background: var(--bg-card); }
.vsearch-hit:hover { border-color: var(--brand); }
.vsearch-hit mark { background: rgba(245, 158, 11, .4); border-radius: 3px; padding: 0 2px; }

/* Toast */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; translate: -50% 0; z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 9px;
  background: #1c2033; color: #f3f5ff; padding: 11px 18px;
  border-radius: 12px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
  max-width: min(92vw, 480px);
}
.toast.ok { background: #103c22; color: #bbf7d0; }
.toast.err { background: #43141a; color: #fecaca; }
.toast.warn { background: #3f2c0c; color: #fde68a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.toast.out { opacity: 0; transition: opacity .3s; }

/* 静态内容页 */
.doc-page { max-width: 780px; margin: 0 auto; padding: 30px 0; }
.doc-page h1 { font-size: 27px; font-weight: 900; }
.doc-page h2 { font-size: 19px; margin-top: 28px; }
.doc-page p, .doc-page li { color: var(--text-2); font-size: 14.5px; }
.doc-page ul { list-style: disc; padding-left: 22px; }

/* 404 */
.nf-wrap { text-align: center; padding: 80px 20px; }
.nf-code { font-size: 88px; font-weight: 900; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* 相关工具 */
.related-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .related-grid { grid-template-columns: repeat(4, 1fr); } }

/* CTA */
.cta-band {
  margin-top: 48px; border-radius: var(--radius-lg); padding: 34px 28px; text-align: center;
  background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-lg);
}
.cta-band h3 { font-size: 21px; margin-bottom: 8px; }
.cta-band p { opacity: .85; font-size: 14px; margin-bottom: 18px; }
.cta-band .btn { background: #fff; color: var(--brand); }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; padding: 36px 0 20px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-col h4 { font-size: 13.5px; margin-bottom: 12px; color: var(--text-1); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: var(--text-3); font-size: 13px; }
.footer-col ul a:hover { color: var(--brand); }
.footer-about p { color: var(--text-3); font-size: 12.5px; margin: 10px 0 0; }
.footer-badge { color: var(--ok) !important; font-weight: 600; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding: 14px 0 20px;
  color: var(--text-3); font-size: 12px;
}

/* ---------- 移动端导航 ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; top: var(--header-h); right: 0; z-index: 99;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-elev); border-left: 1px solid var(--border);
    width: min(78vw, 300px); height: calc(100vh - var(--header-h));
    padding: 14px; box-shadow: var(--shadow-lg);
    transform: translateX(105%); transition: transform .25s ease;
    overflow-y: auto;
  }
  .main-nav.open { transform: none; }
  .mega-panel { display: none !important; }
  .mega-trigger { display: none; }
  .main-nav > .nav-link,
  .hot-wrap > .nav-link { text-align: left; }
  .mobile-nav-list {
    display: grid; gap: 2px;
    padding-top: 12px; margin-top: 8px;
    border-top: 1px solid var(--border);
  }
  .mobile-nav-list .mm-head { margin: 14px 10px 6px; }
  .mobile-nav-list .mm-item { padding: 9px 10px; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 0 40px; }
  .panel { padding: 15px; }
  .tz-head { gap: 12px; }
  .dropzone { padding: 32px 14px; }
}
