/* ============================================================
   在线工具集 · PDF 转长图
   ============================================================ */

.tools-page {
  --ink: #10172a;
  --ink-soft: #43506b;
  --muted: #7a859c;
  --line: rgba(32, 38, 68, 0.09);
  --violet: #7c3aed;
  --violet-deep: #5b21b6;
  --indigo: #4f46e5;
  --cyan: #0891b2;
  --green: #0f9f6e;
  --surface: #ffffff;
  --surface-soft: #f8f7fc;
  --radius-lg: 24px;
  --shadow-card: 0 18px 50px rgba(43, 35, 80, 0.08);
  background:
    radial-gradient(1100px 620px at 10% -8%, rgba(139, 92, 246, 0.15), transparent 62%),
    radial-gradient(900px 580px at 98% 8%, rgba(56, 189, 248, 0.13), transparent 60%),
    linear-gradient(160deg, #fbfaff 0%, #f4f7ff 45%, #f8faff 100%);
  color: var(--ink);
  min-height: 100vh;
}

.tools-page [hidden] {
  display: none !important;
}

/* 编辑图片/PDF 时隐藏客服浮窗，避免遮挡裁切框和操作按钮 */
.tools-page.is-tool-editing .chat-floater {
  display: none;
}

.tools-page .svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.tools-page .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: -0.16em;
}

.tools-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tool-aura {
  position: fixed;
  pointer-events: none;
  filter: blur(110px);
  border-radius: 50%;
  z-index: 0;
  opacity: 0.55;
}

.tool-aura-1 {
  width: 520px;
  height: 520px;
  top: 120px;
  right: -180px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.26), transparent 68%);
}

.tool-aura-2 {
  width: 460px;
  height: 460px;
  top: 760px;
  left: -220px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.2), transparent 68%);
}

.tools-main {
  position: relative;
  z-index: 1;
  padding-bottom: 12px;
}

.tools-container {
  max-width: 1460px;
  padding: 0 40px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 26px;
  font-size: 13px;
  color: #8a92a6;
}

.breadcrumb a {
  color: #6d768c;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--violet); }
.breadcrumb strong { color: #3e475c; font-weight: 600; }
.breadcrumb span { opacity: 0.5; }

/* ===== Hero ===== */
.tools-hero {
  text-align: center;
  padding: 34px 0 30px;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border: 1px solid rgba(124, 58, 237, 0.16);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  color: #6b3fc7;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(84, 49, 158, 0.07);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: dotPulse 2.2s infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  55% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}

.tools-hero h1 {
  margin: 18px 0 10px;
  font-size: 58px;
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: #0d1426;
}

.tools-hero h1 .gradient-text {
  background: linear-gradient(122deg, #7c3aed 2%, #6366f1 38%, #0ea5e9 78%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tools-subtitle {
  max-width: 690px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.85;
  color: #5e6780;
}

.trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 22px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #5c657a;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(35, 42, 72, 0.06);
}

.trust-row .icon {
  width: 15px;
  height: 15px;
  color: #7c3aed;
}

/* ===== 主体布局 ===== */
.tool-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin: 18px 0 64px;
}

.tool-shell-full {
  grid-template-columns: minmax(0, 1fr);
}

/* ===== 左侧栏 ===== */
.tool-sidebar {
  position: sticky;
  top: 100px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 44px rgba(52, 43, 92, 0.07);
  backdrop-filter: blur(18px);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 12px;
  color: #8b93a7;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-heading em {
  font-style: normal;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  font-size: 10.5px;
  letter-spacing: 0;
}

.tool-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 11px;
  border-radius: 15px;
  text-decoration: none;
  color: #313a50;
  border: 1px solid transparent;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.tool-nav-item.active {
  background: linear-gradient(135deg, #f1eafe, #eef2ff 68%, #ecfeff);
  border-color: rgba(124, 58, 237, 0.13);
  box-shadow: 0 10px 24px rgba(91, 33, 182, 0.08);
}

.tool-nav-item:hover { transform: translateY(-1px); }
.tool-nav-item + .tool-nav-item { margin-top: 6px; }

.tool-nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, #8b5cf6, #6366f1);
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.28);
}

.tool-nav-icon .icon { width: 19px; height: 19px; }

.tool-nav-icon.tint-cyan {
  background: linear-gradient(145deg, #06b6d4, #3b82f6);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.26);
}

.tool-nav-icon.tint-slate {
  background: linear-gradient(145deg, #64748b, #334155);
  box-shadow: 0 8px 18px rgba(51, 65, 85, 0.22);
}

.tool-nav-icon.tint-amber {
  background: linear-gradient(145deg, #f59e0b, #ea580c);
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.22);
}

.tool-nav-icon.tint-emerald {
  background: linear-gradient(145deg, #10b981, #0f766e);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.tool-nav-back {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #7c879b;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.tool-nav-back .icon {
  width: 14px;
  height: 14px;
  transform: rotate(180deg);
}

.tool-nav-back:hover {
  color: #6d28d9;
  background: #f8f5ff;
}

.tool-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tool-nav-text strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tool-nav-text small {
  font-size: 11.5px;
  color: #7b8498;
}

.nav-arrow {
  width: 16px;
  height: 16px;
  color: #7c3aed;
  opacity: 0.7;
}

.sidebar-privacy {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 13px 12px;
  border-radius: 14px;
  background: rgba(240, 253, 250, 0.78);
  border: 1px solid rgba(13, 148, 136, 0.1);
}

.privacy-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.1);
  color: #0f766e;
}

.privacy-icon .icon { width: 15px; height: 15px; }

.sidebar-privacy strong {
  display: block;
  font-size: 12.5px;
  color: #115e59;
  margin-bottom: 3px;
}

.sidebar-privacy p,
.sidebar-tip p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: #5c6b78;
}

.sidebar-tip {
  margin-top: 10px;
  padding: 13px 12px;
  border-radius: 14px;
  background: #faf8ff;
  border: 1px solid rgba(124, 58, 237, 0.08);
}

.sidebar-tip strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: #5b21b6;
  margin-bottom: 4px;
}

.sidebar-tip strong .icon { width: 14px; height: 14px; }

/* ===== 工作区 ===== */
.workspace { min-width: 0; }

.upload-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px dashed rgba(124, 58, 237, 0.26);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s, background 0.25s;
}

.upload-card:hover {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 22px 60px rgba(64, 48, 120, 0.1);
}

.upload-card.dragover {
  border-color: #7c3aed;
  background: #faf7ff;
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(91, 33, 182, 0.14);
}

.upload-card.has-file {
  border-style: solid;
  border-color: rgba(17, 24, 39, 0.07);
  background: #fff;
}

.upload-empty {
  padding: 38px 28px 34px;
  text-align: center;
  cursor: pointer;
}

.upload-icon {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  background: linear-gradient(145deg, #f4edff, #eef2ff);
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.1);
}

.upload-icon > .icon { width: 30px; height: 30px; }

.upload-pdf-tag {
  position: absolute;
  right: -9px;
  bottom: -6px;
  padding: 3px 6px;
  border-radius: 5px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.25);
}

.upload-empty h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #161e33;
}

.upload-empty > p {
  margin: 6px 0 18px;
  font-size: 13px;
  color: #7a849a;
}

.upload-empty > small {
  display: block;
  margin-top: 14px;
  font-size: 11.5px;
  color: #99a2b5;
}

.upload-loaded {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
}

.file-emblem {
  position: relative;
  width: 48px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  color: #ef4444;
  background: linear-gradient(160deg, #fff1f2, #ffe4e6);
  border: 1px solid rgba(239, 68, 68, 0.14);
}

.file-emblem .icon { width: 26px; height: 26px; }

.file-emblem span {
  position: absolute;
  bottom: 6px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.file-copy {
  min-width: 0;
  flex: 1;
}

.file-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  color: #1b2337;
  letter-spacing: -0.01em;
}

.file-copy p {
  margin-top: 3px;
  font-size: 12.5px;
  color: #7c8599;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(250, 247, 255, 0.92);
  backdrop-filter: blur(8px);
  color: #6d28d9;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 3;
}

.drop-overlay .icon { width: 38px; height: 38px; }

.upload-card.dragover .drop-overlay { opacity: 1; }

/* ===== 按钮 ===== */
.tools-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 13px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  white-space: nowrap;
}

.tools-page .btn .icon { width: 17px; height: 17px; }

.tools-page .btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 58%, #0ea5e9 130%);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.28);
}

.tools-page .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(99, 102, 241, 0.38);
}

.tools-page .btn-primary:active { transform: translateY(0); }

.tools-page .btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.tools-page .btn-ghost {
  color: #4b5570;
  background: #f7f8fc;
  border-color: rgba(22, 30, 51, 0.07);
}

.tools-page .btn-ghost:hover { background: #eef0f8; }

.tools-page .btn-sm {
  padding: 9px 13px;
  font-size: 12.5px;
  border-radius: 9px;
}

.tools-page .btn-sm .icon { width: 14px; height: 14px; }

.tools-page .btn-success {
  color: #fff;
  background: linear-gradient(135deg, #0f9f6e, #10b981 62%, #06b6d4 135%);
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.25);
}

.tools-page .btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(16, 185, 129, 0.34);
}

.icon-btn {
  width: 35px;
  height: 35px;
  border-radius: 9px;
  border: 1px solid rgba(22, 30, 51, 0.07);
  background: #f7f8fc;
  color: #7d8699;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover { background: #fee2e2; color: #dc2626; }
.icon-btn .icon { width: 16px; height: 16px; }

/* ===== 编辑器 ===== */
.editor {
  margin-top: 20px;
  animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.editor-grid {
  display: grid;
  grid-template-columns: 378px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.settings-panel { padding: 22px; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-kicker {
  display: block;
  margin-bottom: 3px;
  color: #9a7ada;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #161e33;
}

.panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  background: #f6f1ff;
  border: 1px solid rgba(124, 58, 237, 0.08);
}

.panel-icon .icon { width: 17px; height: 17px; }

.field { margin-bottom: 19px; }

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: #343d53;
}

.field-label > span {
  font-weight: 500;
  color: #9aa2b3;
  font-size: 11px;
  margin-left: 3px;
}

.field-label-row .field-label { margin-bottom: 8px; }

.field-label-row output {
  font-size: 11.5px;
  font-weight: 650;
  color: #6d28d9;
  background: #f5f0ff;
  border-radius: 6px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

.field-hint {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #9199ab;
}

.field-hint.is-error { color: #dc2626; }
.field-hint.is-ok { color: #0f9f6e; }

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: #f4f3f9;
  border: 1px solid rgba(33, 36, 56, 0.04);
}

.segmented button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 7px 2px 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #798298;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.25;
}

.segmented button small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 500;
  color: #a7aebd;
  letter-spacing: 0.02em;
}

.segmented button:hover { color: #4c3b76; }

.segmented button.active {
  background: #fff;
  color: #5b21b6;
  box-shadow: 0 3px 10px rgba(50, 38, 85, 0.1);
}

.segmented button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.segmented button.active small { color: #8b5cf6; }
.format-group { grid-template-columns: repeat(3, 1fr); }

.text-input {
  width: 100%;
  border: 1px solid rgba(33, 40, 65, 0.13);
  border-radius: 10px;
  background: #fbfbfe;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: #263049;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.text-input::placeholder { color: #a7aebf; }

.text-input:focus {
  border-color: #a78bfa;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.11);
}

.text-input.is-error {
  border-color: #fca5a5;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.09);
}

input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: #7c3aed;
  cursor: pointer;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  font-size: 9.5px;
  color: #a7aebd;
}

.quality-field { animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.output-estimate {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 10px;
  background: #f8f6ff;
  border: 1px solid rgba(124, 58, 237, 0.08);
  color: #6d6488;
  font-size: 11.5px;
  line-height: 1.55;
}

.output-estimate .icon { width: 15px; height: 15px; color: #8b5cf6; margin-top: 1px; }
.output-estimate strong { color: #5b21b6; font-weight: 700; }

/* ===== 预览面板 ===== */
.preview-panel { overflow: hidden; }

.preview-head { padding: 22px 22px 15px; margin-bottom: 0; align-items: center; }

.preview-badge {
  padding: 5px 9px;
  border-radius: 7px;
  background: #f5f2ff;
  border: 1px solid rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.preview-stage {
  position: relative;
  margin: 0 16px;
  min-height: 476px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(99, 102, 241, 0.16), transparent 65%),
    linear-gradient(160deg, #0b0916 0%, #0f0d1e 55%, #0a111a 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  color: #c8c3dc;
}

.preview-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: #b9a5ff;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.preview-empty-icon .icon { width: 25px; height: 25px; }

.preview-empty strong {
  font-size: 14.5px;
  font-weight: 600;
  color: #e7e3f7;
}

.preview-empty p {
  max-width: 310px;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #8c86a5;
}

.preview-result {
  position: relative;
  z-index: 1;
  height: 100%;
}

.preview-scroll {
  max-height: 480px;
  overflow: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.45) transparent;
}

.preview-scroll::-webkit-scrollbar { width: 7px; }
.preview-scroll::-webkit-scrollbar-track { background: transparent; }
.preview-scroll::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.42);
  border-radius: 10px;
}

.preview-scroll img {
  display: block;
  width: 100%;
  max-width: 660px;
  height: auto;
  margin: 0 auto;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9b94b4;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.preview-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #c4b5fd;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.preview-link:hover { color: #ede9fe; }
.preview-link .icon { width: 14px; height: 14px; }

/* 进度 */
.progress-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 6, 15, 0.72);
  backdrop-filter: blur(8px);
}

.progress-card {
  width: 100%;
  max-width: 310px;
  text-align: center;
  color: #fff;
}

.progress-orbit {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4b5fd;
  background: radial-gradient(circle at 30% 30%, rgba(167, 139, 250, 0.45), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(167, 139, 250, 0.28);
  box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.06), 0 0 42px rgba(124, 58, 237, 0.4);
  animation: orbitPulse 2.2s ease-in-out infinite;
}

.progress-orbit .icon { width: 24px; height: 24px; }

@keyframes orbitPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.progress-card strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.progress-card p {
  margin: 5px 0 14px;
  font-size: 12px;
  color: #aba4c2;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6, #6366f1, #22d3ee);
  transition: width 0.25s ease;
}

.progress-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: #8f88a8;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.text-btn {
  border: 0;
  background: transparent;
  color: #c4b5fd;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}

.text-btn:hover { color: #fff; }

/* 结果列表 */
.result-block { padding: 14px 20px 0; }

.result-note {
  display: flex;
  gap: 7px;
  padding: 9px 11px;
  margin-bottom: 9px;
  border-radius: 9px;
  background: #fffbeb;
  border: 1px solid rgba(217, 119, 6, 0.14);
  color: #92400e;
  font-size: 11.5px;
  line-height: 1.6;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 188px;
  overflow: auto;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(32, 38, 68, 0.06);
  background: #fbfbfe;
}

.result-item-thumb {
  width: 26px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 5px;
  background:
    linear-gradient(#fff, #fff) 4px 5px / 18px 2px no-repeat,
    linear-gradient(#e5e7f0, #e5e7f0) 4px 10px / 18px 2px no-repeat,
    linear-gradient(#e5e7f0, #e5e7f0) 4px 15px / 13px 2px no-repeat,
    #fff;
  border: 1px solid rgba(32, 38, 68, 0.1);
}

.result-item-copy {
  min-width: 0;
  flex: 1;
}

.result-item-copy strong {
  display: block;
  font-size: 12px;
  color: #313a50;
}

.result-item-copy span {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: #9199ab;
  font-variant-numeric: tabular-nums;
}

.result-item a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  padding: 5px 7px;
  border-radius: 6px;
}

.result-item a:hover { background: #f5f0ff; }
.result-item a .icon { width: 13px; height: 13px; }

/* 操作栏 */
.preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 20px;
}

.action-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 10.5px;
  color: #98a0b1;
}

.action-note .icon { width: 13px; height: 13px; color: #10b981; }

.action-buttons {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.btn-generate { min-width: 140px; }
.btn-download { min-width: 140px; }

/* ===== 三步说明 ===== */
.how-card {
  margin-top: 20px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(139, 92, 246, 0.09), transparent 65%),
    linear-gradient(120deg, #fbfaff, #f5f8ff);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 40px rgba(50, 42, 90, 0.05);
}

.how-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.how-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #222b41;
}

.how-head p {
  margin: 0;
  font-size: 11px;
  color: #929bad;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.how-steps li {
  position: relative;
  padding-left: 43px;
}

.step-num {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  background: #fff;
  border: 1px solid rgba(124, 58, 237, 0.13);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(124, 58, 237, 0.06);
}

.how-steps strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  color: #2c3549;
}

.how-steps p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: #818a9e;
}

/* ===== 密码弹窗 ===== */
.password-dialog {
  border: 0;
  width: min(92vw, 390px);
  padding: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 32px 90px rgba(15, 12, 40, 0.32);
}

.password-dialog::backdrop {
  background: rgba(10, 8, 24, 0.58);
  backdrop-filter: blur(5px);
}

.password-dialog form { padding: 26px; }

.dialog-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 13px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  background: #f5f0ff;
  border: 1px solid rgba(124, 58, 237, 0.1);
}

.dialog-icon .icon { width: 21px; height: 21px; }

.password-dialog h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.password-dialog form > p {
  margin: 6px 0 15px;
  color: #7d869a;
  font-size: 12.5px;
  line-height: 1.65;
}

.dialog-error {
  margin: 7px 0 0 !important;
  color: #dc2626 !important;
  font-size: 11.5px !important;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.dialog-actions .btn { padding: 11px 17px; font-size: 13px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 1000;
  transform: translate(-50%, 16px);
  max-width: min(90vw, 460px);
  padding: 11px 17px;
  border-radius: 11px;
  background: rgba(17, 24, 39, 0.94);
  color: #f9fafb;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error { background: rgba(153, 27, 27, 0.96); }
.toast.success { background: rgba(6, 78, 59, 0.96); }

/* ===== 页脚适配 ===== */
.tools-page .footer { margin-top: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 1240px) {
  .tools-container { max-width: 1180px; padding: 0 28px; }
  .tool-shell { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
  .editor-grid { grid-template-columns: 344px minmax(0, 1fr); }
  .settings-panel { padding: 19px; }
  .tools-hero h1 { font-size: 52px; }
}

@media (max-width: 1100px) {
  .tool-shell { grid-template-columns: minmax(0, 1fr); }
  .tool-sidebar {
    position: static;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
  }
  .sidebar-heading,
  .sidebar-privacy,
  .sidebar-tip { display: none; }
  .tool-nav-item { flex: 1 1 auto; }
  .tool-nav-item + .tool-nav-item { margin-top: 0; }
  .tool-nav-back { margin-top: 0; flex: 0 0 auto; padding: 9px 11px; }
  .editor-grid { grid-template-columns: 350px minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-panel { padding: 22px; }
  .preview-stage { min-height: 440px; }
  .preview-scroll { max-height: 440px; }
  .settings-panel .field { margin-bottom: 18px; }
}

@media (max-width: 768px) {
  .tools-container { padding: 0 20px; }
  .breadcrumb { padding-top: 20px; font-size: 12px; }
  .tools-hero { padding: 26px 0 24px; }
  .tools-hero h1 { font-size: 40px; margin-top: 15px; }
  .tools-subtitle { font-size: 14px; padding: 0 4px; }
  .trust-row { gap: 7px; margin-top: 17px; }
  .trust-row span { font-size: 11px; padding: 5px 9px; }
  .tool-shell { margin-bottom: 44px; }
  .upload-empty { padding: 30px 18px 28px; }
  .upload-empty h2 { font-size: 16px; }
  .upload-loaded { padding: 16px; gap: 12px; flex-wrap: wrap; }
  .file-actions { margin-left: 60px; }
  .settings-panel { padding: 18px; }
  .preview-stage { margin: 0 12px; min-height: 400px; border-radius: 14px; }
  .preview-scroll { max-height: 390px; padding: 12px; }
  .preview-head { padding: 18px 18px 13px; }
  .preview-actions { padding: 14px 16px 17px; flex-direction: column; align-items: stretch; }
  .action-note { justify-content: center; order: 2; }
  .action-buttons { justify-content: stretch; }
  .action-buttons .btn { flex: 1; }
  .how-card { padding: 19px; }
  .how-head { display: block; }
  .how-head p { margin-top: 4px; }
  .how-steps { grid-template-columns: 1fr; gap: 16px; }
  .result-block { padding: 12px 14px 0; }
}

@media (min-width: 521px) and (max-width: 768px) {
  .tools-page:not(.dev-page) .tool-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .tools-page:not(.dev-page) .tool-nav-item { flex: none; margin-top: 0; }
  .tools-page:not(.dev-page) .tool-nav-item + .tool-nav-item { margin-top: 0; }
  .tools-page:not(.dev-page) .tool-nav-back {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 0;
  }
  .tools-page:not(.dev-page) .nav-arrow { display: none; }
}

@media (max-width: 520px) {
  .tools-hero h1 { font-size: 34px; }
  .tools-subtitle { line-height: 1.7; }
  .trust-row span:nth-child(3) { display: none; }
  .tool-sidebar { flex-wrap: wrap; }
  .tool-nav-item { flex: 1 1 100%; }
  .tool-nav-back { flex: 1 1 100%; justify-content: center; }
  .nav-arrow { display: none; }
  .segmented button { font-size: 11px; }
  .segmented button small { font-size: 8.5px; }
  .upload-empty h2 { font-size: 15px; }
  .upload-empty > p { font-size: 12px; }
  .upload-empty > small { font-size: 10.5px; }
  .file-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
  .file-copy strong { font-size: 14px; }
  .preview-empty strong { font-size: 13.5px; }
  .preview-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .action-buttons { flex-direction: column-reverse; }
  .action-buttons .btn { width: 100%; }
  .how-steps li { padding-left: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .tools-page *,
  .tools-page *::before,
  .tools-page *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
