/* ==========================================================================
   包包中控台 · styles.css
   浅色系设计系统：CSS 变量统一颜色 / 圆角 / 阴影，零外部依赖。
   ========================================================================== */

/* ------------------------------ 设计变量 ------------------------------ */

:root {
  --primary: #2f6feb;
  --primary-hover: #1f5bd6;
  --primary-active: #184fc0;
  --primary-weak: #eaf1fe;
  --primary-soft: #f4f8ff;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e6eaf1;
  --border-strong: #d6dde8;
  --text: #16202f;
  --text-2: #5b6b82;
  --text-3: #8a97aa;
  --success: #16a34a;
  --success-weak: #e9f8ef;
  --success-strong: #15803d;
  --danger: #e5484d;
  --danger-weak: #fdecec;
  --danger-strong: #b42318;
  --warning: #f59e0b;
  --warning-weak: #fff6e5;
  --warning-strong: #a16207;
  --indigo: #6366f1;
  --indigo-weak: #eef0ff;
  --purple: #8b5cf6;
  --purple-weak: #f3edff;
  --teal: #0d9488;
  --teal-weak: #e6f7f5;

  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 10px 30px -14px rgba(16, 24, 40, 0.22), 0 2px 6px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 24px 60px -24px rgba(16, 24, 40, 0.35), 0 4px 16px -8px rgba(16, 24, 40, 0.12);

  --font: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --sidebar-w: 200px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 56px;
  --ring-track: #edf1f8;

  --focus-ring: 0 0 0 3px rgba(47, 111, 235, 0.16);
}

/* -------------------------------- 基础 -------------------------------- */

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

html,
body {
  height: 100%;
}

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

#app {
  height: 100%;
}

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

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

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  line-height: 0;
}

.svg-icon svg {
  display: block;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

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

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

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

.copy-helper {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}

:focus-visible {
  outline: 2px solid rgba(47, 111, 235, 0.55);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d3dae5;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #b9c4d3;
  background-clip: content-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* -------------------------------- 按钮 -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.05s ease;
  user-select: none;
}

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

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

.btn .svg-icon {
  margin-top: -1px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(47, 111, 235, 0.55);
}

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

.btn-primary:active:not(:disabled) {
  background: var(--primary-active);
}

.btn-secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-2);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #b9c8dd;
  color: var(--text);
  background: #fbfcfe;
}

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

.btn-ghost:hover:not(:disabled) {
  background: #f1f4f9;
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(229, 72, 77, 0.5);
}

.btn-danger:hover:not(:disabled) {
  background: #cf3439;
  border-color: #cf3439;
}

.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #4a2c00;
  font-weight: 600;
  box-shadow: 0 4px 10px -4px rgba(245, 158, 11, 0.5);
}

.btn-warning:hover:not(:disabled) {
  background: #e08c00;
  border-color: #e08c00;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 7px;
  gap: 5px;
}

.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
  gap: 4px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  pointer-events: none;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  flex: none;
  opacity: 0.85;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4a86f7 0%, #2f6feb 55%, #1b53c4 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  flex: none;
  box-shadow: 0 6px 14px -6px rgba(47, 111, 235, 0.65);
  letter-spacing: 0.5px;
}

.brand-mark-lg {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 22px;
}

/* 图标按钮 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  flex: none;
}

.icon-btn:hover:not(:disabled) {
  background: #f1f4f9;
  color: var(--text);
}

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

.icon-btn-sm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.icon-btn-xs {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.icon-btn-danger:hover:not(:disabled) {
  background: var(--danger-weak);
  color: var(--danger);
}

.icon-btn.is-loading .svg-icon svg,
.btn.is-loading .svg-icon svg {
  animation: spin 0.9s linear infinite;
}

/* ------------------------------- 表单控件 ------------------------------ */

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

.input::placeholder,
.textarea::placeholder {
  color: #a9b4c4;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c1cddd;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: #f6f8fb;
  color: var(--text-3);
  cursor: not-allowed;
}

.textarea {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
}

.select {
  cursor: pointer;
  padding-right: 30px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8a97aa 50%),
    linear-gradient(135deg, #8a97aa 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select:disabled {
  cursor: not-allowed;
}

.checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  flex: none;
}

.input-narrow {
  width: 140px;
}

.input-date {
  width: 140px;
  height: 32px;
  font-size: 12.5px;
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 200px;
}

.input-with-suffix .input {
  padding-right: 36px;
}

.input-suffix {
  position: absolute;
  right: 12px;
  color: var(--text-3);
  font-size: 12.5px;
  pointer-events: none;
}

/* -------------------------------- 标签 -------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: #f1f4f9;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex: none;
}

.tag-sm {
  height: 20px;
  padding: 0 7px;
  font-size: 11.5px;
  border-radius: 5px;
}

.tag-pill {
  border-radius: var(--radius-pill);
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  opacity: 0.9;
}

.tag-text {
  white-space: nowrap;
}

.tag-blue {
  background: #eaf1fe;
  color: #1d5fd6;
}

.tag-indigo {
  background: var(--indigo-weak);
  color: #4f46e5;
}

.tag-green {
  background: var(--success-weak);
  color: var(--success-strong);
}

.tag-amber {
  background: var(--warning-weak);
  color: var(--warning-strong);
}

.tag-orange {
  background: #fff0e6;
  color: #c2410c;
}

.tag-red {
  background: var(--danger-weak);
  color: var(--danger-strong);
}

.tag-purple {
  background: var(--purple-weak);
  color: #7c3aed;
}

.tag-teal {
  background: var(--teal-weak);
  color: #0f766e;
}

.tag-gray {
  background: #f1f4f9;
  color: #5b6b82;
}

.tag-empty {
  background: #f4f6fa;
  color: #a3adbb;
}

/* ------------------------------- 状态点 ------------------------------- */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a3adbb;
  flex: none;
}

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

.status-dot-amber {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.status-dot-red {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.14);
}

.status-dot-gray {
  background: #b6c0ce;
}

.status-dot-blue {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.14);
}

/* -------------------------------- 头像 -------------------------------- */

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 15px;
  flex: none;
  background: var(--primary-weak);
  color: var(--primary);
  letter-spacing: 0.3px;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 12.5px;
}

.avatar-blue {
  background: #eaf1fe;
  color: #1d5fd6;
}

.avatar-indigo {
  background: var(--indigo-weak);
  color: #4f46e5;
}

.avatar-green {
  background: var(--success-weak);
  color: var(--success-strong);
}

.avatar-amber {
  background: var(--warning-weak);
  color: #b45309;
}

.avatar-purple {
  background: var(--purple-weak);
  color: #7c3aed;
}

/* ------------------------------- 加载动画 ------------------------------ */

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

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.inline-spinner {
  display: inline-block;
  border-radius: 50%;
  border: 2px solid var(--primary);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
  flex: none;
}

.skeleton-line {
  display: block;
  height: 12px;
  border-radius: 6px;
}

.skeleton-block {
  display: block;
  border-radius: 6px;
}

.skeleton-avatar {
  border-radius: 9px;
}

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

.skeleton-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

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

.skeleton-card-head .skeleton-line {
  flex: 1;
}

.skeleton-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 2px;
}

.skeleton-panel .skeleton-line {
  display: block;
}

.skeleton-table {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.skeleton-row {
  display: flex;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid #f2f5f9;
}

.skeleton-row .skeleton-block {
  flex: 1;
}

.skeleton-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.skeleton-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 8px;
}

.skeleton-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-bottom: 1px solid #f2f5f9;
}

.skeleton-list-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chart-skeleton {
  display: block;
  height: 260px;
  border-radius: 10px;
}

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

.toast-layer {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}

.toast.is-in {
  opacity: 1;
  transform: none;
}

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

.toast-icon {
  margin-top: 1px;
}

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

.toast-success .toast-icon {
  color: var(--success);
}

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

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

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

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info {
  border-left-color: var(--primary);
}

.toast-info .toast-icon {
  color: var(--primary);
}

.toast-text {
  flex: 1;
  line-height: 1.55;
  word-break: break-word;
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  border-radius: 4px;
}

.toast-close:hover {
  color: var(--text);
  background: #f1f4f9;
}

/* -------------------------------- 浮层 -------------------------------- */

.modal-overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  opacity: 0;
  transition: opacity 0.16s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal-overlay {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.is-in,
.drawer-overlay.is-in {
  opacity: 1;
}

.modal-overlay.is-closing,
.drawer-overlay.is-closing {
  opacity: 0;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.18s ease;
}

.modal-overlay.is-in .modal {
  transform: none;
}

.modal-sm {
  max-width: 440px;
}

.modal-md {
  max-width: 560px;
}

.modal-lg {
  max-width: 920px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 14px;
  flex: none;
}

.modal-head-text {
  min-width: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.modal-subtitle {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.modal-close {
  margin: -4px -6px 0 0;
}

.modal-body {
  padding: 0 22px 20px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.modal-lg .modal-body {
  padding: 0 22px 22px;
}

.modal-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.modal-lg .modal-foot {
  padding: 14px 22px;
}

/* 抽屉 */
.drawer-overlay {
  justify-content: flex-end;
}

.drawer {
  width: 620px;
  max-width: 94vw;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(28px);
  transition: transform 0.22s ease;
  box-shadow: -24px 0 70px -34px rgba(16, 24, 40, 0.45);
}

.drawer-overlay.is-in .drawer {
  transform: none;
}

.drawer-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.drawer-head-text {
  min-width: 0;
}

.drawer-title {
  font-size: 17px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  min-height: 0;
}

.drawer-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
}

.drawer-foot-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.drawer-foot-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* 确认框 / 小弹窗 */
.confirm-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.confirm-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-weak);
  color: var(--primary);
  flex: none;
}

.confirm-icon-danger {
  background: var(--danger-weak);
  color: var(--danger);
}

.confirm-message {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
  padding-top: 3px;
}

.locate-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.locate-desc {
  color: var(--text-2);
  font-size: 13px;
}

.locate-status {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f4f9;
  font-size: 13px;
}

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

.profile-label {
  color: var(--text-3);
}

.profile-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.profile-row-block {
  flex-direction: column;
  gap: 8px;
}

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

.profile-perm {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: #f1f4f9;
  color: var(--text-2);
  border-radius: 5px;
  padding: 2px 7px;
}

/* ------------------------------- 空状态 ------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 52px 20px;
  gap: 6px;
  color: var(--text-2);
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: #f1f5fb;
  color: #93a3ba;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

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

.empty-desc {
  max-width: 380px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.65;
}

.empty-action {
  margin-top: 10px;
}

.empty-compact {
  padding: 26px 16px;
}

.empty-compact .empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  margin-bottom: 4px;
}

.empty-compact .empty-title {
  font-size: 13px;
}

.inline-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
}

.inline-alert-error {
  background: var(--danger-weak);
  border: 1px solid #f5c9c9;
  color: var(--danger-strong);
}

.inline-alert-text {
  flex: 1;
}

.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
}

.alert-warning {
  background: #fff9ef;
  border-color: #fbdcae;
  color: #7c4a03;
}

.alert-warning .alert-icon {
  color: #d98200;
}

.alert-info {
  background: var(--primary-soft);
  border-color: #cfe0ff;
  color: #1e4e9c;
}

.alert-info .alert-icon {
  color: var(--primary);
}

.alert-danger {
  background: var(--danger-weak);
  border-color: #f5c9c9;
  color: var(--danger-strong);
}

.alert-danger .alert-icon {
  color: var(--danger);
}

.alert-success {
  background: var(--success-weak);
  border-color: #c9eed8;
  color: var(--success-strong);
}

.alert-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.alert-title {
  font-size: 13px;
  font-weight: 650;
}

.alert-message {
  font-size: 12.5px;
  opacity: 0.88;
  line-height: 1.55;
}

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

/* ------------------------------- 面包屑/工具 --------------------------- */

.toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  height: 34px;
  padding-left: 32px;
  width: 240px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.toolbar-summary {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #eef2f7;
  border-radius: 9px;
}

.segmented-sm {
  padding: 2px;
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

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

.segmented-btn.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}

.segmented-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: #e2e8f2;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 16px;
  text-align: center;
}

.segmented-btn.is-active .segmented-count {
  background: var(--primary-weak);
  color: var(--primary);
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pager-total {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.pager-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pager-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pager-btn:hover:not(:disabled) {
  border-color: #b9c8dd;
  color: var(--text);
}

.pager-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

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

.pager-gap {
  color: var(--text-3);
  font-size: 12px;
  padding: 0 2px;
}

.pager-size {
  width: auto;
  height: 30px;
  padding: 0 26px 0 8px;
  font-size: 12px;
}

/* -------------------------------- 面板 -------------------------------- */

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

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

.panel-head-text {
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  min-width: 0;
}

.panel-title > .svg-icon {
  color: var(--text-3);
}

.panel-count {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: #f1f4f9;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
}

.panel-desc {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

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

.panel-body {
  padding: 16px 18px;
  min-width: 0;
}

.panel-body-flush {
  padding: 0;
}

.panel-foot {
  flex: none;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

/* -------------------------------- 表格 -------------------------------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f4f9;
  color: var(--text-2);
  vertical-align: middle;
}

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

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

.data-table .cell-main,
.data-table .td-message {
  color: var(--text);
  font-weight: 550;
}

.cell-main {
  font-size: 12.8px;
  color: var(--text);
  font-weight: 550;
  line-height: 1.4;
}

.cell-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.4;
}

.cell-time {
  white-space: nowrap;
  color: var(--text-2);
  font-size: 12px;
}

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

.td-num,
.th-num {
  text-align: right;
  white-space: nowrap;
}

.td-success {
  color: var(--success-strong) !important;
  font-weight: 650;
}

.td-danger {
  color: var(--danger) !important;
  font-weight: 650;
}

.td-rank {
  width: 46px;
}

.td-time {
  white-space: nowrap;
  color: var(--text-3);
  font-size: 11.5px;
}

.th-actions {
  width: 120px;
}

.th-check {
  width: 40px;
}

.th-time {
  width: 138px;
}

.th-index {
  width: 48px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.table-actions .btn {
  color: var(--primary);
}

.table-actions .btn:hover:not(:disabled) {
  background: var(--primary-weak);
}

.table-note {
  padding: 8px 18px 12px;
  font-size: 11.5px;
}

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

.login-screen {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(1200px 600px at 78% -10%, #e8f0ff 0%, rgba(245, 247, 250, 0) 60%),
    radial-gradient(900px 500px at 10% 110%, #e9f7f2 0%, rgba(245, 247, 250, 0) 55%),
    linear-gradient(180deg, #f8fafc 0%, #f2f5fa 100%);
}

.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}

.login-orb-1 {
  width: 520px;
  height: 520px;
  background: rgba(47, 111, 235, 0.18);
  top: -160px;
  right: -80px;
}

.login-orb-2 {
  width: 420px;
  height: 420px;
  background: rgba(13, 148, 136, 0.12);
  bottom: -140px;
  left: -60px;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 404px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px 32px 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 20px;
  box-shadow: 0 30px 70px -30px rgba(16, 24, 40, 0.32), 0 4px 16px -8px rgba(16, 24, 40, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.login-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.login-subtitle {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.2px;
}

.login-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--warning-weak);
  border: 1px solid #fbe1b5;
  color: #8a5300;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.6;
}

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

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}

.login-input {
  height: 42px;
  border-radius: 9px;
  font-size: 14px;
  background: #fbfcfe;
}

.login-input:focus {
  background: #fff;
}

.login-pwd-wrap {
  position: relative;
  display: flex;
}

.login-pwd-wrap .login-input {
  padding-right: 42px;
}

.login-pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.login-pwd-toggle:hover {
  background: #f1f4f9;
  color: var(--text-2);
}

.login-submit {
  height: 44px;
  margin-top: 4px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--danger-weak);
  border: 1px solid #f5c9c9;
  color: var(--danger-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.55;
}

.login-demo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.login-demo-label {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.4px;
}

.demo-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fbfd;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.demo-chip:hover {
  border-color: #bcd2f7;
  background: var(--primary-soft);
}

.demo-account {
  font-weight: 600;
  color: var(--text);
  min-width: 44px;
}

.demo-password {
  color: var(--text-3);
  font-size: 11.5px;
}

.demo-role {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-3);
  background: #eef2f7;
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}

.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-3);
}

.login-foot-dot {
  opacity: 0.6;
}

.login-page-foot {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  font-size: 11.5px;
  color: #9aa7b8;
  letter-spacing: 0.3px;
}

/* ------------------------------ 启动屏 -------------------------------- */

.boot-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
}

.boot-logo {
  margin-bottom: 4px;
}

.boot-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.5px;
}

.boot-spinner {
  color: var(--primary);
  margin-top: 6px;
}

.boot-tip {
  font-size: 12px;
  color: var(--text-3);
}

/* ------------------------------ 主框架 -------------------------------- */

.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 30;
  transition: width 0.18s ease;
}

.sidebar-brand {
  position: relative;
  flex: none;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.sidebar-collapse {
  position: absolute;
  right: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 31;
  box-shadow: var(--shadow-sm);
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.18s ease;
}

.sidebar-collapse:hover {
  color: var(--primary);
  border-color: #bcd2f7;
}

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

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

.nav-group-label {
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-3);
  white-space: nowrap;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: #f3f6fb;
  color: var(--text);
}

.nav-item.is-active {
  background: var(--primary-weak);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-foot {
  flex: none;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.sidebar-foot-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  color: var(--success);
}

.sidebar-foot-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}

.sidebar-foot-text > span:first-child {
  font-size: 11.5px;
  color: var(--text-2);
}

.sidebar-version {
  font-size: 9.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.sidebar-backdrop {
  display: none;
}

/* 折叠态 */
.shell.is-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
}

.shell.is-collapsed .brand-text,
.shell.is-collapsed .nav-label,
.shell.is-collapsed .nav-group-label,
.shell.is-collapsed .sidebar-foot-text {
  display: none;
}

.shell.is-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.shell.is-collapsed .sidebar-nav {
  padding: 12px 8px;
}

.shell.is-collapsed .nav-group {
  gap: 4px;
}

.shell.is-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.shell.is-collapsed .sidebar-foot-inner {
  justify-content: center;
  padding: 6px 0;
}

.shell.is-collapsed .sidebar-collapse {
  transform: translateY(-50%) rotate(180deg);
}

/* 主区域 */
.main-wrap {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: none;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
}

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

.nav-toggle {
  display: none;
}

.page-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.page-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.page-sub {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: #f6f8fb;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11.5px;
  white-space: nowrap;
}

.admin-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-switch-btn:hover {
  color: var(--primary);
  border-color: #bcd2f7;
  background: var(--primary-soft);
}

.user-menu-wrap {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.15s ease;
}

.user-menu-btn:hover {
  background: #f3f6fb;
}

.user-menu-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
}

.user-role {
  font-size: 10px;
  color: var(--text-3);
}

.user-menu-chevron {
  color: var(--text-3);
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 236px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 150;
  animation: popIn 0.14s ease;
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
}

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

.user-dropdown-name {
  font-size: 13px;
  font-weight: 600;
}

.user-dropdown-role {
  font-size: 10.5px;
  color: var(--text-3);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}

.user-dropdown-item:hover {
  background: #f3f6fb;
  color: var(--text);
}

.user-dropdown-logout {
  color: var(--danger);
}

.user-dropdown-logout:hover {
  background: var(--danger-weak);
  color: var(--danger);
}

/* 页面滚动区 */
.page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 40px;
}

.page-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1680px;
  margin: 0 auto;
  width: 100%;
}

.page-enter {
  animation: pageIn 0.18s ease;
}

.fallback-page {
  padding-top: 8vh;
}

.fallback-page .empty-state {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 64px 20px;
}

/* ==========================================================================
   工作台
   ========================================================================== */

.banner-slot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pause-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.pause-banner.is-loading {
  min-height: 64px;
  display: block;
  border-left-color: var(--border);
}

.pause-banner.is-running {
  background: linear-gradient(90deg, #ffffff 0%, #f8fbff 100%);
}

.pause-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--success-weak);
  color: var(--success);
  flex: none;
}

.pause-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pause-banner-text strong {
  font-size: 13px;
  font-weight: 650;
}

.pause-banner-text span {
  font-size: 12px;
  color: var(--text-3);
}

.pause-banner-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--success-strong);
  background: var(--success-weak);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}

.pause-banner .btn {
  flex: none;
}

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

.sub-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  outline: none;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.sub-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d4e0f2;
}

.sub-card:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.sub-card.has-error {
  border-color: #f3d3d4;
  background: linear-gradient(180deg, #fffdfd 0%, #ffffff 40%);
}

.sub-card.is-disabled {
  opacity: 0.72;
}

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

.sub-card-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sub-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sub-name {
  font-size: 14.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-id {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.sub-error-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--danger-weak);
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 600;
  flex: none;
}

.sub-ok-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--success-weak);
  color: var(--success-strong);
  font-size: 11.5px;
  font-weight: 500;
  flex: none;
}

.sub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 8px;
  background: #f8fafc;
  border-radius: 10px;
}

.sub-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.sub-stat-icon {
  color: #9aa8bc;
  margin-bottom: 1px;
}

.sub-stat-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.sub-stat-label {
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.sub-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--text-2);
}

.sub-progress-head .num {
  color: var(--text);
  font-weight: 600;
}

.sub-progress-head em {
  font-style: normal;
  color: var(--text-3);
  font-weight: 400;
  font-size: 11px;
}

.progress-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: #eef2f7;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #6aa1f8, #2f6feb);
  transition: width 0.45s ease;
}

.progress-error .progress-fill {
  background: linear-gradient(90deg, #f7908f, #e5484d);
}

.sub-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
}

.foot-error {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--danger);
  font-weight: 500;
  min-width: 0;
}

.foot-error > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foot-ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success-strong);
}

.foot-wait {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
}

.foot-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--primary);
  white-space: nowrap;
}

/* 子账号详情抽屉 */
.sub-detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.detail-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.detail-summary-icon {
  color: #8fa2bb;
  margin-bottom: 1px;
}

.detail-summary-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.detail-summary-label {
  font-size: 10.5px;
  color: var(--text-3);
}

.detail-summary-item.is-danger {
  background: #fffafa;
  border-color: #f6d6d6;
}

.detail-summary-item.is-danger .detail-summary-icon,
.detail-summary-item.is-danger .detail-summary-value {
  color: var(--danger);
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.detail-section-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 650;
}

.detail-section-head h3 .svg-icon {
  color: var(--text-3);
}

.detail-count {
  font-size: 11px;
  color: var(--text-3);
  background: #f1f4f9;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.local-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.local-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f4f9;
  font-size: 12.5px;
}

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

.local-row:hover {
  background: #fbfcff;
}

.local-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9c5d6;
  flex: none;
}

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

.local-name {
  font-size: 12.8px;
  font-weight: 600;
  color: var(--text);
}

.local-meta {
  font-size: 10.5px;
  color: var(--text-3);
}

.local-device {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--text-3);
}

.mini-instance-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.mini-instance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #f1f4f9;
  font-size: 12px;
  min-height: 46px;
}

.mini-instance:last-child {
  border-bottom: 0;
}

/* 待确认（ManualRequired）：红色卡片 + 明确下一步，对齐 BB 的交互 */
.mini-instance.is-pending-confirm {
  display: block;
  padding: 12px;
  border-left: 3px solid var(--danger, #dc2626);
  background: #fff5f5;
}

.mini-instance.is-pending-confirm .mini-instance-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 8px;
}

.pending-confirm-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #7f1d1d;
}

.pending-confirm-body strong {
  font-weight: 600;
  color: #b91c1c;
}

.pending-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.mini-instance-main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}

.mini-instance-local {
  font-weight: 600;
  color: var(--text);
}

.mini-instance-time {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.mini-instance-region {
  color: var(--text-3);
  font-size: 11px;
}

.mini-instance-side {
  flex: none;
}

.mini-instance-error {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--danger);
  font-size: 10.5px;
}

/* ==========================================================================
   团队任务
   ========================================================================== */

.records-page {
  gap: 16px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.7fr);
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - var(--topbar-h) - 60px);
  min-height: 540px;
}

.task-panel {
  min-height: 0;
}

.task-filter {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.task-filter .select {
  width: 116px;
  height: 34px;
  flex: none;
  font-size: 12.5px;
}

.task-filter .search-wrap {
  flex: 1;
  min-width: 0;
}

.task-filter .search-input {
  width: 100%;
}

.task-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  min-height: 0;
}

.task-list .empty-state {
  padding-top: 64px;
}

.task-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.task-row:hover {
  background: #f8fafc;
}

.task-row:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.task-row.is-selected {
  background: var(--primary-soft);
  border-color: #cfe0ff;
}

.task-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 92px;
  min-width: 0;
}

.task-seq {
  font-size: 10.5px;
  color: var(--text-3);
  flex: none;
}

.task-row-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 11.5px;
  color: var(--text-3);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.task-row-actions {
  position: absolute;
  top: 8px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.task-row:hover .task-row-actions,
.task-row:focus-within .task-row-actions,
.task-row.is-selected .task-row-actions {
  opacity: 1;
}

.task-pager {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.task-pager-total {
  font-size: 11.5px;
}

/* 右侧执行实例 */
.instance-panel {
  min-height: 0;
}

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

.instance-head-text {
  min-width: 0;
}

.instance-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.instance-title {
  font-size: 16px;
  font-weight: 650;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instance-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.instance-head-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.instance-stats {
  flex: none;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}

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

.stats-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: #f6f8fb;
  color: var(--text-2);
  font-size: 11.5px;
}

.stats-chip-value {
  font-weight: 650;
  color: var(--text);
  font-size: 12px;
}

.stats-chip-blue {
  background: #eef4ff;
}

.stats-chip-blue .stats-chip-value {
  color: var(--primary);
}

.stats-chip-green {
  background: var(--success-weak);
}

.stats-chip-green .stats-chip-value {
  color: var(--success-strong);
}

.stats-chip-red {
  background: var(--danger-weak);
}

.stats-chip-red .stats-chip-value {
  color: var(--danger);
}

.stats-chip-amber {
  background: var(--warning-weak);
}

.stats-chip-amber .stats-chip-value {
  color: var(--warning-strong);
}

.stats-chip-indigo {
  background: var(--indigo-weak);
}

.stats-chip-indigo .stats-chip-value {
  color: #4f46e5;
}

.stats-chip-gray {
  background: #f3f5f9;
}

.instance-toolbar {
  flex: none;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}

.instance-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.instance-toolbar-hint {
  font-size: 11.5px;
}

.instance-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.instance-body > .empty-state {
  min-height: 320px;
}

.instance-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
}

.instance-footer .muted {
  font-size: 11.5px;
}

.instance-table {
  min-width: 820px;
}

.instance-table .th-progress {
  width: 142px;
}

.instance-table .th-actions {
  width: 128px;
}

.instance-table .cell-time {
  font-size: 11.5px;
  white-space: nowrap;
}

.instance-table td:first-child {
  min-width: 148px;
}

.instance-table td:first-child .cell-main {
  max-width: 158px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 操作列吸右，窄屏横向滚动时始终可见 */
.instance-table th.th-actions,
.instance-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #fff;
  box-shadow: -12px 0 16px -16px rgba(16, 24, 40, 0.28);
}

.instance-table thead th.th-actions {
  z-index: 4;
  background: #f8fafc;
}

.instance-table tbody tr:hover td:last-child {
  background: #fbfcff;
}

.instance-table tbody tr.row-failed td:last-child {
  background: #fffbfb;
}

.instance-table td:nth-child(2) {
  white-space: nowrap;
}

.instance-row.row-failed td {
  background: #fffbfb;
}

.instance-row.row-failed:hover td {
  background: #fff7f7;
}

.error-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 230px;
}

.error-code {
  display: block;
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--danger-weak);
  color: var(--danger-strong);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.error-text {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-3);
}

/* 步骤进度 */
.step-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.step-bar {
  display: flex;
  gap: 2px;
}

.step-seg {
  display: block;
  width: 5px;
  height: 13px;
  border-radius: 2px;
  background: #e8edf5;
  transition: background-color 0.15s ease;
}

.step-green {
  background: var(--success);
}

.step-red {
  background: var(--danger);
}

.step-blue {
  background: var(--primary);
}

.step-amber {
  background: var(--warning);
}

.step-gray {
  background: #b9c3d3;
}

.step-empty {
  background: #e8edf5;
}

.step-count {
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.step-count.has-error {
  color: var(--danger);
  font-weight: 600;
}

.step-detail {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
}

.step-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.step-detail-name {
  color: var(--text-2);
}

/* ==========================================================================
   数据报表
   ========================================================================== */

.report-filter {
  padding: 12px 16px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.date-range-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-size: 11.5px;
}

.date-range-sep {
  color: var(--text-3);
  font-size: 11.5px;
}

.main-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-filter .select {
  width: 172px;
  height: 32px;
  font-size: 12.5px;
}

.filter-label {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.toolbar-range {
  font-size: 11.5px;
  white-space: nowrap;
}

/* 统计卡 */
.stats-grid-slot {
  display: block;
}

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

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  min-height: 104px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.04;
}

.stat-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f4f7fb;
  color: var(--text-2);
  flex: none;
}

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

.stat-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: var(--text);
}

.stat-hint {
  font-size: 10px;
  color: #a6b1c0;
}

.stat-tone-blue {
  color: var(--primary);
}

.stat-tone-blue .stat-icon {
  background: #eaf1fe;
  color: #2563eb;
}

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

.stat-tone-green .stat-icon {
  background: var(--success-weak);
  color: var(--success);
}

.stat-tone-red {
  color: var(--danger);
}

.stat-tone-red .stat-icon {
  background: var(--danger-weak);
  color: var(--danger);
}

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

.stat-tone-amber .stat-icon {
  background: var(--warning-weak);
  color: #d98200;
}

.stat-tone-gray {
  color: #8a97aa;
}

.stat-tone-gray .stat-icon {
  background: #f2f5f9;
  color: #7b8a9f;
}

.stat-tone-indigo {
  color: var(--indigo);
}

.stat-tone-indigo .stat-icon {
  background: var(--indigo-weak);
  color: #4f46e5;
}

.stat-tone-teal {
  color: var(--teal);
}

.stat-tone-teal .stat-icon {
  background: var(--teal-weak);
  color: var(--teal);
}

.stat-card-ring {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  grid-column: span 1;
}

.stat-ring-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stat-ring-sub {
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.ring-progress {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}

.ring-progress svg {
  display: block;
}

.ring-text {
  position: absolute;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.ring-green .ring-text {
  color: var(--success-strong);
}

.ring-blue .ring-text {
  color: var(--primary);
}

.ring-amber .ring-text {
  color: var(--warning-strong);
}

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

/* 趋势图 */
.panel-trend {
  break-inside: avoid;
}

.trend-slot {
  padding: 10px 4px 2px;
  min-height: 260px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-3);
}

.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-line::before {
  content: "";
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.legend-axis::before {
  content: "";
  width: 16px;
  height: 1px;
  background: #cbd5e1;
}

.line-chart {
  position: relative;
  width: 100%;
}

.line-chart-inner {
  width: 100%;
}

.line-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-axis-text {
  font-size: 10.5px;
  fill: var(--text-3);
  font-family: var(--font-mono);
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 142px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 11.5px;
  pointer-events: none;
  transform: translateY(-100%);
}

.chart-tooltip-title {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 4px;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-3);
  line-height: 1.7;
}

.chart-tooltip-row strong {
  color: var(--text);
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.panel-ranking .panel-body,
.panel-errors .panel-body {
  padding-top: 6px;
}

.panel-errors .panel-body {
  padding: 16px 18px 14px;
}

.ranking-table {
  min-width: 660px;
}

.ranking-table th,
.ranking-table td {
  padding: 9px 9px;
}

.ranking-table td:nth-child(2) .cell-main {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-table td:nth-child(3) {
  white-space: nowrap;
}

.ranking-table .cell-sub {
  white-space: nowrap;
}

.ranking-table .td-time {
  font-size: 11px;
  white-space: nowrap;
}

.ranking-table .th-sort {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ranking-table .th-sort:disabled {
  cursor: default;
}

.ranking-table th.is-sorted .th-sort {
  color: var(--primary);
}

.ranking-table .sort-icon {
  color: #a9b4c4;
}

.ranking-table th.is-sorted .sort-icon {
  color: var(--primary);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f1f4f9;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
}

.rank-top {
  background: #fff3d6;
  color: #b45309;
}

.rate-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 106px;
}

.rate-bar {
  width: 46px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: #eef2f7;
  overflow: hidden;
  flex: none;
}

.rate-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--primary);
}

.rate-fill.is-good {
  background: var(--success);
}

.rate-fill.is-bad {
  background: var(--danger);
}

.ranking-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

/* 错误分布条形图 */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 4px 0 2px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.15fr) minmax(70px, 2fr) 44px;
  align-items: center;
  gap: 10px;
}

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

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

.bar-label-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: #f1f4f9;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #7aaaf8, #2f6feb);
  transition: width 0.5s ease;
}

.bar-red {
  background: linear-gradient(90deg, #f79a9a, #e5484d);
}

.bar-amber {
  background: linear-gradient(90deg, #fbd38d, #f59e0b);
}

.bar-green {
  background: linear-gradient(90deg, #86efac, #16a34a);
}

.bar-blue {
  background: linear-gradient(90deg, #7aaaf8, #2f6feb);
}

.bar-value {
  text-align: right;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
}

/* ==========================================================================
   设备管理
   ========================================================================== */

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.device-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.device-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.device-card.is-offline {
  background: linear-gradient(180deg, #fcfdff 0%, #ffffff 60%);
}

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

.device-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f2f5f9;
  color: #8a97aa;
  flex: none;
}

.device-avatar.is-online {
  background: var(--primary-weak);
  color: var(--primary);
}

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

.device-name {
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-id-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 3px;
}

.device-id {
  font-size: 10.5px;
  color: var(--text-3);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 14px;
  padding: 12px 13px;
  background: #f8fafc;
  border-radius: 10px;
}

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

.device-info-label {
  font-size: 10.5px;
  color: var(--text-3);
}

.device-info-value {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-info-value.is-muted {
  color: var(--text-3);
  font-weight: 400;
}

.battery {
  display: flex;
  align-items: center;
  gap: 6px;
}

.battery-shell {
  width: 40px;
  height: 12px;
  padding: 1.5px;
  border: 1.5px solid #c3cedd;
  border-radius: 4px;
  position: relative;
  flex: none;
}

.battery-shell::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: #c3cedd;
}

.battery-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.battery-green {
  background: var(--success);
}

.battery-amber {
  background: var(--warning);
}

.battery-red {
  background: var(--danger);
}

.battery-gray {
  background: #c3cedd;
}

.battery-text {
  font-size: 11px;
  color: var(--text-2);
}

.battery-charging {
  display: inline-flex;
  color: var(--warning);
}

.device-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 20px;
}

.device-tags:empty {
  display: none;
}

.device-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.device-heartbeat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
  min-width: 0;
}

.device-heartbeat-time {
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}

/* ==========================================================================
   地区规则
   ========================================================================== */

.region-toolbar {
  flex: none;
  padding: 14px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.region-unmatched {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unmatched-note {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: #fff9ef;
  border: 1px solid #fbdcae;
  color: #8a5300;
  font-size: 12px;
  line-height: 1.5;
}

.unmatched-ok {
  background: var(--success-weak);
  border-color: #c9eed8;
  color: var(--success-strong);
}

.region-table-slot {
  padding: 14px 18px;
}

.region-table {
  min-width: 720px;
}

.region-table .input {
  min-width: 160px;
  height: 34px;
  font-size: 12.5px;
}

.region-table .th-actions {
  width: 64px;
}

.region-table .td-index {
  color: var(--text-3);
  font-size: 11px;
}

.region-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.region-foot-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: #f1f4f9;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
}

/* ==========================================================================
   子账号邮箱
   ========================================================================== */

.email-add {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.email-add-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-add-input {
  flex: 1;
  min-width: 0;
}

.email-add-input .input {
  width: 100%;
  height: 36px;
}

.email-hint {
  font-size: 11.5px;
  color: var(--text-3);
}

.email-list {
  padding: 4px 0;
}

.email-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid #f2f5f9;
  font-size: 13px;
  transition: background-color 0.15s ease;
}

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

.email-row:hover {
  background: #fbfcff;
}

.email-index {
  font-size: 10.5px;
  color: var(--text-3);
  width: 20px;
  flex: none;
}

.email-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-weak);
  color: var(--primary);
  flex: none;
}

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

.email-address {
  font-size: 13.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-meta {
  font-size: 10.5px;
  color: var(--text-3);
}

.email-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.email-row:hover .email-actions,
.email-row:focus-within .email-actions {
  opacity: 1;
}

.email-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
}

/* ==========================================================================
   异常记录
   ========================================================================== */

.exception-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
}

.exception-seg {
  display: flex;
  align-items: center;
}

.exception-toolbar .segmented-btn {
  height: 26px;
  font-size: 11.5px;
  padding: 0 10px;
}

.exception-table {
  min-width: 940px;
}

.exception-table .td-message {
  max-width: 300px;
}

.exception-table .td-message > span {
  display: inline-block;
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  color: var(--text-2);
}

.exception-table .td-check {
  width: 40px;
}

.exception-table .td-time {
  white-space: nowrap;
}

.exception-row.is-cleared {
  opacity: 0.52;
}

.exception-row.is-cleared .td-message > span {
  text-decoration: line-through;
}

.exception-pager {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
}

/* ==========================================================================
   系统状态
   ========================================================================== */

.system-intro {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid #d7e5ff;
  color: #23508f;
  font-size: 12px;
  line-height: 1.5;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.system-card {
  overflow: visible;
}

.system-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.system-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-weak);
  color: var(--primary);
  flex: none;
}

.system-card-title {
  font-size: 13.5px;
  font-weight: 650;
}

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

.system-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-account-name {
  font-size: 15px;
  font-weight: 650;
}

.system-muted {
  font-size: 11.5px;
  color: var(--text-3);
}

.system-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.system-kv {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.system-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f2f5f9;
  font-size: 12.5px;
}

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

.system-kv-label {
  color: var(--text-3);
  flex: none;
}

.system-kv-value {
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.system-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.system-inline-label {
  color: var(--text-3);
  font-size: 12px;
}

.system-value {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 550;
}

.system-inline-tag {
  display: inline-flex;
}

.system-code {
  display: block;
  padding: 9px 11px;
  background: #f6f8fb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  word-break: break-all;
  line-height: 1.6;
}

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

.system-note {
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   发布任务弹窗表单
   ========================================================================== */

.task-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 2px;
}

.form-error-banner {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-weak);
  border: 1px solid #f5c9c9;
  color: var(--danger-strong);
  font-size: 12.5px;
  line-height: 1.55;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}

.form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.form-section-index {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
}

.form-section-title {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.4;
}

.form-section-desc {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.5;
}

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

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

.form-grid > .form-field:first-child {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}

.form-label-text {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}

.form-required {
  color: var(--danger);
  font-weight: 600;
}

.form-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
}

.field-error {
  font-size: 11.5px;
  color: var(--danger);
  line-height: 1.5;
}

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

.form-field.has-error .input,
.form-field.has-error .select,
.form-field.has-error .textarea {
  border-color: var(--danger);
  background: #fffafa;
}

.form-field.has-error .input:focus,
.form-field.has-error .select:focus,
.form-field.has-error .textarea:focus {
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.14);
}

/* 任务类型卡片 */
.type-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.type-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.type-card:hover {
  border-color: #c9d7ec;
}

.type-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.08);
}

.type-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: #f1f4f9;
  color: var(--text-2);
}

.type-card.is-selected .type-card-icon {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.type-tone-blue {
  color: var(--primary);
}

.type-tone-indigo {
  color: var(--indigo);
}

.type-tone-purple {
  color: var(--purple);
}

.type-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.type-card-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.type-card-desc {
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.45;
}

.type-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.type-card.is-selected .type-card-check {
  opacity: 1;
  transform: none;
}

/* 频率 */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.choice-pill:hover {
  border-color: #c1cddd;
}

.choice-pill.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 550;
}

.freq-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freq-pane-label {
  font-size: 11.5px;
  color: var(--text-3);
}

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

.weekday-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.weekday-chip:hover {
  border-color: #c1cddd;
}

.weekday-chip.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 550;
}

/* 目标地方号 */
.target-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.target-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.target-summary {
  font-size: 12px;
  color: var(--text-2);
}

.target-summary .num {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}

.target-summary-total {
  color: var(--text-3);
  font-size: 11.5px;
}

.target-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.target-groups {
  max-height: 258px;
  overflow-y: auto;
  padding: 4px 12px 8px;
}

.target-group {
  padding: 7px 0;
  border-bottom: 1px dashed #eef2f7;
}

.target-group:last-child {
  border-bottom: 0;
}

.target-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 2px 2px;
  user-select: none;
}

.target-group-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.target-group-name .svg-icon {
  color: var(--text-3);
}

.target-group-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
}

.target-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 0 0 24px;
}

.target-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  max-width: 100%;
}

.target-chip:hover {
  border-color: #c1cddd;
}

.target-chip.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.target-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-chip-sub {
  font-size: 9.5px;
  color: var(--text-3);
  white-space: nowrap;
}

/* 内容与素材 */
.content-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.textarea-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.textarea-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.textarea {
  border: 0;
  border-radius: 0;
  min-height: 96px;
  padding: 4px 0;
  background: transparent;
  box-shadow: none;
  resize: vertical;
  font-size: 13px;
}

.textarea:focus {
  box-shadow: none;
  border: 0;
}

.textarea-meta {
  display: flex;
  justify-content: flex-end;
}

.textarea-count {
  font-size: 10.5px;
  color: var(--text-3);
}

.emoji-panel {
  position: absolute;
  top: 42px;
  right: 10px;
  z-index: 20;
  width: 318px;
  max-height: 216px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.emoji-panel[hidden] {
  display: none;
}

.emoji-btn {
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text-2);
  font-size: 10.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emoji-btn:hover {
  background: var(--primary-soft);
  border-color: #cfe0ff;
  color: var(--primary);
}

.sub-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

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

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

.comment-index {
  width: 18px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-3);
  flex: none;
}

.comment-row .input {
  height: 34px;
  font-size: 12.5px;
}

.comment-empty {
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafcff;
  color: var(--text-3);
  font-size: 11.5px;
  text-align: center;
}

.comment-add {
  display: flex;
}

.media-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.media-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafcff;
  color: var(--text-3);
  font-size: 11.5px;
}

.media-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafcff;
  max-width: 100%;
}

.media-thumb {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  flex: none;
  background: #eef2f7;
}

.media-thumb-icon {
  display: grid;
  place-items: center;
  color: var(--text-3);
}

.media-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 190px;
}

.media-name {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-size {
  font-size: 10px;
  color: var(--text-3);
}

.task-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.form-foot-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.form-foot-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ==========================================================================
   补充分散样式
   ========================================================================== */

.seg-slot {
  display: flex;
  align-items: center;
}

.sub-grid-slot,
.device-grid-slot,
.email-list-slot {
  min-width: 0;
}

.drawer-content {
  min-width: 0;
}

.cell-error {
  max-width: 230px;
}

.stats-chip-label {
  color: var(--text-2);
}

.target-count,
.target-total {
  color: var(--primary);
  font-weight: 700;
}

.target-total {
  color: var(--text-3);
  font-weight: 500;
}

.th-rank {
  width: 46px;
}

.th-status {
  width: 88px;
}

.emoji-toggle {
  color: var(--text-2);
}

.login-brand-text {
  min-width: 0;
}

.exception-selection {
  font-size: 11.5px;
}

.stars {
  color: var(--warning);
  letter-spacing: 1px;
}

.type-link-fields {
  min-width: 0;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1360px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-card-ring {
    grid-column: span 1;
  }
}

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

  .split-layout {
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr);
  }

  .filter-actions {
    margin-left: 0;
  }
}

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

  .split-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .task-panel {
    max-height: 460px;
  }

  .instance-panel {
    min-height: 520px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 18px 0 50px -30px rgba(16, 24, 40, 0.4);
  }

  .shell.nav-open .sidebar {
    transform: none;
  }

  .shell.is-collapsed .sidebar {
    width: 220px;
  }

  .shell.is-collapsed .brand-text,
  .shell.is-collapsed .nav-label,
  .shell.is-collapsed .nav-group-label,
  .shell.is-collapsed .sidebar-foot-text {
    display: flex;
  }

  .shell.is-collapsed .nav-group-label,
  .shell.is-collapsed .nav-label {
    display: block;
  }

  .shell.is-collapsed .sidebar-brand {
    justify-content: flex-start;
    padding: 0 14px;
  }

  .shell.is-collapsed .nav-item {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .shell.is-collapsed .sidebar-foot-inner {
    justify-content: flex-start;
    padding: 6px;
  }

  .sidebar-collapse {
    display: none;
  }

  .shell.nav-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(15, 23, 42, 0.36);
    animation: pageIn 0.18s ease;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .topbar {
    padding: 0 14px;
  }

  .page {
    padding: 16px 14px 32px;
  }

  .page-sub {
    display: none;
  }

  .conn-pill .conn-text {
    display: none;
  }

  .sub-grid,
  .device-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .detail-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .type-cards,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid > .form-field:first-child {
    grid-column: auto;
  }

  .filter-row {
    gap: 10px;
  }

  .topbar-right {
    gap: 6px;
  }

  .user-menu-text {
    display: none;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 26px 20px 20px;
  }

  .login-title {
    font-size: 19px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .modal-head,
  .modal-lg .modal-body,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-foot {
    padding: 12px 16px;
  }

  .drawer {
    width: 100%;
    max-width: 100vw;
  }

  .drawer-body {
    padding: 16px;
  }

  .page {
    padding: 12px 10px 28px;
  }

  .topbar {
    padding: 0 10px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    padding: 12px;
    min-height: 96px;
  }

  .stat-value {
    font-size: 21px;
  }

  .stat-card-ring {
    grid-column: 1 / -1;
  }

  .toolbar-card {
    padding: 10px 12px;
  }

  .search-input {
    width: 100%;
  }

  .toolbar-right {
    width: 100%;
  }

  .toolbar-right .search-wrap {
    flex: 1;
    min-width: 0;
  }

  .task-filter {
    flex-wrap: wrap;
  }

  .task-filter .select,
  .task-filter .search-wrap {
    flex: 1 1 100%;
    width: 100%;
  }

  .instance-head {
    flex-direction: column;
  }

  .instance-head-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .filter-row {
    align-items: stretch;
  }

  .date-range {
    flex-wrap: wrap;
  }

  .filter-actions {
    width: 100%;
    justify-content: space-between;
  }

  .pause-banner {
    flex-wrap: wrap;
  }

  .pause-banner .btn {
    margin-left: auto;
  }

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

  .sub-card {
    padding: 14px;
  }

  .email-row {
    flex-wrap: wrap;
  }

  .email-actions {
    opacity: 1;
  }

  .task-row-actions,
  .email-actions {
    opacity: 1;
  }

  .comment-row .input {
    min-width: 0;
  }
}

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

/* ==========================================================================
   打开方式提示（file:// 直接打开时由 index.html 内联脚本渲染）
   ========================================================================== */

.file-guard {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(900px 500px at 80% 0%, #e8f0ff 0%, rgba(245, 247, 250, 0) 60%), var(--bg);
}

.file-guard-card {
  width: 560px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  padding: 32px;
}

.file-guard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--warning-weak);
  color: var(--warning-strong);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.file-guard-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0 0 10px;
}

.file-guard-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.8;
  margin: 0 0 18px;
}

.file-guard-code {
  display: block;
  padding: 12px 14px;
  background: #f6f8fb;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 14px;
  word-break: break-all;
}

.file-guard-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
}

.file-guard-hint code {
  background: #f1f4f9;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  color: var(--text-2);
}

/* 子账号卡片上的「待确认」徽标 */
.sub-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sub-card.has-pending {
  border-color: #fecaca;
  box-shadow: 0 0 0 1px #fecaca inset;
}

/* 地方号行内的「分身槽位」下拉 */
.local-clone-select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  padding: 3px 22px 3px 8px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.local-clone-select:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* 地方号列表头部的操作区（自动分配分身按钮 + 数量） */
.detail-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 地方号管理页 ---------- */
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.locals-page .input-sm {
  font-size: 12px;
  padding: 5px 8px;
  height: auto;
  min-height: 30px;
}

.locals-table .locals-device-select {
  min-width: 190px;
  max-width: 240px;
}

.locals-table .locals-slot-select {
  min-width: 92px;
}

.btn-danger-ghost {
  color: #b91c1c;
}

.btn-danger-ghost:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fecaca;
}

.locals-card {
  padding: 4px 0 0;
}

/* 地方号管理：批量选择 */
.th-check,
.td-check {
  width: 38px;
  text-align: center;
}

.locals-check,
.locals-check-all {
  width: 16px;
  height: 16px;
  accent-color: var(--primary, #2563eb);
  cursor: pointer;
}
