/* Node 控制台 — 浅色主题
 * 约束：不引用任何外部字体 / 图片 / CDN；无内联样式依赖；全部图标为内联 SVG。
 * 结构：设计变量 → 基础 → 侧栏 → 顶栏 → 卡片 → 按钮 → 表单 → 攻击面板 → 表格 → 日志 → 弹层 → 登录页 → 响应式
 */

/* ============================== 设计令牌 ==============================
 * 三层：原始色板 → 语义令牌 → 组件令牌。业务样式只准用语义层，
 * 改主题只动这一块。色板选冷灰中性色，单一蓝色强调，避免到处抢眼。
 * ================================================================== */
:root {
  /* --- 原始色板（中性） --- */
  --gray-0: #ffffff;
  --gray-25: #fcfcfd;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e8edf3;
  --gray-300: #d6dde6;
  --gray-400: #a8b3c1;
  --gray-500: #7c8798;
  --gray-600: #5b6675;
  --gray-700: #3e4756;
  --gray-800: #272e3a;
  --gray-900: #171c25;

  /* --- 原始色板（色相） --- */
  --blue-50: #eef4ff;
  --blue-100: #dbe7ff;
  --blue-500: #3b6ef5;
  --blue-600: #2a56d6;
  --blue-700: #1f43ab;
  --green-50: #ecfdf4;
  --green-500: #12a150;
  --green-600: #0d8040;
  --amber-50: #fffaeb;
  --amber-500: #c47f17;
  --red-50: #fef3f2;
  --red-500: #d92d20;
  --red-600: #b42318;

  /* --- 语义：表面 --- */
  --bg: var(--gray-50);
  --card: var(--gray-0);
  --surface-soft: var(--gray-25);
  --surface-sunken: var(--gray-100);

  /* --- 语义：文字 --- */
  --text: var(--gray-900);
  --text-secondary: var(--gray-600);
  --muted: var(--gray-500);

  /* --- 语义：描边 --- */
  --border: var(--gray-200);
  --border-strong: var(--gray-300);

  /* --- 语义：强调与状态 --- */
  --accent: var(--blue-500);
  --accent-strong: var(--blue-600);
  --accent-soft: var(--blue-50);
  --accent-border: var(--blue-100);
  --success: var(--green-600);
  --success-soft: var(--green-50);
  --success-border: #b9f0d0;
  --warning: var(--amber-500);
  --warning-soft: var(--amber-50);
  --danger: var(--red-600);
  --danger-soft: var(--red-50);
  --danger-border: #fbd5d1;

  /* --- 圆角：一组只用三个值 --- */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* --- 阴影：靠描边表达层级，阴影只做轻微浮起 --- */
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  /* --- 字体 --- */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* --- 布局 --- */
  --sidebar-width: 216px;

  /* --- 间距刻度（4/8 网格） --- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px;  --s-10: 40px; --s-12: 48px;

  /* --- 触控尺寸 --- */
  --tap: 36px;
  --tap-lg: 42px;

  /* --- 层级 --- */
  --z-topbar: 40;
  --z-modal: 100;
  --z-toast: 1000;

  /* --- 焦点环 --- */
  --focus-ring: 0 0 0 3px rgba(59, 110, 245, 0.25);
}

/* ============================== 基础 ============================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  display: block;
}

::selection {
  background: #dbe7ff;
  color: var(--text);
}

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

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
  font-size: 12.5px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================== 侧栏 ============================== */
.app-body {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: var(--card);
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark-lg {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand-name {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-badge {
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: var(--surface-sunken);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.75;
}

.nav-group {
  margin: 14px 0 4px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.nav-group:first-child {
  margin-top: 2px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 2px 4px;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.user-label {
  color: var(--muted);
  font-size: 11px;
}

.user-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  width: 15px;
  height: 15px;
  flex: none;
}

/* ============================== 顶栏 ============================== */
.app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 28px 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.topbar-heading {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.crumb-sep {
  color: var(--border-strong);
}

.page-title {
  margin-top: 2px;
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.topbar-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  flex: 1;
  padding: 20px 28px 48px;
  max-width: 1320px;
  width: 100%;
}

/* ============================== 视图 ============================== */
.view {
  display: none;
}

.view.is-active {
  display: block;
}

/* ============================== 卡片 ============================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.card-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

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

/* ============================== 按钮 ============================== */
.btn {
  height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--tap);
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:disabled {
  opacity: 0.55;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-danger-outline {
  background: #ffffff;
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-danger-text {
  color: var(--danger);
}

.btn-danger-text:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-xs {
  height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
}

.btn-lg {
  height: var(--tap-lg);
  padding: 0 20px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-grow {
  flex: 1;
}

/* ============================== 状态标签 / 圆点 ============================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

.chip b {
  color: var(--text);
  font-weight: 700;
}

.chip-ghost {
  background: var(--surface-soft);
  border-color: var(--border);
}

.chip-success {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: #15803d;
}

.chip-danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: #b91c1c;
}

.chip-blue {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.chip-blue b {
  color: var(--accent-strong);
}

.chip-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.chip-dot-blue {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 110, 245, 0.14);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status-text {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.status-text.online {
  color: #15803d;
}

/* 降级：节点仍然可达，但最近 10 次采样里成功率不足 80%。 */
.status-text.degraded {
  color: #b45309;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-running {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-finished {
  background: var(--success-soft);
  color: #15803d;
}

.badge-stopped {
  background: var(--surface-soft);
  color: #4b5563;
}

.badge-error {
  background: var(--danger-soft);
  color: #b91c1c;
}

.badge-unknown {
  background: var(--surface-soft);
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tag-raw {
  background: var(--warning-soft);
  border-color: #fde68a;
  color: var(--warning);
}

/* ============================== 表单基础 ============================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-label {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.field-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field-hint {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.field-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.input:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible,
.chip-btn:focus-visible,
.layer-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.input {
  width: 100%;
  height: var(--tap);
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--gray-400);
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-sm {
  height: 30px;
  font-size: 12.5px;
}

.input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.select-sm {
  width: auto;
  padding-right: 30px;
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
}

.form-error {
  display: block;
  min-height: 0;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}

.form-error:empty {
  display: none;
}

.form-error.is-error {
  display: block;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Keep the start/stop buttons visible while scrolling the attack form. */
#attack-form .form-actions {
  position: sticky;
  bottom: 12px;
  z-index: 25;
  margin: 8px -8px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}
.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.overview-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.overview-label {
  color: var(--muted);
  font-size: 11.5px;
}

.overview-value {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.overview-sub {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1100px) {
.overview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
.overview-strip {
    grid-template-columns: 1fr;
  }
}

.history-summary {
  padding: 0;
  color: var(--muted);
  font-size: 12px;
}

.stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 3px;
}

.stat {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.stat b {
  color: var(--text);
  font-weight: 700;
}

.stat-strong b {
  color: var(--accent);
}

.stat-ok b {
  color: #15803d;
}

.stat-err b {
  color: #b91c1c;
}

.stat-proxy b {
  color: #7c3aed;
}

.cell-progress {
  min-width: 96px;
}

.mini-progress {
  width: 100%;
  height: 5px;
  margin-top: 5px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  appearance: none;
}

.mini-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e2e8f0;
}

.mini-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.mini-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(520px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.attack-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
}

.layer-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.layer-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 15px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.layer-card:hover {
  border-color: var(--border-strong);
  background: #fbfcff;
}

.layer-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(59, 110, 245, 0.08);
}

.layer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f3f6fb;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.layer-icon svg {
  width: 19px;
  height: 19px;
}

.layer-card.is-active .layer-icon {
  background: #ffffff;
  color: var(--accent);
}

.layer-card-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.layer-card-sub {
  color: var(--muted);
  font-size: 11.5px;
}

/* -------- 方法下拉 -------- */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dropdown-toggle:hover {
  border-color: var(--border-strong);
}

.dropdown-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 110, 245, 0.1);
}

.dropdown-value {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dropdown-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.dropdown-desc {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-chevron {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.dropdown-toggle[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 330px;
  padding: 6px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.dd-group {
  padding: 8px 9px 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dd-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.dd-option:hover,
.dd-option:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.dd-option.is-selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.dd-option.is-disabled,
.dd-option.is-disabled:hover,
.dd-option.is-disabled:focus-visible {
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.75;
}

.dd-option-name {
  flex: none;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.dd-option-desc {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-option.is-selected .dd-option-desc,
.dd-option:hover .dd-option-desc {
  color: #4b66a8;
}

.dd-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* 方法下拉里的「显示冷门方法」开关：与普通选项隔开一条线，
 * 冷门方法是后端标记 hidden 的那批（协议/载体已失效）。 */
.dd-toggle-hidden {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  color: var(--muted);
}

.dd-toggle-hidden .dd-option-name {
  font-family: var(--font);
  font-weight: 600;
}

/* -------- CC 节点多选 -------- */
.node-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.node-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.node-pick:hover {
  border-color: var(--border-strong);
}

.node-pick.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.node-pick.is-offline {
  opacity: 0.62;
}

.node-pick-input {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}

.node-pick-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.node-pick-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-pick-addr {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-pick-tasks {
  flex: none;
  align-self: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.node-pick-tasks.is-idle {
  display: none;
}

.node-empty {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* -------- 数值 / 高级选项 -------- */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.range {
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.advanced {
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfe;
}

.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.advanced-toggle::-webkit-details-marker {
  display: none;
}

.advanced-toggle::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #eef2f8;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.advanced[open] .advanced-toggle::before {
  content: "−";
}

.advanced-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 2px 0 14px;
}

/* Inline (non-collapsible) parameter block: these fields are used often. */
.advanced-inline {
  padding: 12px 14px;
}

.advanced-inline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}

.advanced-inline-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.advanced-inline .advanced-body {
  padding-bottom: 2px;
}

.proxy-source {
  grid-column: 1 / -1;
}

.proxy-source textarea {
  margin-top: 8px;
}

/* ============================== 攻击记录 ============================== */
.history-card {
  overflow: hidden;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
}

.history-summary {
  color: var(--muted);
  font-size: 12px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  color: #9ca3af;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input {
  padding-left: 33px;
}

.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.history-table-wrap {
  max-height: calc(100vh - 300px);
  min-height: 220px;
  overflow: auto;
  /* 行数跨过可视高度时滚动条会反复出现/消失，宽度变化会让整张表左右跳 */
  scrollbar-gutter: stable;
}

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

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--surface-sunken);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: var(--surface-soft);
}

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

.table tbody tr:hover td {
  background: #fbfcff;
}

.table .num {
  text-align: right;
}

.history-table {
  table-layout: fixed;
  min-width: 440px;
}

.history-table th,
.history-table td {
  padding-right: 8px;
  padding-left: 8px;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 70px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: auto;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 52px;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 40px;
}

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
  width: 62px;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
  width: 66px;
}

.history-table th:nth-child(7),
.history-table td:nth-child(7) {
  width: 58px;
  padding-right: 6px;
}

.history-row.is-muted td {
  color: #9ca3af;
}

.history-row.is-muted .method-tag,
.history-row.is-muted .badge {
  opacity: 0.85;
}

/* 指标行用固定轨道高度的 grid：行数只跟列宽有关，不受数字位数影响。
   之前是 flex-wrap，数字多一位就可能从两行变成三行，整表高度跟着抖。 */
.history-table .stat-line {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  grid-auto-rows: 16px;
  align-items: center;
  gap: 0 8px;
  overflow: hidden;
}

.history-table .stat {
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-table .stat b {
  font-variant-numeric: tabular-nums;
}

/* 行内小字默认会被 class 的 display 覆盖，这里保证 hidden 属性真正隐藏 */
.history-table [hidden] {
  display: none !important;
}

.cell-id {
  color: #4b5563;
  font-family: var(--mono);
  font-size: 11.5px;
}

.cell-meta {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 10.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ok-meta {
  color: #15803d;
}

.error-meta {
  color: var(--danger);
}

.target-text {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.method-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: #4b5563;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.cell-actions {
  white-space: nowrap;
}

.cell-actions .btn-xs {
  height: 24px;
  padding: 0 6px;
  font-size: 11.5px;
}

.cell-actions .btn + .btn {
  margin-left: 4px;
}

.muted-dash {
  color: #cbd5e1;
}

.empty-cell {
  padding: 34px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ============================== CC 节点页 ============================== */
.nodes-table {
  min-width: 720px;
}

.nodes-table .cell-name {
  font-weight: 600;
}

.actions-col {
  width: 132px;
}

.cell-version {
  color: #4b5563;
  font-size: 11.5px;
}

.cell-seen {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.table-foot {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 12px;
}

.code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-soft);
  color: #374151;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ============================== 事件日志 ============================== */
.log-card {
  overflow: hidden;
}

.log {
  height: calc(100vh - 240px);
  min-height: 320px;
  padding: 12px 18px 18px;
  overflow-y: auto;
  background: #fbfcfe;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}

.log-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px dashed #eef1f6;
}

.log-time {
  flex: none;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.log-level {
  flex: none;
  width: 38px;
  font-weight: 700;
}

.log-info .log-level {
  color: var(--accent);
}

.log-ok .log-level {
  color: var(--success);
}

.log-warn .log-level {
  color: #d97706;
}

.log-error .log-level {
  color: var(--danger);
}

.log-msg {
  color: #374151;
  word-break: break-word;
}

.log-empty {
  padding: 28px 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  text-align: center;
}

/* ============================== 弹层 ============================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(442px, 100%);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

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

.modal-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.modal-close {
  font-size: 13px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

/* ============================== 自动选择向量 ============================== */
.autoplan-result {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

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

.autoplan-title {
  color: var(--text);
  font-size: 12.5px;
}

.autoplan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.autoplan-why {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.autoplan-notes {
  margin-top: 6px;
  color: #b45309;
  font-size: 11.5px;
  line-height: 1.6;
}

.autoplan-notes p {
  margin: 2px 0;
}

/* ============================== 混合攻击 ============================== */
.mix-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mix-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mix-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mix-tag {
  flex: none;
  width: 22px;
  padding: 2px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.mix-row.is-primary .mix-tag {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.mix-layer {
  flex: none;
  width: 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}

.mix-method {
  flex: 1;
  min-width: 0;
}

.mix-weight {
  flex: none;
  width: 68px;
  font-variant-numeric: tabular-nums;
}

.mix-pct {
  flex: none;
  width: 42px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mix-remove {
  flex: none;
}

.mix-spacer {
  flex: none;
  width: 28px;
}

.mix-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.mix-weight-text {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* ============================== 顶部快捷条 ==============================
 * 核心操作全在这一屏：层切换 / 方法 / 目标 / 线程 / 时长 / 开始 / 停止。
 * 下面的表单只留混合、节点勾选和高级参数，改常用参数不用再滚下去。 */
.attack-quickbar {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

.qb-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.qb-main {
  align-items: center;
}

/* 三个主控件统一高度，一行站齐 */
.attack-quickbar .layer-card,
.qb-method .dropdown-toggle,
.qb-target {
  height: var(--tap);
}

/* 层切换：紧凑两连按钮 */
.attack-quickbar .qb-layers {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  margin: 0;
}

.attack-quickbar .layer-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0 12px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.attack-quickbar .layer-card.is-active {
  background: #eef4ff;
  border-color: #bfd3ff;
  color: #1d4ed8;
}

/* 方法下拉：宽度固定，不抢目标输入的空间 */
.qb-method {
  flex: 0 0 190px;
  min-width: 150px;
}

.qb-method .dropdown-toggle {
  height: 100%;
  min-height: 38px;
}

.qb-target {
  flex: 1 1 320px;
  min-width: 240px;
  min-height: 38px;
  font-family: var(--mono, monospace);
  font-size: 12.5px;
}

.qb-target-help {
  display: none;
}

/* 线程 / 时长 */
.qb-num {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.qb-num-input {
  width: 76px;
  min-height: 38px;
  text-align: center;
  font-family: var(--mono, monospace);
  font-size: 12.5px;
}

.qb-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.qb-meta {
  gap: 8px;
  padding-top: 2px;
}

.qb-presets {
  display: inline-flex;
  gap: 3px;
  flex-wrap: nowrap;
}

.qb-presets .chip-btn {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.quickbar-chip {
  display: inline-flex;
  align-items: center;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-family: var(--mono, monospace);
}

.quickbar-running.is-live {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

/* ============================== 节点实时状态条 ============================== */
.node-strip {
  margin: 0 0 12px;
}

.node-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.node-strip-title {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
}

.node-strip-count {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-family: var(--mono, monospace);
}

.node-strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 8px;
}

.node-strip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font-size: 12px;
  min-width: 0;
}

.node-strip-item.is-offline {
  opacity: 0.55;
}

.node-strip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}

.node-strip-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* 两行布局：上面完整节点名，下面版本/任务/速率，右侧相对时间。
 * 之前单行放不下，103.x 两个节点都显示成「103.…」，分不出来。 */
.node-strip-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.node-strip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-0);
  font-weight: 600;
}

.node-strip-meta {
  color: var(--muted, #64748b);
  font-family: var(--mono, monospace);
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-strip-heart {
  color: #94a3b8;
  font-family: var(--mono, monospace);
  font-size: 10.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.node-strip-empty {
  padding: 10px 12px;
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 10px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

/* ============================== 杂项 ============================== */
.noscript {
  padding: 12px 20px;
  background: var(--danger-soft);
  border-bottom: 1px solid var(--danger-border);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ============================== 登录页 ============================== */
.auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
  background:
    radial-gradient(1000px 460px at 50% -12%, #e6eeff 0%, rgba(230, 238, 255, 0) 70%),
    var(--bg);
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px 28px 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.09);
}

.auth-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-heading {
  min-width: 0;
}

.auth-title {
  color: var(--text);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.auth-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-row .input {
  flex: 1;
  min-width: 0;
}

.captcha-frame {
  display: inline-flex;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.captcha-img {
  display: block;
  width: 124px;
  height: 40px;
  border: 0;
  cursor: pointer;
  object-fit: fill;
  background: #16202c;
}

.captcha-frame:hover {
  border-color: var(--border-strong);
}

.auth-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

.auth-footer {
  margin-top: 18px;
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
}

/* ============================== 滚动条 ============================== */
.dropdown-menu::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.log::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dropdown-menu::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.log::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
  background-color: #d5dbe5;
}

.dropdown-menu::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.log::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  min-width: 620px;
}

/* ============================== 响应式 ============================== */
@media (max-width: 1300px) {
  .panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-table-wrap {
    max-height: 420px;
  }
}

@media (max-width: 920px) {
  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand {
    padding: 12px 16px;
    border-bottom: 0;
  }

  .sidebar-nav {
    flex: 1;
    flex-direction: row;
    gap: 4px;
    padding: 8px 12px;
    overflow-x: auto;
  }

  .nav-item {
    width: auto;
    white-space: nowrap;
  }

  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-top: 0;
  }

  .sidebar-footer .btn-block {
    width: auto;
  }

  .user-meta .user-label {
    display: none;
  }

  .app-main {
    margin-left: 0;
  }

  .topbar {
    padding: 14px 16px;
  }

  .content {
    padding: 16px 16px 32px;
  }

  .page-title {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .layer-cards,
  .form-row,
  .advanced-body,
  .node-chips {
    grid-template-columns: minmax(0, 1fr);
  }

  .attack-form {
    padding: 16px;
  }

  .topbar-chips {
    width: 100%;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

  .history-table {
    min-width: 480px;
  }

  /* 顶部快捷条与节点状态条在窄屏上竖排，按钮整行铺开 */
  .attack-quickbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    top: 4px;
  }

  .attack-quickbar-summary {
    width: 100%;
  }

  .quickbar-chip {
    max-width: 100%;
  }

  .attack-quickbar-actions {
    width: 100%;
  }

  .attack-quickbar-actions .btn {
    flex: 1;
  }

  .node-strip-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

/* ============================== 自动部署 ============================== */
.textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  color: var(--text);
  font-size: 13px;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.deploy-paste-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.deploy-log {
  height: clamp(240px, 42vh, 480px);
  min-height: 240px;
  padding: 12px 18px 18px;
  overflow-y: auto;
  background: #fbfcfe;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.deploy-line {
  padding: 2px 0;
  border-bottom: 1px dashed #eef1f6;
  color: #374151;
}

.deploy-line:last-child {
  border-bottom: 0;
}

.deploy-line.is-ok {
  color: #15803d;
}

.deploy-line.is-err {
  color: #b91c1c;
}

.deploy-line.is-step {
  color: #1d4ed8;
}

/* ============================== 人性化小部件 ============================== */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-btn {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.chip-btn:hover,
.chip-btn:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.method-search-wrap {
  padding: 6px 6px 2px;
}

.method-search {
  width: 100%;
}

.history-toolbar {
  flex-wrap: wrap;
}

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(6px);
  animation: toast-in 0.2s ease forwards;
}

.toast.is-ok {
  background: #15803d;
}

.toast.is-err {
  background: #b91c1c;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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


/* ============================== SSH server cards ============================== */
.ssh-panel {
  margin: 4px 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.ssh-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ssh-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ssh-panel-heading {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.ssh-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}

.ssh-panel-tools {
  display: flex;
  gap: 6px;
}

.ssh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.ssh-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ssh-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.ssh-card-ok {
  border-color: var(--success-border);
}

.ssh-card-err {
  border-color: var(--danger-border);
}

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

.ssh-avatar {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
}

.ssh-card-ok .ssh-avatar {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.ssh-card-err .ssh-avatar {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.ssh-head-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.ssh-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssh-addr {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssh-status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ssh-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ssh-status-ok {
  background: var(--success-soft);
  color: #15803d;
}

.ssh-status-err {
  background: var(--danger-soft);
  color: #b91c1c;
}

.ssh-status-run {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 降级：连续丢包但仍有成功采样，位于在线与离线之间的中间态。 */
.ssh-status-warn {
  background: #fef3c7;
  color: #b45309;
}

/* 探测中：面板刚启动或节点刚添加，还没有第一个采样结果。 */
.ssh-status-idle {
  background: #f1f5f9;
  color: var(--muted);
}

/* 状态胶囊里的附加信息（RTT、时钟偏差）。 */
.ssh-status-meta {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.75;
}

.ssh-status-meta.ssh-status-warn {
  background: transparent;
  color: #b45309;
  opacity: 1;
}

.ssh-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ssh-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
}

.ssh-pill-muted {
  padding-left: 0;
  background: transparent;
  color: var(--muted);
}

/* 旧版 CC（没有 /cc/v1/node/* 接口）需要先重新部署，用醒目但不刺眼的黄色提示 */
.ssh-pill-warn {
  background: #fef3c7;
  color: #92400e;
}

.ssh-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.ssh-card-actions .btn-primary {
  flex: 1 1 auto;
}

.ssh-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
}

.ssh-empty-icon {
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
}

.ssh-empty-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.ssh-empty-desc {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
/* ============================== SSH server list & deploy modal ============================== */
.ssh-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* 四列：勾选 / 节点信息 / 状态 / 操作。操作列宽度固定，行内只有主按钮+更多+删除，
   不会再因为按钮太多挤成第二行。 */
.ssh-list-head,
.ssh-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 156px 300px;
  align-items: center;
  gap: 14px;
}

.ssh-list-head {
  padding: 2px 16px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.ssh-head-actions {
  text-align: right;
}

.ssh-row {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ssh-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.ssh-row.is-selected {
  border-color: var(--accent);
  background: #eff6ff;
}

.ssh-row-ok {
  border-left-color: #22c55e;
}

.ssh-row-err {
  border-left-color: #ef4444;
}

.ssh-row-run {
  border-left-color: var(--accent);
}

.ssh-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ssh-row-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssh-row-addr {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssh-row-meta,
.ssh-row-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ssh-row-tags {
  margin-top: 1px;
}

.ssh-row-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.ssh-row-since {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.ssh-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

/* 行内「更多」菜单：原生 details，零 JS 切换；面板用绝对定位浮在行上方。 */
.row-menu {
  position: relative;
  display: inline-block;
}

.row-menu > summary {
  list-style: none;
  cursor: pointer;
}

.row-menu > summary::-webkit-details-marker {
  display: none;
}

.row-menu[open] > summary {
  background: #eef2f7;
}

.row-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 138px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.row-menu-panel .btn {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

/* 窄屏：操作列掉到下一行，靠左排列，仍然只占一行。 */
@media (max-width: 1180px) {
  .ssh-list-head {
    display: none;
  }

  .ssh-row {
    grid-template-columns: 22px minmax(0, 1fr) 140px;
    row-gap: 8px;
  }

  .ssh-row-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.bulk-count {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.bulk-count b {
  font-size: 15px;
}

.bulk-bar .btn-ghost {
  margin-left: auto;
}

@media (max-width: 1000px) {
  .ssh-list-head {
    display: none !important;
  }

  .ssh-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .ssh-row-main {
    flex: 1 1 calc(100% - 40px);
  }

  .ssh-row-meta {
    order: 5;
  }

  .ssh-row-status {
    order: 6;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .ssh-row-actions {
    order: 7;
    margin-left: auto;
  }

  .ssh-node-actions {
    flex: 1 1 100%;
    order: 8;
  }
}

/* ============================== CC 节点详情 / 日志弹层 ============================== */
.node-detail-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.node-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.node-detail-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.node-detail-log-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.node-info-grid {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 14px;
  font-size: 12.5px;
}

.node-info-label {
  color: var(--muted);
}

.node-info-value {
  overflow-wrap: anywhere;
  color: var(--text);
}

.node-info-value.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.node-logs-meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.node-logs-pre {
  max-height: 52vh;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-card-wide {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: 90vh;
}

.modal-card-wide .modal-body {
  overflow-y: auto;
}

.deploy-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deploy-camo-custom {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deploy-modal-actions {
  position: static;
  margin: 4px 0 0;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.target-pick {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.deploy-form.is-batch .deploy-ssh-field {
  display: none;
}
.request-custom {
  grid-column: 1 / -1;
}

.request-custom code {
  padding: 0 3px;
  border-radius: 4px;
  background: #f1f5f9;
  font-family: var(--mono);
  font-size: 11px;
}
/* ============================== Client proxy pools ============================== */
.proxy-pool-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.proxy-pool-nodes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 46vh;
  overflow-y: auto;
}

.proxy-pool-node {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.proxy-pool-node-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.proxy-pool-node-addr {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
}

.proxy-pool-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* 存活趋势与评分榜：等宽字体 + 淡色，避免抢「可用 N 个」的注意力 */
.pool-trend,
.pool-top {
  flex-basis: 100%;
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: var(--gray-400);
}

.pool-top {
  color: #0f766e;
}

.proxy-pool-item strong {
  color: var(--text);
}

.proxy-pool-item .pool-type {
  min-width: 64px;
  color: var(--text);
  font-weight: 600;
}

.proxy-pool-item .pool-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.proxy-pool-error {
  color: #b91c1c;
  font-size: 12px;
}

.proxy-pool-list {
  max-height: 28vh;
  margin: 10px 0 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
/* ============================== Origin recon ============================== */
.recon-input-row {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.recon-input-row .input {
  flex: 1;
}

.recon-result {
  max-height: 56vh;
  overflow-y: auto;
}

.recon-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.recon-summary strong {
  color: var(--text);
}

.recon-warn {
  padding: 8px 10px;
  margin: 8px 0;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
}

.recon-title {
  margin: 12px 0 6px;
  color: var(--text);
  font-size: 13px;
}

.recon-table {
  width: 100%;
  font-size: 12px;
}

.recon-table th,
.recon-table td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.recon-suspect {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
}
.ssh-row-blank {
  display: block;
  width: 22px;
}

/* ============================== 数据图表 ============================== */
/* 图表全部是运行时生成的 SVG（CSP style-src 'self'，因此不使用内联样式，
 * 几何走 SVG 属性、配色走这里的类）。 */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.chart-span-2 {
  grid-column: 1 / -1;
}

.chart-card .card-head {
  padding: 12px 16px;
}

.chart-body {
  padding: 12px 16px 10px;
}

/* ---- 目标探测（面板视角）----
 * 一条时间条带：每根柱子是一次探测（绿=全通、橙=丢包、红=全失败），
 * 一眼就能看出目标是从哪一刻开始不响应的。 */
.target-monitor {
  margin-bottom: 16px;
}

.target-monitor .card-head {
  padding: 12px 16px;
}

.target-monitor-body {
  padding: 4px 16px 14px;
}

.target-monitor-stats {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.target-monitor-stats.is-good {
  color: #15803d;
}

.target-monitor-stats.is-warn {
  color: #b45309;
}

.target-monitor-stats.is-bad {
  color: var(--danger);
}

.target-monitor-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 42px;
}

/* 节点视角：面板全通而节点全超时 = 节点出口/线路的问题；两边一起挂才是目标被打趴。 */
.target-monitor-nodes {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.target-monitor-nodes.is-good {
  color: #15803d;
}

.target-monitor-nodes.is-warn {
  color: #b45309;
}

.target-monitor-nodes.is-bad {
  color: var(--danger);
}

/* 打击效果判定：任务跑了多久、其中多久目标真的不可达。 */
.target-monitor-impact {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.target-monitor-impact.is-good {
  color: #15803d;
}

.target-monitor-impact.is-warn {
  color: #b45309;
}

.target-monitor-impact.is-bad {
  color: var(--danger);
}

.tm-bar {
  flex: 1 1 0;
  min-width: 2px;
  height: 6%;
  border-radius: 2px;
  background: #e5e7eb;
}

.tm-bar.is-good {
  height: 100%;
  background: #16a34a;
}

.tm-bar.is-warn {
  height: 62%;
  background: #d97706;
}

.tm-bar.is-bad {
  height: 26%;
  background: var(--danger);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chart-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--accent);
}

.chart-swatch-pps { background: #2563eb; }
.chart-swatch-err { background: #dc2626; }
.chart-swatch-bw { background: #0d9488; }
.chart-swatch-running { background: #2563eb; }
.chart-swatch-finished { background: #16a34a; }
.chart-swatch-stopped { background: #94a3b8; }
.chart-swatch-error { background: #dc2626; }

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.chart-axis-text {
  fill: #9aa4b2;
  font-size: 10.5px;
  font-family: var(--font);
}

.chart-grid-line {
  stroke: #eef2f7;
  stroke-width: 1;
}

.chart-line-pps {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-line-err {
  fill: none;
  stroke: #dc2626;
  stroke-width: 1.6;
  stroke-dasharray: 4 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-line-bw {
  fill: none;
  stroke: #0d9488;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 132px;
}

.chart-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-donut-legend .chart-legend-item {
  gap: 7px;
}

.chart-donut-legend b {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-donut-track {
  fill: none;
  stroke: #eef2f7;
}

.chart-donut-ring {
  fill: none;
  stroke-linecap: butt;
}

.chart-donut-value {
  fill: var(--text);
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font);
  text-anchor: middle;
}

.chart-donut-sub {
  fill: var(--muted);
  font-size: 10.5px;
  font-family: var(--font);
  text-anchor: middle;
}

.chart-bar-bg {
  fill: #eef2f7;
}

.chart-bar-fill {
  fill: #2563eb;
}

.chart-bar-fill.is-off {
  fill: #cbd5e1;
}

.chart-bar-name {
  fill: var(--text);
  font-size: 11.5px;
  font-family: var(--font);
}

.chart-bar-name.is-off {
  fill: #9aa4b2;
}

.chart-bar-value {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-span-2 {
    grid-column: auto;
  }
}
/* ---- 服务器 / CC 页面：工具条精简后的样式 ---- */
.advanced-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
  font-size: 12px;
}

.advanced-label {
  color: var(--muted);
  letter-spacing: .06em;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.deploy-log-empty {
  padding: 20px 4px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.8;
}
/* ---- 服务器 / CC 页：表头与行对齐、间距 ---- */
.ssh-list-head {
  padding: 4px 16px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.ssh-head-actions {
  justify-self: end;
  padding-right: 6px;
}

.attack-card > .field-help {
  margin: 4px 0 8px;
  max-width: 900px;
}

.advanced-row {
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 14px;
}
/* 指标说明：放在运行总览下方，用一句人话解释四个数字，客户不需要懂 PPS/BPS。 */
.overview-help {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.overview-help b {
  color: var(--text);
  font-weight: 600;
}

/* ============================ 一键开打 ============================ */
/* 版式：页面头（标题 + 一句话说明）→ 两栏（左发起 / 右目标状况）。
 * 间距走 8 的倍数，卡片内部统一 20px，输入聚焦给 4px 柔光环。 */

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.view-head-text {
  min-width: 0;
  max-width: 62ch;
}

.view-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

.view-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

/* 执行端「已停用」标签：灰底虚线边框，与 RAW 标签区分 */
.tag-disabled {
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}


/* ============================== 表格滚动兜底 ============================== */
/* 小屏下攻击记录/节点表列数多，直接溢出会把整页撑出横向滚动条。
   统一包一层 scroll 容器，表格自己保持 min-width。 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  min-width: 620px;
}


/* ============================== 小屏适配（≤640px）============================== */
@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px 10px;
  }
  .page-title {
    font-size: 19px;
  }
  .content {
    padding: 14px 16px 32px;
  }
  .btn {
    height: 40px;
  }
  .btn-xs {
    height: 34px;
    padding: 0 10px;
  }
  .qb-num-input,
  .input {
    height: 40px;
    font-size: 14px; /* iOS 聚焦时不再自动放大 */
  }
  .layer-card {
    min-height: 40px;
  }
  .card {
    border-radius: 12px;
  }
  /* 触控间距：相邻可点元素至少 8px */
  .qb-row {
    gap: 10px;
  }
  .card-actions {
    gap: 8px;
  }
}

/* ============================== 作战页（与全站同一套浅色）============================== */
/* ---- 直播页容器：不再强制暗色，跟全站同一套浅色 ---- */
.view-live {
  min-height: calc(100vh - 120px);
  display: none;
}
.view-live.is-active {
  display: block;
}

.live-standby {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 220px);
}

.live-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.live-pulse {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.live-pulse span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(59, 110, 245, 0.45);
  animation: live-pulse 2.2s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(59, 110, 245, 0.4); }
  70%  { box-shadow: 0 0 0 18px rgba(59, 110, 245, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 110, 245, 0); }
}

.live-title {
  margin: 0;
  color: var(--text);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.live-sub {
  margin: 12px 0 0;
  color: var(--gray-600);
  font-size: 15px;
  line-height: 1.6;
}

.live-launch {
  display: flex;
  gap: 12px;
  margin: 30px 0 6px;
}
.live-input {
  flex: 1;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--gray-0);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.live-input::placeholder { color: var(--gray-400); }
.live-input:hover { border-color: var(--muted); }
.live-input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.btn-fire {
  height: 56px;
  padding: 0 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--gray-0);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.btn-fire:hover { background: var(--blue-600); box-shadow: 0 6px 24px rgba(59, 110, 245, 0.28); }
.btn-fire:active { transform: scale(0.97); }
.btn-fire:disabled { opacity: 0.55; cursor: default; }

.live-error { margin-top: 10px; color: var(--danger); }

.live-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

/* ---- 直播中 ---- */
.live-battle, .live-result {
  max-width: 860px;
  margin: 0 auto;
}
.live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.live-chip-running {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}
.live-target {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  word-break: break-all;
}
.live-head-actions { flex: 0 0 auto; padding-top: 4px; }
.btn-live-ghost {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--gray-0);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-live-ghost:hover { border-color: var(--danger); color: var(--danger); }

.live-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
}
.live-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}
.live-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--blue-600));
  transition: width 1s linear;
}
.live-progress-text {
  flex: 0 0 auto;
  color: var(--gray-600);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.live-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.live-stat {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--gray-25);
}
.live-stat span { color: var(--gray-600); font-size: 12px; }
.live-stat b {
  display: block;
  margin: 4px 0 2px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.live-stat span:last-child { font-size: 12px; }

.live-timeline-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-25);
}
.live-timeline {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.7;
}
.live-line {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  color: var(--gray-600);
}
.live-line.is-key {
  color: var(--text);
}
.live-line-time {
  flex: 0 0 auto;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}
.live-line-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}
.live-line.is-key .live-line-dot { background: var(--accent); }

/* ---- 战果卡 ---- */
.result-card {
  margin: 0 auto;
  padding: 34px 38px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
}
.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}
.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.result-target {
  margin: 10px 0 18px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  word-break: break-all;
}
.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.result-metric {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--gray-25);
  border: 1px solid var(--border);
}
.result-metric span { color: var(--gray-600); font-size: 12px; }
.result-metric b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}
.result-verdict {
  margin: 16px 0 0;
  color: var(--gray-600);
  font-size: 13.5px;
  line-height: 1.7;
}
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.btn-live-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--gray-0);
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-live-primary:hover { background: var(--blue-600); }

/* 专家模式开关激活态 */
.chip-btn-toggle { cursor: pointer; }
body.expert-mode .nav-item-war { opacity: 0.5; }

@media (max-width: 640px) {
  .live-launch { flex-direction: column; }
  .btn-fire { width: 100%; }
  .live-title { font-size: 30px; }
  .live-stats { grid-template-columns: 1fr; }
  .result-card { padding: 24px 20px; }
  .result-metrics { grid-template-columns: 1fr; }
}

/* ---- 直播页：正在跑的任务表 ---- */
.live-tasks-wrap {
  margin: 14px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-25);
  overflow: hidden;
}
.live-tasks-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.live-tasks-title {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
}
.live-tasks-count {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}
.live-tasks-head .btn-live-xs {
  margin-left: auto;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}
.live-tasks-scroll {
  max-height: 300px;
  overflow: auto;
  scrollbar-gutter: stable;
}
.live-tasks-table {
  min-width: 720px;
  font-size: 12.5px;
}
.live-tasks-table th {
  padding: 8px 10px;
  background: var(--gray-100);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}
.live-tasks-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.live-tasks-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.live-tasks-table td.cell-target {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-tasks-table tr.is-running td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
.live-tasks-table .btn-live-xs {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 7px;
}

/* ===================== 定时 / 通知页 ===================== */
.plan-form {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0 18px;
  background: var(--bg);
}
.plan-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 4px 0 8px;
  cursor: pointer;
}
.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.plan-table td {
  vertical-align: top;
}
.plan-target {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}
.plan-name {
  font-weight: 600;
}
.plan-sub {
  color: var(--muted);
  font-size: 12px;
}
.empty-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
  text-align: center;
}
.notify-hint-ok {
  color: var(--success);
}

/* ---------------------- 参数行 / 快捷预设 ---------------------- */
.params-row {
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}

.params-row .field {
  gap: 6px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.quick-chips .chip-btn {
  height: 24px;
  padding: 0 9px;
  font-size: 11.5px;
}

/* ---------------------- 快捷条补充 ---------------------- */
.qb-spacer {
  flex: 1;
}

/* ---- 作战待命页：多网址输入 + 时长 ---- */
.live-hero { max-width: 760px; }
.live-inputs { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.live-textarea {
  width: 100%;
  height: auto;
  min-height: 132px;
  padding: 14px 18px;
  line-height: 1.6;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.live-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.live-controls .btn-fire { margin-left: auto; }
.live-dur {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.live-select {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--gray-0);
  color: var(--text);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
.live-select:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.live-targets-count {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.live-select.is-muted { opacity: 0.45; }
.live-dur-custom { gap: 6px; }
.live-num {
  width: 88px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--gray-0);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.live-num::placeholder { color: var(--gray-400); }
.live-num:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.live-num.is-bad { border-color: var(--danger); }
.live-targets-count.is-over { color: var(--warning); border-color: var(--warning); }

/* ---- 直播页：各网址进度表 ---- */
.live-targets-wrap {
  margin: 14px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-25);
  overflow: hidden;
}
.live-targets-scroll { max-height: 260px; overflow: auto; }
.live-targets-table tr.is-running td:first-child { color: var(--accent); font-weight: 600; }
.live-targets-table tr.is-wait td { color: var(--muted); }
.live-targets-table tr.is-done td { color: var(--muted); }
.live-targets-table tr.is-bad td { color: var(--danger); }

/* ---- 战果卡：多网址逐条汇报 ---- */
.result-card { max-width: 760px; }
.result-single.hidden, .result-multi.hidden { display: none; }
.result-summary {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
}
.result-multi-scroll { max-height: 380px; overflow: auto; }
.result-multi-table td, .result-multi-table th { white-space: nowrap; }
.result-multi-table tr.is-bad td { color: var(--danger); }
.result-multi-table .cell-target { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .live-controls .btn-fire { margin-left: 0; width: 100%; }
  .result-card { max-width: none; }
}

/* ---- 作战中追加网址 ---- */
.live-addbar {
  margin: 12px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-25);
}
.live-addbar.hidden { display: none; }
.live-add-input { min-height: 84px; }
.live-add-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.btn-fire-sm {
  height: 40px;
  padding: 0 22px;
  font-size: 14px;
  letter-spacing: 0.1em;
}
