:root {
  --primary: #0054a6;
  --primary-deep: #004b96;
  --primary-soft: #eff4ff;
  --primary-line: #b9d9f5;
  --bg: #e9ebee;
  --panel: #ffffff;
  --text: #1f2a37;
  --muted: #667085;
  --border: #dce3ec;
  --surface-soft: #f8fafc;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgb(47 128 237 / 28%); outline-offset: 2px; }

.auth-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: clamp(22px, 5vw, 64px);
  background: #087bc8 url('/assets/signin-background.webp') center / cover no-repeat;
}

.auth-card {
  display: grid;
  width: min(720px, 100%);
  min-height: 420px;
  grid-template-columns: 44% 56%;
  overflow: hidden;
  border-radius: 24px;
  background: #edfbfe;
  box-shadow: 0 26px 64px rgb(0 36 110 / 28%);
}

.auth-visual {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 34px 28px;
  background: radial-gradient(circle at 30% 14%, #fff 0%, #edfbfe 58%, #e0f7fd 100%);
}

.brand-logo { width: 190px; max-width: 90%; mix-blend-mode: multiply; }
.auth-product { max-width: 220px; text-align: center; }
.auth-product strong { display: block; color: #08101f; font-size: 22px; letter-spacing: -.03em; }
.auth-product span { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.auth-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 40px 42px 44px;
  background: rgb(237 251 254 / 94%);
}
.auth-panel::before { content: ''; position: absolute; top: 36px; bottom: 36px; left: 0; width: 1px; background: linear-gradient(to bottom, transparent, rgb(4 107 167 / 14%) 14%, rgb(4 107 167 / 14%) 86%, transparent); }
.mobile-logo { display: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 22px; padding: 4px; border-radius: 10px; background: rgb(255 255 255 / 58%); }
.auth-tab { min-height: 36px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; }
.auth-tab.active { color: var(--primary); background: #fff; box-shadow: var(--shadow); }
.auth-panel h1 { margin: 0; color: #08101f; font-size: 27px; letter-spacing: -.04em; line-height: 1.2; }
.auth-note { margin: 7px 0 22px; color: var(--muted); font-size: 13px; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; color: #344054; font-size: 13px; font-weight: 700; }
.field input, .file-input {
  width: 100%; min-height: 43px; padding: 10px 13px; color: var(--text); background: rgb(255 255 255 / 78%); border: 1px solid #a9c8e7; border-radius: 9px; outline: none;
}
.field input:focus { border-color: #0789d0; box-shadow: 0 0 0 3px rgb(11 176 220 / 16%); background: #fff; }
.field small { color: var(--muted); font-weight: 400; line-height: 1.5; }

.button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border-radius: var(--radius); cursor: pointer; font-weight: 800; text-decoration: none; transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.button:active { transform: translateY(1px) scale(.99); }
.button:disabled { cursor: not-allowed; opacity: .58; }
.button-primary { color: #fff; background: var(--primary); border: 1px solid var(--primary); }
.button-primary:hover:not(:disabled) { background: var(--primary-deep); border-color: var(--primary-deep); box-shadow: 0 6px 14px rgb(0 84 166 / 16%); }
.button-ghost { color: var(--primary); background: #fff; border: 1px solid var(--primary-line); }
.button-ghost:hover:not(:disabled) { color: var(--primary-deep); background: var(--primary-soft); border-color: #8fc5f0; }
.auth-submit { min-height: 46px; margin-top: 5px; border: 0; border-radius: 10px; background: linear-gradient(100deg, #22cad8 0%, #109bca 45%, #0054a6 100%); box-shadow: 0 12px 24px rgb(7 118 213 / 24%); }

.form-message { margin: 0; padding: 10px 12px; border: 1px solid; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.error-message { color: var(--danger); background: var(--danger-soft); border-color: #fecdca; }
.warning-message { color: var(--warning); background: var(--warning-soft); border-color: #fedf89; }
.success-message { color: var(--success); background: var(--success-soft); border-color: #abefc6; }

.app-header { position: sticky; top: 0; z-index: 10; display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(16px, 4vw, 40px); color: #fff; background: var(--primary); box-shadow: 0 2px 8px rgb(0 52 104 / 18%); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 108px; height: 46px; object-fit: cover; mix-blend-mode: screen; filter: brightness(2.2) saturate(.6); }
.brand strong { font-size: 17px; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions span { max-width: 260px; overflow: hidden; color: #dcefff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.header-actions .button { min-height: 32px; color: #fff; background: rgb(255 255 255 / 9%); border-color: rgb(255 255 255 / 34%); }
.header-actions .button:hover { background: rgb(255 255 255 / 17%); }

.page { width: min(1380px, 100%); margin: 0 auto; padding: 18px clamp(14px, 3vw, 30px) 42px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 0 16px; }
.page-heading h1 { margin: 0; color: #101828; font-size: 25px; letter-spacing: -.03em; }
.page-heading p { max-width: 680px; margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.panel { overflow: hidden; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.panel-header { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 0; font-size: 17px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.task-form { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(280px, 1.5fr) auto; align-items: end; gap: 14px; padding: 18px 16px; }
.task-form .form-message { grid-column: 1 / -1; }
.system-alert { margin: 12px 16px 0; }
.file-input { padding: 8px 10px; }
.file-input::file-selector-button { height: 29px; margin-right: 10px; padding: 0 12px; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: 6px; cursor: pointer; font-weight: 700; }

.task-list { display: grid; }
.task-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) 100px minmax(180px, 1fr); align-items: center; gap: 16px; min-height: 72px; padding: 12px 16px; border-bottom: 1px solid #e7edf4; }
.task-row:last-child { border-bottom: 0; }
.task-main { display: grid; gap: 5px; }
.task-main strong { font-size: 15px; }
.task-main span { color: var(--muted); font-size: 12px; }
.status { width: fit-content; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-pending { color: #475467; background: #f2f4f7; }
.status-running { color: var(--warning); background: var(--warning-soft); }
.status-done { color: var(--success); background: var(--success-soft); }
.status-failed { color: var(--danger); background: var(--danger-soft); }
.task-action { display: flex; align-items: center; justify-content: flex-end; }
.task-error { max-width: 380px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.task-empty, .task-placeholder { display: grid; min-height: 160px; place-content: center; gap: 7px; padding: 24px; color: var(--muted); text-align: center; }
.task-empty strong { color: #344054; }

.report-page { width: min(1480px, 100%); }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.report-state { min-height: 220px; display: grid; place-items: center; padding: 28px; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.report-frame { display: block; width: 100%; min-height: calc(100dvh - 150px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
@media (max-width: 760px) {
  .auth-page { padding: 20px; }
  .auth-card { width: min(430px, 100%); min-height: 0; grid-template-columns: 1fr; border-radius: 22px; }
  .auth-visual { display: none; }
  .auth-panel { padding: 32px 26px 36px; }
  .auth-panel::before { display: none; }
  .mobile-logo { display: block; width: 150px; margin: -8px auto 16px; mix-blend-mode: multiply; }
  .auth-panel h1, .auth-note { text-align: center; }
  .app-header { min-height: 58px; padding: 0 14px; }
  .brand img { display: none; }
  .brand strong { font-size: 15px; }
  .header-actions span { display: none; }
  .page { padding: 14px 12px 30px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 22px; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .task-form { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr auto; gap: 10px; }
  .task-action { grid-column: 1 / -1; justify-content: flex-start; }
  .task-action .button { width: 100%; }
  .report-toolbar { align-items: flex-start; flex-direction: column; }
  .report-frame { min-height: calc(100dvh - 180px); }
}

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