:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e5e9f2;
  --text: #1b2434;
  --text-sub: #6b7688;
  --brand: #1d4ed8;
  --brand-hover: #1a46c4;
  --brand-weak: #eef3ff;
  --success: #15803d;
  --danger: #dc2626;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 顶部条：与系统导航后台保持一致 */
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.topbar h1 { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.crumb { color: var(--text-sub); font-size: 13px; margin-left: 8px; }
.btn-admin {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-sub);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: all .15s ease;
}
.btn-admin:hover { color: var(--brand); border-color: #c8d6f5; background: var(--brand-weak); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 32px 64px; }
.head { margin-bottom: 22px; }
.head h2 { font-size: 22px; font-weight: 600; letter-spacing: .4px; }
.head p { margin-top: 6px; color: var(--text-sub); font-size: 13.5px; line-height: 1.7; }

.notice {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.6;
}
.notice svg { flex: none; margin-top: 1px; }

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}
.panel-title { display: flex; align-items: center; gap: 10px; }
.panel-title h3 { font-size: 15.5px; font-weight: 600; }
.step {
  width: 26px; height: 22px;
  border-radius: 6px;
  background: var(--brand-weak);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.panel-hint { font-size: 11.5px; color: #9aa4b5; }

/* 上传区 */
.dropzone {
  border: 1.5px dashed #c8d6f5;
  border-radius: 12px;
  background: #fbfcff;
  padding: 34px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-drag {
  border-color: var(--brand);
  background: var(--brand-weak);
  outline: none;
}
.dropzone.is-drag { transform: scale(1.005); }
.dz-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--brand-weak);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.dz-title { font-size: 14px; font-weight: 600; }
.dz-sub { margin-top: 7px; font-size: 12.5px; color: var(--text-sub); }

.file-card {
  display: flex; align-items: center; gap: 11px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.file-icon {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 9px;
  background: var(--brand-weak);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta { margin-top: 3px; font-size: 11.5px; color: var(--text-sub); }
.file-state {
  flex: none;
  font-size: 11.5px;
  color: var(--success);
  background: #ecfdf3;
  border-radius: 999px;
  padding: 3px 9px;
}

.alert {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-all;
}

/* 进度 */
.progress-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faff;
}
.progress-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; }
.percent { color: var(--brand); font-variant-numeric: tabular-nums; }
.progress-track {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e8edf7;
  overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, var(--brand));
  transition: width .35s ease;
}
.progress-foot { margin-top: 8px; font-size: 11.5px; color: var(--text-sub); }

.actions { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-sub);
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover:not(:disabled) { color: var(--text); border-color: #cfd8e6; background: #fbfcfe; }
.btn-primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { border-color: var(--brand-hover); background: var(--brand-hover); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
#startBtn { flex: 1; }

.tips {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--text-sub);
}
.tips-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.tips ul { margin: 7px 0 0 17px; font-size: 12px; line-height: 1.9; }

/* 结果区 */
.result-panel { display: flex; flex-direction: column; min-height: 560px; }
.tag {
  font-size: 11.5px;
  color: var(--brand);
  background: var(--brand-weak);
  border-radius: 999px;
  padding: 3px 10px;
}
.tag.demo { color: var(--warn); background: #fffbeb; border: 1px solid #fde68a; }
.result-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
}
.result-meta span {
  font-size: 11.5px;
  color: var(--text-sub);
  background: #f6f8fc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 9px;
}
.result-meta span b { color: var(--text); font-weight: 600; }
.result-text {
  flex: 1;
  width: 100%;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 15px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.9;
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.result-text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .1); }
.result-text::placeholder { color: #a8b1c1; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.result-foot { margin-top: 10px; font-size: 11.5px; color: #9aa4b5; }

.toast {
  position: fixed;
  left: 50%; bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  background: #1b2434;
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .3);
}
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .result-panel { min-height: 420px; }
  .result-text { min-height: 260px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .crumb { display: none; }
  .wrap { padding: 24px 16px 48px; }
  .head h2 { font-size: 20px; }
  .panel { padding: 18px; }
}
