:root {
  --app-primary: #1677ff;
  --sider-width: 180px;
  --app-card-bg: #fff;
  --app-border: #e8e8e8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #1f1f1f;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

code {
  font-size: 12px;
  background: #f5f5f5;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ========== Login (uwwwroot) ========== */
.login-page {
  min-height: 100%;
  height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: #f5f7fb;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #e8f1ff;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(56, 152, 236, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(14, 116, 144, 0.28), transparent 50%),
    linear-gradient(160deg, #0b1b2e 0%, #123049 48%, #0d2136 100%);
}

.logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #2f80ed, #1a5fbf);
  box-shadow: 0 10px 24px rgba(47, 128, 237, 0.35);
  margin-bottom: 28px;
}

.login-brand h1 { margin: 0; font-size: 40px; font-weight: 750; color: #fff; }
.tagline { margin: 12px 0 28px; font-size: 16px; color: rgba(232, 241, 255, 0.72); }
.features { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.features li { position: relative; padding-left: 18px; font-size: 14px; color: rgba(232, 241, 255, 0.78); }
.features li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #5aa7ff;
}
.brand-footer { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(232, 241, 255, 0.35); }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.panel-card { width: 100%; max-width: 400px; background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
.panel-head h2, .panel-card h2 { margin: 0; font-size: 28px; font-weight: 700; color: #1f2937; }
.panel-head p, .panel-card .sub { margin: 8px 0 24px; color: #6b7280; font-size: 14px; }
.switch-link { margin-top: 16px; text-align: center; font-size: 13px; }
.switch-link a { color: var(--app-primary); }
.hint { margin-top: 12px; text-align: center; color: #9ca3af; font-size: 12px; }

/* ========== App shell (uwwwroot AdminLayout) ========== */
.app-layout {
  min-height: 100%;
  height: 100%;
  background: #f0f2f5;
}

.app-sider {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sider-width);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #001529;
  box-shadow: 2px 0 8px rgba(0, 21, 41, 0.12);
  /* 默认不要 width 过渡：整页跳转时收起态回填会被动画成「左右抖」 */
  transition: none;
}

.app-sider.is-dark { background: #141414; box-shadow: 2px 0 8px rgba(0, 0, 0, 0.35); }
.app-sider.is-dark .sider-foot { border-top-color: #303030; }

.sider-brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sider-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.sider-text { display: flex; flex-direction: column; justify-content: center; color: #fff; overflow: hidden; min-width: 0; }
.sider-text strong { font-size: 14px; font-weight: 650; line-height: 18px; white-space: nowrap; }
.sider-text span { font-size: 10px; color: rgba(255, 255, 255, 0.45); margin-top: 2px; white-space: nowrap; }

.sider-menu-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 12px;
}

.sider-menu-group { margin-bottom: 6px; }
.sider-menu-group-title {
  padding: 10px 20px 6px;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
  user-select: none;
}
.app-layout.sider-rail:not(.sider-hover) .sider-menu-group-title { display: none; }

.sider-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 2px 8px;
  padding: 0 16px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.sider-menu-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sider-menu-item.is-active {
  color: #fff !important;
  background: var(--app-primary);
  font-weight: 600;
}
.sider-menu-item.is-active .sider-menu-label,
.sider-menu-item.is-active .sider-menu-icon,
.sider-menu-item.is-active svg {
  color: #fff !important;
  fill: currentColor !important;
  background: transparent !important;
  opacity: 1;
}

.sider-menu-icon { display: inline-flex; opacity: 0.85; color: inherit; }
.sider-menu-icon svg { display: block; fill: currentColor; }
.sider-menu-label { background: transparent; }

.sider-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sider-foot-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.sider-foot-btn svg { display: block; }
.sider-foot-btn:hover,
.sider-foot-btn.is-on {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.app-main-wrap {
  margin-left: var(--sider-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 不用过渡，避免切换页面/悬停时主区左右抖动 */
}

/*
 * 轨道模式（手动收起 或 取消固定）：
 * - 主区恒定留 56px，避免切换抖动
 */
.app-layout.sider-rail .app-main-wrap { margin-left: 56px; }
.app-layout.sider-rail .app-sider {
  width: 56px;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.28);
}
.app-layout.sider-rail:not(.sider-hover) .sider-text,
.app-layout.sider-rail:not(.sider-hover) .sider-menu-label { display: none; }
.app-layout.sider-rail:not(.sider-hover) .sider-menu-item {
  justify-content: center;
  padding: 0;
  margin-inline: 4px;
  width: calc(100% - 8px);
}
.app-layout.sider-rail:not(.sider-hover) .sider-brand { justify-content: center; padding: 0; }
.app-layout.sider-rail:not(.sider-hover) .sider-foot {
  justify-content: center;
  padding: 6px 0 8px;
}
.app-layout.sider-rail:not(.sider-hover) #btnSiderPin { display: none; }

/* 收起导航（仍固定）：悬停某一项只浮出该项名称，不整栏展开 */
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .app-sider,
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .sider-menu-wrap {
  overflow: visible;
}
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .sider-menu-item {
  position: relative;
}
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .sider-menu-item .sider-menu-label {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: #001529;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  z-index: 300;
  pointer-events: none;
}
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .sider-menu-item .sider-menu-label::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #001529;
}
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .sider-menu-item:hover .sider-menu-label,
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .sider-menu-item:focus-visible .sider-menu-label {
  display: block;
}
/* 仅收起态浮层 tip 使用深底，展开态文字勿带背景块 */
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .app-sider.is-dark .sider-menu-item .sider-menu-label {
  background: #1f1f1f;
}
.app-layout.sider-rail.sider-collapsed:not(.sider-unpinned) .app-sider.is-dark .sider-menu-item .sider-menu-label::before {
  border-right-color: #1f1f1f;
}

/* 取消固定：悬停才整栏浮出（与图钉一致）；仅此处允许宽度动画 */
.app-layout.sider-rail.sider-unpinned .app-sider {
  transition: width 0.2s;
}
.app-layout.sider-rail.sider-unpinned.sider-hover .app-sider {
  width: var(--sider-width);
  z-index: 120;
}
.app-layout.sider-rail.sider-unpinned.sider-hover .sider-text { display: flex; }
.app-layout.sider-rail.sider-unpinned.sider-hover .sider-menu-label { display: inline; }
.app-layout.sider-rail.sider-unpinned.sider-hover .sider-menu-item {
  justify-content: flex-start;
  padding: 0 16px;
  margin: 2px 8px;
  width: auto;
  position: static;
}
.app-layout.sider-rail.sider-unpinned.sider-hover .sider-menu-item .sider-menu-label {
  position: static;
  transform: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
.app-layout.sider-rail.sider-unpinned.sider-hover .sider-menu-item .sider-menu-label::before { display: none; }
.app-layout.sider-rail.sider-unpinned.sider-hover .sider-brand {
  justify-content: flex-start;
  padding: 0 12px;
}
.app-layout.sider-rail.sider-unpinned.sider-hover .sider-foot {
  justify-content: space-between;
  padding: 6px 10px 8px;
}
.app-layout.sider-rail.sider-unpinned.sider-hover #btnSiderPin { display: inline-flex; }

.app-layout.is-tab-max .app-sider,
.app-layout.is-tab-max .app-header {
  display: none !important;
}

.app-layout.is-tab-max .app-main-wrap {
  margin-left: 0 !important;
}

.app-header {
  height: 50px;
  flex-shrink: 0;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.collapse-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #595959;
  cursor: pointer;
  font-size: 16px;
}

.collapse-btn:hover { background: rgba(0, 0, 0, 0.04); color: var(--app-primary); }

.header-breadcrumb {
  font-size: 14px;
  color: #595959;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-breadcrumb a:hover { color: var(--app-primary); }
.bc-sep { margin: 0 6px; color: #bfbfbf; }

.header-tools { display: flex; align-items: center; gap: 2px; }

.tool-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #595959;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tool-btn:hover { color: var(--app-primary); background: rgba(0, 0, 0, 0.04); }
.tool-btn svg { display: block; }
.tool-btn-text {
  width: auto;
  padding: 0 10px;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.tool-btn-label { line-height: 1; }
@media (max-width: 768px) {
  .tool-btn-label { display: none; }
  .tool-btn-text { width: 36px; padding: 0; }
}

/* 全局配置弹窗 */
.gc-modal { position: fixed; inset: 0; z-index: 960; display: none; }
.gc-modal.open { display: block; }
.gc-modal-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.gc-modal-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 16px 24px;
  pointer-events: none;
  overflow: auto;
}
.gc-modal-box {
  pointer-events: auto;
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.gc-modal.open .gc-modal-box { transform: translateY(0); opacity: 1; }
.gc-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.gc-modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: #141414; }
.gc-modal-sub { margin: 4px 0 0; font-size: 12px; color: #8c8c8c; }
.gc-modal-x {
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: transparent; color: #8c8c8c; font-size: 22px; line-height: 1; cursor: pointer;
}
.gc-modal-x:hover { background: rgba(0,0,0,0.04); color: #141414; }
.gc-modal-body { padding: 16px 20px 20px; }
.gc-modal-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
body.gc-modal-open,
body.pe-modal-open { overflow: hidden; }

.pe-modal { z-index: 970; }
.pe-modal-box {
  max-width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.pe-modal .gc-modal-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.pe-content {
  font-family: Consolas, "SF Mono", Monaco, monospace;
  font-size: 12px;
  line-height: 1.45;
  min-height: 320px;
  resize: vertical;
}
.pe-status { min-height: 1.2em; margin-top: 8px; }
.pe-status.is-err { color: #cf1322; }

html[data-theme='dark'] .gc-modal-box {
  background: #1f1f1f; border-color: #303030;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
html[data-theme='dark'] .gc-modal-head { border-bottom-color: #303030; }
html[data-theme='dark'] .gc-modal-head h3 { color: rgba(255,255,255,0.9); }
html[data-theme='dark'] .gc-modal-x:hover { background: rgba(255,255,255,0.06); color: #fff; }

.header-divider {
  width: 1px;
  height: 20px;
  background: #f0f0f0;
  margin: 0 6px;
  flex: none;
}

.theme-mode-row { display: flex; gap: 8px; }
.theme-mode-btn { flex: 1; }
.theme-mode-btn.is-active {
  color: #fff;
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.theme-dropdown { position: relative; }

.theme-panel {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  width: 220px;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  z-index: 50;
}

.theme-panel.open { display: block; }

.theme-panel-title { font-size: 12px; color: #8c8c8c; margin-bottom: 8px; }

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.theme-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.theme-swatch.active { border-color: #141414; }

.user-dropdown { position: relative; }

.user-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.user-entry:hover { background: #f5f5f5; }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--app-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: #262626; }
.user-role { font-size: 11px; color: #8c8c8c; }
.user-caret { font-size: 10px; color: #8c8c8c; }

.user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  min-width: 140px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  padding: 6px 0;
  z-index: 50;
}

.user-menu.open { display: block; }

.user-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: #595959;
}

.user-menu a:hover { background: #f5f5f5; color: var(--app-primary); }

.user-menu-section { padding: 8px 12px 4px; }
.user-menu-label { font-size: 12px; color: #8c8c8c; margin-bottom: 6px; }
.user-project-switch select {
  width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  background: #fff;
}
.user-menu-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 4px 0;
}

.app-content {
  flex: 1;
  min-height: 0;
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-col {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-head {
  flex-shrink: 0;
  padding: 4px 0 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  min-width: 0;
}

.opened-tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: auto;
  scrollbar-width: none;
}

.opened-tabs::-webkit-scrollbar { display: none; }

.opened-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  max-width: 180px;
  padding: 0 8px 0 10px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  color: #595959;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.opened-tab + .opened-tab {
  box-shadow: inset 1px 0 0 #f0f0f0;
}

.opened-tab.is-active {
  background: #e6f7ff;
  color: #1890ff;
  box-shadow: none;
}

.opened-tab.is-active + .opened-tab {
  box-shadow: none;
}

.opened-tab-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
}

.opened-tab.is-active .opened-tab-icon {
  opacity: 1;
}

.opened-tab-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.opened-tab-close {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: #8c8c8c;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.opened-tab-close:hover {
  color: #ff4d4f;
  background: rgba(0, 0, 0, 0.04);
}

.opened-tab-pin {
  flex: none;
  display: inline-flex;
  align-items: center;
  color: #8c8c8c;
  opacity: 0.85;
}

.page-head-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-fullscreen-icon {
  width: 14px;
  height: 14px;
}

.tab-fullscreen-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-fullscreen-icon rect {
  fill: currentColor;
  stroke: none;
}

.tab-nav-btn {
  flex: none;
  width: 24px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: #8c8c8c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 4px;
}

.tab-nav-btn:hover:not(:disabled) {
  color: var(--app-primary);
}

.tab-nav-btn:disabled {
  color: #d9d9d9;
  cursor: default;
}

.tab-ops-wrap {
  position: relative;
  flex: none;
}

.tab-ops-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 168px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  padding: 4px 0;
  z-index: 30;
}

.tab-ops-menu.open { display: block; }

.tab-ops-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #595959;
  cursor: pointer;
}

.tab-ops-item-icon {
  flex: none;
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: rgba(0, 0, 0, 0.45);
}

.tab-ops-item:hover {
  background: #f5f5f5;
  color: var(--app-primary);
}

.tab-ops-item:hover .tab-ops-item-icon {
  color: var(--app-primary);
}

.tab-ops-divider {
  height: 1px;
  margin: 4px 0;
  background: #f0f0f0;
}

.sider-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  background: var(--app-card-bg);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  scrollbar-gutter: stable;
}

/* ========== Form & components ========== */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; font-size: 13px; color: #374151; font-weight: 600; }
.form-item input:not([type="checkbox"]):not([type="radio"]),
.form-item select,
.form-item textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-item input:not([type="checkbox"]):not([type="radio"]):focus,
.form-item select:focus,
.form-item textarea:focus {
  outline: none;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}
.form-hint { font-size: 12px; color: #8c8c8c; margin: 6px 0 0; line-height: 1.5; }
.muted { color: #8c8c8c; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.btn-primary { background: var(--app-primary); color: #fff; border-color: var(--app-primary); }
.btn-primary:hover { filter: brightness(0.95); }
.btn-success { background: #52c41a; color: #fff; }
.btn-warning { background: #faad14; color: #fff; }
.btn-info { background: #13c2c2; color: #fff; }
.btn-ghost { background: #fff; border-color: #d9d9d9; color: #595959; }
.btn-ghost:hover { color: var(--app-primary); border-color: var(--app-primary); }
.btn-danger { background: #fff; border-color: #ffccc7; color: #ff4d4f; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Flash modal (保存后提示) */
.flash-modal { position: fixed; inset: 0; z-index: 1000; display: none; }
.flash-modal.open { display: block; }
.flash-modal-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.flash-modal.open .flash-modal-mask { opacity: 1; }
.flash-modal-wrap {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 24px; pointer-events: none;
}
.flash-modal-box {
  pointer-events: auto;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 22px 22px 18px;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}
.flash-modal.open .flash-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.flash-modal-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}
.flash-modal-box.is-success .flash-modal-icon {
  color: #389e0d;
  background: linear-gradient(145deg, #f6ffed 0%, #d9f7be 100%);
  box-shadow: inset 0 0 0 1px rgba(82, 196, 26, 0.25);
}
.flash-modal-box.is-success .flash-modal-icon::before { content: '✓'; }
.flash-modal-box.is-error .flash-modal-icon {
  color: #cf1322;
  background: linear-gradient(145deg, #fff2f0 0%, #ffccc7 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 79, 0.28);
}
.flash-modal-box.is-error .flash-modal-icon::before { content: '!'; }
.flash-modal-main { flex: 1; min-width: 0; }
.flash-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #141414;
  margin: 2px 0 8px;
  letter-spacing: 0.01em;
}
.flash-modal-body {
  font-size: 14px;
  color: #595959;
  line-height: 1.65;
  margin: 0 0 18px;
  word-break: break-word;
  white-space: pre-wrap;
}
.flash-modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.flash-modal-ok {
  min-width: 96px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.28);
}
.flash-modal-box.is-error .flash-modal-ok {
  background: #ff4d4f !important;
  border-color: #ff4d4f !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.28);
}
.flash-modal-box.is-error .flash-modal-ok:hover {
  filter: brightness(0.95);
  color: #fff !important;
}
.flash-modal-box.is-confirm .flash-modal-icon {
  background: #e6f4ff;
  color: #1677ff;
}
.flash-modal-box.is-confirm .flash-modal-icon::before { content: '?'; }
.flash-modal-cancel { min-width: 88px; }
body.flash-modal-open { overflow: hidden; }

.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; line-height: 1.5; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.alert-ok { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.alert-info { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }
.alert-warn { background: #fffbe6; border: 1px solid #ffe58f; color: #ad6800; }

.card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.card h3, .card h4 { margin: 0 0 12px; font-size: 15px; font-weight: 650; color: #262626; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card.nested { background: #fafafa; }
.card-foot { padding-top: 12px; border-top: 1px solid #f0f0f0; font-size: 12px; color: #8c8c8c; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid #f0f0f0; text-align: left; vertical-align: top; }
.table th { color: #8c8c8c; font-weight: 600; background: #fafafa; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-pan { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; }
.grid-dashboard { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-bottom: 16px; }

/* Overview 风格统计卡（对齐 uwwwroot） */
.overview { padding: 0 2px 8px; box-sizing: border-box; }
.ov-stat-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.ov-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 96px;
  padding: 14px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ov-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.ov-stat-card::after {
  content: '';
  position: absolute;
  right: -18px;
  top: -18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.ov-stat-icon {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 28%, transparent);
}
.ov-stat-icon svg { display: block; }
.ov-stat-body { position: relative; z-index: 1; min-width: 0; }
.ov-stat-label {
  color: #8c8c8c;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-stat-value {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 700;
  color: #1f1f1f;
  letter-spacing: -0.5px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.ov-stat-foot {
  margin-top: 4px;
  font-size: 11px;
  color: #bfbfbf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.65fr;
  gap: 16px;
  margin-bottom: 16px;
}
.ov-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 14px 16px 16px;
}
.ov-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ov-panel-title { font-size: 15px; font-weight: 600; color: #262626; }
.ov-panel-extra { display: inline-flex; align-items: center; gap: 10px; }
.ov-hint { font-size: 12px; color: #bfbfbf; }
.ov-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8c8c8c;
  font-size: 13px;
  user-select: none;
}
.ov-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9d9d9;
  flex-shrink: 0;
}
.ov-live-dot.is-on {
  background: #52c41a;
  animation: ov-live-pulse 1.6s ease-out infinite;
}
@keyframes ov-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(82, 196, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0); }
}
.ov-chart { width: 100%; height: 320px; }
.ov-device {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.ov-device-title { font-size: 12px; font-weight: 600; color: #8c8c8c; margin-bottom: 8px; }
.ov-device-split { display: flex; }
.ov-device-item { flex: 1; text-align: center; }
.ov-device-item + .ov-device-item { border-left: 1px solid #f0f0f0; }
.ov-device-label { font-size: 12px; color: #8c8c8c; }
.ov-device-num { margin-top: 4px; font-size: 22px; font-weight: 700; color: #262626; font-variant-numeric: tabular-nums; }
.ov-sys-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.ov-sys-item {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #262626;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ov-sys-k { font-size: 12px; color: #8c8c8c; }
.ov-sys-wide { grid-column: 1 / -1; }

html[data-theme='dark'] .ov-stat-card {
  background: linear-gradient(135deg, #1f1f1f 0%, rgba(255,255,255,0.03) 100%);
  border-color: #303030;
}
html[data-theme='dark'] .ov-stat-value { color: rgba(255,255,255,0.88); }
html[data-theme='dark'] .ov-panel {
  background: #1f1f1f;
  border-color: #303030;
}
html[data-theme='dark'] .ov-panel-title { color: rgba(255,255,255,0.88); }
html[data-theme='dark'] .ov-sys-item {
  background: #141414;
  border-color: #303030;
  color: rgba(255,255,255,0.85);
}
html[data-theme='dark'] .ov-device-num { color: rgba(255,255,255,0.88); }
html[data-theme='dark'] .ov-device { border-top-color: #303030; }
html[data-theme='dark'] .ov-device-item + .ov-device-item { border-left-color: #303030; }
html[data-theme='dark'] .bot-row { border-bottom-color: #303030; }
html[data-theme='dark'] .bot-name { color: rgba(255, 255, 255, 0.75); }
html[data-theme='dark'] .pill {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
html[data-theme='dark'] .app-sider .sider-menu-item.is-active {
  color: #fff !important;
  background: var(--app-primary);
}
html[data-theme='dark'] .app-sider .sider-menu-item.is-active .sider-menu-label,
html[data-theme='dark'] .app-sider .sider-menu-item.is-active .sider-menu-icon,
html[data-theme='dark'] .app-sider .sider-menu-item.is-active svg {
  color: #fff !important;
  fill: currentColor !important;
  background: transparent !important;
  -webkit-text-fill-color: #fff;
}

@media (max-width: 1200px) {
  .ov-stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .ov-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: 1fr; }
  .ov-sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* V8 首页统计卡（旧） */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  border: none;
  border-radius: 8px;
  padding: 16px 18px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.stat-card .label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-card .label i { width: 16px; text-align: center; opacity: 0.9; }
.stat-card .value { font-size: 32px; font-weight: 700; margin-top: 10px; line-height: 1.1; color: #fff; }
.stat-card .foot { font-size: 12px; opacity: 0.75; margin-top: 8px; color: #fff; }
.stat-row-v8 .sc-green { background: #10b981; }
.stat-row-v8 .sc-red { background: #ef4444; }
.stat-row-v8 .sc-blue { background: #3b82f6; }
.stat-row-v8 .sc-dark { background: #1f2937; }

.marquee-bar {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.marquee-v8 {
  border: 1px solid #f5c6cb;
  background: #f8d7da;
}
.marquee-inner {
  line-height: 40px;
  color: #721c24;
  font-size: 14px;
  font-weight: 700;
  padding: 0 12px;
  white-space: nowrap;
}

.bot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.bot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  min-width: 0;
}
.bot-name {
  font-size: 13px;
  color: #434343;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-svg-ico { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; color: inherit; }
.dash-svg-ico path { fill: currentColor; }
.stat-card .dash-svg-ico { color: #fff; opacity: 0.95; }
.marquee-ico { margin-right: 8px; vertical-align: -2px; color: #721c24; }
.card h3 .dash-svg-ico { margin-right: 6px; }
.device-label .dash-svg-ico { margin-right: 4px; vertical-align: -2px; }
.ico-primary { color: #1677ff; }
.ico-danger { color: #ff4d4f; }
.ico-success { color: #52c41a; }
.ico-info { color: #13c2c2; }
.ico-muted { color: #8c8c8c; }
h3 .muted { color: #8c8c8c; font-size: 14px; }
.device-label { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.device-split { display: flex; text-align: center; }
.device-split .device-item { flex: 1; padding: 8px 0; }
.device-split .device-item:first-child { border-right: 1px solid #f0f0f0; }
.device-box-v8 { flex-direction: column; background: #fafafa; border-radius: 0 0 8px 8px; margin: 0 -12px -12px; padding: 12px 12px 8px; }
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head-row h3 { margin: 0; }
.device-box-title { font-size: 12px; font-weight: 600; color: #8c8c8c; margin-bottom: 8px; }
.pill {
  background: #f5f5f5;
  color: #595959;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 20px;
  flex: none;
}
.device-box { display: flex; border-top: 1px solid #f0f0f0; margin-top: 8px; padding-top: 12px; }
.device-item { flex: 1; text-align: center; }
.device-item .h { font-size: 22px; font-weight: 700; margin-top: 4px; }
.sys-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 13px; }

/* —— 全局复选框 / 单选框美化 —— */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  margin: 0;
  flex: none;
  vertical-align: middle;
  cursor: pointer;
  background: #fff;
  border: 1.5px solid #d9d9d9;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  position: relative;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
input[type="radio"] {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--app-primary);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.2);
  border-color: var(--app-primary);
}
input[type="checkbox"]:checked {
  background: var(--app-primary);
  border-color: var(--app-primary);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked {
  border-color: var(--app-primary);
  background: #fff;
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--app-primary);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: #f5f5f5;
}

/* 开关行：复选框做成开关 */
.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  cursor: pointer;
  user-select: none;
}
.switch-line > input[type="checkbox"] {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: none;
  background: #d9d9d9;
  box-shadow: none;
}
.switch-line > input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transform: none;
  transition: transform 0.2s;
}
.switch-line > input[type="checkbox"]:checked {
  background: var(--app-primary);
  border: none;
}
.switch-line > input[type="checkbox"]:checked::after {
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border: none;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transform: translateX(16px);
}
.switch-line > input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.2);
}
.switch-line > span { font-size: 14px; color: #262626; line-height: 1.4; }

.radio-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio-block:hover { border-color: #91caff; background: #fafafa; }
.radio-block:has(input:checked) {
  border-color: var(--app-primary);
  background: #f0f5ff;
}
.radio-block input[type="radio"] { margin-top: 3px; }

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.check-inline input[type="checkbox"] { flex: none; }
.inline-bind { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-bind input { flex: 1; min-width: 180px; }
.inline-bind-key {
  flex-wrap: nowrap;
  align-items: stretch;
}
.inline-bind-key input {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
}
.btn-test-llm {
  flex: none;
  align-self: stretch;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(22, 119, 255, 0.35);
}
.btn-test-llm:hover {
  filter: brightness(1.05);
  box-shadow: 0 3px 8px rgba(22, 119, 255, 0.45);
}
.mono { font-family: Consolas, monospace; font-size: 12px; }

/* Spider shield (zhizhu) */
.zz { display: flex; flex-direction: column; gap: 12px; }
.zz-toolbar { display: flex; flex-direction: column; gap: 4px; }
.zz-toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.zz-toolbar h2 { margin: 0; font-size: 16px; font-weight: 650; color: #141414; }
.zz-sub { margin: 0; font-size: 12px; color: #8c8c8c; }
.zz-hint { font-size: 11px; color: #8c8c8c; line-height: 1.4; }
.zz-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid transparent;
}
.zz-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.zz-live.is-on { background: #f6ffed; color: #389e0d; border-color: #b7eb8f; }
.zz-live.is-off { background: #fafafa; color: #8c8c8c; border-color: #f0f0f0; }

.zz-panel { padding: 12px 14px !important; margin-bottom: 0 !important; }
.zz-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.zz-row-main { display: flex; flex-direction: column; gap: 2px; }
.zz-row-main strong { font-size: 14px; }
.zz-row-main .muted,
.zz-sec-head .muted,
.zz-foot .muted { font-size: 12px; }
.zz-sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.zz-sec-head strong { font-size: 14px; }
.zz-chip {
  font-size: 12px; color: #8c8c8c; background: #f5f5f5; border-radius: 999px;
  padding: 1px 8px; font-variant-numeric: tabular-nums;
}

.zz-switch { position: relative; display: inline-flex; cursor: pointer; }
.zz-switch input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
  border: none; background: transparent; box-shadow: none;
}
.zz-switch input[type="checkbox"]::after { display: none; }
.zz-switch-ui {
  width: 36px; height: 20px; border-radius: 999px; background: #d9d9d9;
  position: relative; transition: background 0.2s;
}
.zz-switch-ui::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s;
}
.zz-switch input:checked + .zz-switch-ui { background: var(--app-primary); }
.zz-switch input:checked + .zz-switch-ui::after { transform: translateX(16px); }

.zz-modes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.zz-mode {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px; border: 1px solid #f0f0f0; border-radius: 8px;
  cursor: pointer; background: #fafafa; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.zz-mode input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
  width: 0; height: 0; margin: 0; border: none; box-shadow: none;
}
.zz-mode input[type="radio"]::after { display: none; }
.zz-mode:hover { border-color: #91caff; }
.zz-mode.is-active {
  border-color: var(--app-primary); background: #f0f5ff;
  box-shadow: 0 0 0 1px var(--app-primary);
}
.zz-mode-title { font-size: 13px; font-weight: 650; color: #262626; }
.zz-mode-desc { font-size: 12px; color: #8c8c8c; line-height: 1.45; }

.zz-lists { gap: 12px; }
.zz-list-panel.is-dim { opacity: 0.55; }
.zz-list-panel.is-focus { box-shadow: 0 0 0 1px #91caff; }
.zz-list-panel textarea,
.zz-panel textarea {
  width: 100%; min-height: 140px; resize: vertical;
  font-size: 12px; line-height: 1.5;
}
.zz-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 0 4px;
}
.zz-form { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 860px) {
  .zz-modes { grid-template-columns: 1fr; }
}

/* Generate queue — compact console style */
.gq { display: flex; flex-direction: column; gap: 12px; }
.gq-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.gq-toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gq-toolbar h2 { margin: 0; font-size: 16px; font-weight: 650; color: #141414; }
.gq-toolbar-right { display: flex; gap: 8px; }
.gq-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid transparent;
}
.gq-live-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gq-live.is-on { background: #f6ffed; color: #389e0d; border-color: #b7eb8f; }
.gq-live.is-on .gq-live-dot { animation: gq-pulse 1.2s ease-in-out infinite; }
.gq-live.is-warn { background: #fff7e6; color: #d46b08; border-color: #ffd591; }
.gq-live.is-idle { background: #fafafa; color: #8c8c8c; border-color: #f0f0f0; }
@keyframes gq-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.gq-panel { padding: 12px 14px !important; }
.gq-panel.is-running { border-color: #91caff; }
.gq-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.gq-panel-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.gq-panel-title strong { font-size: 14px; }
.gq-panel-name { font-size: 13px; color: #595959; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gq-panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gq-counts { font-size: 12px; color: #8c8c8c; font-variant-numeric: tabular-nums; }
.gq-counts b { color: #262626; font-weight: 650; }
.gq-counts b.ok { color: #389e0d; }
.gq-counts b.bad { color: #cf1322; }
.gq-inline-form { margin: 0; }

.gq-progress { margin-bottom: 10px; }
.gq-progress-track {
  height: 6px; background: #f0f0f0; border-radius: 999px; overflow: hidden;
}
.gq-progress-track.sm { height: 4px; width: 88px; flex: none; }
.gq-progress-fill {
  height: 100%; width: 0; background: var(--app-primary);
  border-radius: 999px; transition: width 0.35s ease;
}
.gq-panel.is-running .gq-progress-fill { background: linear-gradient(90deg, #1677ff, #69b1ff); }
.gq-progress-meta {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 6px;
  font-size: 12px; color: #8c8c8c;
}
.gq-progress-meta strong { color: #1677ff; font-variant-numeric: tabular-nums; }
.gq-now { min-height: 0; margin-top: 4px; font-size: 12px; color: #595959; }
.gq-now:empty { display: none; }
.gq-now b { color: #1677ff; font-weight: 600; }

.gq-items-table th, .gq-items-table td,
.gq-jobs-table th, .gq-jobs-table td { padding: 8px 6px; vertical-align: middle; }
.gq-items-table tbody tr.status-running { background: #f0f5ff; }
.gq-item-title { font-weight: 500; color: #262626; }
.gq-item-err { margin-top: 2px; font-size: 12px; color: #cf1322; }
.gq-jobs-table tbody tr.is-active { background: #f0f5ff; }
.gq-jobs-table tbody tr.is-active td { border-color: #d6e4ff; }
.gq-mini { display: flex; align-items: center; gap: 8px; }
.gq-mini-txt { font-size: 12px; color: #8c8c8c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gq-empty { padding: 20px 14px !important; text-align: center; }
.gq-empty p { margin: 0; color: #8c8c8c; font-size: 13px; }
.gq-empty a { color: var(--app-primary); }
.gq-empty-line { margin: 4px 0 0; font-size: 13px; }

.job-status-badge {
  display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
  background: #f5f5f5; color: #595959; white-space: nowrap; line-height: 20px;
}
.job-status-badge.status-pending { background: #fff7e6; color: #d46b08; }
.job-status-badge.status-running { background: #e6f4ff; color: #1677ff; }
.job-status-badge.status-done,
.job-status-badge.status-success { background: #f6ffed; color: #389e0d; }
.job-status-badge.status-failed { background: #fff2f0; color: #cf1322; }
.job-status-badge.status-cancelled { background: #f5f5f5; color: #8c8c8c; }

@media (max-width: 720px) {
  .gq-panel-name { max-width: 180px; }
  .gq-progress-track.sm { width: 56px; }
}

.page-block { border-bottom: 1px solid #f0f0f0; padding-bottom: 20px; margin-bottom: 20px; }
.page-block:last-child { border-bottom: none; margin-bottom: 0; }
.page-block-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-block h4 { margin: 0; font-size: 16px; }
.page-regen-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f5f9ff;
  border: 1px solid #d6e4ff;
}
.page-regen-box.is-done {
  background: #f6ffed;
  border-color: #b7eb8f;
}
.page-regen-box.is-fail {
  background: #fff2f0;
  border-color: #ffccc7;
}
.page-regen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.page-regen-label { font-size: 13px; font-weight: 600; color: #1677ff; }
.page-regen-box.is-done .page-regen-label { color: #389e0d; }
.page-regen-box.is-fail .page-regen-label { color: #cf1322; }
.page-regen-pct { font-size: 13px; font-variant-numeric: tabular-nums; color: #1677ff; font-weight: 600; }
.page-regen-track { height: 8px; border-radius: 999px; background: rgba(22, 119, 255, 0.12); overflow: hidden; }
.page-regen-box .gq-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1677ff, #69b1ff);
  transition: width 0.35s ease;
}
.page-regen-msg { margin-top: 8px; font-size: 12px; color: #595959; line-height: 1.5; }
.domain-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.domain-tag { display: inline-flex; align-items: center; gap: 6px; background: #f5f5f5; border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.domain-tag-stat {
  color: #1677ff;
  text-decoration: none;
  font-weight: 600;
  padding: 0 2px;
}
.domain-tag-stat:hover { text-decoration: underline; }
.tag-x { border: none; background: transparent; color: #999; cursor: pointer; font-size: 16px; line-height: 1; }

/* Dark theme */
html[data-theme='dark'],
html[data-theme='dark'] body {
  background: #141414;
  color: rgba(255, 255, 255, 0.85);
}

html[data-theme='dark'] .app-layout { background: #141414; }
html[data-theme='dark'] .app-sider.is-classic { background: #141414; }
html[data-theme='dark'] .app-header { background: #1f1f1f; border-bottom-color: #303030; }
html[data-theme='dark'] .page-main { background: #1f1f1f; border-color: #303030; }
html[data-theme='dark'] .card { background: #1f1f1f; border-color: #303030; }
html[data-theme='dark'] .flash-modal-mask { background: rgba(0, 0, 0, 0.62); }
html[data-theme='dark'] .flash-modal-box {
  background: #1f1f1f;
  border-color: #303030;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
html[data-theme='dark'] .flash-modal-title { color: rgba(255, 255, 255, 0.92); }
html[data-theme='dark'] .flash-modal-body { color: rgba(255, 255, 255, 0.65); }
html[data-theme='dark'] .flash-modal-box.is-success .flash-modal-icon {
  background: rgba(82, 196, 26, 0.16);
  color: #95de64;
  box-shadow: inset 0 0 0 1px rgba(82, 196, 26, 0.28);
}
html[data-theme='dark'] .flash-modal-box.is-confirm .flash-modal-icon {
  background: rgba(22, 119, 255, 0.18);
  color: #69b1ff;
}
html[data-theme='dark'] .flash-modal-box.is-error .flash-modal-icon {
  background: rgba(255, 77, 79, 0.16);
  color: #ff7875;
  box-shadow: inset 0 0 0 1px rgba(255, 77, 79, 0.3);
}
html[data-theme='dark'] .device-box-v8 { background: rgba(255, 255, 255, 0.04); }
html[data-theme='dark'] .device-split .device-item:first-child { border-color: #303030; }
html[data-theme='dark'] .opened-tab { color: rgba(255, 255, 255, 0.65); }
html[data-theme='dark'] .opened-tab + .opened-tab { box-shadow: inset 1px 0 0 #303030; }
html[data-theme='dark'] .opened-tab.is-active { background: rgba(22, 119, 255, 0.18); color: #69b1ff; }
html[data-theme='dark'] .tab-ops-menu { background: #1f1f1f; }
html[data-theme='dark'] .tab-ops-item:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme='dark'] .tab-ops-divider { background: rgba(255, 255, 255, 0.08); }
html[data-theme='dark'] .user-entry:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme='dark'] .user-name { color: rgba(255, 255, 255, 0.85); }
html[data-theme='dark'] .tool-btn { color: rgba(255, 255, 255, 0.65); }
html[data-theme='dark'] .theme-panel, html[data-theme='dark'] .user-menu { background: #1f1f1f; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
html[data-theme='dark'] .theme-swatch.active { border-color: #fff; }
html[data-theme='dark'] .header-divider { background: #303030; }
html[data-theme='dark'] .user-menu-divider { background: #303030; }
html[data-theme='dark'] .user-project-switch select {
  background: #141414;
  border-color: #434343;
  color: rgba(255, 255, 255, 0.85);
}
html[data-theme='dark'] .form-item input:not([type="checkbox"]):not([type="radio"]),
html[data-theme='dark'] .form-item select,
html[data-theme='dark'] .form-item textarea {
  background: #141414;
  border-color: #434343;
  color: rgba(255, 255, 255, 0.85);
}
html[data-theme='dark'] input[type="checkbox"],
html[data-theme='dark'] input[type="radio"] {
  background: #141414;
  border-color: #434343;
}
html[data-theme='dark'] input[type="checkbox"]:checked {
  background: var(--app-primary);
  border-color: var(--app-primary);
}
html[data-theme='dark'] input[type="radio"]:checked {
  background: #141414;
  border-color: var(--app-primary);
}
html[data-theme='dark'] .switch-line > input[type="checkbox"] {
  background: #434343;
}
html[data-theme='dark'] .switch-line > input[type="checkbox"]:checked {
  background: var(--app-primary);
}
html[data-theme='dark'] .switch-line > span { color: rgba(255, 255, 255, 0.85); }
html[data-theme='dark'] .radio-block {
  border-color: #303030;
}
html[data-theme='dark'] .radio-block:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: #69b1ff;
}
html[data-theme='dark'] .radio-block:has(input:checked) {
  background: rgba(22, 119, 255, 0.12);
  border-color: var(--app-primary);
}

/* —— 全局组件暗黑补齐 —— */
html[data-theme='dark'] code {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
html[data-theme='dark'] .form-item label { color: rgba(255, 255, 255, 0.75); }
html[data-theme='dark'] .form-hint,
html[data-theme='dark'] .muted,
html[data-theme='dark'] .zz-hint,
html[data-theme='dark'] .zz-sub { color: rgba(255, 255, 255, 0.45); }
html[data-theme='dark'] .card h3,
html[data-theme='dark'] .card h4,
html[data-theme='dark'] .page-block h4 { color: rgba(255, 255, 255, 0.88); }
html[data-theme='dark'] .page-regen-box {
  background: rgba(22, 119, 255, 0.1);
  border-color: rgba(22, 119, 255, 0.28);
}
html[data-theme='dark'] .page-regen-box.is-done {
  background: rgba(82, 196, 26, 0.12);
  border-color: rgba(82, 196, 26, 0.35);
}
html[data-theme='dark'] .page-regen-box.is-fail {
  background: rgba(255, 77, 79, 0.12);
  border-color: rgba(255, 77, 79, 0.35);
}
html[data-theme='dark'] .page-regen-msg { color: rgba(255, 255, 255, 0.55); }
html[data-theme='dark'] .page-regen-track { background: rgba(255, 255, 255, 0.08); }
html[data-theme='dark'] .card.nested { background: #141414; }
html[data-theme='dark'] .card-foot { border-top-color: #303030; color: rgba(255, 255, 255, 0.45); }
html[data-theme='dark'] .page-block { border-bottom-color: #303030; }
html[data-theme='dark'] .table th {
  background: #141414;
  color: rgba(255, 255, 255, 0.45);
}
html[data-theme='dark'] .table th,
html[data-theme='dark'] .table td { border-bottom-color: #303030; }
html[data-theme='dark'] .btn-ghost {
  background: transparent;
  border-color: #434343;
  color: rgba(255, 255, 255, 0.75);
}
html[data-theme='dark'] .btn-ghost:hover {
  color: #69b1ff;
  border-color: #69b1ff;
  background: rgba(22, 119, 255, 0.1);
}
html[data-theme='dark'] .btn-danger {
  background: transparent;
  border-color: rgba(255, 77, 79, 0.45);
  color: #ff7875;
}
html[data-theme='dark'] .btn-danger:hover {
  background: rgba(255, 77, 79, 0.12);
}
html[data-theme='dark'] .alert-error {
  background: rgba(255, 77, 79, 0.12);
  border-color: rgba(255, 77, 79, 0.35);
  color: #ff7875;
}
html[data-theme='dark'] .alert-ok {
  background: rgba(82, 196, 26, 0.12);
  border-color: rgba(82, 196, 26, 0.35);
  color: #95de64;
}
html[data-theme='dark'] .alert-info {
  background: rgba(22, 119, 255, 0.12);
  border-color: rgba(22, 119, 255, 0.35);
  color: #69b1ff;
}
html[data-theme='dark'] .alert-warn {
  background: rgba(250, 173, 20, 0.12);
  border-color: rgba(250, 173, 20, 0.35);
  color: #ffc53d;
}
html[data-theme='dark'] .domain-tag {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
html[data-theme='dark'] .domain-tag a { color: #69b1ff; }
html[data-theme='dark'] .tag-x { color: rgba(255, 255, 255, 0.45); }
html[data-theme='dark'] .tag-x:hover { color: #ff7875; }
html[data-theme='dark'] .header-breadcrumb { color: rgba(255, 255, 255, 0.45); }
html[data-theme='dark'] .user-menu a { color: rgba(255, 255, 255, 0.75); }
html[data-theme='dark'] .user-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #69b1ff;
}
html[data-theme='dark'] .tab-ops-item { color: rgba(255, 255, 255, 0.75); }
html[data-theme='dark'] .device-box { border-top-color: #303030; }
html[data-theme='dark'] .check-inline { color: rgba(255, 255, 255, 0.85); }

/* 蜘蛛防护 */
html[data-theme='dark'] .zz-toolbar h2,
html[data-theme='dark'] .gq-toolbar h2 { color: rgba(255, 255, 255, 0.88); }
html[data-theme='dark'] .zz-chip {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
}
html[data-theme='dark'] .zz-live.is-on {
  background: rgba(82, 196, 26, 0.15);
  color: #95de64;
  border-color: rgba(82, 196, 26, 0.35);
}
html[data-theme='dark'] .zz-live.is-off {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  border-color: #303030;
}
html[data-theme='dark'] .zz-mode {
  background: #141414;
  border-color: #303030;
}
html[data-theme='dark'] .zz-mode:hover { border-color: #69b1ff; }
html[data-theme='dark'] .zz-mode.is-active {
  background: rgba(22, 119, 255, 0.12);
  border-color: var(--app-primary);
}
html[data-theme='dark'] .zz-mode-title { color: rgba(255, 255, 255, 0.88); }
html[data-theme='dark'] .zz-mode-desc { color: rgba(255, 255, 255, 0.45); }
html[data-theme='dark'] .zz-list-panel.is-focus { box-shadow: 0 0 0 1px #69b1ff; }
html[data-theme='dark'] .zz-switch-ui { background: #434343; }

/* 生成队列 */
html[data-theme='dark'] .gq-live.is-on {
  background: rgba(82, 196, 26, 0.15);
  color: #95de64;
  border-color: rgba(82, 196, 26, 0.35);
}
html[data-theme='dark'] .gq-live.is-warn {
  background: rgba(250, 173, 20, 0.15);
  color: #ffc53d;
  border-color: rgba(250, 173, 20, 0.35);
}
html[data-theme='dark'] .gq-live.is-idle {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  border-color: #303030;
}
html[data-theme='dark'] .gq-panel.is-running { border-color: #69b1ff; }
html[data-theme='dark'] .gq-panel-name,
html[data-theme='dark'] .gq-now { color: rgba(255, 255, 255, 0.65); }
html[data-theme='dark'] .gq-counts { color: rgba(255, 255, 255, 0.45); }
html[data-theme='dark'] .gq-counts b { color: rgba(255, 255, 255, 0.88); }
html[data-theme='dark'] .gq-counts b.ok { color: #95de64; }
html[data-theme='dark'] .gq-counts b.bad { color: #ff7875; }
html[data-theme='dark'] .gq-progress-track { background: rgba(255, 255, 255, 0.08); }
html[data-theme='dark'] .gq-progress-meta { color: rgba(255, 255, 255, 0.45); }
html[data-theme='dark'] .gq-progress-meta strong { color: #69b1ff; }
html[data-theme='dark'] .gq-now b { color: #69b1ff; }
html[data-theme='dark'] .gq-item-title { color: rgba(255, 255, 255, 0.88); }
html[data-theme='dark'] .gq-items-table tbody tr.status-running,
html[data-theme='dark'] .gq-jobs-table tbody tr.is-active {
  background: rgba(22, 119, 255, 0.12);
}
html[data-theme='dark'] .gq-jobs-table tbody tr.is-active td { border-color: rgba(22, 119, 255, 0.25); }
html[data-theme='dark'] .gq-mini-txt,
html[data-theme='dark'] .gq-empty p { color: rgba(255, 255, 255, 0.45); }

html[data-theme='dark'] .job-status-badge {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
}
html[data-theme='dark'] .job-status-badge.status-pending {
  background: rgba(250, 173, 20, 0.15);
  color: #ffc53d;
}
html[data-theme='dark'] .job-status-badge.status-running {
  background: rgba(22, 119, 255, 0.18);
  color: #69b1ff;
}
html[data-theme='dark'] .job-status-badge.status-done,
html[data-theme='dark'] .job-status-badge.status-success {
  background: rgba(82, 196, 26, 0.15);
  color: #95de64;
}
html[data-theme='dark'] .job-status-badge.status-failed {
  background: rgba(255, 77, 79, 0.15);
  color: #ff7875;
}
html[data-theme='dark'] .job-status-badge.status-cancelled {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
}

/* 表单控件：不在 .form-item 内的 input（页面绑定等） */
html[data-theme='dark'] .page-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
html[data-theme='dark'] .page-main select,
html[data-theme='dark'] .page-main textarea {
  background: #141414;
  border-color: #434343;
  color: rgba(255, 255, 255, 0.85);
}
html[data-theme='dark'] .page-main input::placeholder,
html[data-theme='dark'] .page-main textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 1100px) {
  .stat-row, .grid-dashboard, .grid-pan, .grid-3, .sys-grid, .ov-stat-row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .user-meta, .user-caret, .header-breadcrumb { display: none; }
  .header-divider { display: none; }
  .app-sider { width: 56px; }
  .app-sider .sider-text, .app-sider .sider-menu-label { display: none; }
  .app-main-wrap { margin-left: 56px !important; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: 160px; padding: 24px; }
  .features, .brand-footer { display: none; }
}

/* ========== 蜘蛛统计页 ========== */
.sp-page { padding: 0 2px 12px; }
.sp-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 70% 80% at 0% 0%, rgba(22, 119, 255, 0.12), transparent 55%),
    linear-gradient(135deg, #fff 0%, #f7faff 100%);
  border: 1px solid rgba(22, 119, 255, 0.08);
}
.sp-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1677ff;
  margin-bottom: 4px;
}
.sp-title {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  color: #141414;
  letter-spacing: -0.02em;
  word-break: break-all;
}
.sp-desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: #8c8c8c;
  max-width: 640px;
  line-height: 1.5;
}
.sp-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sp-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.sp-stat-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff 0%, var(--accent-soft) 100%);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.sp-stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.sp-stat-label { font-size: 12px; color: #8c8c8c; font-weight: 500; }
.sp-stat-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 750;
  color: #1f1f1f;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.sp-stat-foot {
  margin-top: 6px;
  font-size: 11px;
  color: #bfbfbf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 16px;
  margin-bottom: 16px;
}
.sp-panel {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  padding: 14px 16px 16px;
  margin-bottom: 16px;
}
.sp-grid .sp-panel { margin-bottom: 0; }
.sp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sp-panel-head strong { font-size: 15px; color: #262626; }
.sp-hint { font-size: 12px; color: #bfbfbf; }
.sp-chart { width: 100%; height: 280px; }
.sp-bot-list { display: flex; flex-direction: column; gap: 8px; }
.sp-bot-row {
  display: grid;
  grid-template-columns: minmax(110px, 140px) 1fr 48px;
  align-items: center;
  gap: 10px;
}
.sp-bot-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #595959;
  min-width: 0;
}
.sp-bot-name svg { width: 16px; height: 16px; flex-shrink: 0; }
.sp-bot-bar {
  height: 8px;
  border-radius: 999px;
  background: #f5f5f5;
  overflow: hidden;
}
.sp-bot-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #69b1ff, #1677ff);
  min-width: 0;
  transition: width 0.35s ease;
}
.sp-bot-num {
  text-align: right;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: #262626;
}
.sp-device { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.sp-device-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #8c8c8c;
  margin-bottom: 8px;
}
.sp-device-track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #f5f5f5;
}
.sp-device-track i { display: block; height: 100%; }
.sp-device-track .is-pc { background: #1677ff; }
.sp-device-track .is-mobile { background: #13c2c2; }
.sp-table-wrap { overflow: auto; }
.sp-table { margin: 0; }
.sp-table th { white-space: nowrap; }
.sp-url {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-dom-link { color: #1677ff; font-weight: 500; }
.sp-dom-link:hover { text-decoration: underline; }

html[data-theme='dark'] .sp-hero {
  background:
    radial-gradient(ellipse 70% 80% at 0% 0%, rgba(22, 119, 255, 0.18), transparent 55%),
    linear-gradient(135deg, #1f1f1f 0%, #141414 100%);
  border-color: #303030;
}
html[data-theme='dark'] .sp-title { color: rgba(255,255,255,0.92); }
html[data-theme='dark'] .sp-stat-card {
  background: linear-gradient(145deg, #1f1f1f 0%, rgba(255,255,255,0.03) 100%);
  border-color: #303030;
}
html[data-theme='dark'] .sp-stat-value { color: rgba(255,255,255,0.9); }
html[data-theme='dark'] .sp-panel {
  background: #1f1f1f;
  border-color: #303030;
}
html[data-theme='dark'] .sp-panel-head strong { color: rgba(255,255,255,0.9); }
html[data-theme='dark'] .sp-bot-name { color: rgba(255,255,255,0.7); }
html[data-theme='dark'] .sp-bot-num { color: rgba(255,255,255,0.88); }
html[data-theme='dark'] .sp-bot-bar { background: #303030; }
html[data-theme='dark'] .sp-device { border-top-color: #303030; }
html[data-theme='dark'] .sp-device-track { background: #303030; }

@media (max-width: 960px) {
  .sp-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sp-stat-row { grid-template-columns: 1fr; }
  .sp-bot-row { grid-template-columns: 1fr 56px; }
  .sp-bot-bar { display: none; }
}
