/* PDF 翻译 —— 站点样式
   设计基调：中性、克制、信息优先。没有渐变、没有阴影装饰。
   所有颜色走 CSS 变量，自动适配系统深色模式。 */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f5f5f3;
  --border: #e3e3e0;
  --border-strong: #cfcfca;
  --text: #1a1a18;
  --text-2: #6b6b66;
  --text-3: #96968f;
  --accent: #1f6feb;
  --accent-hover: #1a5fcc;
  --accent-soft: #e8f0fd;
  --ok: #1a7f48;
  --warn: #a06000;
  --warn-soft: #fdf6e7;
  --error: #b42318;
  --error-soft: #fdf0ee;
  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 760px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
          "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --surface: #1b1b1a;
    --surface-2: #232322;
    --border: #2f2f2d;
    --border-strong: #434340;
    --text: #ececea;
    --text-2: #a1a19b;
    --text-3: #787872;
    --accent: #4c8dfb;
    --accent-hover: #6aa0fc;
    --accent-soft: #1a2740;
    --ok: #4ec98a;
    --warn: #e0a343;
    --warn-soft: #2a2318;
    --error: #f2807a;
    --error-soft: #2d1b1a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }

/* ── 顶栏 ───────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; opacity: 0.8; }
.brand svg { color: var(--text-2); }

.site-nav { display: flex; gap: 18px; }
.site-nav a { color: var(--text-2); font-size: 13.5px; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* ── 主体 ───────────────────────────────────────────── */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 64px;
}

.hero { padding: 32px 0 28px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  max-width: 54ch;
  color: var(--text-2);
  font-size: 15.5px;
}

.banner {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.banner-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

/* ── 卡片 ───────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

.card-error { border-color: color-mix(in srgb, var(--error) 40%, var(--border)); }
.card-error h2 { color: var(--error); }

/* ── 拖拽区 ─────────────────────────────────────────── */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 34px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.dropzone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone-icon { color: var(--text-3); margin-bottom: 6px; }
.dropzone.is-drag .dropzone-icon { color: var(--accent); }
.dropzone-title { margin: 0; font-weight: 500; }
.dropzone-hint { margin: 0; font-size: 12.5px; color: var(--text-3); }

/* ── 文件卡 ─────────────────────────────────────────── */

.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-top: 14px;
}
.file-card-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-card-main svg { color: var(--text-3); flex: none; }
.file-meta { display: flex; flex-direction: column; min-width: 0; }
.file-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-size { font-size: 12px; color: var(--text-3); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.icon-btn:hover { background: var(--border); color: var(--text); }

/* ── 表单 ───────────────────────────────────────────── */

.options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}

select {
  appearance: none;
  width: 100%;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.primary-btn:hover:not(:disabled) { background: var(--accent-hover); text-decoration: none; }
.primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.primary-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

a.primary-btn { width: auto; }

.ghost-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--text); border-color: var(--text-3); }

.fine-print {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* ── 进度 ───────────────────────────────────────────── */

.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.progress-head h2 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.progress-head p { margin: 0; }

.pct {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-3);
}
.stages li { display: flex; align-items: center; gap: 6px; }
.stages li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.stages li.is-active { color: var(--accent); }
.stages li.is-active::before {
  background: var(--accent);
  border-color: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.stages li.is-done { color: var(--ok); }
.stages li.is-done::before { background: var(--ok); border-color: var(--ok); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.progress-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
#progress-meta { font-family: var(--mono); font-size: 12px; }

/* ── 结果 ───────────────────────────────────────────── */

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.result-head h2 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.result-head p { margin: 0; }

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.previews img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: block;
}
.previews:empty { display: none; }

.result-foot { margin-top: 4px; }

/* ── 说明区 ─────────────────────────────────────────── */

.prose { margin-top: 44px; }
.prose h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 16px;
}
.steps li { position: relative; padding-left: 34px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}
.steps strong { font-weight: 500; font-size: 14.5px; }
.steps p { margin: 3px 0 0; color: var(--text-2); font-size: 14px; }

details {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
details:last-of-type { border-bottom: none; }
summary {
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--text-3);
  width: 12px;
}
details[open] summary::before { content: "−"; }
details p { margin: 8px 0 0 20px; color: var(--text-2); font-size: 14px; }

/* ── 页脚 ───────────────────────────────────────────── */

.site-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 40px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
}

/* ── 响应式 ─────────────────────────────────────────── */

@media (max-width: 620px) {
  .options { grid-template-columns: 1fr; }
  .hero { padding: 20px 0 22px; }
  .card { padding: 16px; }
  .dropzone { padding: 26px 14px; }
  .site-nav { display: none; }
  .progress-head { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
