:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-raised: #0b1727;
  --panel: #0d1b2d;
  --panel-soft: #102238;
  --line: rgba(167, 199, 220, 0.15);
  --line-strong: rgba(167, 199, 220, 0.26);
  --text: #f3f8fb;
  --muted: #92a8bb;
  --muted-bright: #b9cbd7;
  --accent: #20c6c7;
  --accent-strong: #13a6ad;
  --accent-ink: #031d23;
  --blue: #52a7ff;
  --danger: #ff7d7d;
  --warning: #f6c76a;
  --success: #4cdaa4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.27);
  --radius: 18px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 0%, rgba(15, 126, 139, 0.16), transparent 27rem),
    linear-gradient(180deg, #07111f 0%, #081423 100%);
  font-size: 16px;
  line-height: 1.55;
}

button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: .02em;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 16px;
  background: linear-gradient(145deg, #16a9b2, #087581);
  box-shadow: 0 12px 30px rgba(8, 127, 140, .24);
}

.brand-mark span {
  width: 3px;
  border-radius: 999px;
  background: #eaffff;
}

.brand-mark span:nth-child(1), .brand-mark span:nth-child(5) { height: 12px; opacity: .75; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(4) { height: 23px; }
.brand-mark span:nth-child(3) { height: 32px; }
.brand-mark.compact { width: 34px; height: 34px; border-radius: 10px; gap: 2px; }
.brand-mark.compact span { width: 2px; }
.brand-mark.compact span:nth-child(1), .brand-mark.compact span:nth-child(5) { height: 8px; }
.brand-mark.compact span:nth-child(2), .brand-mark.compact span:nth-child(4) { height: 14px; }
.brand-mark.compact span:nth-child(3) { height: 20px; }

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.topbar-actions form { margin: 0; }

.private-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-bright);
  font-size: .875rem;
}

.private-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(76, 218, 164, .1);
}

.text-button, .refresh-button, .icon-button, .reveal-button {
  border: 0;
  background: none;
  cursor: pointer;
}

.text-button, .refresh-button { color: var(--muted-bright); font-size: .9rem; }
.text-button:hover, .refresh-button:hover { color: var(--text); }

.workspace {
  width: min(1180px, calc(100% - 40px));
  margin: 34px auto 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
  gap: 20px;
  align-items: stretch;
}

.upload-panel, .process-panel, .tasks-section {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(14, 30, 49, .96), rgba(10, 24, 40, .96));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.upload-panel { padding: 32px; }
.process-panel { padding: 32px 28px; }

.section-heading, .tasks-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 1.5rem; line-height: 1.25; letter-spacing: -.025em; }
h3 { margin-bottom: 4px; }

.model-chip {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(32, 198, 199, .28);
  border-radius: 999px;
  color: #83e7e4;
  background: rgba(32, 198, 199, .07);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .75rem;
}

.drop-zone {
  min-height: 272px;
  margin-top: 28px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed rgba(121, 191, 208, .4);
  border-radius: 15px;
  background:
    linear-gradient(rgba(12, 37, 57, .72), rgba(12, 37, 57, .72)),
    repeating-linear-gradient(90deg, transparent 0, transparent 25px, rgba(32, 198, 199, .025) 26px);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}

.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(19, 166, 173, .09);
  outline: none;
}

.drop-zone.dragging { transform: scale(.995); }
.upload-icon { width: 48px; height: 48px; margin-bottom: 16px; padding: 12px; border-radius: 14px; color: var(--accent); background: rgba(32, 198, 199, .1); }
.upload-icon svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { font-size: 1.1rem; }
.drop-zone > span:nth-of-type(2) { margin-top: 4px; color: var(--muted); font-size: .88rem; }

.choose-button {
  margin-top: 20px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--muted-bright);
  background: rgba(255,255,255,.025);
  font-size: .88rem;
}

.selected-file {
  margin-top: 20px;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(3, 12, 22, .28);
}

.file-symbol { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: #a7f7f1; background: rgba(32, 198, 199, .1); font-size: .72rem; }
.file-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy span { color: var(--muted); font-size: .82rem; }
.icon-button { width: 38px; height: 38px; border-radius: 9px; color: var(--muted); font-size: 1.4rem; }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.05); }

.upload-options { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; border-radius: 99px; background: #304258; transition: background .2s; }
.switch::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #dce7ed; transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--accent-strong); }
.switch-row input:checked + .switch::after { transform: translateX(18px); background: white; }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--blue); outline-offset: 3px; }
.switch-row > span:last-child { display: flex; flex-direction: column; }
.switch-row strong { font-size: .92rem; }
.switch-row small { color: var(--muted); font-size: .78rem; }

.primary-button {
  min-height: 44px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  border: 0;
  border-radius: 10px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #47dbd7, #20b8c0);
  box-shadow: 0 10px 26px rgba(21, 172, 181, .16);
  font-weight: 750;
  cursor: pointer;
  transition: filter .2s, transform .2s;
}

.primary-button:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.primary-button.wide { width: 100%; }

.upload-progress { margin-top: 22px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted-bright); font-size: .86rem; }
.progress-copy strong { color: var(--text); }
.progress-track { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), #50ddd8); transition: width .2s; }
.upload-progress p { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }
.global-message { margin: 16px 0 0; color: var(--danger); font-size: .88rem; }

.process-list { list-style: none; margin: 23px 0 24px; padding: 0; }
.process-list li { position: relative; min-height: 65px; display: flex; gap: 15px; }
.process-list li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 35px; bottom: 7px; width: 1px; background: var(--line-strong); }
.process-list li > span { z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); background: var(--panel); font-family: ui-monospace, monospace; font-size: .68rem; }
.process-list div { padding-top: 3px; display: flex; flex-direction: column; }
.process-list strong { font-size: .92rem; }
.process-list small { color: var(--muted); font-size: .77rem; }

.leave-note { display: flex; gap: 12px; padding: 15px; border: 1px solid rgba(76, 218, 164, .16); border-radius: 12px; background: rgba(76, 218, 164, .055); }
.leave-note > span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #021b14; background: var(--success); font-size: .78rem; font-weight: 900; }
.leave-note p { margin: 0; color: var(--muted); font-size: .79rem; }
.leave-note strong { color: var(--muted-bright); font-size: .84rem; }

.tasks-section { grid-column: 1 / -1; margin-top: 6px; padding: 30px 32px; }
.refresh-button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; }
.task-list { margin-top: 22px; display: grid; gap: 10px; }

.task-card {
  display: grid;
  grid-template-columns: minmax(210px, 1.45fr) minmax(190px, .85fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 96px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 16, 29, .32);
}

.task-file { min-width: 0; display: flex; align-items: center; gap: 14px; }
.task-file-icon { width: 42px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-bright); background: var(--panel-soft); font-size: .68rem; font-weight: 800; }
.task-file-copy { min-width: 0; }
.task-file-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.task-file-copy small { color: var(--muted); font-size: .75rem; }
.task-state { min-width: 0; }
.state-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.state-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-bright); font-size: .82rem; }
.state-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.state-label.active::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(32,198,199,.09); animation: pulse 1.8s infinite; }
.state-label.done::before { background: var(--success); }
.state-label.failed::before { background: var(--danger); }
.state-line > span:last-child { color: var(--muted); font-size: .74rem; }
.task-progress { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.task-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s; }
.task-message { grid-column: 1 / -1; margin: -10px 0 0 56px; color: var(--warning); font-size: .78rem; }
.task-message.error { color: var(--danger); }
.task-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.action-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--muted-bright); background: transparent; text-decoration: none; font-size: .78rem; cursor: pointer; }
.action-button:hover { color: var(--text); border-color: rgba(167,199,220,.45); }
.action-button.highlight { border-color: rgba(32,198,199,.34); color: #97efed; background: rgba(32,198,199,.08); }
.action-button.danger { color: #dca1a1; }

.empty-state { padding: 54px 20px 36px; text-align: center; color: var(--muted); }
.empty-state > span { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--accent); font-family: ui-monospace, monospace; font-size: .73rem; font-weight: 800; }
.empty-state h3 { color: var(--muted-bright); font-size: 1rem; }
.empty-state p { font-size: .84rem; }

.login-page { display: grid; place-items: center; padding: 30px 20px; }
.login-shell { width: min(100%, 420px); }
.login-card { padding: 42px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(14,30,49,.97), rgba(8,20,34,.98)); box-shadow: var(--shadow); }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h1 { font-size: 2rem; }
.login-intro { margin: 8px 0 28px; color: var(--muted); }
.login-form label { display: block; margin-bottom: 8px; color: var(--muted-bright); font-size: .86rem; }
.password-field { position: relative; margin-bottom: 16px; }
.password-field input { width: 100%; height: 50px; padding: 0 66px 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; color: var(--text); background: rgba(3,12,22,.48); }
.password-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(32,198,199,.09); }
.reveal-button { position: absolute; right: 8px; top: 7px; height: 36px; color: var(--muted); font-size: .78rem; }
.form-error { margin: -4px 0 14px; color: var(--danger); font-size: .84rem; }
.privacy-note { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: .76rem; }

@keyframes pulse { 50% { opacity: .42; } }

@media (max-width: 840px) {
  .workspace { grid-template-columns: 1fr; }
  .process-panel { display: none; }
  .tasks-section { grid-column: auto; }
  .task-card { grid-template-columns: 1fr auto; }
  .task-state { grid-column: 1 / -1; grid-row: 2; }
  .task-actions { grid-column: 2; grid-row: 1; }
  .task-message { grid-column: 1 / -1; margin: 0; }
}

@media (max-width: 600px) {
  .topbar, .workspace { width: min(100% - 24px, 1180px); }
  .topbar { height: 66px; }
  .private-badge { display: none; }
  .workspace { margin-top: 18px; }
  .upload-panel, .tasks-section { padding: 22px 18px; }
  .section-heading { flex-direction: column; gap: 10px; }
  .drop-zone { min-height: 220px; margin-top: 22px; padding: 20px; }
  .upload-options { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .task-card { grid-template-columns: 1fr; gap: 14px; }
  .task-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .task-state { grid-column: 1; grid-row: auto; }
  .login-card { padding: 32px 24px; }
}

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

