/* ============================================================
   扫描喵 - 手机拍照图片批量转黑白扫描件
   专业在线工具样式 · PC / 移动端响应式适配
   ============================================================ */

:root {
  --primary: #1e6ef2;
  --primary-dark: #1558c9;
  --primary-light: #e8f0fe;
  --ink: #17233d;
  --ink-2: #4a5872;
  --ink-3: #8290a9;
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --line: #e3e9f2;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(23, 43, 77, 0.08);
  --shadow-lg: 0 10px 30px rgba(23, 43, 77, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; }

.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: var(--primary);
  margin: 12px auto 0;
}

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}
.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 18px; }
.logo-text small { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.site-nav { display: flex; gap: 26px; }
.site-nav a { color: var(--ink-2); font-size: 15px; transition: color 0.2s; }
.site-nav a:hover { color: var(--primary); }

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(160deg, #eef4ff 0%, #f8fbff 55%, #eef8f3 100%);
  padding: 72px 0 56px;
  text-align: center;
}
.hero h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.hero-sub {
  max-width: 640px;
  margin: 0 auto 22px;
  color: var(--ink-2);
  font-size: 17px;
}
.hero-sub strong { color: var(--primary-dark); }
.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.hero-badges li {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* ---------------- 工具面板 ---------------- */
.tool-section { padding: 48px 0 64px; }
.tool-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

/* 上传区 */
.drop-zone {
  border: 2px dashed #b9c8e0;
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}
.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.drop-icon { color: var(--primary); display: inline-flex; margin-bottom: 12px; }
.drop-title { font-size: 17px; font-weight: 600; color: var(--ink); }
.drop-hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

/* 设置区 */
.settings-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px 28px;
  margin: 22px 0 6px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.setting-row { display: flex; flex-direction: column; gap: 8px; }
.setting-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.setting-value {
  min-width: 30px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  border-radius: 6px;
  padding: 1px 8px;
}
.setting-tip { font-size: 12px; color: var(--ink-3); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #d7e1f0;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(30, 110, 242, 0.5);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(30, 110, 242, 0.5);
  cursor: pointer;
}

/* 模式选择 */
.mode-group {
  display: flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  gap: 4px;
}
.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  font-size: 14px;
  border-radius: 7px;
  color: var(--ink-2);
  transition: all 0.2s;
  white-space: nowrap;
}
.mode-btn:hover { color: var(--primary); }
.mode-btn.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(30, 110, 242, 0.35);
}

/* 按钮 */
.btn {
  border: none;
  border-radius: 9px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(30, 110, 242, 0.35); }
.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-ghost:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-mini { padding: 6px 12px; font-size: 13px; border-radius: 7px; }

/* 工具栏 */
.tool-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.toolbar-spacer { flex: 1; }

/* 进度条 */
.progress-wrap { margin-top: 18px; }
.progress-bar {
  height: 10px;
  border-radius: 5px;
  background: #e6edf7;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--primary), #5aa0ff);
  transition: width 0.3s ease;
}
.progress-text { font-size: 13px; color: var(--ink-2); margin-top: 8px; text-align: center; }

/* 文件列表 */
.file-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.file-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.file-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eef2f8;
  overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: contain; }
.status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink-3);
}
.status-badge.st-pending { background: #94a3b8; }
.status-badge.st-processing { background: var(--warning); }
.status-badge.st-done { background: var(--success); }
.status-badge.st-error { background: var(--danger); }
.status-badge.st-dirty { background: var(--warning); }
.file-info { padding: 10px 12px 4px; min-height: 56px; }
.file-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta { font-size: 12px; color: var(--ink-3); }
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
}
.empty-tip {
  margin-top: 22px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

/* ---------------- 功能特点 ---------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 30px; display: inline-block; margin-bottom: 12px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--ink-2); }

/* ---------------- 使用步骤 ---------------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 24px 20px;
  position: relative;
  box-shadow: var(--shadow);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 12px;
}
.step-card h3 { font-size: 16px; margin-bottom: 8px; }
.step-card p { font-size: 13.5px; color: var(--ink-2); }

/* ---------------- 使用场景 ---------------- */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.scene-card {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 20px 20px 18px;
}
.scene-card h3 { font-size: 16px; margin-bottom: 8px; }
.scene-card p { font-size: 14px; color: var(--ink-2); }

/* ---------------- 使用帮助 ---------------- */
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.help-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}
.help-card h3 { font-size: 16px; margin-bottom: 12px; color: var(--primary-dark); }
.help-card ul { list-style: none; }
.help-card li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.help-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---------------- FAQ ---------------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 44px 15px 18px;
  font-weight: 600;
  font-size: 15px;
  position: relative;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item[open] summary { color: var(--primary-dark); }
.faq-item p {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--ink-2);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin: 0 18px 16px;
  padding-left: 0;
  padding-right: 0;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  background: var(--ink);
  color: #c3cddd;
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-logo { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.footer-brand p { font-size: 13px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a { color: #c3cddd; font-size: 14px; }
.footer-nav a:hover { color: #fff; }
/* 友情链接 */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
  padding: 16px 0 4px;
  font-size: 13px;
}
.friend-links-title { color: #c3cddd; margin-right: 2px; }
.friend-links a { color: #c3cddd; }
.friend-links a:hover { color: #fff; }
.footer-copy {
  text-align: center;
  font-size: 12.5px;
  color: #8e9ab0;
  padding-top: 18px;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  background: rgba(23, 35, 61, 0.92);
  color: #fff;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: rgba(220, 38, 38, 0.94); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .feature-grid,
  .scene-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 30px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .section { padding: 46px 0; }
  .section-title { font-size: 23px; margin-bottom: 26px; }

  .header-inner { height: 56px; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 13.5px; }
  .site-nav a:nth-child(n + 4) { display: none; }
  .logo-text { font-size: 16px; }

  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 24px; letter-spacing: 0; }
  .hero-sub { font-size: 14.5px; }

  .tool-panel { padding: 14px; }
  .drop-zone { padding: 32px 14px; }
  .settings-panel { grid-template-columns: 1fr; padding: 16px; gap: 16px; }

  .tool-toolbar { gap: 8px; }
  .toolbar-spacer { display: none; }
  .tool-toolbar .btn { flex: 1 1 40%; padding: 11px 8px; font-size: 14px; }
  #btnProcess { flex: 1 1 100%; }

  .file-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .file-actions { padding: 8px 10px 10px; gap: 6px; }
  .btn-mini { padding: 5px 9px; font-size: 12px; }

  .feature-grid,
  .scene-grid,
  .steps,
  .help-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; }
}

@media (max-width: 400px) {
  .file-list { grid-template-columns: 1fr; }
  .mode-group { flex-direction: column; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
