:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #eef0f4;

  --text-primary: rgba(0, 0, 0, 0.88);
  --text-secondary: rgba(0, 0, 0, 0.56);
  --text-muted: rgba(0, 0, 0, 0.36);

  --border: #e5e7eb;
  --border-light: #f0f2f5;
  --input-border: #d9dde4;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --primary-ring: rgba(37, 99, 235, 0.14);

  --success: #00b42a;
  --success-text: #15803d;
  --success-soft: #f0fdf4;

  --warning: #d97706;
  --warning-text: #92400e;
  --warning-soft: #fffbeb;

  --danger: #f53f3f;
  --danger-text: #cf2323;
  --danger-soft: #fef2f2;

  --radius-card: 8px;
  --radius-control: 6px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);

  --scroll-thumb: rgba(37, 99, 235, 0.34);
  --scroll-thumb-hover: rgba(29, 78, 216, 0.62);

  --font-regular: "Alibaba PuHuiTi 2.0-55 Regular", "Alibaba PuHuiTi", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-medium: "Alibaba PuHuiTi 2.0-65 Medium", "Alibaba PuHuiTi", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-regular);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  touch-action: manipulation;
  overscroll-behavior-x: none;
  overflow-x: clip;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* 65 Medium 仅用于有限的核心视觉锚点 */
h1,
h2,
h3,
strong,
b,
.brand-name,
.mobile-brand-name,
.topbar-title,
.row-title,
.row-price,
.order-amount,
.drawer-title,
.button.primary,
.nav-item.active,
.seg-btn.active,
.mnav-item.active,
.sub-tab.active {
  font-family: var(--font-medium);
  font-weight: 500;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-weight: 400;
  font-size: inherit;
  color: inherit;
}

input[type='text'],
input[type='url'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='number'],
select,
textarea {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

textarea {
  height: auto;
  min-height: 88px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* 统一自定义下拉框箭头 */
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  cursor: pointer;
}

.select-chevron {
  position: absolute;
  right: 9px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12.5px;
  background: var(--surface-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 6px 极简悬浮滚动条 */
html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

html:hover,
body:hover,
*:hover {
  scrollbar-color: var(--scroll-thumb) transparent;
}

@supports selector(::-webkit-scrollbar) {
  html,
  body,
  *,
  html:hover,
  body:hover,
  *:hover {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
  }

  *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  *::-webkit-scrollbar-track,
  *::-webkit-scrollbar-corner {
    background: transparent;
  }

  *::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }

  *::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 3px;
  }

  *:hover::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb);
  }

  *::-webkit-scrollbar-thumb:hover {
    background-color: var(--scroll-thumb-hover);
  }
}

/* 主应用骨架 */
.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
}

/* 左侧边栏 */
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-name {
  font-size: 15px;
  line-height: 1.25;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}

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

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

.nav-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  height: 18px;
  line-height: 18px;
  border-radius: 999px;
  font-size: 11.5px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

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

.node-meta {
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
}

.node-host {
  font-size: 12.5px;
  color: var(--text-primary);
  word-break: break-all;
}

.node-env {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* 工作区与单一顶栏 */
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text-primary);
}

.topbar-summary {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.runner-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  flex-shrink: 0;
}

.dot.ok {
  background: var(--success);
}

.dot.warn {
  background: var(--warning);
}

.dot.live {
  background: var(--success);
  animation: liveDotPulse 2s ease-out infinite;
}

.mobile-header,
.mobile-bottom-nav,
.mobile-sub-tabs {
  display: none;
}

/* 主舞台区域 */
.stage {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px 56px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-note {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* 按钮体系 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.button:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--primary-border);
  color: var(--primary);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.button.small {
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}

.button.full-width {
  width: 100%;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.text-button:hover:not(:disabled) {
  background: var(--primary-soft);
}

.text-button.subtle {
  color: var(--text-secondary);
  justify-content: flex-start;
  padding-left: 8px;
}

.text-button.subtle:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

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

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

.text-button.small-link {
  font-size: 12px;
  height: 24px;
  padding: 0 6px;
}

/* 顶部搜索与分段控件栏（严格 36px 等高） */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  padding-left: 32px;
}

.toolbar .select-wrap {
  min-width: 148px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 3px;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  gap: 2px;
}

.seg-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* 桌面端统一圆角列表容器 + 5 列规整监控行 */
.monitor-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
}

.monitor-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 118px 168px auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.14s ease;
}

.monitor-row:first-child {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.monitor-row:last-child {
  border-bottom: 0;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.monitor-row:hover {
  background: #fafbfd;
}

.row-thumb-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.row-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.row-thumb-fallback {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
}

.thumb-checking-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  display: none;
  place-items: center;
}

.monitor-row.is-checking .thumb-checking-badge {
  display: grid;
}

.thumb-checking-badge::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.6px solid var(--primary);
  border-top-color: transparent;
  animation: spinRing 0.7s linear infinite;
}

.row-info {
  min-width: 0;
}

.row-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.row-title {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--text-primary);
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.pill.spec {
  background: var(--primary-soft);
  color: var(--primary);
}

.pill.auto {
  background: var(--success-soft);
  color: var(--success-text);
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}

.row-detail {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.status-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.status-dot-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.status-dot-badge.in_stock {
  background: var(--success-soft);
  color: var(--success-text);
}

.status-dot-badge.out_of_stock {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.status-dot-badge.error,
.status-dot-badge.verification_required {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.row-price {
  font-size: 13.5px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* 紧凑实时节拍列 */
.row-live-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.live-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c2c8d1;
  flex-shrink: 0;
}

.monitor-row.is-monitoring .live-dot {
  background: var(--success);
  animation: liveDotPulse 2s ease-out infinite;
}

.monitor-row.is-checking .live-dot {
  background: var(--primary);
  animation: liveDotPulseBlue 0.9s ease-out infinite;
}

.live-text {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-row.is-monitoring .live-text {
  color: var(--success-text);
}

.monitor-row.is-checking .live-text {
  color: var(--primary);
}

.live-progress-wrap {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
}

progress.live-progress {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

progress.live-progress::-webkit-progress-bar {
  background: transparent;
}

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

.monitor-row.is-checking progress.live-progress::-webkit-progress-value {
  background: var(--primary);
}

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

/* 行操作区与悬浮菜单 */
.row-actions-col {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--surface-subtle);
}

.icon-btn.primary-soft {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
  font-family: var(--font-medium);
  font-weight: 500;
}

.icon-btn.primary-soft:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.icon-btn.dots {
  width: 30px;
  padding: 0;
}

.menu-wrap {
  position: relative;
}

.row-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 35;
  min-width: 164px;
  width: max-content;
  max-width: 240px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--surface-subtle);
  text-decoration: none;
}

.menu-item.danger {
  color: var(--danger);
}

.menu-item.danger:hover {
  background: var(--danger-soft);
}

/* 通用开关（Toggle Switch） */
.toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cfd5df;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border: 0;
  transition: background-color 0.18s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

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

.toggle-switch.blue:checked {
  background: var(--primary);
}

.toggle-switch:checked::after {
  transform: translateX(16px);
}

/* 通用面板与卡片网格 */
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.card-grid > .panel {
  display: flex;
  flex-direction: column;
}

.card-grid > .panel > .muted:last-of-type {
  margin-bottom: 12px;
}

.card-grid .account-actions {
  margin-top: auto;
  padding-top: 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}

.panel h2 {
  margin: 8px 0 4px;
  font-size: 15px;
}

.panel p {
  margin: 4px 0;
  color: var(--text-secondary);
}

.form-panel {
  margin-top: 10px;
}

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

.panel-head h2 {
  margin: 0;
}

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

.small-line {
  display: block;
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--success-soft);
  color: var(--success-text);
}

.tag.amber {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.tag.danger {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.account-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.account-actions .menu-wrap {
  margin-left: auto;
}

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-card);
  margin-bottom: 14px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--text-primary);
  font-size: 13px;
}

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

.order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.order-head h2 {
  margin: 6px 0 3px;
}

.order-amount {
  font-size: 15.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.run-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}

.run-row:last-child {
  border-bottom: 0;
}

.run-msg {
  font-size: 13px;
  color: var(--text-primary);
}

.run-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 表单布局 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label,
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.form-foot {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.input-with-btn {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-btn input {
  flex: 1;
}

/* 居中模态弹窗与桌面端右侧滑出抽屉 */
dialog.sheet-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0;
  width: min(490px, calc(100vw - 24px));
  max-height: 90dvh;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

dialog.sheet-dialog.wide {
  width: min(610px, calc(100vw - 24px));
}

dialog.drawer-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  padding: 0;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.36);
}

.dialog-form,
.drawer-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: inherit;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dialog-head h3 {
  margin: 0;
  font-size: 15.5px;
}

.dialog-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.close-btn:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.dialog-body {
  flex: 1;
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-actions,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.drawer-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}

.drawer-actions-left,
.drawer-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 商品自动识别预览 */
.inspect-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.inspect-preview.loading {
  opacity: 0.72;
}

.inspect-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.inspect-info {
  min-width: 0;
  flex: 1;
}

.inspect-title {
  font-family: var(--font-medium);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-primary);
  word-break: break-word;
}

.inspect-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 规格点选 */
.variant-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.variant-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px;
}

.variant-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.variant-chip:hover {
  border-color: var(--primary-border);
}

.variant-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.variant-chip-thumb {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-muted);
}

.variant-chip-body {
  min-width: 0;
  flex: 1;
}

.variant-chip-label {
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.variant-chip-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.variant-chip-stock.ok {
  color: var(--success-text);
}

.variant-chip-stock.out {
  color: var(--danger);
}

/* 步进器与刷新间隔 */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  overflow: hidden;
  width: 100%;
}

.stepper-btn {
  width: 36px;
  height: 34px;
  border: 0;
  background: var(--surface-subtle);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.stepper-btn:hover {
  background: var(--surface-muted);
}

.stepper input[type='number'] {
  flex: 1;
  height: 34px;
  padding: 4px;
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.interval-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.interval-chip {
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
}

.interval-chip:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.interval-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.interval-input {
  width: 74px !important;
  height: 34px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sub-box {
  padding: 12px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.switch-row {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.switch-title {
  color: var(--text-primary);
  font-size: 13px;
}

.manual-variant-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  user-select: none;
}

.manual-variant-details[open] summary {
  margin-bottom: 8px;
}

.note-box,
.path-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--text-secondary);
  font-size: 12.5px;
}

.steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
}

.preview-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.empty {
  text-align: center;
  padding: 44px 20px;
  background: var(--surface);
  border: 1px dashed var(--input-border);
  border-radius: var(--radius-card);
}

.monitor-list > .empty {
  border: 0;
  border-radius: 10px;
}

.empty-icon-svg {
  width: 30px;
  height: 30px;
  margin: 0 auto 8px;
  color: var(--text-muted);
}

.empty h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.empty p {
  margin: 0 auto 14px;
  color: var(--text-secondary);
  max-width: 42ch;
  font-size: 13px;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 12.5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(92vw, 460px);
  padding: 9px 16px;
  border-radius: var(--radius-control);
  background: #1f2937;
  color: #ffffff;
  font-size: 13px;
  box-shadow: var(--shadow-modal);
}

@keyframes liveDotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 180, 42, 0.42);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(0, 180, 42, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 180, 42, 0);
  }
}

@keyframes liveDotPulseBlue {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

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

/* 中等宽度适配：操作列紧凑化 */
@media (max-width: 1080px) {
  .monitor-row {
    grid-template-columns: 48px minmax(0, 1fr) 104px 140px auto;
    gap: 12px;
    padding: 12px 14px;
  }
}

/* 监控订单分组容器 */
.order-groups-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-group-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
  overflow: visible;
}

.order-group-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px 12px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 10px;
  min-width: 0;
}

.order-group-title-wrap {
  min-width: 0;
  flex: 1;
}

.order-group-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-group-title {
  margin: 0;
  font-family: var(--font-medium);
  font-weight: 500;
  font-size: 14.5px;
  color: var(--text-primary);
}

.order-group-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}

.order-readiness-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.order-readiness-pill.ready {
  background: var(--success-soft);
  color: var(--success-text);
}

.order-readiness-pill.warn {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.order-group-actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px 12px 0;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  border-top-right-radius: 10px;
  flex-wrap: wrap;
}

.order-group-card .monitor-list {
  grid-column: 1 / -1;
  grid-row: 2;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.order-group-card .monitor-row:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.order-group-card .monitor-row:last-child {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.order-group-card.has-foot .monitor-row:last-child {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.order-group-foot {
  grid-column: 1 / -1;
  grid-row: 3;
  padding: 9px 16px;
  border-top: 1px solid var(--border-light);
  background: #fafbfd;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.order-group-foot.warn {
  background: var(--warning-soft);
  color: var(--warning-text);
}

/* 新建订单对话框内清单 */
.order-draft-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-draft-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--border-light);
}

.order-draft-info {
  min-width: 0;
  flex: 1;
}

.order-draft-title {
  font-family: var(--font-medium);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-draft-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.order-items-line {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inline-add-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  flex-wrap: wrap;
}

/* 手机通知设置表单 */
.notify-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notify-guide {
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.notify-toggles {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.notify-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.notify-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

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

@media (prefers-reduced-motion: reduce) {
  .dot.live,
  .monitor-row.is-monitoring .live-dot,
  .monitor-row.is-checking .live-dot,
  .thumb-checking-badge::after {
    animation: none !important;
  }
}
