:root {
  color-scheme: dark;
  --bg: #080a0d;
  --panel: rgba(18, 21, 27, 0.82);
  --panel-strong: #13171d;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #8d96a6;
  --text: #f6f7f9;
  --orange: #ff6b22;
  --orange-bright: #ff9b54;
  --green: #54d39d;
  --red: #ff6969;
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 50% -10%, #18202d 0, transparent 38%), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }

.ambient { position: fixed; width: 480px; height: 480px; border-radius: 50%; filter: blur(120px); opacity: .1; pointer-events: none; }
.ambient-one { top: 18%; left: -300px; background: var(--orange); }
.ambient-two { right: -330px; bottom: 0; background: #3c7fff; }

.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(28px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--line); background: rgba(8, 10, 13, .72); backdrop-filter: blur(18px); position: relative; z-index: 3; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: var(--orange); }
.brand-mark svg { width: 100%; }
.runtime-pill { font: 500 11px/1 "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; color: #bcc4cf; border: 1px solid var(--line); padding: 9px 12px; border-radius: 999px; background: rgba(255,255,255,.025); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(84,211,157,.08); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; position: relative; z-index: 1; }
.hero { text-align: center; padding: 82px 0 58px; }
.eyebrow { font: 500 11px/1 "DM Mono", monospace; letter-spacing: .22em; color: var(--orange-bright); margin-bottom: 20px; }
.hero h1 { font-size: clamp(42px, 6vw, 76px); line-height: 1.03; letter-spacing: -.055em; margin: 0; font-weight: 800; }
.hero h1 span { color: transparent; background: linear-gradient(100deg, #fff 10%, #ffb17b 48%, var(--orange) 92%); background-clip: text; -webkit-background-clip: text; }
.hero > p { max-width: 650px; margin: 24px auto 30px; color: #9ca4b0; font-size: 16px; line-height: 1.8; }
.hero-metrics { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.02); }
.hero-metrics div { min-width: 126px; padding: 13px 18px; display: grid; gap: 2px; border-right: 1px solid var(--line); }
.hero-metrics div:last-child { border-right: 0; }
.hero-metrics strong { font: 500 13px/1.4 "DM Mono", monospace; }
.hero-metrics span { color: var(--muted); font-size: 11px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(320px, .78fr); gap: 18px; align-items: stretch; }
.panel { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); border-radius: 18px; box-shadow: 0 26px 70px rgba(0,0,0,.28); }
.upload-panel { padding: 28px; min-height: 580px; }
.settings-panel { padding: 28px; }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 25px; }
.panel-heading h2 { font-size: 17px; margin: 0 0 3px; letter-spacing: -.02em; }
.panel-heading p { color: var(--muted); margin: 0; font-size: 12px; }
.step { color: var(--orange-bright); font: 500 10px/1 "DM Mono", monospace; border: 1px solid rgba(255,107,34,.3); background: rgba(255,107,34,.08); padding: 7px; border-radius: 7px; }

.dropzone { width: 100%; height: 300px; display: grid; place-items: center; align-content: center; gap: 9px; border: 1px dashed rgba(255,255,255,.18); background: linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.01)); border-radius: 14px; cursor: pointer; transition: border .2s, background .2s, transform .2s; }
.dropzone:hover, .dropzone.dragging { border-color: rgba(255,107,34,.7); background: rgba(255,107,34,.055); transform: translateY(-2px); }
.upload-icon { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid rgba(255,107,34,.25); border-radius: 15px; color: var(--orange-bright); background: rgba(255,107,34,.07); margin-bottom: 8px; }
.upload-icon svg { width: 34px; }
.dropzone strong { font-size: 15px; }
.dropzone > span:not(.upload-icon) { color: var(--muted); font-size: 12px; }
.dropzone small { font: 400 10px/1.4 "DM Mono", monospace; color: #697281; margin-top: 12px; }
.file-list { margin-top: 16px; display: grid; gap: 8px; }
.file-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; min-height: 60px; padding: 10px 12px; background: rgba(255,255,255,.028); border: 1px solid var(--line); border-radius: 11px; }
.file-type { width: 38px; height: 38px; display: grid; place-items: center; background: #1b2028; border-radius: 8px; color: var(--orange-bright); font: 500 9px/1 "DM Mono", monospace; text-transform: uppercase; }
.file-meta { min-width: 0; }
.file-meta strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta small { color: var(--muted); font-size: 10px; }
.file-action { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px; }
.file-action:hover { color: var(--text); }
.status-badge { font: 500 10px/1 "DM Mono", monospace; color: var(--muted); }
.status-badge.working { color: var(--orange-bright); }
.status-badge.done { color: var(--green); }
.status-badge.error { color: var(--red); }
.download-link { color: var(--green); font-size: 11px; text-decoration: none; border-bottom: 1px solid rgba(84,211,157,.35); }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend, .input-grid label { color: #b9c0ca; font-size: 11px; font-weight: 600; margin-bottom: 9px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.2); }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 10px; text-align: center; border-radius: 7px; color: var(--muted); font: 500 11px/1 "DM Mono", monospace; cursor: pointer; }
.segmented input:checked + span { color: #fff; background: #272d36; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.input-grid label { display: grid; gap: 8px; margin: 0; }
.input-grid input { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.2); color: var(--text); padding: 11px 12px; outline: none; font: 500 12px/1 "DM Mono", monospace; }
.input-grid input:focus { border-color: rgba(255,107,34,.65); }
.toggle-row { min-height: 61px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row span { display: grid; gap: 3px; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { color: var(--muted); font-size: 10px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { width: 36px; height: 20px; border-radius: 999px; background: #303640; position: relative; transition: background .2s; }
.toggle-row i::after { content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; border-radius: 50%; background: #929aa6; transition: transform .2s, background .2s; }
.toggle-row input:checked + i { background: rgba(255,107,34,.35); }
.toggle-row input:checked + i::after { transform: translateX(16px); background: var(--orange); }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; padding: 12px; border-radius: 10px; color: #9099a6; background: rgba(84,211,157,.045); border: 1px solid rgba(84,211,157,.1); font-size: 10px; line-height: 1.55; }
.privacy-note svg { flex: 0 0 18px; color: var(--green); }
.run-button { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 10px; background: linear-gradient(110deg, #f45c17, #ff8138); color: white; font-weight: 700; font-size: 13px; box-shadow: 0 12px 28px rgba(255,107,34,.18); cursor: pointer; transition: transform .2s, filter .2s, opacity .2s; }
.run-button svg { width: 17px; }
.run-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.run-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.api-status { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 13px; color: var(--muted); }
.api-status span { width: 6px; height: 6px; border-radius: 50%; background: #697281; }
.api-status em { font-size: 9px; font-style: normal; font-family: "DM Mono", monospace; }
.api-status.online span { background: var(--green); }
.api-status.offline span { background: var(--red); }

footer { width: min(1180px, calc(100% - 40px)); margin: 28px auto 0; padding: 22px 0 34px; border-top: 1px solid var(--line); color: #596170; display: flex; justify-content: space-between; gap: 20px; font: 400 9px/1.4 "DM Mono", monospace; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .hero { padding-top: 60px; }
  .hero h1 { font-size: clamp(40px, 12vw, 62px); }
  .runtime-pill { display: none; }
}

@media (max-width: 520px) {
  main { width: min(100% - 24px, 1180px); }
  .topbar { padding: 0 16px; }
  .hero { padding: 48px 4px 40px; }
  .hero h1 br { display: none; }
  .hero-metrics { width: 100%; }
  .hero-metrics div { min-width: 0; flex: 1; padding: 12px 7px; }
  .panel, .upload-panel, .settings-panel { padding: 20px; border-radius: 14px; }
  .dropzone { height: 250px; }
  footer { width: calc(100% - 24px); flex-direction: column; }
}

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