:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --accent: #7c3aed;
  --text: #1f2328;
  --text-soft: #57606a;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --border: #d8dee4;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(31, 35, 40, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}
a { color: var(--primary); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.noscript-bar {
  background: #fff7ed; color: #9a3412; padding: 10px 16px; text-align: center;
  border-bottom: 1px solid #fed7aa;
}

/* 顶部导航 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 20px; }
.logo em { color: var(--primary); font-style: normal; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-soft); text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--primary); }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-btn {
  border: none; background: #fff; color: var(--text-soft); font-size: 13px;
  padding: 5px 12px; cursor: pointer;
}
.lang-btn.active { background: var(--primary); color: #fff; }

/* Hero */
.hero {
  padding: 46px 0 54px;
  background:
    radial-gradient(900px 340px at 20% -10%, rgba(79, 70, 229, 0.10), transparent 60%),
    radial-gradient(800px 320px at 90% 0%, rgba(124, 58, 237, 0.10), transparent 60%);
}
.hero-copy { text-align: center; max-width: 760px; margin: 0 auto 30px; }
.hero h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.25; margin: 0 0 12px; letter-spacing: -0.5px; }
.hero .lead { color: var(--text-soft); font-size: 17px; margin: 0 0 18px; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin: 0; padding: 0; font-size: 14px; color: var(--text-soft); }
.hero-badges li { white-space: nowrap; }

/* 转换表单 */
.converter {
  max-width: 760px; margin: 0 auto;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow);
}
.dropzone {
  border: 2px dashed #b6bde8; border-radius: var(--radius);
  background: #fafbff; text-align: center; padding: 40px 20px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.1s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); background: #f4f5ff; outline: none; }
.dropzone.dragover { border-color: var(--primary); background: #eef0ff; transform: scale(1.01); }
.dz-icon { color: var(--primary); margin-bottom: 8px; }
.dz-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.dz-sub { color: var(--text-soft); font-size: 13px; margin: 0; }

.settings { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.settings summary { cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: 14px; user-select: none; }
.settings[open] summary { border-bottom: 1px solid var(--border); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 14px; padding: 12px 14px 4px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-soft); cursor: pointer; }
.check input { accent-color: var(--primary); }
.tip {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #e8ebf5; color: var(--text-soft);
  font-size: 11px; font-weight: 800; line-height: 1;
  cursor: help; flex: none; user-select: none;
}
.tip::after { content: "?"; }
.tip-text {
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 250px; max-width: min(250px, 74vw);
  padding: 10px 12px;
  background: #24292f; color: #fff; border-radius: 8px;
  font-size: 12.5px; line-height: 1.6; font-weight: 400; text-align: left;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 40; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  white-space: normal;
}
.tip:hover .tip-text, .tip:focus .tip-text, .tip:focus-within .tip-text { opacity: 1; visibility: visible; }
.tip-text::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #24292f;
}
.settings-row { display: flex; flex-wrap: wrap; gap: 14px 26px; padding: 8px 14px 14px; }
.settings-row label { font-size: 13.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 7px; }
.settings-row select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; }
.settings-hint { margin: 0; padding: 0 14px 14px; color: var(--text-soft); font-size: 12.5px; line-height: 1.6; }

.file-count { text-align: center; color: var(--text-soft); font-size: 13px; margin: 12px 0 4px; }
.queue-title { font-size: 15px; margin: 6px 0; }
.queue { display: flex; flex-direction: column; gap: 8px; }
.file-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fcfcfd; }
.file-card-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.file-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-status { font-size: 12px; white-space: nowrap; }
.file-status.waiting { color: var(--text-soft); }
.file-status.processing { color: var(--primary); }
.file-status.done { color: #1a7f37; }
.file-status.error { color: #cf222e; }
.file-progress { height: 6px; border-radius: 4px; background: #e6e9f2; overflow: hidden; }
.file-progress-bar { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.3s; }
.file-detail { font-size: 12.5px; color: var(--text-soft); margin-top: 5px; min-height: 18px; }
.file-detail.error { color: #cf222e; }

/* 结果区 */
.results { margin-top: 34px; margin-bottom: 44px; }
.results-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.result-tabs { display: flex; flex-wrap: wrap; gap: 6px; max-width: 640px; }
.result-tab {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 5px 13px; font-size: 13px; cursor: pointer; color: var(--text-soft);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 1px solid var(--border); background: #fff; border-radius: 9px;
  padding: 7px 14px; font-size: 13.5px; cursor: pointer; color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost.active { background: #eef0ff; border-color: var(--primary); color: var(--primary); }
.btn-danger:hover { border-color: #cf222e; color: #cf222e; }
.result-meta { color: var(--text-soft); font-size: 13px; margin: 14px 0 10px; }
.result-body { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
#result-text {
  width: 100%; border: none; resize: vertical; padding: 16px; font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Courier New", monospace;
  line-height: 1.65; color: var(--text); background: #fff; outline: none;
}
.preview-frame { width: 100%; height: 620px; border: none; background: #fff; display: block; }

/* 内容区块 */
.section { padding: 54px 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { text-align: center; font-size: clamp(24px, 3vw, 32px); margin: 0 0 10px; }
.section-sub { text-align: center; color: var(--text-soft); margin: 0 0 34px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature-card h3 { margin: 0 0 8px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--text-soft); font-size: 14.5px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 8px; }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  font-weight: 800; font-size: 18px; margin-bottom: 12px;
}
.step h3 { margin: 0 0 8px; font-size: 17px; }
.step p { margin: 0; color: var(--text-soft); font-size: 14.5px; }

.faq-wrap { max-width: 760px; }
.faq-wrap details { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.faq-wrap summary { cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 15px; user-select: none; }
.faq-wrap details p { margin: 0; padding: 0 16px 14px; color: var(--text-soft); font-size: 14.5px; }
#privacy p { max-width: 760px; margin: 0 auto; color: var(--text-soft); font-size: 15px; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; text-align: center; }
.site-footer p { margin: 4px 0; }
.footer-note { color: var(--text-soft); font-size: 13px; }
.footer-links { margin: 18px 0 6px; }
.footer-links-title { font-size: 13px; color: var(--text-soft); margin: 0 0 8px; font-weight: 600; }
.footer-links-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; }
.footer-links-list a { color: var(--text-soft); font-size: 13px; text-decoration: none; transition: color 0.15s; }
.footer-links-list a:hover { color: var(--primary); }

#flash-tip {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(16px);
  background: #24292f; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  z-index: 99; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
#flash-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero { padding: 30px 0 36px; }
  .dropzone { padding: 28px 14px; }
  .result-tabs { max-width: 100%; }
  .results-header { flex-direction: column; }
  .preview-frame { height: 480px; }
}
