:root {
  color-scheme: light;
  --page-bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dce3ed;
  --text: #172033;
  --muted: #6b7688;
  --primary: #2563eb;
  --console-bg: #0b1020;
  --console-text: #dbeafe;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--page-bg);
}

.auth-card {
  width: min(100%, 420px);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #93c5fd;
  font-size: 13px;
  font-weight: 800;
}

.page-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: 0;
}

.page-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px;
}

.section {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.section-stack {
  margin-top: 16px;
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
}

.main-tabs {
  margin-top: 16px;
}

.main-tabs .ant-tabs-nav {
  margin-bottom: 0;
}

.main-tabs .ant-tabs-content-holder {
  min-width: 0;
}

.metric-card {
  height: 100%;
  border-color: var(--border);
  border-radius: 8px;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 20px;
}

.full-width {
  width: 100%;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.compact-alert {
  margin-bottom: 14px;
}

.proxy-pool-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 2px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.proxy-pool-status strong {
  color: var(--text);
  font-weight: 680;
}

.proxy-pool-status .is-error {
  flex-basis: 100%;
  color: #b91c1c;
  word-break: break-word;
}

.task-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.task-status-grid > div {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-status-grid span,
.task-status-grid strong {
  display: block;
}

.task-status-grid strong {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 680;
  word-break: break-word;
}

.command-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef3fb;
  color: #1f2a44;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.task-console {
  height: 360px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: var(--console-bg);
  color: var(--console-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.task-console-empty {
  display: grid;
  place-items: center;
  color: #93a4bd;
}

.task-console-line {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  min-height: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-console-line + .task-console-line {
  margin-top: 2px;
}

.task-console-line.is-error {
  color: #fecaca;
}

.task-console-time {
  color: #7dd3fc;
}

.task-console-message {
  color: inherit;
}

.is-selected-row > td {
  background: #eff6ff !important;
}

@media (max-width: 1024px) {
  .grid-main {
    grid-template-columns: 1fr;
  }

  .task-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .content {
    padding: 16px;
  }

  .task-status-grid {
    grid-template-columns: 1fr;
  }

  .task-console-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
