:root {
  --page: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #18212b;
  --muted: #6f7b87;
  --subtle: #97a1ab;
  --line: #e5eaee;
  --line-strong: #d7dee4;
  --accent: #1677ff;
  --accent-dark: #0f62d6;
  --accent-soft: #eaf3ff;
  --danger: #e5484d;
  --danger-soft: #fff0f0;
  --success: #238636;
  --success-soft: #edf8ef;
  --radius: 10px;
  --shadow: 0 18px 48px rgba(37, 55, 72, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; color-scheme: light; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.2);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.app-shell { min-height: 100vh; background: var(--surface); }
.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.96); }
.header-inner, .main-content, .footer-inner { width: min(100% - 40px, 1040px); margin-inline: auto; }
.header-top {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand-block { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: var(--accent);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 18px;
  height: 7px;
  border: 3px solid #fff;
  border-top: 0;
  transform: skewY(-24deg);
}
.brand-mark::before { top: 8px; }
.brand-mark::after { top: 17px; }
.brand-copy strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.brand-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.header-meta { text-align: right; }
.header-meta strong, .header-meta span { display: block; }
.header-meta strong { font-size: 13px; font-weight: 650; }
.header-meta span { margin-top: 3px; color: var(--subtle); font-size: 12px; }
.nav-row { display: flex; align-items: center; gap: 30px; min-height: 50px; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 160ms ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); font-weight: 650; }
.nav-link.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.main-content { min-height: calc(100vh - 214px); padding-block: 34px 72px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.page-heading h1, .page-heading p { margin: 0; }
.page-heading h1 { font-size: clamp(25px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.035em; }
.page-heading p { max-width: 620px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.surface-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.query-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; }
.query-form { padding: 28px; }
.form-section + .form-section { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-heading h2, .section-heading p { margin: 0; }
.section-heading h2 { font-size: 16px; font-weight: 700; }
.section-heading p { color: var(--subtle); font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-group label { display: block; margin-bottom: 8px; color: #46515c; font-size: 13px; font-weight: 600; }
.required { color: var(--danger); }
.text-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.text-input::placeholder { color: #929da7; }
.text-input:hover { border-color: #bdc7d0; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12); outline: 0; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; color: #46515c; }
.checkbox-field input, .row-checkbox { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-field input { margin-top: 2px; }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.form-note { color: var(--subtle); font-size: 12px; }
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: 0.65; }
.button-primary { min-width: 116px; background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: #394550; }
.button-secondary:hover { border-color: #b7c2cb; background: var(--surface-soft); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover { background: #ce353b; }
.side-note { align-self: start; padding: 22px; border-top: 3px solid var(--accent); }
.side-note h2, .side-note p { margin: 0; }
.side-note h2 { font-size: 15px; }
.side-note p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.status-message {
  display: none;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--surface-soft);
  color: #46515c;
  font-size: 13px;
}
.status-message.visible { display: block; }
.status-message.success { border-color: #b8dfbf; background: var(--success-soft); color: var(--success); }
.status-message.error { border-color: #f1c1c3; background: var(--danger-soft); color: #c42e35; }
.query-progress {
  display: none;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}
.query-progress.visible { display: block; }
.progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-heading strong { font-size: 13px; }
.progress-heading span { color: var(--accent-dark); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-track { height: 7px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 300ms ease; }
.progress-detail { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.query-progress.success { border-color: #b8dfbf; background: var(--success-soft); }
.query-progress.success .progress-heading strong, .query-progress.success .progress-heading span { color: var(--success); }
.query-progress.success .progress-track span { background: var(--success); }
.query-progress.failed { border-color: #f1c1c3; background: var(--danger-soft); }
.query-progress.failed .progress-heading strong, .query-progress.failed .progress-heading span { color: var(--danger); }
.query-progress.failed .progress-track span { background: var(--danger); }
.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 33, 43, 0.52);
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.captcha-dialog {
  width: min(100%, 410px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(24, 33, 43, 0.24);
}
.captcha-heading h2, .captcha-heading p { margin: 0; }
.captcha-heading h2 { margin-top: 6px; font-size: 22px; letter-spacing: -0.025em; }
.captcha-heading p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.captcha-step { color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.captcha-image {
  display: block;
  width: 100%;
  min-height: 72px;
  max-height: 150px;
  margin-top: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-soft);
  object-fit: contain;
}
.captcha-form { margin-top: 20px; }
.captcha-form label { display: block; margin-bottom: 8px; color: #46515c; font-size: 13px; font-weight: 600; }
.captcha-form .button { width: 100%; margin-top: 16px; }
.captcha-error { min-height: 20px; margin: 7px 0 0; color: #c42e35; font-size: 12px; }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-form .text-input { width: 230px; }
.list-panel { overflow: hidden; }
.list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.list-summary strong { color: var(--ink); }
.delete-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  padding: 8px 18px;
  border-bottom: 1px solid #f1c1c3;
  background: var(--danger-soft);
}
.delete-toolbar.visible { display: flex; }
.toolbar-info { color: #b4232a; font-size: 13px; }
.toolbar-actions { display: flex; gap: 8px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; vertical-align: middle; }
.data-table th {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td { border-bottom: 1px solid var(--line); color: #37424d; font-size: 13px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfdff; }
.th-check, .td-check { width: 44px; }
.cell-id, .cell-time, .cell-cost { color: var(--muted) !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-name { max-width: 300px; color: var(--ink) !important; font-weight: 600; }
.download-link { color: var(--accent-dark); font-weight: 650; text-decoration: none; white-space: nowrap; }
.download-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
}
.status-ok { background: var(--success-soft); color: var(--success); }
.status-fail { background: var(--danger-soft); color: #c42e35; }
.empty-state { padding: 64px 24px !important; color: var(--muted) !important; text-align: center !important; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.page-button {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: #46515c;
  padding: 0 11px;
  text-decoration: none;
}
.page-button:hover:not(.disabled), .page-button.active { border-color: var(--accent); color: var(--accent-dark); }
.page-button.active { background: var(--accent-soft); font-weight: 700; }
.page-button.disabled { pointer-events: none; color: #b5bdc4; background: var(--surface-soft); }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--subtle);
  font-size: 11px;
}
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 20px;
  background: linear-gradient(180deg, #eef7fa 0, #f4f7f9 46%, #f4f7f9 100%);
}
.login-shell {
  width: min(100%, 860px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(37, 55, 72, 0.12);
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 500px;
  padding: 42px;
  background: #edf7fa;
}
.login-brand h1, .login-brand p { margin: 0; }
.login-brand h1 { max-width: 270px; font-size: 32px; line-height: 1.25; letter-spacing: -0.04em; }
.login-brand p { max-width: 280px; margin-top: 15px; color: var(--muted); line-height: 1.8; }
.login-art { position: relative; width: 160px; height: 128px; align-self: center; }
.login-art::before {
  content: "";
  position: absolute;
  inset: 16px 20px 14px;
  border: 2px solid #9dc7d0;
  border-radius: 50% 50% 44% 56%;
  transform: rotate(-8deg);
}
.login-art::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 25px;
  width: 82px;
  height: 40px;
  border-radius: 50%;
  background: rgba(22, 119, 255, 0.1);
  transform: rotate(-12deg);
}
.login-form-panel { display: flex; align-items: center; padding: 54px 64px; }
.login-form { width: 100%; }
.login-form h2, .login-form > p { margin: 0; }
.login-form h2 { font-size: 28px; letter-spacing: -0.035em; }
.login-form > p { margin-top: 8px; margin-bottom: 32px; color: var(--muted); }
.login-form .field-group + .field-group { margin-top: 20px; }
.login-form .button-primary { width: 100%; margin-top: 28px; }
.login-error { margin-top: 18px; border: 1px solid #f1c1c3; border-radius: 8px; background: var(--danger-soft); color: #b4232a; padding: 11px 13px; }

@media (max-width: 760px) {
  .header-inner, .main-content, .footer-inner { width: min(100% - 28px, 1040px); }
  .header-top { min-height: 88px; }
  .header-meta { display: none; }
  .nav-row { gap: 24px; overflow-x: auto; }
  .main-content { padding-block: 26px 52px; }
  .page-heading, .form-actions, .footer-inner { align-items: stretch; flex-direction: column; }
  .query-layout, .field-grid, .login-shell { grid-template-columns: 1fr; }
  .side-note { order: -1; }
  .query-form { padding: 22px 18px; }
  .button-primary { width: 100%; }
  .page-heading { align-items: flex-start; }
  .search-form { width: 100%; }
  .search-form .text-input { min-width: 0; width: 100%; }
  .list-summary { align-items: flex-start; flex-direction: column; padding-block: 12px; }
  .delete-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions .button { flex: 1; }
  .footer-inner { justify-content: center; min-height: 72px; padding-block: 14px; }
  .login-page { padding: 18px 14px; }
  .login-brand { min-height: 260px; padding: 28px; }
  .login-art { position: absolute; opacity: 0.65; }
  .login-form-panel { padding: 36px 28px 42px; }
}

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