/* ============================================================
   Cicada Studio · 工具箱共享设计系统
   设计基调与官网一致：深色画布 × 智能绿点缀 × 简洁卡片
   （tokens 完全对齐 assets/css/style.css，勿单方面改数值）
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* 色彩 */
  --bg-0: #070A0E;          /* 页面底色 */
  --bg-1: #0B0F14;          /* 主背景 */
  --bg-2: #10161E;          /* 卡片 */
  --bg-3: #17202B;          /* 卡片 hover */
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text-1: #EDF3F0;        /* 主文字 */
  --text-2: #A3B0BA;        /* 次要文字 */
  --text-3: #67727E;        /* 弱文字 */
  --green: #37E494;         /* 智能绿（主强调） */
  --green-deep: #14B877;
  --blue: #57A6FF;          /* 亮蓝（次强调） */
  --grad: linear-gradient(115deg, #37E494 0%, #57A6FF 100%);
  --glow-green: rgba(55, 228, 148, .18);
  --glow-blue: rgba(87, 166, 255, .14);
  --danger: #FF6B6B;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono", monospace;

  /* 间距（4px 基准） */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  /* 圆角 */
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-pill: 999px;

  /* 动效 */
  --ease-out: cubic-bezier(.22, .75, .28, 1);
  --t-fast: .18s var(--ease-out);
  --t-mid: .32s var(--ease-out);

  /* 布局 */
  --container: 1120px;
  --header-h: 64px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
svg { display: block; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: rgba(55, 228, 148, .28); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- 工具页头部 ---------- */
.tool-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  background: rgba(7, 10, 14, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.tool-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #04120B;
  box-shadow: 0 4px 18px var(--glow-green);
}

.brand-mark svg { width: 19px; height: 19px; }

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}

.brand-name .thin { color: var(--text-2); font-weight: 500; }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--text-2);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.back-link:hover {
  color: var(--text-1);
  border-color: var(--green);
  background: var(--glow-green);
}

/* ---------- 页面主体 ---------- */
.tool-main {
  flex: 1;
  padding: var(--sp-7) 0 var(--sp-8);
}

.page-head {
  margin-bottom: var(--sp-6);
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: var(--sp-3);
}
.page-kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.page-title {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: .5px;
}

.page-desc {
  margin-top: var(--sp-3);
  max-width: 640px;
  color: var(--text-2);
  font-size: 15.5px;
}

/* ---------- 卡片 / 面板 ---------- */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-6);
}

.panel + .panel { margin-top: var(--sp-5); }

.panel-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: var(--sp-5);
}

.step-badge {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--glow-green);
  border: 1px solid rgba(55, 228, 148, .35);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 13px;
  display: grid;
  place-items: center;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  border: 1px solid transparent;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad);
  color: #04120B;
  box-shadow: 0 6px 22px var(--glow-green);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(55, 228, 148, .3); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text-1);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--green); background: var(--glow-green); }

.btn-subtle {
  background: var(--bg-3);
  border-color: var(--line);
  color: var(--text-2);
}
.btn-subtle:hover { color: var(--text-1); border-color: var(--line-strong); }

.btn-danger-ghost {
  border-color: var(--line-strong);
  color: var(--text-2);
}
.btn-danger-ghost:hover { color: var(--danger); border-color: var(--danger); }

.btn-sm { padding: 7px 14px; font-size: 13.5px; border-radius: 9px; }

.btn .icon { width: 16px; height: 16px; }

/* ---------- 表单控件 ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }

.field-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .3px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.input,
.select {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text-1);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--text-3); }
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(55, 228, 148, .16);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3B0BA' stroke-width='2'%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;
}

/* 滑杆 */
.range-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex: 1;
  min-width: 220px;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(to right, var(--green) var(--fill, 50%), var(--bg-3) var(--fill, 50%));
  outline: none;
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #EDF3F0;
  border: 3px solid var(--green-deep);
  box-shadow: 0 2px 10px rgba(55, 228, 148, .35);
  cursor: grab;
  transition: transform var(--t-fast);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #EDF3F0;
  border: 3px solid var(--green-deep);
  box-shadow: 0 2px 10px rgba(55, 228, 148, .35);
  cursor: grab;
}
.range::-moz-range-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: transparent;
}

.range-value {
  flex: none;
  min-width: 52px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  background: var(--glow-green);
  border: 1px solid rgba(55, 228, 148, .28);
  border-radius: 8px;
  padding: 3px 8px;
}

/* 颜色选择 */
.color-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
}
.color-input {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.color-input::-webkit-color-swatch-wrapper { padding: 3px; }
.color-input::-webkit-color-swatch { border: none; border-radius: 5px; }
.color-input::-moz-color-swatch { border: none; border-radius: 5px; }
.color-hex {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- 拖放上传区 ---------- */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-1);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--green);
  background: rgba(55, 228, 148, .06);
  box-shadow: inset 0 0 40px var(--glow-green);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto var(--sp-4);
  border-radius: var(--r-md);
  background: var(--glow-green);
  border: 1px solid rgba(55, 228, 148, .3);
  display: grid;
  place-items: center;
  color: var(--green);
}
.drop-icon svg { width: 26px; height: 26px; }

.drop-title { font-size: 16px; font-weight: 600; }
.drop-title em {
  font-style: normal;
  color: var(--green);
  border-bottom: 1px dashed rgba(55, 228, 148, .5);
  padding-bottom: 1px;
}
.drop-sub { margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* ---------- 文件行 ---------- */
.file-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.file-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--t-fast);
}
.file-row:hover { border-color: var(--line-strong); }

.file-thumb {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-3);
  border: 1px solid var(--line);
}

.file-meta { flex: 1; min-width: 0; }
.file-name {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sub {
  font-size: 12.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.file-status { font-size: 12.5px; margin-top: 3px; }
.file-status.ok { color: var(--green); }
.file-status.err { color: var(--danger); }
.file-status.busy { color: var(--blue); }

.file-actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  border: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { color: var(--text-1); border-color: var(--line-strong); background: var(--bg-3); }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(255, 107, 107, .4); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- 进度条 ---------- */
.progress {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--grad);
  transition: width .25s var(--ease-out);
}

/* ---------- 徽标 / 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: .4px;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
}
.tag.green {
  color: var(--green);
  border-color: rgba(55, 228, 148, .35);
  background: var(--glow-green);
}
.tag.blue {
  color: var(--blue);
  border-color: rgba(87, 166, 255, .35);
  background: var(--glow-blue);
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: rgba(4, 6, 9, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--t-mid);
}
.modal.show { display: flex; }
.modal.visible { opacity: 1; }

.modal-body {
  position: relative;
  max-width: min(860px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  transform: scale(.96);
  transition: transform var(--t-mid);
}
.modal.visible .modal-body { transform: scale(1); }

.modal-body img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
}

.modal-caption {
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  display: grid;
  place-items: center;
  transition: background var(--t-fast), transform var(--t-fast);
}
.modal-close:hover { background: var(--danger); border-color: var(--danger); transform: rotate(90deg); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: rgba(16, 22, 30, .92);
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-mid), transform var(--t-mid);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: rgba(55, 228, 148, .45); }
.toast.err { border-color: rgba(255, 107, 107, .5); }

/* ---------- 页脚 ---------- */
.tool-footer {
  border-top: 1px solid var(--line);
  padding: var(--sp-6) 0;
  color: var(--text-3);
  font-size: 13px;
}
.tool-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.tool-footer a:hover { color: var(--green); }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--t-mid), transform var(--t-mid),
              color var(--t-fast), border-color var(--t-fast);
}
.back-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-top:hover { color: var(--green); border-color: var(--green); }

/* ---------- 进场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

html.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 工具箱首页 ---------- */
.hub-hero {
  position: relative;
  padding: calc(var(--header-h) + var(--sp-8)) 0 var(--sp-7);
  overflow: hidden;
}
.hub-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 120%;
  background:
    radial-gradient(42% 55% at 22% 30%, var(--glow-green), transparent 70%),
    radial-gradient(38% 50% at 78% 20%, var(--glow-blue), transparent 72%);
  pointer-events: none;
}

.hub-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgba(16, 22, 30, .6);
  font-size: 12.5px;
  letter-spacing: .12em;
  font-family: var(--font-mono);
  color: var(--text-2);
}
.hub-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.hub-title {
  position: relative;
  margin-top: var(--sp-5);
  font-size: clamp(32px, 5.4vw, 54px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 1px;
}
.hub-title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-sub {
  position: relative;
  margin-top: var(--sp-4);
  max-width: 620px;
  color: var(--text-2);
  font-size: 16.5px;
}

/* 工具卡片 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  padding-bottom: var(--sp-8);
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform var(--t-mid), border-color var(--t-mid), box-shadow var(--t-mid);
  overflow: hidden;
}
.tool-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--grad);
  opacity: 0;
  transition: opacity var(--t-mid);
}
.tool-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(55, 228, 148, .12);
}
.tool-card:hover::after { opacity: 1; }

.tool-card .card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--glow-green);
  border: 1px solid rgba(55, 228, 148, .28);
}
.tool-card .card-icon.blue {
  color: var(--blue);
  background: var(--glow-blue);
  border-color: rgba(87, 166, 255, .3);
}
.tool-card .card-icon.mix {
  background: linear-gradient(135deg, var(--glow-green), var(--glow-blue));
  color: var(--text-1);
  border-color: var(--line-strong);
}
.tool-card .card-icon svg { width: 25px; height: 25px; }

.tool-card h2 { font-size: 19px; font-weight: 700; }
.tool-card .card-tagline { margin-top: 4px; font-size: 13px; color: var(--green); font-family: var(--font-mono); letter-spacing: .6px; }
.tool-card .card-text { margin-top: var(--sp-3); color: var(--text-2); font-size: 14.5px; flex: 1; }

.card-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.card-enter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.card-enter svg { width: 15px; height: 15px; transition: transform var(--t-fast); }
.tool-card:hover .card-enter { color: var(--green); }
.tool-card:hover .card-enter svg { transform: translateX(4px); }

/* ---------- 通用业务组件（跨工具复用，见 docs/UI.md） ---------- */

/* 勾选组：导出字段 / 选项开关 */
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.check-pill:hover { border-color: var(--line-strong); }
.check-pill input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}
.check-pill:has(input:checked) {
  border-color: rgba(55, 228, 148, .5);
  background: var(--glow-green);
  color: var(--text-1);
}

/* 说明条目列表 */
.rule-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.rule-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.75;
}
.rule-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.rule-list strong { color: var(--text-1); }

/* 数据表格（生成结果等） */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}
.data-table th,
.data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .4px;
  background: var(--bg-3);
  position: sticky;
  top: 0;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(55, 228, 148, .05); }
.data-table td.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* 信息卡网格（PDF 信息 / 算法说明等） */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
}
.info-card {
  padding: var(--sp-4);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.info-card .info-label {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .4px;
}
.info-card .info-value {
  margin-top: 5px;
  font-size: 16px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 预览卡片网格（PDF 页预览等） */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}
.preview-item {
  padding: var(--sp-3);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: center;
}
.preview-item canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
}
.preview-item .page-number {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* 大号输出框（生成的密码 / 导出预览等） */
.output-box {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 15px;
  word-break: break-all;
}
.output-box .output-text { flex: 1; min-width: 0; }

/* 对话框面板（表单类弹窗，区别于图片 lightbox 的 .modal-body） */
.modal-card {
  position: relative;
  width: min(600px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  text-align: left;
  overflow-y: auto;
  transform: scale(.96);
  transition: transform var(--t-mid);
}
.modal.visible .modal-card { transform: scale(1); }
.modal-card .modal-close { top: var(--sp-4); right: var(--sp-4); }
.modal-card h3 { font-size: 17px; margin: 0; }
.modal-card .drop-sub { margin: var(--sp-1) 0 0; }

/* 代码预览框（导出预览等多行只读文本） */
.code-box {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-0);
  overflow: hidden;
}
.code-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.code-box-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .3px;
}
.code-box-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.code-area {
  width: 100%;
  min-height: 168px;
  max-height: 42vh;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  resize: none;
  outline: none;
  overflow: auto;
}
.code-area::placeholder { color: var(--text-3); }

/* 结果行列表（多条结果 + 单条复制，配合 code-box 外壳使用） */
.result-list {
  display: flex;
  flex-direction: column;
  max-height: 42vh;
  overflow-y: auto;
}
.result-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 7px var(--sp-4);
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast);
}
.result-row:last-child { border-bottom: none; }
.result-row:hover { background: var(--bg-2); }
.result-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-1);
  white-space: nowrap;
  overflow-x: auto;
  user-select: all;
}
.result-empty {
  margin: 0;
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-3);
}

/* 开关（toggle switch） */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch .track {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--t-fast), background var(--t-fast);
}
.switch input:checked + .track {
  background: rgba(55, 228, 148, .25);
  border-color: var(--green);
}
.switch input:checked + .track::after {
  transform: translateX(18px);
  background: var(--green);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-main { padding: var(--sp-6) 0 var(--sp-7); }
  .panel { padding: var(--sp-5) var(--sp-4); }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 28px); }
  .brand-name { font-size: 15px; }
  .back-link span { display: none; }
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-end; }
}
