:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #111827;
  --text-soft: #4b5563;
  --text-muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --success: #059669;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.02em; }
h2 { font-size: clamp(21px, 2.4vw, 27px); letter-spacing: -.01em; }
h3 { font-size: 17px; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 62px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.logo-text { font-size: 16px; letter-spacing: .01em; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 14.5px;
  white-space: nowrap;
}
.nav a:hover { background: #f3f4f6; color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* ---------- hero ---------- */
.hero {
  padding: 46px 0 26px;
  background:
    radial-gradient(900px 320px at 12% -10%, rgba(37, 99, 235, .10), transparent 65%),
    radial-gradient(700px 300px at 88% -20%, rgba(14, 165, 233, .10), transparent 60%);
}
.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.crumbs a { color: var(--text-muted); }
.hero h1 { margin-bottom: 12px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.lead {
  max-width: 760px;
  margin: 0;
  color: var(--text-soft);
  font-size: 16.5px;
}
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 13.5px;
}
.trust li { display: flex; align-items: center; gap: 6px; }
.trust li::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #d1fae5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 13l4 4L19 7' fill='none' stroke='%23059669' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- tool card ---------- */
.tool-section { padding: 8px 0 20px; }

.tool-card {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings {
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.field { margin: 0; padding: 0; border: 0; }

.fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.fields:empty { display: none; }

.advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after {
  content: "+";
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}
.advanced[open] summary::after { content: "−"; }
.advanced .fields {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #fff;
}
.field > label, .field > legend {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 7px;
  padding: 0;
}
.field > label span { float: right; color: var(--brand); }

select, input[type="number"] {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
select { width: 100%; }
select:focus, input[type="number"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  margin: 4px 0 0;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
}
.radio-row:hover { background: #f3f4f6; }
.radio-row input[type="radio"] { accent-color: var(--brand); margin: 0; }
.radio-row .mini-input {
  width: 64px;
  margin-left: auto;
  padding: 4px 6px;
  font-size: 13px;
  text-align: right;
}
.radio-row .unit { width: 22px; font-size: 12px; color: var(--text-muted); }
.radio-row:has(input[type="radio"]:not(:checked)) .mini-input { opacity: .5; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .12s, box-shadow .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 4px 14px rgba(37, 99, 235, .28); }
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover:not(:disabled) { background: #f3f4f6; color: var(--text); }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--text-muted);
}
.privacy-note .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, .12);
}

/* ---------- workarea ---------- */
.workarea { padding: 22px; display: flex; flex-direction: column; min-height: 420px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 44px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: #fafbff;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}
.dropzone svg { color: var(--brand); transition: transform .25s ease; }
.dropzone:hover svg { transform: translateY(-2px); }
.dz-title { margin: 2px 0 0; font-size: 15.5px; font-weight: 600; color: var(--text); }
.dz-sub { margin: 0 0 12px; font-size: 13px; }
.dropzone .btn-outline { pointer-events: none; }

.dropzone.compact {
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 11px 16px;
  text-align: left;
}
.dropzone.compact > svg { width: 20px; height: 20px; }
.dropzone.compact .dz-title { margin: 0; font-size: 14px; }
.dropzone.compact .dz-sub,
.dropzone.compact .btn-outline { display: none; }

.tool-card.dragging {
  box-shadow: 0 0 0 2px var(--brand), var(--shadow);
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
  font-size: 13.5px;
  color: var(--text-muted);
}
#progressText { color: var(--brand); }

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  animation: fadeUp .25s ease both;
  transition: border-color .15s, box-shadow .15s;
}
.file-item:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(16, 24, 40, .05); }
.file-item[data-status="working"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: slide 1.1s linear infinite;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(350%); }
}
.file-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background:
    linear-gradient(45deg, #f3f4f6 25%, transparent 25%, transparent 75%, #f3f4f6 75%) 0 0 / 12px 12px,
    linear-gradient(45deg, #f3f4f6 25%, #fff 25%, #fff 75%, #f3f4f6 75%) 6px 6px / 12px 12px;
  border: 1px solid var(--line);
}
.file-meta { min-width: 0; }
.file-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 2px;
}
.file-sub .good { color: var(--success); font-weight: 600; }
.file-sub .bad { color: var(--danger); }
.delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.delta.good { background: #d1fae5; color: #065f46; }
.delta.bad { background: #fee2e2; color: #991b1b; }
.delta em { font-style: normal; opacity: .72; }
.file-actions { display: flex; align-items: center; gap: 6px; }
.file-actions .btn { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: #f3f4f6; color: var(--danger); }
.tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--text-muted);
}
.tag.pending { background: #fef3c7; color: #92400e; }
.tag.working { background: #e0f2fe; color: #075985; }
.tag.done { background: #d1fae5; color: #065f46; }
.tag.error { background: #fee2e2; color: #991b1b; }

.list-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ---------- content sections ---------- */
.prose { padding: 34px 0 8px; }
.prose > h2 { margin-top: 34px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0 8px;
}
.feature {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.feature h3 { margin-bottom: 6px; font-size: 15.5px; }
.feature p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.steps {
  margin: 14px 0;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 10px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 14px 10px 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text-soft);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.notice {
  font-size: 13px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: #f9fafb;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
}

/* ---------- faq ---------- */
.faq-section { padding: 28px 0 10px; }
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px 18px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-right: 26px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: -2px;
  font-size: 20px;
  color: var(--text-muted);
  font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin: 10px 0 0;
  font-size: 14.5px;
  color: var(--text-soft);
  line-height: 1.75;
}

/* ---------- related ---------- */
.related { padding: 30px 0 46px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.related-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
}
.related-item:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.related-item .arrow { color: var(--text-muted); }

/* ---------- static pages ---------- */
.page {
  padding: 46px 0 60px;
}
.page .container { max-width: 820px; }
.page h1 { font-size: clamp(26px, 3.4vw, 34px); }
.page h2 { margin-top: 32px; font-size: 20px; }
.page p, .page li { color: var(--text-soft); font-size: 15px; }
.page ul { padding-left: 20px; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 20px;
  background: #0f172a;
  color: #94a3b8;
  font-size: 13.5px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  padding: 44px 0 28px;
}
.footer-brand .logo { color: #fff; }
.footer-brand p { margin: 10px 0 0; max-width: 320px; }
.footer-col h4 {
  margin: 0 0 10px;
  color: #e2e8f0;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.footer-col a {
  display: block;
  padding: 3px 0;
  color: #94a3b8;
}
.footer-col a:hover { color: #fff; text-decoration: none; }
.copyright {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0 26px;
  border-top: 1px solid #1e293b;
  font-size: 12.5px;
  color: #64748b;
}

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #991b1b; }

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

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tool-card { grid-template-columns: 1fr; }
  .settings { border-right: 0; border-bottom: 1px solid var(--line); }
  .privacy-note { margin-top: 4px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 28px); }
  .hero { padding: 30px 0 20px; }
  .workarea, .settings { padding: 16px; }
  .dropzone { padding: 32px 14px; }
  .file-item { grid-template-columns: 44px minmax(0, 1fr); }
  .file-thumb { width: 44px; height: 44px; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .site-footer { margin-top: 0; }
}
