:root {
  --paper: #f4f2eb;
  --surface: #fffefa;
  --ink: #26332c;
  --muted: #737d76;
  --line: #dcded5;
  --forest: #2f493b;
  --sage: #e8ecdf;
  --blue: #536b9c;
  --danger: #a65f52;
}

* { box-sizing: border-box; }
html { color: var(--ink); background: var(--paper); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
body {
  min-height: 100svh;
  margin: 0;
  background: radial-gradient(circle at 92% 6%, #dfe6d4 0, transparent 27%), var(--paper);
}
button, input, textarea { font: inherit; }
button, a { transition: background-color .16s, border-color .16s, color .16s, transform .16s; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #8da58066; outline-offset: 3px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: #f5f3ecdf;
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--forest); color: #f6f6ef; font: 20px/1 Georgia, serif; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.brand b { font-size: 15px; font-weight: 600; }
.brand small { color: #929990; font-size: 9px; letter-spacing: .8px; }
nav { display: flex; gap: 22px; font-size: 13px; }
nav a { color: #69736b; text-decoration: none; }
nav a:hover { color: var(--forest); }

main { width: min(100% - 48px, 1180px); margin: 0 auto; padding: 50px 0 64px; }
.intro { max-width: 780px; }
.eyebrow { color: #778673; font-size: 10px; font-weight: 600; letter-spacing: 2px; }
h1 { margin: 16px 0 14px; font: 500 clamp(36px, 5.2vw, 64px)/1.18 Georgia, "Songti SC", serif; letter-spacing: -1.8px; }
h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
h3 { margin: 5px 0 0; font-size: 18px; font-weight: 600; }
.intro p { max-width: 680px; color: var(--muted); font-size: 15px; line-height: 1.9; }

label { display: block; margin: 18px 0 8px; color: #5e6b5e; font-size: 12px; font-weight: 600; }
input, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #d8ddd1;
  border-radius: 10px;
  background: #fbfcf8;
  color: #334037;
  font-size: 15px;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.75; }
input::placeholder, textarea::placeholder { color: #a8b0a5; }

.primary, .secondary, .primary-link, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.primary { border: 1px solid var(--forest); background: var(--forest); color: #f8f9f3; }
.primary:hover { background: #3c5747; transform: translateY(-1px); }
.secondary { border: 1px solid #ccd4c7; background: #fbfcf8; color: #56694f; }
.secondary:hover { background: #eef2e8; }
.primary:disabled, .secondary:disabled { cursor: wait; opacity: .55; transform: none; }
.primary-link { border: 1px solid var(--forest); background: var(--forest); color: white; }
.text-button { min-height: 40px; border: 0; background: transparent; color: #5c7255; padding: 0; }
.status { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 12px; line-height: 1.65; }
.status.success { color: #5f805d; }

.auth-panel {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 70px;
  align-items: start;
  margin-top: 44px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 70px #34472d0d;
}
.auth-panel p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.auth-panel form { padding: 22px; border-radius: 14px; background: #f1f4eb; }
.auth-panel form .primary { width: 100%; margin-top: 8px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-row button { flex: none; min-height: 48px; padding: 0 14px; border: 1px solid #cdd6c7; border-radius: 9px; background: #fbfcf8; color: #60725b; font-size: 12px; }

.workspace { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; margin-top: 44px; align-items: start; }
.job-sidebar, .job-main > div, .job-main > section { border: 1px solid var(--line); background: var(--surface); }
.job-sidebar { position: sticky; top: 20px; padding: 18px; border-radius: 16px; }
.sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sidebar-head h2 { margin-top: 7px; font-size: 18px; }
.sidebar-head button { min-height: 32px; border: 1px solid #d9dfd4; border-radius: 7px; background: #f8faf5; color: #73816d; font-size: 11px; }
.job-list { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.job-item { width: 100%; padding: 13px; border: 1px solid #e0e4dc; border-radius: 10px; background: #fbfcf8; color: #5d685c; text-align: left; }
.job-item:hover { border-color: #c8d3c4; background: #f3f6ee; }
.job-item.active { border-color: #9cae94; background: #eef3e8; box-shadow: 0 0 0 2px #9cae941a; }
.job-item b { display: block; color: #39473b; font-size: 13px; }
.job-item small { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #929b90; font-size: 10px; }

.job-main { min-width: 0; }
.job-main > div, .job-main > section { border-radius: 16px; }
.empty-state { display: flex; min-height: 430px; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 50%; background: var(--sage); color: #6b8064; font-size: 28px; }
.empty-state p { max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.empty-state .primary-link { margin-top: 12px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid #ebece7; }
.detail-head h2 { margin-top: 8px; }
.detail-head p { margin: 7px 0 0; color: #8a9387; font-size: 12px; }
.status-badge { flex: none; padding: 7px 10px; border-radius: 999px; background: #eef2e8; color: #657b5e; font-size: 11px; }
.status-badge.processing { background: #fff3e2; color: #a7753d; }
.status-badge.ready { background: #edf1fd; color: #6075a7; }
.status-badge.completed { background: #e8f4eb; color: #4d815b; }
.status-badge.failed { background: #fff0ee; color: #a75b50; }

.submit-card, .progress-card, .result-card, .notice-card { margin-top: 16px; padding: 24px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.card-head > span { color: #90998e; font-size: 10px; text-align: right; }
.file-drop { position: relative; padding: 22px; border: 1px dashed #c7d0c2; border-radius: 12px; background: #f7f9f3; text-align: center; }
.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop b { display: block; color: #53664e; font-size: 14px; }
.file-drop small { display: block; margin-top: 7px; color: #909b8c; font-size: 11px; }
.submit-card .primary { width: 100%; margin-top: 16px; }

.progress-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.progress-line { grid-column: 1 / -1; height: 3px; margin-bottom: 4px; border-radius: 99px; background: #e2e7dd; overflow: hidden; }
.progress-line i { display: block; width: 38%; height: 100%; background: #758d6c; }
.progress-step { opacity: .48; }
.progress-step.done, .progress-step.active { opacity: 1; }
.progress-step b { display: block; font-size: 13px; }
.progress-step span { display: block; margin-top: 6px; color: #7f887d; font-size: 11px; line-height: 1.65; }
.progress-step.done b::before { content: '✓ '; color: #5d8058; }
.progress-step.active b::before { content: '● '; color: #5874a5; }

.download-row { display: flex; gap: 10px; margin: 20px 0; }
.result-card details { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e7e9e3; }
.result-card summary { cursor: pointer; color: #5c6b59; font-size: 12px; }
.result-card pre { max-height: 430px; overflow: auto; margin: 12px 0 0; padding: 16px; border-radius: 10px; background: #f4f6ef; color: #485447; font: 13px/1.8 "Microsoft YaHei", sans-serif; white-space: pre-wrap; word-break: break-word; }
.revision-note { color: #899287; font-size: 11px; line-height: 1.7; }
.notice-card { background: #eef1e8; }
.notice-card b { font-size: 13px; color: #52644e; }
.notice-card p { margin: 7px 0 0; color: #808a7c; font-size: 11px; line-height: 1.75; }

footer { display: flex; justify-content: space-between; gap: 16px; width: min(100% - 48px, 1180px); margin: 0 auto; padding: 20px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: #99a096; font-size: 10px; }
[hidden] { display: none!important; }

@media(max-width:850px) {
  main { width: calc(100% - 32px); padding-top: 34px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .job-sidebar, .job-main { min-width: 0; position: static; }
  .job-list { flex-direction: row; overflow-x: auto; }
  .job-item { min-width: 220px; }
  .auth-panel { grid-template-columns: 1fr; gap: 20px; }
}

@media(max-width:560px) {
  .topbar { min-height: 64px; padding-left: 18px; padding-right: 18px; }
  nav a:first-child { display: none; }
  h1 { font-size: 38px; }
  .auth-panel { padding: 20px; }
  .auth-panel form { padding: 17px; }
  .detail-head, .submit-card, .progress-card, .result-card, .notice-card { padding: 18px; }
  .detail-head { flex-direction: column; }
  .progress-card { grid-template-columns: 1fr; }
  .download-row { flex-direction: column; }
  .card-head { flex-direction: column; }
  .card-head > span { text-align: left; }
  footer { width: calc(100% - 32px); flex-direction: column; }
}

@media(prefers-reduced-motion:reduce) {
  * { animation: none!important; transition: none!important; }
}
