:root {
  --ink: #15222c;
  --ink-soft: #51616d;
  --paper: #f5f7f8;
  --card: #ffffff;
  --line: #dce4e8;
  --cyan: #00a8b8;
  --cyan-soft: #e4f7f8;
  --orange: #ef7c2f;
  --green: #23856a;
  --red: #c54e4e;
  --mono: "Fira Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Fira Sans", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button, .job-row, .dropzone { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible + .dropzone { outline: 3px solid rgba(0, 168, 184, .35); outline-offset: 3px; }

.topbar { height: 72px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--ink); color: var(--cyan); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }
.service-state { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(35,133,106,.12); }
.server-chip { padding: 3px 6px; border: 1px solid #b8d9d7; color: var(--green); }

.shell { width: min(1220px, 90vw); margin: 0 auto; padding: 64px 0 48px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 40px; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 670px; margin-bottom: 18px; font-size: clamp(38px, 5vw, 68px); font-weight: 600; line-height: 1.04; letter-spacing: -.045em; }
h1 em { color: var(--orange); font-style: normal; }
.intro-copy { max-width: 560px; margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }
.intro-stat { min-width: 170px; padding-left: 24px; border-left: 2px solid var(--orange); }
.intro-stat strong { display: block; color: var(--ink); font-family: var(--mono); font-size: 48px; font-weight: 500; line-height: 1; }
.intro-stat span { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 13px; }

.work-grid { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr); gap: 20px; margin-top: 28px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--card); }
.upload-panel { padding: 28px; }
.history-panel { min-height: 426px; padding: 28px 0 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 26px; padding: 0 28px; }
.panel-heading h2, .detail-heading h2 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.025em; }
.step-mark { color: var(--orange); font-family: var(--mono); font-size: 13px; }
.history-heading { margin-bottom: 18px; }

.dropzone { min-height: 232px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 1px dashed #a9c7cc; background: #fbfdfd; text-align: center; transition: border-color .2s ease, background .2s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--cyan); background: var(--cyan-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-symbol { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 16px; border: 1px solid var(--cyan); color: var(--cyan); font-family: var(--mono); font-size: 26px; line-height: 1; }
.dropzone strong { font-size: 15px; font-weight: 600; }
.dropzone small { margin-top: 8px; color: var(--ink-soft); font-size: 12px; }
.selected-file { display: flex; align-items: center; gap: 12px; min-height: 58px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); }
.file-type { color: var(--orange); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.file-meta { flex: 1; min-width: 0; }
.file-meta strong, .file-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta strong { font-size: 13px; }
.file-meta small { color: var(--ink-soft); font-size: 11px; }
.primary-button, .outline-button, .text-button { border: 0; background: none; cursor: pointer; }
.primary-button { width: 100%; min-height: 48px; margin-top: 18px; padding: 10px 16px; border: 1px solid var(--ink); color: white; background: var(--ink); font-weight: 600; transition: background .2s ease, transform .2s ease; }
.primary-button span { margin-left: 8px; color: var(--orange); font-size: 20px; vertical-align: -1px; }
.primary-button:not(:disabled):hover { background: #233744; transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; }
.outline-button { min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.outline-button:hover, .text-button:hover { color: var(--cyan); border-color: var(--cyan); }
.text-button { padding: 4px 0; color: var(--ink-soft); font-size: 12px; }
.form-status { min-height: 22px; margin: 10px 0 0; color: var(--red); font-size: 12px; }
.upload-note { display: flex; justify-content: space-between; gap: 8px; margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }

.job-list { border-top: 1px solid var(--line); }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px 94px; align-items: center; gap: 18px; min-height: 78px; padding: 14px 28px; border-bottom: 1px solid var(--line); transition: background .2s ease; }
.job-row:hover, .job-row.selected { background: #f4fafb; }
.job-name { min-width: 0; }
.job-name strong, .job-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-name strong { font-size: 13px; font-weight: 600; }
.job-name small { margin-top: 4px; color: var(--ink-soft); font-family: var(--mono); font-size: 10px; }
.job-progress { display: flex; align-items: center; gap: 8px; }
.progress-track { height: 5px; overflow: hidden; flex: 1; background: #e8eef0; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .35s ease; }
.progress-value { min-width: 30px; color: var(--ink-soft); font-family: var(--mono); font-size: 10px; text-align: right; }
.job-status { justify-self: end; padding: 4px 7px; border: 1px solid var(--line); color: var(--ink-soft); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.job-status.running, .status-badge.running { color: var(--cyan); border-color: #a5dadd; background: var(--cyan-soft); }
.job-status.succeeded, .status-badge.succeeded { color: var(--green); border-color: #b7ded2; background: #edf8f3; }
.job-status.failed, .status-badge.failed { color: var(--red); border-color: #e7bdbd; background: #fff4f4; }
.empty-state { padding: 62px 28px; color: var(--ink-soft); text-align: center; font-size: 13px; }

.detail-panel { margin-top: 20px; padding: 28px; }
.detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.status-badge { padding: 5px 8px; border: 1px solid var(--line); color: var(--ink-soft); font-family: var(--mono); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
.progress-row, .log-heading, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-soft); font-size: 12px; }
.progress-row strong { color: var(--ink); font-family: var(--mono); font-size: 13px; }
.progress-track.large { height: 10px; margin-top: 12px; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; color: var(--ink-soft); font-size: 12px; }
.detail-meta span { display: block; padding-top: 10px; border-top: 1px solid var(--line); }
.detail-meta b { display: block; margin-top: 3px; color: var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 400; }
.log-panel { min-width: 0; border: 1px solid var(--line); background: #15222c; }
.log-heading { padding: 10px 12px; color: #b9d6d9; border-bottom: 1px solid rgba(255,255,255,.12); font-family: var(--mono); font-size: 11px; }
.log-heading .text-button { color: #b9d6d9; }
.log-panel pre { height: 158px; overflow: auto; margin: 0; padding: 13px; color: #dcebed; font-family: var(--mono); font-size: 10px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.result-area { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-heading small { color: var(--ink-soft); font-size: 11px; }
.result-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.result-files a { padding: 7px 9px; border: 1px solid var(--line); color: var(--ink); font-family: var(--mono); font-size: 10px; text-decoration: none; }
.result-files a:hover { border-color: var(--cyan); color: var(--cyan); }
.footer { display: flex; justify-content: space-between; width: min(1220px, 90vw); margin: 0 auto; padding: 20px 0 30px; color: var(--ink-soft); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 820px) {
  .shell { width: min(92vw, 640px); padding-top: 42px; }
  .intro { align-items: start; flex-direction: column; gap: 24px; }
  .intro-stat { padding-left: 16px; }
  .work-grid, .detail-grid { grid-template-columns: 1fr; }
  .job-row { grid-template-columns: minmax(0, 1fr) 82px; gap: 10px; padding: 14px 18px; }
  .job-progress { grid-column: 1 / -1; grid-row: 2; }
  .job-status { grid-column: 2; grid-row: 1; }
  .panel-heading { padding: 0 18px; }
  .history-panel { padding-top: 24px; }
  .detail-panel, .upload-panel { padding: 20px; }
  .footer { width: 92vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
