/* ==========================================================================
   PDF工具箱 · 设计系统
   --------------------------------------------------------------------------
   目录：
     1. CSS 变量与重置
     2. 布局容器
     3. 按钮 / 表单
     4. 卡片
     5. 顶部导航
     6. Hero 区
     7. 工具宫格
     8. 工具详情页
     9. 上传区 / 页面选择器
    10. 认证页
    11. 个人中心 / 充值 / 订单
    12. Toast / 弹窗 / 空状态
    13. Footer
    14. 响应式
   ========================================================================== */

/* ========================================================== 1. 变量与重置 */

:root {
  /* 主色：靛蓝 → 紫罗兰，工具类产品的稳重感 */
  --brand-from: #4f46e5;
  --brand-to: #7c3aed;
  --brand: #5b52e8;
  --brand-dark: #4338ca;
  --brand-light: #eef2ff;
  --brand-glow: rgba(79, 70, 229, .18);
  --brand-ring: rgba(79, 70, 229, .12);

  /* 辅助色 */
  --ok: #10b981;
  --ok-light: #ecfdf5;
  --warn: #f59e0b;
  --warn-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #0ea5e9;
  --info-light: #f0f9ff;

  /* 文字 */
  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-inv: #ffffff;

  /* 背景与描边 */
  --bg: #f6f8fc;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --line: #e6ebf3;
  --line-2: #d5dcea;

  /* 圆角 */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* 阴影 */
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .06);
  --sh: 0 4px 16px rgba(15, 23, 42, .07);
  --sh-lg: 0 12px 40px rgba(15, 23, 42, .10);
  --sh-cta: 0 6px 20px rgba(79, 70, 229, .28);

  /* 尺寸 */
  --header-h: 64px;
  --container: 1360px;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  /* 任何意外的宽度溢出都不该让用户左右拖动页面（手机上尤其烦人）。
     html 与 body 都要设：只设html 在部分浏览器里不生效。 */
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > .container,
body > main { flex: 1 0 auto; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

::selection { background: var(--brand-glow); color: var(--brand-dark); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ========================================================== 2. 布局容器 */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }

.section-head { margin-bottom: 32px; }
.section-head.is-center { text-align: center; }
.section-title {
  font-size: 28px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title svg { width: 26px; height: 26px; color: var(--brand); flex-shrink: 0; }
.section-desc { color: var(--text-2); font-size: 15px; max-width: 640px; }
.section-head.is-center .section-desc { margin: 0 auto; }

@media (min-width: 1600px) {
  :root { --container: 1520px; }
}
/* 1920 及以上再放宽一档：留白约 140px，
   既不浪费横向空间，又不至于让一行文字拉得太长不好读。 */
@media (min-width: 1920px) {
  :root { --container: 1640px; }
}
@media (min-width: 2240px) {
  :root { --container: 1760px; }
}

/* ========================================================== 3. 按钮 / 表单 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease),
    background .18s var(--ease), opacity .18s var(--ease), border-color .18s var(--ease);
  user-select: none;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  color: var(--text-inv);
  box-shadow: var(--sh-cta);
}
.btn-primary:hover { color: var(--text-inv); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(79,70,229,.34); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-sm);
}
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-light); }

.btn-soft { background: var(--brand-light); color: var(--brand-dark); }
.btn-soft:hover { background: #e0e7ff; color: var(--brand-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-lg { padding: 14px 34px; font-size: 16.5px; border-radius: var(--r); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }

.btn:disabled, .btn.is-loading { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }

.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::after, .btn-soft.is-loading::after { border-color: rgba(79,70,229,.3); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  /* 16px 以下 iOS Safari 聚焦会自动放大页面 */
  font-size: 16px;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  appearance: none;
}
.form-textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-input:disabled { background: var(--bg-soft); color: var(--text-3); cursor: not-allowed; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
  cursor: pointer;
}

.form-hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }

.input-group { display: flex; gap: 10px; align-items: stretch; }
.input-group .form-input { flex: 1; min-width: 0; }
.input-group .btn { flex-shrink: 0; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* 复选/单选 */
.check-line { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check-line input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }

/* 验证码输入框（算术验证） */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.captcha-q {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.captcha-box input {
  width: 92px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
  outline: none;
  background: var(--surface);
}
.captcha-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.captcha-refresh { color: var(--text-3); font-size: 13px; padding: 4px; }
.captcha-refresh:hover { color: var(--brand); }

/* ========================================================== 4. 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sh);
}
.card-tight { padding: 20px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.panel-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h3 { font-size: 16.5px; }
.panel-head .panel-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.panel-body { padding: 24px; }

/* ========================================================== 5. 顶部导航 */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

/* 登录 / 注册按钮
 *
 * ⚠️ 这里必须显式给 flex-shrink: 0。
 *    窄屏下 .header-actions 空间不足，按钮会被 flex 压扁 —— 文字被挤成
 *    竖排、紫色渐变拉成长条，就是"按钮太丑"的真正原因，不是配色问题。
 */
.btn-login {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}
.btn-register {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  color: var(--text-inv);
  box-shadow: 0 3px 10px rgba(79, 70, 229, .26);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn-register:hover {
  color: var(--text-inv);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, .32);
}
.btn-register:active { transform: translateY(0); }

.logo { display: flex; align-items: center; gap: 10px; color: var(--text-1); flex-shrink: 0; }
.logo:hover { color: var(--text-1); }
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, .3);
}
.logo-mark svg { width: 19px; height: 19px; }
.logo-text { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  transition: all .18s var(--ease);
}
.nav a:hover { background: var(--brand-light); color: var(--brand-dark); }
.nav a.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.btn-vip {
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: #b45309;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  box-shadow: 0 2px 8px rgba(245, 158, 11, .2);
}
.btn-vip:hover { color: #92400e; box-shadow: 0 4px 14px rgba(245, 158, 11, .3); }
.btn-vip.is-vip {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--text-1);
  transition: background .18s var(--ease);
}
.user-chip:hover { background: var(--brand-light); color: var(--text-1); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.user-name { font-size: 14px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 19px; height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 98;
}
.nav-mask.is-show { display: block; }

/* ========================================================== 6. Hero 区 */

.hero {
  position: relative;
  padding: 64px 0 36px;
  overflow: hidden;
  background:
    radial-gradient(1000px 380px at 15% -10%, rgba(124, 58, 237, .13), transparent 60%),
    radial-gradient(800px 320px at 88% 0%, rgba(79, 70, 229, .13), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.hero::after {
  /* 细网格纹理，增加质感但不影响可读性 */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 70, 229, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 70, 229, .035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 15px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--sh-sm);
  margin-bottom: 22px;
}
.hero-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.hero-title {
  font-size: clamp(30px, 5.2vw, 50px);
  font-weight: 900;
  letter-spacing: -.035em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-1) 30%, var(--brand-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--text-2);
  max-width: 660px;
  margin: 0 auto 30px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 34px;
}
.hero-stat { text-align: center; }
.hero-stat .num {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.hero-stat .lbl { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* 快捷入口 */
.quick-tools {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quick-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 17px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh-sm);
  transition: all .18s var(--ease);
}
.quick-tool:hover {
  color: var(--brand-dark);
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--sh);
}
.quick-tool svg { width: 16px; height: 16px; }

/* 信任条 */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 18px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.trust-item { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 13.5px; }
.trust-item svg { width: 16px; height: 16px; color: var(--ok); }

/* ========================================================== 7. 工具宫格 */

/* 分类区块间距。
 * 第一个区块紧跟 hero，hero 已经有 36px 下边距了，
 * 再叠一层 34px 会让首屏下方空出一大片（看起来像"内容没加载出来"）。
 * 所以用 :first-of-type 把第一个的上边距去掉。 */
.cat-section { padding: 30px 0; }
.cat-section + .cat-section { padding-top: 0; }
main.container > .cat-section:first-of-type { padding-top: 8px; }

.cat-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}
.cat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cat-icon svg { width: 24px; height: 24px; }
.cat-icon.c-blue   { background: #eff6ff; color: #2563eb; }
.cat-icon.c-red    { background: #fef2f2; color: #dc2626; }
.cat-icon.c-orange { background: #fff7ed; color: #ea580c; }
.cat-icon.c-purple { background: #f5f3ff; color: #7c3aed; }
.cat-icon.c-teal   { background: #f0fdfa; color: #0d9488; }
.cat-icon.c-green  { background: #f0fdf4; color: #16a34a; }
.cat-title { font-size: 21px; }
.cat-count { font-size: 13px; color: var(--text-3); font-weight: 400; margin-top: 1px; }

.tool-grid {
  display: grid;
  /* 218px 是「Word转PDF」这类较长名字能完整显示的下限。
     原来 178px 偏窄，名字被压缩成一团（用户反馈"功能有点挤"）。 */
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  min-height: 76px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text-1);
  transition: all .2s var(--ease);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.tool-card:hover {
  color: var(--text-inv);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(79, 70, 229, .22);
}
.tool-card:hover::before { opacity: 1; }
.tool-card > * { position: relative; z-index: 1; }

.tool-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s var(--ease);
}
/* 内联 SVG 图标（includes/icon.php 输出）
 *
 * 图标原本用 <img src="xx.svg"> 加载，但颜色写死在 SVG 内部
 * （stroke="#ed3e45"），外部 CSS 完全管不到 —— 悬停变白做不到，
 * 也没法跟随分类色。改成内联后统一由 CSS 控制：
 *   · 默认用 currentColor，跟随所在容器的 color
 *   · 描边色统一成一个 CSS 变量，分类卡可各自覆盖
 */
.ico {
  display: block;
  flex-shrink: 0;
  stroke: currentColor;
  overflow: visible;
}
.ico [stroke]:not([stroke="none"]) { stroke: currentColor; }
.ico [fill]:not([fill="none"]):not([fill="transparent"]) {
  /* SVG 里少数图标用 fill 上色（如圆形背景块），保留原色但淡化一点 */
  opacity: .16;
  fill: currentColor;
}

.tool-icon svg, .tool-icon img { width: 26px; height: 26px; }
.tool-icon .ico { color: var(--brand); }
.tool-card:hover .tool-icon .ico,
.tool-card:hover .tool-icon svg [stroke] { color: #fff; stroke: #fff; }

/* 工具卡片 */
.tool-card.is-off .ico { opacity: .5; }
.tool-card:hover .tool-icon { background: rgba(255, 255, 255, .22); }
.tool-icon svg [stroke] { transition: stroke .2s var(--ease); }
.tool-card:hover .tool-icon svg [stroke] { stroke: #fff; }

.tool-info { min-width: 0; flex: 1; }
.tool-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  /* 允许两行：卡片加宽后大多数名字能完整显示，
     特别长的（如"OCR文字识别（表格）"）最多占两行且带省略号，
     不会被硬切成半个词。 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.tool-sub {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
  margin-top: 1px;
}
.tool-card:hover .tool-sub { color: rgba(255, 255, 255, .82); }

.tool-card.is-off { opacity: .62; }
.tool-card.is-off:hover { transform: none; box-shadow: var(--sh-sm); }
.tool-card.is-off:hover::before { opacity: 0; }

/* 搜索 */
.search-bar { position: relative; margin-bottom: 28px; }
.search-bar input {
  width: 100%;
  padding: 14px 46px 14px 46px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 15px;
  outline: none;
  box-shadow: var(--sh-sm);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search-bar input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.search-bar .s-icon {
  position: absolute; left: 17px; top: 50%;
  transform: translateY(-50%);
  width: 19px; height: 19px;
  color: var(--text-3);
  pointer-events: none;
}
.search-hint { text-align: center; color: var(--text-3); font-size: 13.5px; margin-top: 12px; }
.search-hint b { color: var(--brand); }

/* ========================================================== 8. 工具详情页 */

.tool-page { padding: 28px 0 60px; }
.crumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; color: var(--text-3);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.crumb a { color: var(--text-3); }
.crumb a:hover { color: var(--brand); }
.crumb .sep { color: var(--line-2); }

.tool-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  margin-bottom: 22px;
}
.tool-hero-icon {
  width: 58px; height: 58px;
  border-radius: 15px;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tool-hero-icon svg { width: 32px; height: 32px; }
.tool-hero-info { flex: 1; min-width: 0; }
.tool-hero-title { font-size: 24px; margin-bottom: 6px; }
.tool-hero-desc { color: var(--text-2); font-size: 14.5px; }
.tool-hero-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  padding: 3px 11px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}

.tool-layout { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.tool-main { min-width: 0; }
.tool-side { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 960px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; }
}

.work-panel { padding: 26px; }

/* ========================================================== 9. 上传区 / 页面选择 */

.dropzone {
  border: 2px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: 44px 24px;
  text-align: center;
  background: var(--bg);
  transition: all .2s var(--ease);
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--brand);
  background: var(--brand-light);
}
.dropzone.is-drag { transform: scale(1.01); }
.dropzone input[type=file] { display: none; }
.dropzone-icon {
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, .28);
}
.dropzone-icon svg { width: 30px; height: 30px; }
.dropzone-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.dropzone-desc { color: var(--text-3); font-size: 13.5px; }
.dropzone-desc b { color: var(--brand); }

/* 上传进度 */
.upload-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.upload-item + .upload-item { margin-top: 10px; }
.file-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--danger-light);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 11px; font-weight: 800;
}
.file-icon.is-img { background: var(--info-light); color: var(--info); }
.file-meta { flex: 1; min-width: 0; }
.file-name {
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-size { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.file-del { color: var(--text-3); padding: 6px; border-radius: 6px; flex-shrink: 0; }
.file-del:hover { color: var(--danger); background: var(--danger-light); }
.file-del svg { width: 17px; height: 17px; }

.progress {
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to));
  border-radius: 3px;
  transition: width .3s var(--ease);
  width: 0;
}
.progress-bar.is-indeterminate {
  width: 40% !important;
  animation: indeterminate 1.2s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* 页面选择器 */
.page-selector { margin-top: 20px; }
.page-selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.page-selector-title { font-size: 15px; font-weight: 600; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-actions .btn { padding: 6px 13px; font-size: 13px; }

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--r);
  border: 1px solid var(--line);
}
.page-cell {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.page-cell:hover { border-color: var(--brand-light); transform: translateY(-2px); box-shadow: var(--sh); }
.page-cell.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.page-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #fff;
}
.page-thumb.is-empty { display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; }
.page-num {
  position: absolute;
  top: 6px; left: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: rgba(15, 23, 42, .74);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.page-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all .16s var(--ease);
}
.page-check svg { width: 13px; height: 13px; }
.page-cell.is-selected .page-check { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 排序列表（拖拽） */
.sort-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.sort-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: grab;
  transition: all .16s var(--ease);
}
.sort-item:hover { border-color: var(--brand); box-shadow: var(--sh-sm); }
.sort-item.is-drag { opacity: .45; border-style: dashed; }
.sort-item.is-over { border-color: var(--brand); background: var(--brand-light); }
.sort-handle { color: var(--text-3); flex-shrink: 0; cursor: grab; }
.sort-handle svg { width: 16px; height: 16px; }
.sort-thumb {
  width: 34px; height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #fff;
}
.sort-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; }
.sort-pos {
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
}

/* 九宫格位置选择器 */
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 168px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.pos-cell {
  padding: 7px 2px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-2);
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.pos-cell:hover { border-color: var(--brand); color: var(--brand-dark); }
.pos-cell.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* 处理按钮条 */
.action-bar {
  position: sticky;
  bottom: 0;
  margin-top: 22px;
  padding: 16px 0 4px;
  background: linear-gradient(180deg, transparent, var(--surface) 30%);
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 5;
}
.action-bar .btn { flex: 1; }
.action-bar .btn-aux { flex-shrink: 0; }
.action-meta { font-size: 13px; color: var(--text-3); margin-right: auto; }

/* 处理状态 */
.process-box {
  margin-top: 22px;
  padding: 22px;
  background: var(--brand-light);
  border: 1px solid #dbe0ff;
  border-radius: var(--r);
  text-align: center;
}
.process-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.spinner {
  width: 38px; height: 38px;
  margin: 0 auto 14px;
  border: 3px solid var(--brand-glow);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.process-msg { color: var(--text-2); font-size: 14px; margin-top: 10px; }

/* 结果 */
.result-box {
  margin-top: 22px;
  padding: 22px;
  background: var(--ok-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--r);
}
.result-title {
  display: flex; align-items: center; gap: 9px;
  color: #047857;
  font-size: 16px; font-weight: 700;
  margin-bottom: 6px;
}
.result-title svg { width: 21px; height: 21px; }
.result-desc { color: #065f46; font-size: 13.5px; margin-bottom: 16px; }
.result-files { display: flex; flex-direction: column; gap: 9px; }
.result-file {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid #d1fae5;
}

.error-box {
  margin-top: 22px;
  padding: 18px;
  background: var(--danger-light);
  border: 1px solid #fecaca;
  border-radius: var(--r);
  color: #b91c1c;
  font-size: 14px;
  display: flex; align-items: flex-start; gap: 10px;
}
.error-box svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }

/* 侧栏信息 */
.side-info { padding: 20px; }
.side-title { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }
.side-list li {
  display: flex; gap: 9px;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.side-list li svg { width: 15px; height: 15px; color: var(--ok); flex-shrink: 0; margin-top: 4px; }

.quota-card { padding: 18px; }
.quota-num {
  font-size: 30px; font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.quota-num.is-vip { background: linear-gradient(135deg, #f59e0b, #d97706); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.quota-label { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.quota-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.quota-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-from), var(--brand-to)); border-radius: 3px; }

/* 相关工具 */
.rel-grid { display: flex; flex-direction: column; gap: 7px; }
.rel-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  transition: all .16s var(--ease);
}
.rel-item:hover { background: var(--brand-light); color: var(--brand-dark); }
.rel-item svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ========================================================== 10. 认证页 */

.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  background:
    radial-gradient(900px 380px at 20% 0%, rgba(124, 58, 237, .12), transparent 60%),
    radial-gradient(760px 320px at 82% 10%, rgba(79, 70, 229, .12), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 428px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--sh-lg);
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .logo-mark { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px; }
.auth-brand .logo-mark svg { width: 28px; height: 28px; }
.auth-title { font-size: 22px; margin-bottom: 6px; }
.auth-desc { color: var(--text-3); font-size: 14px; }

.auth-tabs {
  display: flex;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  transition: all .18s var(--ease);
}
.auth-tab.is-active { background: var(--surface); color: var(--brand-dark); box-shadow: var(--sh-sm); }

.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}
.auth-foot a { font-weight: 600; }
.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 13.5px;
}

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-3);
  font-size: 12.5px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.benefit-list { display: flex; flex-direction: column; gap: 11px; margin-top: 20px; }
.benefit-item { display: flex; gap: 9px; font-size: 13.5px; color: var(--text-2); }
.benefit-item svg { width: 17px; height: 17px; color: var(--brand); flex-shrink: 0; margin-top: 2px; }

.auth-alert {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: none;
}
.auth-alert.is-show { display: block; }
.auth-alert.is-error { background: var(--danger-light); color: #b91c1c; border: 1px solid #fecaca; }
.auth-alert.is-warn { background: var(--warn-light); color: #92400e; border: 1px solid #fde68a; }
.auth-alert.is-info { background: var(--info-light); color: #075985; border: 1px solid #bae6fd; }

/* 登录侧边装饰 */
.auth-wrap { display: grid; grid-template-columns: 1fr 428px; gap: 40px; align-items: center; max-width: 1000px; width: 100%; }
.auth-promo { padding-right: 20px; }
.auth-promo h2 { font-size: 32px; margin-bottom: 14px; letter-spacing: -.03em; }
.auth-promo h2 em { font-style: normal; color: var(--brand); }
.auth-promo p { color: var(--text-2); margin-bottom: 26px; line-height: 1.75; }
.auth-feature { display: flex; gap: 12px; margin-bottom: 18px; }
.auth-feature-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--brand-light);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-feature-icon svg { width: 20px; height: 20px; }
.auth-feature h4 { font-size: 14.5px; margin-bottom: 2px; }
.auth-feature p { font-size: 13px; color: var(--text-3); margin: 0; }

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-promo { display: none; }
}

/* ========================================================== 11. 个人中心 / 充值 */

.page-head { padding: 30px 0 8px; }
.page-title { font-size: 27px; margin-bottom: 6px; }
.page-sub { color: var(--text-2); font-size: 14.5px; }

.user-layout { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; padding-bottom: 60px; }
@media (max-width: 880px) { .user-layout { grid-template-columns: 1fr; } }

.user-nav { padding: 10px; position: sticky; top: calc(var(--header-h) + 20px); }
@media (max-width: 880px) { .user-nav { position: static; display: flex; overflow-x: auto; gap: 4px; } }
.user-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14.5px;
  white-space: nowrap;
  transition: all .16s var(--ease);
}
.user-nav a svg { width: 17px; height: 17px; }
.user-nav a:hover { background: var(--bg-soft); color: var(--text-1); }
.user-nav a.is-active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }

.user-card-top {
  display: flex; align-items: center; gap: 15px;
  padding: 22px;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  color: #fff;
  border-radius: var(--r-lg);
  margin-bottom: 18px;
}
.user-card-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 700;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .3);
}
.user-card-name { font-size: 18px; font-weight: 700; }
.user-card-sub { font-size: 13px; opacity: .88; margin-top: 2px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-tile {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.stat-tile .num {
  font-size: 25px; font-weight: 800; color: var(--brand);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.stat-tile .num.is-gold { color: var(--warn); }
.stat-tile .lbl { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* 套餐 */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.plan-card {
  position: relative;
  padding: 26px 22px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  text-align: center;
  transition: all .2s var(--ease);
  cursor: pointer;
}
.plan-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--sh-lg); }
.plan-card.is-hot { border-color: var(--brand); }
.plan-card.is-active { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 0 0 4px var(--brand-ring); }
.plan-flag {
  position: absolute;
  top: -11px; left: 50%;
  transform: translateX(-50%);
  padding: 3px 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--warn), #ea580c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.plan-name { font-size: 15.5px; font-weight: 600; color: var(--text-2); }
.plan-price { margin: 12px 0 4px; }
.plan-price .sym { font-size: 17px; font-weight: 700; color: var(--text-1); vertical-align: super; }
.plan-price .num { font-size: 40px; font-weight: 900; color: var(--text-1); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-per { font-size: 12.5px; color: var(--text-3); }
.plan-benefit {
  margin: 16px 0 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--text-2);
  text-align: left;
  line-height: 1.7;
}

/* 支付方式 */
.pay-methods { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.pay-method {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 22px;
  border: 2px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: all .18s var(--ease);
  font-weight: 500;
}
.pay-method:hover { border-color: var(--brand-light); }
.pay-method.is-active { border-color: #1677ff; background: #f0f7ff; color: #1677ff; }
.pay-method svg { width: 21px; height: 21px; }

.pay-qr {
  text-align: center;
  padding: 24px;
  background: var(--bg);
  border-radius: var(--r);
  border: 1px solid var(--line);
}
.pay-qr img { width: 210px; height: 210px; margin: 0 auto 14px; border-radius: var(--r-sm); background: #fff; padding: 8px; }
.pay-status { font-size: 14px; color: var(--text-2); margin-top: 10px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-soft);
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.data-table th:first-child { border-radius: 8px 0 0 8px; }
.data-table th:last-child { border-radius: 0 8px 8px 0; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-soft);
  color: var(--text-2);
}
.badge-ok { background: var(--ok-light); color: #047857; }
.badge-warn { background: var(--warn-light); color: #b45309; }
.badge-danger { background: var(--danger-light); color: #b91c1c; }
.badge-brand { background: var(--brand-light); color: var(--brand-dark); }

/* ========================================================== 12. Toast / 弹窗 / 空状态 */

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.94);
  background: rgba(15, 23, 42, .94);
  color: #fff;
  padding: 13px 26px;
  border-radius: var(--r);
  font-size: 14.5px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: min(88vw, 420px);
  text-align: center;
  line-height: 1.6;
  backdrop-filter: blur(8px);
  box-shadow: var(--sh-lg);
}
.toast.is-show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.is-success { background: rgba(16, 185, 129, .95); }
.toast.is-error { background: rgba(239, 68, 68, .95); }
.toast.is-warn { background: rgba(245, 158, 11, .95); }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-mask.is-show { display: flex; }
.modal-box {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sh-lg);
  max-height: 86vh;
  overflow-y: auto;
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(12px); } }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-title { font-size: 18px; }
.modal-close { color: var(--text-3); padding: 4px; border-radius: 6px; flex-shrink: 0; }
.modal-close:hover { color: var(--text-1); background: var(--bg-soft); }
.modal-close svg { width: 19px; height: 19px; }
.modal-body { color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.modal-foot { display: flex; gap: 10px; margin-top: 22px; }
.modal-foot .btn { flex: 1; }

/* 空状态 */
.empty-state { padding: 54px 20px; text-align: center; }
.empty-icon {
  width: 66px; height: 66px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.empty-title { font-size: 16.5px; margin-bottom: 7px; }
.empty-desc { color: var(--text-3); font-size: 14px; margin-bottom: 18px; }

/* ========================================================== 13. Footer */

.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 46px 0 22px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }

/* 手机端：原来 520px 以下直接塌成单列，5 个区块竖着排，
   实测 footer 高达 985px —— 要滑 4 屏才够，很不友好。
   改成两列：品牌区仍独占整行（简介较长），其余 4 组两两并排，
   高度直接砍掉一半以上。 */
@media (max-width: 520px) {
  .footer { padding: 30px 0 16px; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px 16px;
    padding-bottom: 22px;
  }
  /* 品牌区（logo + 简介 + 徽章）跨整行 */
  .footer-grid .footer-brand { grid-column: 1 / -1; margin-bottom: 2px; }
  .footer-col h4 { margin-bottom: 10px; font-size: 13.5px; }
  .footer-col li { margin-bottom: 7px; }
  .footer-col a, .footer-col span { font-size: 13px; }
  .footer-desc { font-size: 13px; margin-bottom: 12px; }
  .footer-qr img { width: 80px; height: 80px; }
  .footer-qr { margin-top: 10px; }
}

.footer-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.footer-desc { font-size: 13.5px; color: #94a3b8; line-height: 1.7; margin-bottom: 14px; }
.footer-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.footer .badge { background: rgba(255, 255, 255, .08); color: #cbd5e1; font-size: 11.5px; }

.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-col li { margin-bottom: 9px; }
.footer-col a, .footer-col span { color: #94a3b8; font-size: 13.5px; }
.footer-col a:hover { color: #fff; }

.footer-qr { margin-top: 14px; text-align: left; }
.footer-qr img { width: 96px; height: 96px; border-radius: 10px; background: #fff; padding: 5px; }
.footer-qr span { display: block; font-size: 12px; color: #64748b; margin-top: 5px; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding-top: 20px;
  font-size: 13px;
  color: #64748b;
}
/* 手机端版权行：改为上下居中，别让备案号和链接挤在一起 */
@media (max-width: 520px) {
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding-top: 16px;
    font-size: 12.5px;
  }
  .footer-links { gap: 16px; }
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: #64748b; }
.footer-links a:hover { color: #cbd5e1; }

/* ========================================================== 14. 响应式 */

@media (max-width: 1024px) {
  .nav a { padding: 8px 11px; font-size: 14px; }
}

@media (max-width: 860px) {
  :root { --header-h: 58px; }

  .nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: var(--sh-lg);
    padding: 14px;
    width: 218px;
    transform: translateX(100%);
    /* 收起时禁用点击：元素还在文档流里（translate 不影响布局计算），
       不加这条的话，鼠标移到屏幕右侧会"点到"看不见的菜单项。
       visibility 方案更彻底，但会引入过渡时序问题（读到的值可能在中间态），
       而且一旦过渡异常菜单就永久点不开 —— 这里选更稳的 pointer-events。 */
    pointer-events: none;
    transition: transform .25s var(--ease);
    z-index: 99;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav.is-open { transform: translateX(0); pointer-events: auto; }
  .nav a { padding: 11px 14px; border-radius: var(--r-sm); }

  .nav-toggle { display: flex; }
  .user-name { display: none; }
  .header-inner { gap: 14px; }

  .hero { padding: 42px 0 34px; }
  .hero-stats { gap: 26px; }
  .section { padding: 38px 0; }
  .section-title { font-size: 23px; }

  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .tool-card { padding: 13px; gap: 10px; }
  .tool-icon { width: 34px; height: 34px; border-radius: 9px; }
  .tool-icon svg { width: 19px; height: 19px; }
  .tool-name { font-size: 14px; }

  .tool-hero { padding: 20px; gap: 14px; }
  .tool-hero-icon { width: 48px; height: 48px; border-radius: 13px; }
  .tool-hero-icon svg { width: 26px; height: 26px; }
  .tool-hero-title { font-size: 20px; }

  .work-panel, .card, .panel-body { padding: 20px; }
  .dropzone { padding: 32px 18px; }

  .page-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }

  .auth-card { padding: 26px 22px; }

  .trust-bar { gap: 18px; font-size: 12.5px; }
  .footer { padding: 34px 0 18px; }
}

@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 27px; }
  .btn { padding: 10px 18px; }
  .btn-lg { padding: 13px 24px; font-size: 15.5px; }
  .user-card-top { padding: 18px; }
  .stat-tile { padding: 14px; }
  .plan-price .num { font-size: 34px; }
  .page-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 打印（结果页预览时可打印） */
@media print {
  .header, .footer, .action-bar, .tool-side, .nav-mask { display: none !important; }
  body { background: #fff; }
  .card, .panel { box-shadow: none; border: 1px solid #ddd; }
}
/* ========================================================== 站点公告
 * 后台「公告管理」启用后显示在导航栏下方。
 * 服务端已渲染好 HTML，这里只管交互样式与轮播。
 */
.notice-bar {
  background: linear-gradient(90deg, #eef2ff, #f5f3ff 50%, #eef2ff);
  border-bottom: 1px solid #e0e7ff;
  overflow: hidden;
}
.notice-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.notice-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: var(--r-pill);
  padding: 2px 9px;
}
.notice-tag svg { width: 13px; height: 13px; }

.notice-viewport {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 42px;
}
.notice-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-1);
  text-decoration: none;
  font-size: 13.5px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .32s var(--ease), transform .32s var(--ease), visibility .32s;
  pointer-events: none;
}
.notice-item.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.notice-item strong {
  font-weight: 600;
  flex-shrink: 0;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-text {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-item:hover strong { color: var(--brand); }

.notice-arrow,
.notice-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.notice-arrow:hover,
.notice-close:hover { background: #fff; color: var(--brand); }
.notice-arrow svg,
.notice-close svg { width: 15px; height: 15px; }

@media (max-width: 720px) {
  .notice-inner { padding: 0 16px; }
  .notice-text { display: none; }
  .notice-item strong { max-width: 100%; }
}

/* ========================================================== 算术人机验证（v1.0.3 重做）
 * 之前只有「题面 + 答案框 + 换一题」，界面上**没有任何能触发 verify() 的按钮**，
 * 用户填完答案点注册一律被拦。现在补上「确认」按钮，并按状态切换配色。
 */
.captcha-box {
  position: relative;
  flex-wrap: wrap;
  row-gap: 8px;
}
.captcha-input {
  width: 88px !important;
  flex-shrink: 0;
}
.captcha-ok {
  flex-shrink: 0;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.captcha-ok:hover:not(:disabled) { background: var(--brand-dark); }
.captcha-ok:disabled { opacity: .55; cursor: not-allowed; }

.captcha-state {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}

/* 已通过：整块变绿 */
.captcha-box[data-state="ok"] {
  background: #f0fdf4;
  border-color: #86efac;
}
.captcha-box[data-state="ok"] .captcha-q { color: #15803d; }
.captcha-box[data-state="ok"] .captcha-ok { background: #16a34a; }
.captcha-box[data-state="ok"] .captcha-state { color: #15803d; }

/* 验证中：题面转灰 + 按钮禁用 */
.captcha-box[data-state="checking"] { opacity: .8; }
.captcha-box[data-state="checking"] .captcha-q { color: var(--text-3); }

/* 答错：转红 */
.captcha-box[data-state="error"] {
  background: #fef2f2;
  border-color: #fca5a5;
}
.captcha-box[data-state="error"] .captcha-q { color: #b91c1c; }
.captcha-box[data-state="error"] .captcha-state { color: #b91c1c; }

/* 加载中 */
.captcha-box[data-state="loading"] { opacity: .7; }

@media (max-width: 480px) {
  .captcha-input { width: 72px !important; }
  .captcha-ok { padding: 0 12px; }
}

/* ========================================================== 公告条（v1.0.3 调整）
 * 用户反馈"公告开启后怎么会有一个大图标" —— 那个喇叭 SVG 标签在 42px 高的条里
 * 显得很突兀。已去掉图标，只留一个纯文字的「公告」小标签。
 */
.notice-tag {
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* ---------------------------------------------------------------- 公告弹窗 */
.notice-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.notice-modal.is-show { display: flex; }
.notice-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  animation: noticeFade .2s var(--ease);
}
.notice-modal-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: noticePop .22s var(--ease);
}
@keyframes noticeFade { from { opacity: 0; } }
@keyframes noticePop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.notice-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.notice-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
}
.notice-modal-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  background: var(--bg-soft);
  color: var(--text-3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.notice-modal-close:hover { background: #fee2e2; color: #dc2626; }
.notice-modal-close svg { width: 16px; height: 16px; }

.notice-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.notice-modal-body:empty::before {
  content: '（公告内容为空）';
  color: var(--text-3);
}

.notice-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

@media (max-width: 560px) {
  .notice-modal { padding: 16px; }
  .notice-modal-box { max-height: 84vh; }
}
