/* ---------- 基础变量：暖色调 ---------- */
:root {
  --parchment: #FBF6EF;
  --paper: #FFFFFF;
  --paper-warm: #F5EDE2;
  --ink: #2E2A26;
  --ink-soft: #6B6259;
  --ink-faint: #9A8F82;
  --terracotta: #B4552F;
  --terracotta-dark: #94421F;
  --terracotta-soft: #F4E2D6;
  --line: #E2D7C7;
  --line-soft: #EDE4D7;
  --olive: #6E7F55;
  --amber: #B0812F;
  --brick: #A8382A;
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(46, 42, 38, .05), 0 8px 24px rgba(46, 42, 38, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 24px;
}

code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--terracotta-dark);
}

/* ---------- 页头 ---------- */
.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 40px 0 32px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
}

.masthead h1 {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.lede {
  margin: 0;
  max-width: 640px;
  color: var(--ink-soft);
  font-size: 15.5px;
}

/* ---------- 拖放区 ---------- */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--terracotta);
  outline: none;
}

.dropzone.is-over {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
  transform: scale(1.004);
}

.dz-inner {
  text-align: center;
  padding: 40px 24px;
  pointer-events: none;
}

.dz-icon {
  width: 48px;
  height: 48px;
  color: var(--terracotta);
  opacity: .85;
  margin-bottom: 12px;
}

.dz-main {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0 0 6px;
}

.dz-sub {
  margin: 0;
  color: var(--ink-faint);
  font-size: 13.5px;
}

/* ---------- 统计卡片 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 12px 12px;
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 4px;
}

.stat.is-ok .stat-num { color: var(--olive); }
.stat.is-bad .stat-num { color: var(--brick); }

/* ---------- 操作条 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.toolbar-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-size: 14.5px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.btn:hover:not(:disabled) {
  border-color: var(--terracotta);
  color: var(--terracotta-dark);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #FFF;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
  color: #FFF;
}

.btn-ghost {
  background: transparent;
  border-style: dashed;
  color: var(--ink-soft);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.switch input {
  accent-color: var(--terracotta);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ---------- 进度 ---------- */
.progress { margin-bottom: 24px; }

.progress-bar {
  height: 5px;
  background: var(--line-soft);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--terracotta);
  border-radius: 99px;
  transition: width .25s ease;
}

.progress-text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- 文件列表 ---------- */
.filelist-section { margin-bottom: 36px; }

.section-title {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.filelist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filecard {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.fc-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  color: var(--terracotta-dark);
  letter-spacing: -.02em;
}

.filecard.is-done .fc-mark {
  background: #EDF0E6;
  border-color: #D8E0CB;
  color: var(--olive);
}

.filecard.is-fail .fc-mark {
  background: #FAEBE8;
  border-color: #EECFC9;
  color: var(--brick);
}

.fc-body { flex: 1 1 auto; min-width: 0; }

.fc-name {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-meta {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.fc-meta.is-error { color: var(--brick); }

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

.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}

.tag.is-wait { background: var(--paper-warm); }
.tag.is-run  { background: var(--terracotta-soft); border-color: #E7CBBB; color: var(--terracotta-dark); }
.tag.is-done { background: #EDF0E6; border-color: #D8E0CB; color: var(--olive); }
.tag.is-fail { background: #FAEBE8; border-color: #EECFC9; color: var(--brick); }

.linkbtn {
  font: inherit;
  font-size: 13px;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--terracotta);
}

.linkbtn:hover { background: var(--terracotta-soft); }
.linkbtn:disabled { opacity: .4; cursor: not-allowed; background: none; }

.linkbtn.is-muted { color: var(--ink-faint); }
.linkbtn.is-muted:hover { background: var(--paper-warm); }

/* ---------- 说明区 ---------- */
.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.note-col {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.note-col h3 {
  font-family: var(--serif);
  font-size: 15.5px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.note-col ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.note-col li { margin-bottom: 5px; }

.note-warn {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--amber);
  background: #FBF3E4;
  border-left: 3px solid var(--amber);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
}

.loss-tip {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.note-ok {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--olive);
  background: #F0F3EA;
  border-left: 3px solid var(--olive);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
}

/* ---------- FAQ ---------- */
.faq {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--ink-soft);
}

.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
}

.faq p { margin: 12px 0 0; }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px dashed var(--line);
  margin-top: 40px;
  padding: 20px 0 40px;
}

.foot p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.foot .foot-copy {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-faint);
  opacity: .85;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #FBF6EF;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 99px;
  box-shadow: 0 8px 28px rgba(46, 42, 38, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s, transform .26s;
  z-index: 99;
  max-width: 90vw;
  text-align: center;
}

.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast.is-ok { background: var(--olive); }
.toast.is-warn { background: var(--amber); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .masthead { padding: 28px 0 24px; }
  .masthead h1 { font-size: 28px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .notes { grid-template-columns: 1fr; }
  .filecard { flex-wrap: wrap; }
  .fc-actions { width: 100%; justify-content: flex-end; }
  .toolbar { align-items: flex-start; }
}
