:root {
  --ink: #18221d;
  --muted: #66716b;
  --line: #dce2de;
  --paper: #f7f8f6;
  --white: #ffffff;
  --green: #126b48;
  --green-dark: #0b5135;
  --green-soft: #e6f1eb;
  --yellow: #f3c84b;
  --red: #b33b31;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, textarea { font: inherit; }
button, .dropzone, .file-row { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 68px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 11px; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--green); color: white; border-radius: 6px; }
.brand-mark svg, button svg, .upload-icon svg, .result-icon svg, .download-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.connection { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.connection i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #a8afa9; }
.connection.online i { background: #38a76c; box-shadow: 0 0 0 3px #dff1e7; }
.connection.offline i { background: var(--red); }

.workspace { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 52px; }
.intro { display: grid; grid-template-columns: 1fr auto; column-gap: 48px; align-items: end; margin-bottom: 36px; }
.intro .eyebrow, .result-copy .eyebrow { grid-column: 1; margin: 0 0 11px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 1.7px; }
.intro h1 { grid-column: 1; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(36px, 5vw, 56px); font-weight: 600; line-height: 1.12; letter-spacing: 0; }
.intro > p:not(.eyebrow) { grid-column: 1; max-width: 680px; margin: 18px 0 0; color: var(--muted); line-height: 1.75; }
.metrics { grid-column: 2; grid-row: 1 / span 3; align-self: stretch; min-width: 225px; padding-left: 32px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.metrics strong { display: inline-block; min-width: 63px; color: var(--ink); font-family: Georgia, serif; font-size: 19px; }

.workbench { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--green); box-shadow: 0 12px 40px rgba(22, 42, 31, .055); }
form { padding: 36px 40px 28px; }
.section-heading { min-height: 46px; display: flex; align-items: flex-start; gap: 15px; }
.step { flex: 0 0 34px; height: 26px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); border-radius: 4px; font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.section-heading h2 { margin: -3px 0 3px; font-size: 18px; letter-spacing: 0; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.file-counter { margin-left: auto; padding: 5px 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.field-grid { margin: 23px 0 0 49px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 9px; font-size: 13px; font-weight: 650; }
.field em { margin-left: 4px; color: var(--red); font-size: 11px; font-style: normal; font-weight: 500; }
input, textarea { width: 100%; border: 1px solid #cfd7d2; border-radius: 4px; background: #fbfcfb; color: var(--ink); outline: none; transition: border-color .18s, box-shadow .18s; }
input { height: 48px; padding: 0 14px; }
textarea { min-height: 90px; padding: 13px 14px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18, 107, 72, .1); }
input::placeholder, textarea::placeholder { color: #9aa39e; }
.divider { height: 1px; background: var(--line); margin: 34px 0; }

.dropzone { margin: 23px 0 0 49px; min-height: 162px; border: 1px dashed #aebbb4; background: #fafcfa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: .18s ease; }
.dropzone:hover, .dropzone:focus, .dropzone.dragging { border-color: var(--green); background: #f2f8f4; outline: none; }
.upload-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; margin-bottom: 2px; }
.dropzone strong { font-size: 14px; }
.dropzone > span:last-child { color: var(--muted); font-size: 12px; }
.file-list { list-style: none; margin: 14px 0 0 49px; padding: 0; display: grid; gap: 8px; }
.file-row { min-height: 52px; padding: 8px 10px; display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 10px; border: 1px solid var(--line); background: white; }
.file-row.drag-over { border-color: var(--green); box-shadow: inset 3px 0 var(--green); }
.drag-handle { color: #9ca69f; cursor: grab; font-size: 16px; letter-spacing: -3px; }
.file-info { min-width: 0; }
.file-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-info span { color: var(--muted); font-size: 11px; }
.file-order { color: var(--muted); font: 12px Georgia, serif; }
.icon-button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 4px; font-size: 20px; }
.icon-button:hover { background: #f5e8e6; color: var(--red); }
.form-error { min-height: 18px; margin: 10px 0 0 49px; color: var(--red); font-size: 12px; }
.action-row { margin: 16px -40px -28px; min-height: 82px; padding: 16px 40px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: #fafbfa; }
.action-row p { color: var(--muted); font-size: 12px; }
.lock-icon { color: var(--green); font-size: 8px; margin-right: 7px; }
.primary-button { height: 48px; padding: 0 17px 0 22px; display: flex; align-items: center; gap: 17px; border: 0; border-radius: 4px; color: white; background: var(--green); font-weight: 700; cursor: pointer; transition: background .18s, transform .18s; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { background: #8ca69a; cursor: wait; }

.result-panel { position: relative; margin-top: 20px; background: white; border: 1px solid var(--line); overflow: hidden; }
.status-rail { height: 3px; background: #e8ece9; }
.status-rail span { display: block; width: 8%; height: 100%; background: var(--yellow); transition: width .45s ease; }
.result-content { min-height: 138px; padding: 28px 32px; display: flex; align-items: flex-start; gap: 18px; }
.result-icon { flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.result-icon svg { width: 23px; }
.result-copy { min-width: 0; flex: 1; }
.result-copy .eyebrow { margin-bottom: 5px; }
.result-copy h2 { margin: 0 0 5px; font-size: 18px; }
.result-copy > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-line; }
.workflow-steps { display: flex; gap: 8px; margin-top: 14px; }
.workflow-steps span { padding: 4px 8px; border: 1px solid var(--line); color: #8a948e; font-size: 11px; }
.workflow-steps span.active { border-color: #b8d5c5; background: var(--green-soft); color: var(--green); }
.download-button { align-self: center; height: 42px; padding: 0 15px; display: flex; align-items: center; gap: 8px; color: var(--green); border: 1px solid var(--green); border-radius: 4px; text-decoration: none; font-size: 13px; font-weight: 700; }
.download-button:hover { color: white; background: var(--green); }

footer { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 0 0 28px; display: flex; justify-content: space-between; color: #89928d; font-size: 11px; }

@media (max-width: 720px) {
  .topbar { height: 60px; padding: 0 18px; }
  .connection span { display: none; }
  .workspace { width: min(100% - 28px, 600px); padding: 40px 0 36px; }
  .intro { display: block; }
  .intro h1 { font-size: 38px; }
  .metrics { margin-top: 27px; padding: 15px 0 0; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; justify-content: space-between; gap: 8px; }
  .metrics span { display: flex; flex-direction: column; }
  .metrics strong { min-width: 0; }
  form { padding: 28px 20px 22px; }
  .field-grid { margin-left: 0; grid-template-columns: 1fr; }
  .dropzone, .file-list, .form-error { margin-left: 0; }
  .dropzone { padding: 24px 14px; text-align: center; }
  .action-row { margin: 16px -20px -22px; padding: 18px 20px; align-items: stretch; flex-direction: column; }
  .action-row p { margin: 0 0 13px; }
  .primary-button { justify-content: center; }
  .result-content { padding: 24px 20px; flex-wrap: wrap; }
  .result-copy { flex-basis: calc(100% - 62px); }
  .download-button { margin-left: 62px; }
  .workflow-steps { flex-wrap: wrap; }
  footer { width: calc(100% - 28px); }
}

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