/* 抢单控制台样式：纯原生 CSS，无外部字体 / 图片 / CDN 依赖 */

:root {
  color-scheme: dark;
  --bg: #0f141b;
  --panel: #161d27;
  --panel-soft: #1b2431;
  --border: #263243;
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #e6edf6;
  --text-dim: #8fa2b8;
  --text-faint: #64748b;
  --accent: #4f8cff;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(79, 140, 255, 0.12), transparent 62%),
    radial-gradient(760px 420px at -8% 108%, rgba(52, 211, 153, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

code,
pre {
  font-family: var(--mono);
}

a {
  color: var(--accent);
}

.muted {
  color: var(--text-dim);
  font-size: 13px;
}

.noscript {
  padding: 24px;
  color: var(--amber);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 通用按钮 ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #1c2635;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: #243044;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn.is-busy {
  opacity: 0.75;
  cursor: progress;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07111f;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: #6da3ff;
  border-color: #6da3ff;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.32);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.2);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

/* ---------- 表单 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.field > span {
  font-size: 12px;
  letter-spacing: 0.02em;
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset.field > legend {
  padding: 0;
  margin-bottom: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

input[type="text"],
input[type="password"],
input[type="time"],
input[type="number"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d1420;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-faint);
}

input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.16);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}

.check:hover {
  border-color: #34465c;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  cursor: pointer;
}

.switch {
  appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  margin: 0;
  border-radius: 12px;
  background: #2a3546;
  cursor: pointer;
  transition: background 0.15s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.switch:checked {
  background: var(--accent);
}

.switch:checked::after {
  transform: translateX(18px);
}

.switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  padding: 8px 10px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  font-size: 13px;
}

/* ---------- 启动加载 ---------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 14px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 登录页 ---------- */

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(380px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-brand h1 {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  box-shadow: 0 0 18px rgba(79, 140, 255, 0.35);
}

.login-sub {
  color: var(--text-dim);
  font-size: 13px;
}

.login-tip {
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 27, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.clock {
  white-space: nowrap;
}

.poll-state {
  color: var(--amber);
  font-size: 12px;
  white-space: nowrap;
}

.poll-state::before {
  content: "●";
  margin-right: 4px;
  font-size: 9px;
  vertical-align: 1px;
}

.topbar-actions {
  display: flex;
  gap: 6px;
}

/* ---------- 主区域 ---------- */

.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 22px 48px;
}

.list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.list-head h1 {
  font-size: 17px;
}

.list-head .btn {
  margin-left: auto;
}

/* 自动抢单调度说明 */

.schedule-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 13px;
  border: 1px solid rgba(52, 211, 153, 0.26);
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.07);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.schedule-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.schedule-label {
  color: #6ee7b7;
  font-weight: 600;
}

.schedule-text {
  min-width: 0;
}

.schedule-bar.is-off {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.schedule-bar.is-off .schedule-dot {
  background: var(--text-faint);
  box-shadow: none;
}

.schedule-bar.is-off .schedule-label {
  color: var(--text-dim);
}

.empty-note {
  padding: 26px 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  text-align: center;
  font-size: 13px;
}

.machine-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
  gap: 16px;
}

/* ---------- 机器卡片 ---------- */

.machine-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s ease;
}

.machine-card.is-running {
  border-color: rgba(52, 211, 153, 0.32);
}

.machine-card.is-disabled {
  opacity: 0.82;
}

.machine-card.is-offline {
  border-style: dashed;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  margin-top: 7px;
  border-radius: 50%;
  background: #475569;
}

.status-dot.is-online {
  background: var(--green);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.card-title {
  min-width: 0;
  flex: 1;
}

.card-title h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15.5px;
}

.m-id {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 400;
}

.m-meta {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot-sep {
  margin: 0 6px;
  color: var(--text-faint);
}

/* 徽章 */

.badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-running {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
}

.badge-disabled {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
}

.badge-offline {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

.badge-pending {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}

.badge-done {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.badge-error {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.badge-expired {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}

.cmd-table .badge-running {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}

/* 标签 chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
}

.chip-accent {
  border-color: rgba(79, 140, 255, 0.28);
  background: rgba(79, 140, 255, 0.1);
  color: #9cc0ff;
}

.chip-warn {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}

.chip-muted {
  color: var(--text-faint);
}

.chip-auto {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  font-weight: 600;
}

/* 已抢订单 */

.orders {
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.orders-title {
  margin-bottom: 6px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.order-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 0;
}

.order-account {
  flex: none;
  width: 62px;
  padding-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
}

.order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.11);
  color: #86efac;
  font-size: 11.5px;
  white-space: nowrap;
}

.order-none {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
}

.order-empty {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 12px;
}

/* 日志尾行 */

.logtail {
  margin: 0;
  padding: 8px 10px;
  max-height: 68px;
  overflow: auto;
  border: 1px solid #1d2735;
  border-radius: 8px;
  background: #0a0e13;
  color: #9fb3c8;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 卡片按钮 */

.card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.card-actions .btn {
  width: 100%;
  font-size: 12.5px;
}

/* ---------- 弹窗 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 12, 0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow: auto;
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: modal-in 0.16s ease-out;
}

.modal-wide {
  width: min(760px, 100%);
}

.modal-sm {
  width: min(420px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.modal-note {
  color: var(--text-dim);
  font-size: 12.5px;
}

.sub-title {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-dim);
}

.warn-box {
  padding: 8px 10px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.09);
  color: #fcd34d;
  font-size: 12.5px;
}

.confirm-message {
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

/* 日志弹窗 */

.log-body {
  gap: 8px;
  padding: 12px 14px;
  flex: 1 1 auto;
}

.log-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.log-meta .muted {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-pre {
  flex: 1 1 auto;
  min-height: 240px;
  max-height: 58vh;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0e13;
  color: #c5d4e4;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 详情弹窗 */

.detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0 18px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.info-key {
  flex: none;
  color: var(--text-dim);
}

.info-val {
  min-width: 0;
  text-align: right;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 详情里的自动抢单设置 */

.auto-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.035);
}

.auto-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.auto-head .muted {
  font-size: 12px;
}

.auto-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) 1.2fr;
  gap: 12px;
  align-items: start;
}

.auto-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.auto-status {
  font-size: 12px;
}

.detail-cmds {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cmd-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.cmd-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #1b2431;
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.cmd-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.cmd-table tr:last-child td {
  border-bottom: 0;
}

.cmd-table .empty-cell {
  padding: 18px 10px;
  color: var(--text-faint);
  text-align: center;
}

.cmd-time {
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cmd-result {
  max-width: 280px;
  overflow: hidden;
  color: var(--text-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 一次性 token */

.token-box {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.token-box code {
  flex: 1;
  min-width: 0;
  max-height: 90px;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0e13;
  color: #e6edf6;
  font-size: 13px;
  word-break: break-all;
}

.code-block {
  margin: 0;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0e13;
  color: #c5d4e4;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
}

/* ---------- Toast ---------- */

.toasts {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid #64748b;
  border-radius: 8px;
  background: #1b2534;
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
  word-break: break-word;
  animation: toast-in 0.16s ease-out;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-info {
  border-left-color: #60a5fa;
}

.toast-out {
  opacity: 0;
  transform: translateY(-4px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 滚动条（可选增强） ---------- */

.logtail::-webkit-scrollbar,
.log-pre::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.code-block::-webkit-scrollbar,
.token-box code::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.logtail::-webkit-scrollbar-thumb,
.log-pre::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb,
.token-box code::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #2c3a4d;
}

/* ---------- 手机适配 ---------- */

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

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .topbar {
    gap: 8px;
    padding: 10px 14px;
  }

  .brand {
    font-size: 15.5px;
  }

  .topbar-meta {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .topbar-actions .btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12.5px;
  }

  .main {
    padding: 14px 14px 40px;
  }

  .btn {
    min-height: 40px;
  }

  .btn-ghost {
    min-height: 34px;
  }

  .card-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid2 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .detail-info {
    grid-template-columns: 1fr;
  }

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

  .schedule-bar {
    padding: 8px 11px;
    font-size: 12px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .modal-actions {
    padding-bottom: calc(13px + env(safe-area-inset-bottom, 0px));
  }

  .log-pre {
    min-height: 200px;
    max-height: 50vh;
  }

  .toasts {
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: auto;
  }

  .login-card {
    padding: 22px;
  }
}

@media (max-width: 380px) {
  .card-actions {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
