@import url("/fonts/source-han.css");
/* 学科网文件预处理 —— 与站内其他工具页保持同一套视觉：米灰底、方角、细线、红黑。 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #f3f1ec;
}

body {
  margin: 0;
  color: #1d1d1b;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  background: #f3f1ec;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid #d9d6ce;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.brand {
  color: #1d1d1b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.tool-nav {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 18px;
}

.tool-nav a {
  color: #9a958b;
  font-size: 11px;
  text-decoration: none;
  padding: 7px 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

.tool-nav a:hover,
.tool-nav a.active {
  color: #1d1d1b;
  border-color: #e34a3b;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #77736d;
  white-space: nowrap;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  background: #53a77a;
  border-radius: 50%;
  flex: none;
}

/* ---------------- 页脚（备案） ---------------- */

.site-foot {
  max-width: 1340px;
  margin: 0 auto;
  padding: 24px 5vw 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  border-top: 1px solid #d9d6ce;
  color: #77736d;
  font-size: 11px;
}

.site-foot a {
  color: #77736d;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-foot a:hover {
  color: #1d1d1b;
  border-color: #e34a3b;
}

/* ---------------- 版心 ---------------- */

.workspace {
  max-width: 1340px;
  margin: 0 auto;
  padding: 58px 5vw 32px;
}

.intro {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: end;
  margin-bottom: 34px;
}

.eyebrow {
  color: #e34a3b;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  margin: 0 0 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(30px, 3.6vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 17px;
  font-weight: 700;
}

.lede {
  color: #77736d;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 0;
  max-width: 56ch;
}

.step-indicator {
  display: flex;
  border-bottom: 1px solid #c5c1b9;
  gap: 24px;
  padding-bottom: 9px;
  color: #9a958b;
  font-size: 11px;
  white-space: nowrap;
}

.step-indicator .active {
  color: #1d1d1b;
}

/* ---------------- 隐私说明 ---------------- */

.privacy-banner {
  border: 1px solid #cbd9cd;
  background: #edf3ec;
  padding: 18px 20px;
  margin-bottom: 34px;
}

.privacy-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 9px;
}

.privacy-banner p {
  margin: 0 0 6px;
  color: #4d5c50;
  font-size: 12px;
  line-height: 1.85;
}

.privacy-banner p:last-child {
  margin-bottom: 0;
}

.privacy-banner b {
  color: #2f4634;
}

/* ---------------- 主区域两栏 ---------------- */

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, 0.78fr);
  border-top: 1px solid #1d1d1b;
  border-bottom: 1px solid #d9d6ce;
}

.file-panel {
  min-width: 0;
  padding: 26px 30px 30px 0;
  border-right: 1px solid #d9d6ce;
}

.settings-panel {
  padding: 26px 0 30px 30px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.head-actions {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.file-count {
  color: #9a958b;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 拖拽区 ---------------- */

.drop-zone {
  position: relative;
  min-height: 104px;
  border: 1px dashed #bbb6ac;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  padding: 16px;
}

.drop-zone:hover,
.drop-zone.is-over {
  border-color: #e34a3b;
  background: #fbebe7;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #77736d;
  font-size: 11px;
}

.drop-copy strong {
  color: #1d1d1b;
  font-size: 13px;
  font-weight: 700;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 18px;
}

.picker-hint {
  color: #a9a49a;
  font-size: 11px;
}

/* ---------------- 文件列表 ---------------- */

.file-list {
  border-top: 1px solid #e2ddd3;
  max-height: 46vh;
  overflow-y: auto;
}

.empty-state {
  margin: 0;
  padding: 20px 0;
  color: #a9a49a;
  font-size: 12px;
  line-height: 1.8;
}

.file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #e2ddd3;
}

.file-ext {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #77736d;
  border: 1px solid #c5c1b9;
  padding: 3px 5px;
  min-width: 42px;
  text-align: center;
}

.file-main {
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-note {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #9a958b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-note.is-error {
  color: #b4443a;
}

.file-status {
  font-size: 11px;
  color: #9a958b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.file-status.is-running {
  color: #e34a3b;
}

.file-status.is-converting {
  color: #e34a3b;
}

.file-status.is-done {
  color: #3f7a52;
}

.file-status.is-skipped {
  color: #b8892c;
}

.file-status.is-passthrough {
  color: #b8892c;
}

.file-status.is-error {
  color: #b4443a;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-button {
  border: 0;
  background: transparent;
  color: #a9a49a;
  cursor: pointer;
  font-size: 11px;
  padding: 4px 6px;
  white-space: nowrap;
}

.icon-button:hover {
  color: #e34a3b;
}

.icon-button.is-strong {
  color: #1d1d1b;
  border-bottom: 1px solid #c5c1b9;
}

/* ---------------- 操作条 ---------------- */

.run-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.primary-button {
  border: 1px solid #e34a3b;
  background: #e34a3b;
  color: #fff;
  min-height: 42px;
  padding: 0 24px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.primary-button:hover:not(:disabled) {
  background: #cf3d2f;
  border-color: #cf3d2f;
}

.secondary-button {
  border: 1px solid #e34a3b;
  background: transparent;
  color: #e34a3b;
  min-height: 42px;
  padding: 0 24px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.secondary-button:hover:not(:disabled) {
  background: #fbebe7;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.text-button {
  border: 0;
  background: transparent;
  color: #77736d;
  font-size: 11px;
  padding: 5px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button:hover {
  color: #e34a3b;
}

.progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.progress-track {
  flex: 1;
  height: 2px;
  background: #ddd8ce;
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: #e34a3b;
  transition: width 0.25s ease;
}

.progress span {
  font-size: 11px;
  color: #77736d;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------- 选项 ---------------- */

.option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #e2ddd3;
  cursor: pointer;
}

.option input[type='checkbox'] {
  margin: 2px 0 0;
  width: 15px;
  height: 15px;
  accent-color: #e34a3b;
  cursor: pointer;
}

.option-title {
  display: block;
  font-size: 12px;
  line-height: 1.4;
}

.option-desc {
  display: block;
  margin-top: 4px;
  color: #9a958b;
  font-size: 11px;
  line-height: 1.7;
}

/* ---------------- 规则编辑 ---------------- */

.rules {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #d9d6ce;
}

.rules-head,
.rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: center;
}

.rules-head {
  color: #9a958b;
  font-size: 10px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.rule-row {
  margin-bottom: 7px;
}

.rule-row input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid #aaa59b;
  background: #f3f1ec;
  color: #1d1d1b;
  padding: 0 8px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.rule-row input:hover {
  border-color: #77736d;
}

.rule-row input:focus {
  border-color: #e34a3b;
  background: #fffdf8;
}

.rule-remove {
  border: 0;
  background: transparent;
  color: #b3ada2;
  font-size: 15px;
  line-height: 1;
  padding: 4px 0;
  cursor: pointer;
}

.rule-remove:hover {
  color: #e34a3b;
}

.rule-error {
  margin: 2px 0 10px;
  padding: 8px 10px;
  border-left: 2px solid #b4443a;
  background: #fbeeee;
  color: #8f342c;
  font-size: 11px;
  line-height: 1.7;
}

.rules-foot {
  display: flex;
  gap: 16px;
  margin-top: 2px;
}

.rules-hint {
  margin: 10px 0 0;
  color: #a9a49a;
  font-size: 11px;
  line-height: 1.8;
}

.rules-hint code,
.notes code {
  background: #e9e4db;
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

/* ---------------- 试卷流水线 ---------------- */

.pipeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.pipeline-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1d1d1b;
}

.pipeline-hint {
  color: #a9a49a;
  font-size: 10px;
}

.option.is-compact {
  padding: 10px 0;
}

.option.is-compact .option-desc b {
  color: #b4443a;
  font-weight: 700;
}

.split-config {
  margin-top: 12px;
  padding: 12px 0 0;
  border-top: 1px dashed #d9d6ce;
}

.split-head {
  color: #9a958b;
  font-size: 10px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.split-name {
  font-size: 11px;
  color: #55524c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-input {
  width: 100%;
  height: 30px;
  border: 1px solid #aaa59b;
  background: #f3f1ec;
  color: #1d1d1b;
  padding: 0 8px;
  font-size: 11px;
  outline: none;
}

.split-input:focus {
  border-color: #e34a3b;
  background: #fffdf8;
}

.split-pages {
  color: #a9a49a;
  font-size: 10px;
  white-space: nowrap;
}

.split-empty {
  margin: 0;
  color: #a9a49a;
  font-size: 11px;
  line-height: 1.7;
}

/* ---------------- 日志 ---------------- */

.log-panel {
  padding: 26px 0;
  border-bottom: 1px solid #d9d6ce;
}

#logBox {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  background: #fffdf8;
  border: 1px solid #d9d6ce;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.85;
  color: #55524c;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------- 页脚说明 ---------------- */

.notes {
  padding: 30px 0 48px;
}

.notes h2 {
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.notes ul {
  margin: 0;
  padding-left: 18px;
  color: #77736d;
  font-size: 12px;
  line-height: 1.95;
}

.notes li {
  margin-bottom: 2px;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1000px) {
  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-panel {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid #d9d6ce;
    padding-bottom: 26px;
  }

  .settings-panel {
    padding-left: 0;
  }

  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .file-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: 60px;
  }

  .tool-nav {
    display: none;
  }

  .privacy-note {
    font-size: 11px;
  }

  .workspace {
    padding-top: 34px;
  }

  .file-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 6px;
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* ---------------- 容器圆角（全站统一：小圆角 8px，保持硬朗） ---------------- */

.privacy-banner,
.step-indicator,
.drop-zone,
.picker-row,
.file-list,
.run-bar,
.notes,
.log-panel,
.file-count,
.primary-button,
.secondary-button {
  border-radius: 8px;
}

.log-panel #logBox {
  border-radius: 8px;
}
