:root {
  color-scheme: light;
  --ink: #111217;
  --muted: #6f727b;
  --subtle: #a1a4ad;
  --paper: #f4f2ed;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #fbfaf7;
  --terminal: #111318;
  --terminal-soft: #181b22;
  --line: rgba(17, 18, 23, 0.09);
  --shadow:
    0 1px 1px rgba(17, 18, 23, 0.04),
    0 12px 36px rgba(17, 18, 23, 0.07);
  --blue: #2f6fff;
  --violet: #7657e8;
  --green: #21a56d;
  --red: #d95656;
  --amber: #c58a24;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
.log-viewer:focus-visible {
  outline: 3px solid rgba(47, 111, 255, 0.25);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  line-height: 1.3;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.brand-lockup-dark {
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 7px;
  border-radius: 8px;
  background: #f5f4f0;
  box-shadow: inset 0 0 0 1px rgba(17, 18, 23, 0.08);
}

.brand-mark span {
  width: 3px;
  border-radius: 2px;
  background: var(--ink);
}

.brand-mark span:nth-child(1) {
  height: 6px;
}

.brand-mark span:nth-child(2) {
  height: 12px;
}

.brand-mark span:nth-child(3) {
  height: 9px;
}

.login-body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(62, 91, 120, 0.22), transparent 32%),
    #0d0f13;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(28px, 4vw, 64px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 36%),
    radial-gradient(circle at 76% 72%, rgba(47, 111, 255, 0.18), transparent 32%);
}

.login-story::after {
  position: absolute;
  right: -18%;
  bottom: -25%;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.018),
    0 0 0 140px rgba(255, 255, 255, 0.012);
  content: "";
  pointer-events: none;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.login-copy .eyebrow {
  color: rgba(255, 255, 255, 0.38);
}

.login-copy h1 {
  max-width: 620px;
  margin: 18px 0 24px;
  color: #f7f7f4;
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 630;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.login-copy p:last-child {
  max-width: 500px;
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 15px;
  line-height: 1.8;
}

.signal-strip {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  color: rgba(255, 255, 255, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.signal-strip span,
.live-chip,
.task-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.signal,
.live-chip i,
.task-status i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px currentColor;
}

.signal-blue {
  color: rgba(72, 126, 255, 0.28);
}

.signal-violet {
  color: rgba(139, 105, 255, 0.25);
}

.signal-green {
  color: rgba(52, 190, 131, 0.25);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background: var(--paper);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.18);
}

.login-card {
  width: min(100%, 420px);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}

@starting-style {
  .login-card {
    opacity: 0;
    transform: translateY(8px);
  }
}

.login-card-head {
  margin-bottom: 32px;
}

.login-card-head p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(33, 165, 109, 0.09);
  color: #17794f;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.secure-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field > span:first-child {
  color: #494c54;
  font-size: 12px;
  font-weight: 680;
}

.field input {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(17, 18, 23, 0.1),
    0 1px 1px rgba(17, 18, 23, 0.02);
  color: var(--ink);
  padding: 0 14px;
  transition:
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.field input:focus {
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(47, 111, 255, 0.52),
    0 0 0 3px rgba(47, 111, 255, 0.1);
  outline: none;
}

.otp-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: 0.32em;
  text-align: center;
}

.form-error {
  margin: -4px 0 16px;
  border-radius: 10px;
  background: rgba(217, 86, 86, 0.09);
  color: #ad3838;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.icon-button:active,
.task-card:active {
  transform: scale(0.97);
}

.primary-button {
  display: flex;
  width: 100%;
  height: 50px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(17, 18, 23, 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 0 17px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-arrow {
  font-size: 18px;
}

.login-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--subtle);
  font-size: 11px;
}

.lock-glyph {
  color: var(--green);
  font-size: 8px;
}

.dashboard-body {
  background:
    radial-gradient(circle at 84% 0%, rgba(47, 111, 255, 0.05), transparent 22%),
    var(--paper);
}

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(244, 242, 237, 0.88);
  backdrop-filter: blur(16px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-chip {
  color: var(--green);
  font-size: 11px;
  font-weight: 680;
}

.live-chip i {
  box-shadow: 0 0 0 3px rgba(33, 165, 109, 0.12);
}

.header-clock {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ghost-button,
.icon-button {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  padding: 8px 10px;
}

.dashboard-main {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 52px 24px 72px;
}

.hero-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.hero-row h1 {
  margin: 10px 0 8px;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 630;
  letter-spacing: -0.055em;
  line-height: 1;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  color: #3e4148;
  font-size: 12px;
  font-weight: 680;
  padding: 11px 14px;
}

.secondary-button.is-refreshing span:first-child {
  transform: rotate(180deg);
  transition: transform 240ms var(--ease-in-out);
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.task-card {
  display: flex;
  min-width: 0;
  min-height: 176px;
  flex-direction: column;
  align-items: stretch;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 20px;
  text-align: left;
  transition:
    transform 150ms var(--ease-out),
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.task-card.is-active {
  background: #fff;
  box-shadow:
    0 1px 1px rgba(17, 18, 23, 0.04),
    0 0 0 2px var(--ink),
    0 18px 42px rgba(17, 18, 23, 0.09);
}

.task-card-top,
.task-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}

.task-status i {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 3px rgba(111, 114, 123, 0.1);
}

.status-success {
  color: var(--green);
}

.status-running {
  color: var(--blue);
}

.status-failed {
  color: var(--red);
}

.status-warning {
  color: var(--amber);
}

.task-card > strong {
  margin-top: 22px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.task-summary {
  display: -webkit-box;
  min-height: 34px;
  margin-top: 8px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.task-card-foot {
  margin-top: auto;
  padding-top: 18px;
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 18px;
}

.log-card,
.system-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.log-card {
  min-width: 0;
}

.log-toolbar {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}

.log-toolbar h2,
.system-card h2 {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.log-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  display: flex;
  width: min(260px, 26vw);
  height: 34px;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--subtle);
  padding: 0 9px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  outline: 0;
}

.search-field kbd {
  border-radius: 4px;
  background: rgba(17, 18, 23, 0.05);
  color: var(--subtle);
  font-family: inherit;
  font-size: 9px;
  padding: 2px 5px;
}

.icon-button.is-active {
  background: var(--ink);
  color: #fff;
}

.terminal-head {
  display: grid;
  min-height: 38px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: var(--terminal-soft);
  color: rgba(255, 255, 255, 0.38);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  padding: 0 14px;
}

.terminal-head > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.log-viewer {
  height: clamp(380px, 52vh, 640px);
  overflow: auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.013) 1px, transparent 1px),
    var(--terminal);
  background-size: 100% 24px;
  color: #c6c9d2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  overscroll-behavior: contain;
  padding: 12px 0;
}

.log-line {
  display: grid;
  min-width: max-content;
  grid-template-columns: 54px minmax(0, 1fr);
  padding: 2px 16px 2px 0;
}

.log-viewer.is-wrapped .log-line {
  min-width: 0;
}

.line-number {
  position: sticky;
  left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--terminal);
  color: rgba(255, 255, 255, 0.2);
  font-variant-numeric: tabular-nums;
  padding-right: 12px;
  text-align: right;
  user-select: none;
}

.line-content {
  padding-left: 14px;
  white-space: pre;
}

.is-wrapped .line-content {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.line-error .line-content {
  color: #ff8d8d;
}

.line-warning .line-content {
  color: #e9be6a;
}

.line-success .line-content {
  color: #83d6ad;
}

.line-accent .line-content {
  color: #8db1ff;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.32);
  text-align: center;
}

.log-footer {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  background: var(--terminal-soft);
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
  padding: 0 14px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 26px;
  height: 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background-color 160ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  content: "";
  transform: translateX(0);
  transition: transform 160ms var(--ease-out);
}

.switch-control input:checked + .switch {
  background: rgba(47, 111, 255, 0.7);
}

.switch-control input:checked + .switch::after {
  background: #fff;
  transform: translateX(11px);
}

.system-card {
  align-self: start;
  padding: 20px;
}

.metric-stack {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.metric-label strong {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.meter {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  margin-top: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 18, 23, 0.07);
  appearance: none;
}

.meter::-webkit-progress-bar {
  border-radius: inherit;
  background: rgba(17, 18, 23, 0.07);
}

.meter::-webkit-progress-value {
  border-radius: inherit;
  background: var(--blue);
}

.meter::-moz-progress-bar {
  border-radius: inherit;
  background: var(--blue);
}

.meter-violet::-webkit-progress-value {
  background: var(--violet);
}

.meter-violet::-moz-progress-bar {
  background: var(--violet);
}

.metric p {
  margin: 7px 0 0;
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.runtime-list {
  display: grid;
  gap: 0;
  margin: 28px 0 0;
}

.runtime-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.runtime-list dt {
  color: var(--muted);
  font-size: 10px;
}

.runtime-list dd {
  margin: 0;
  color: #41444c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-align: right;
}

.system-note {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  border-radius: 11px;
  background: rgba(47, 111, 255, 0.06);
  color: #596273;
  font-size: 10px;
  line-height: 1.55;
  padding: 12px;
}

.system-note p {
  margin: 0;
}

.note-mark {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(47, 111, 255, 0.12);
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  border-radius: 11px;
  background: var(--ink);
  box-shadow: 0 16px 40px rgba(17, 18, 23, 0.2);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  padding: 11px 14px;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast[data-type="error"] {
  background: #8f3030;
}

@media (hover: hover) and (pointer: fine) {
  .primary-button:hover {
    background: #24262c;
    box-shadow: 0 10px 26px rgba(17, 18, 23, 0.18);
  }

  .task-card:hover:not(.is-active) {
    transform: translateY(-2px);
    box-shadow:
      0 1px 1px rgba(17, 18, 23, 0.04),
      0 18px 42px rgba(17, 18, 23, 0.09);
  }

  .ghost-button:hover,
  .icon-button:hover {
    background: #fff;
    color: var(--ink);
  }

  .secondary-button:hover {
    transform: translateY(-1px);
  }
}

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

  .system-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }

  .system-card header,
  .system-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 42vh;
    padding: 28px 24px;
  }

  .login-copy {
    margin: 72px 0 54px;
  }

  .login-copy h1 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .login-panel {
    min-height: 58vh;
    padding: 44px 24px 60px;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.24);
  }

  .topbar {
    padding: 0 16px;
  }

  .live-chip span,
  .header-clock {
    display: none;
  }

  .dashboard-main {
    padding: 36px 16px 54px;
  }

  .hero-row {
    align-items: start;
  }

  .hero-subtitle {
    max-width: 220px;
  }

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

  .task-card {
    min-height: 150px;
  }

  .log-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .log-actions,
  .search-field {
    width: 100%;
  }

  .search-field {
    flex: 1;
  }

  .log-viewer {
    height: 58vh;
  }

  .system-card {
    display: block;
  }
}

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

  .task-card:hover,
  .secondary-button:hover {
    transform: none !important;
  }
}
