/* ============================================================
   MarvOS · 移动端风格设计系统
   大圆角 · 柔和阴影 · 蓝色主调 · 干净留白
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

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

:root {
  /* ── 画布 ── */
  --ui-bg: #f5f6fa;
  --ui-surface: #ffffff;
  --ui-surface-2: rgba(0,0,0,.035);
  --ui-surface-glass: rgba(255,255,255,.94);
  --ui-bg-soft: #f8fafc;

  /* ── 文字 ── */
  --ui-fg: #1e293b;
  --ui-fg-muted: #94a3b8;

  /* ── 品牌蓝 #2563eb ── */
  --ui-accent: #2563eb;
  --ui-accent-2: #1d4ed8;
  --ui-accent-soft: rgba(37,99,235,.08);
  --ui-primary: #3b82f6;
  --ui-primary-deep: #1d4ed8;

  /* ── 描边 ── */
  --ui-line: rgba(0,0,0,.08);
  --ui-line-soft: rgba(0,0,0,.05);

  /* ── 状态色 ── */
  --ui-success: #22c55e;
  --ui-warning: #f59e0b;
  --ui-danger: #ef4444;

  /* ── 圆角 ── */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ── 弹层投影 ── */
  --shadow-dialog: 0 20px 60px -12px rgba(0,0,0,.25),
                   0 0 0 1px rgba(0,0,0,.06);

  /* ── 排版 ── */
  --font-mono: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
  --font-sans: "Noto Sans SC", "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --ui-bg: #111111;
  --ui-surface: #1a1a1a;
  --ui-surface-2: rgba(255,255,255,.04);
  --ui-surface-glass: rgba(17,17,17,.92);
  --ui-bg-soft: #1a1a1a;

  --ui-fg: #e4e4e7;
  --ui-fg-muted: #71717a;

  --ui-accent: #60a5fa;
  --ui-accent-2: #3b82f6;
  --ui-accent-soft: rgba(96,165,250,.10);
  --ui-primary: #60a5fa;
  --ui-primary-deep: #3b82f6;

  --ui-line: rgba(255,255,255,.10);
  --ui-line-soft: rgba(255,255,255,.06);

  --shadow-dialog: 0 20px 60px -12px rgba(0,0,0,.5),
                   0 0 0 1px rgba(255,255,255,.08);
}

/* ── 基础画布 ── */
body {
  font-family: var(--font-sans);
  background-color: var(--ui-bg);
  color: var(--ui-fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-size: 14px;
}

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

/* ============================================================
   排版
   ============================================================ */
h1, .h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ui-fg); }
h2, .h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--ui-fg); }
.card-title {
  font-size: 15px; font-weight: 600; color: var(--ui-fg);
  padding-left: 12px; border-left: 3px solid var(--ui-accent); margin-bottom: 16px; line-height: 1.4;
}
.meta { font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--ui-fg-muted); }

/* ============================================================
   布局
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.main-content { flex: 1; padding: 24px 28px; overflow-y: auto; max-height: 100vh; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.page-header h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--ui-fg); }
.page-header .header-actions { display: flex; gap: 8px; align-items: center; }
.mobile-user-bar { display: none; }

/* ============================================================
   侧边栏
   ============================================================ */
.sidebar {
  width: 220px;
  background: var(--ui-surface);
  border-right: 1px solid var(--ui-line-soft);
  padding: 14px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .logo-area {
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--ui-line-soft);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  border-radius: 10px;
}
.logo-icon {
  width: 20px;
  height: 20px;
  display: block;
}
.sidebar .logo-text h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ui-fg);
}
.sidebar .logo-text .sub {
  font-size: 10.5px;
  color: var(--ui-fg-muted);
  margin-top: 1px;
}
.mobile-menu-btn {
  display: none;
}
.sidebar .nav-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  margin: 1px 10px;
  cursor: pointer;
  color: var(--ui-fg-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 180ms ease;
  border-radius: 10px;
  position: relative;
}
.sidebar .nav-item:hover {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}
.sidebar .nav-item.active {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  font-weight: 600;
}
.sidebar .nav-item .icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar .nav-item .icon i {
  line-height: 1;
}
.sidebar .nav-divider {
  height: 1px;
  background: var(--ui-line);
  margin: 14px 10px;
  position: relative;
}
.sidebar .nav-divider span {
  position: absolute;
  left: 16px;
  top: -9px;
  background: var(--ui-surface);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-fg-muted);
  letter-spacing: 0.04em;
}

/* ── 导航分组（可折叠） ── */
.sidebar .nav-group {
  margin: 2px 0;
}
.sidebar .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  margin: 1px 10px;
  cursor: pointer;
  color: var(--ui-fg-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 180ms ease;
  border-radius: var(--radius-sm);
  user-select: none;
}
.sidebar .nav-group-toggle:hover {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}
.sidebar .nav-group-toggle .icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar .nav-group-toggle .icon i {
  line-height: 1;
}
.sidebar .nav-group-chevron {
  margin-left: auto;
  font-size: 12px;
  transition: transform 220ms ease;
  opacity: 0.5;
}
.sidebar .nav-group.open .nav-group-chevron {
  transform: rotate(180deg);
}
.sidebar .nav-group-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 280ms ease;
}
.sidebar .nav-group.open .nav-group-children {
  max-height: 300px;
}
.sidebar .nav-sub {
  padding: 8px 18px 8px 48px;
  margin: 1px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ui-fg-muted);
  border-radius: var(--radius-sm);
  transition: all 180ms ease;
  position: relative;
}
.sidebar .nav-sub::before {
  content: '';
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ui-fg-muted);
  opacity: 0;
  transition: opacity 180ms ease;
}
.sidebar .nav-sub:hover {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}
.sidebar .nav-sub:hover::before {
  opacity: 0.4;
}
.sidebar .nav-sub.active {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  font-weight: 600;
}
.sidebar .nav-sub.active::before {
  opacity: 0.6;
  background: var(--ui-accent);
}
/* ── 侧边栏底部用户信息 ── */
.sidebar .user-info {
  padding: 10px 12px;
  border-top: 1px solid var(--ui-line-soft);
  margin: auto 0 6px;
  background: var(--ui-surface-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.sidebar .ui-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar .ui-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.sidebar .ui-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .ui-role {
  font-size: 10.5px;
  color: var(--ui-fg-muted);
  font-weight: 400;
}
.sidebar .ui-theme-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--ui-fg-muted);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms ease;
  flex-shrink: 0;
}
.sidebar .ui-theme-btn:hover {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}
.sidebar .ui-more-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--ui-fg-muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms ease;
  flex-shrink: 0;
}
.sidebar .ui-more-btn:hover {
  background: var(--ui-surface);
  color: var(--ui-fg);
}
.sidebar .ui-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 101;
  animation: uiSlideUp 200ms ease;
}
.sidebar .ui-dropdown.open {
  display: block;
}
@keyframes uiSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sidebar .ui-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--ui-fg);
  font-size: 12.5px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 160ms ease;
  text-align: left;
  font-weight: 500;
}
.sidebar .ui-drop-item i {
  font-size: 14px;
  width: 16px;
  text-align: center;
  color: var(--ui-fg-muted);
}
.sidebar .ui-drop-item:hover {
  background: var(--ui-surface-2);
}
.sidebar .ui-drop-logout {
  color: var(--ui-danger);
}
.sidebar .ui-drop-logout:hover {
  background: rgba(239,68,68,.08);
}
.sidebar .ui-drop-logout i {
  color: var(--ui-danger);
}

/* ── 移动端组件（桌面端隐藏） ── */
.mobile-nav,
.mobile-more-panel,
.mobile-overlay {
  display: none;
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--ui-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ui-line-soft);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
}
.card-interactive {
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 180ms ease;
  cursor: pointer;
}
.card-interactive:hover {
  border-color: rgba(59,130,246,.25);
  box-shadow: 0 4px 20px rgba(59,130,246,.10);
  transform: translateY(-1px);
}

.announcement-card {
  background: var(--ui-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ui-line-soft);
  border-left: 3px solid var(--ui-accent);
  padding: 18px 24px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

/* ── 公告卡片内联样式 ── */
.announcement-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.announcement-icon {
  font-size: 15px;
  flex-shrink: 0;
}
.announcement-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--ui-fg);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.announcement-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ui-fg-muted);
}
.announcement-time {
  margin-top: 10px;
  text-align: right;
  font-size: 12px;
  color: var(--ui-fg-muted);
}
@media (max-width: 768px) {
  .announcement-header {
    flex-wrap: wrap;
    gap: 4px;
  }
  .announcement-title {
    white-space: normal;
  }
  .announcement-body {
    font-size: 12px;
  }
  .announcement-time {
    margin-top: 8px;
    font-size: 11px;
  }
  /* 仪表盘公告调小 */
  #announcementCard .announcement-item > div:nth-child(1) {
    font-size: 13px !important;
  }
  #announcementCard .announcement-item > div:nth-child(2) {
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
}

/* ============================================================
   统计卡片行
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--ui-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ui-line-soft);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  transition: transform 200ms ease, border-color 200ms ease;
  animation: cardScaleIn 420ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59,130,246,.20);
}
.stat-card .value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-card .label {
  font-size: 13px;
  color: var(--ui-fg-muted);
  margin-top: 4px;
  font-weight: 500;
}
.stat-card .value.accent { color: var(--ui-accent); }
.stat-card .value.success { color: var(--ui-success); }
.stat-card .value.warning { color: var(--ui-warning); }
.stat-card .value.danger { color: var(--ui-danger); }

.stat-card-sm { padding: 16px 18px; }
.stat-card-sm .value { font-size: 24px; }

/* ── 仪表盘分节 ── */
.dash-section { margin-bottom: 20px; }
.dash-layout {
  display: flex;
  flex-direction: column;
}
.dash-row {
  display: grid;
  gap: 14px;
}
.dash-row-2col { grid-template-columns: 1fr 1fr; }
.dash-row-4col { grid-template-columns: repeat(4, 1fr); }

/* ── 系统健康 ── */
.health-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}
.health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ui-bg);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
}
.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-online {
  background: var(--ui-success);
  box-shadow: 0 0 6px var(--ui-success);
  animation: healthPulse 2s ease-in-out infinite;
}
.health-offline {
  background: var(--ui-danger);
  opacity: 0.5;
}
.health-name { color: var(--ui-fg); font-weight: 500; }
.health-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.health-online ~ .health-status {
  color: var(--ui-success);
  background: rgba(34, 197, 94, 0.1);
}
.health-offline ~ .health-status {
  color: var(--ui-danger);
  background: rgba(239, 68, 68, 0.1);
}

@keyframes healthPulse {
  0%, 100% { box-shadow: 0 0 4px var(--ui-success); }
  50%      { box-shadow: 0 0 12px var(--ui-success); }
}

/* ── 7日趋势图 ── */
.trend-chart { padding-top: 8px; }
.trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  gap: 6px;
  padding: 0 4px;
}
.trend-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 4px;
}
.trend-bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-fg-muted);
  min-height: 16px;
}
.trend-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 0 0;
  background: var(--ui-accent-soft);
  position: relative;
  overflow: hidden;
  min-height: 4px;
  transition: height 500ms ease;
}
.trend-bar-fill {
  position: absolute;
  inset: 0;
  background: var(--ui-accent);
  opacity: 0.7;
  border-radius: 6px 6px 0 0;
}
.trend-bar-label {
  font-size: 11px;
  color: var(--ui-fg-muted);
  margin-top: 4px;
}

/* ── 最近任务 ── */
.recent-task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}
.recent-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease;
  font-size: 13px;
}
.recent-task-item:hover { background: var(--ui-bg); }
.recent-task-id {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ui-fg-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-task-time {
  font-size: 11px;
  color: var(--ui-fg-muted);
  margin-left: auto;
  flex-shrink: 0;
}

/* ── 小空状态 ── */
.empty-sm {
  text-align: center;
  color: var(--ui-fg-muted);
  padding: 20px;
  font-size: 13px;
}

/* ============================================================
   表单控件 · Select
   ============================================================ */
.form-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 180ms ease;
}
.form-select:focus {
  border-color: var(--ui-accent);
}

/* ============================================================
   账单分类行
   ============================================================ */
.bill-category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ui-line-soft);
}
.bill-category-row:last-child {
  border-bottom: none;
}
.bill-cat-reason {
  flex: 1;
  font-size: 13px;
  color: var(--ui-fg);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bill-cat-amount {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.bill-cat-count {
  font-size: 12px;
  color: var(--ui-fg-muted);
  white-space: nowrap;
}

.bill-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ── 账号多选列表 ── */
.account-search-bar {
  position: relative;
  margin-bottom: 8px;
}
.account-multi-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  background: var(--ui-bg);
}
.account-multi-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--ui-line-soft);
  transition: background 120ms ease;
}
.account-multi-item:last-child {
  border-bottom: none;
}
.account-multi-item:hover {
  background: var(--ui-surface);
}
.account-multi-item .account-checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--ui-accent);
  cursor: pointer;
}
.account-multi-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-multi-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-fg);
}
.account-multi-meta {
  font-size: 11px;
  color: var(--ui-fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-sm { padding: 5px 14px; font-size: 12px; border-radius: var(--radius-pill); }

/* ============================================================
   按钮 · Button（仅 4 类）
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ui-fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms ease;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.5;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* Primary */
.btn-primary {
  background: var(--ui-accent);
  color: #fff;
  border-color: var(--ui-accent);
}
.btn-primary:hover {
  background: var(--ui-accent-2);
  border-color: var(--ui-accent-2);
}

/* Border */
.btn-border {
  background: var(--ui-surface);
  border-color: var(--ui-line);
  color: var(--ui-fg);
}
.btn-border:hover {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ui-fg-muted);
}
.btn-ghost:hover {
  background: var(--ui-surface-2);
  color: var(--ui-fg);
}

/* Danger */
.btn-danger {
  background: var(--ui-surface);
  border-color: rgba(239,68,68,.35);
  color: var(--ui-danger);
}
.btn-danger:hover {
  background: rgba(239,68,68,.10);
  border-color: var(--ui-danger);
}

/* ── 分段切换按钮组 ── */
.seg-group {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.seg-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms ease;
  text-align: center;
}
.seg-btn:hover {
  border-color: var(--ui-accent);
  color: var(--ui-fg);
}
.seg-btn .seg-icon {
  font-size: 18px;
}
.seg-btn.active {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  box-shadow: 0 0 0 1px var(--ui-accent) inset;
}

/* ============================================================
   标签 · Badge（软底 Pill Chip）
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.5;
  white-space: nowrap;
}
.badge::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 状态色变体 */
.badge-success {
  background: rgba(34,197,94,.10);
  border: 1px solid rgba(34,197,94,.35);
  color: var(--ui-success);
}
.badge-success::before { background: var(--ui-success); }

.badge-warning {
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.35);
  color: var(--ui-warning);
}
.badge-warning::before { background: var(--ui-warning); }

.badge-danger {
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.35);
  color: var(--ui-danger);
}
.badge-danger::before { background: var(--ui-danger); }

.badge-info {
  background: var(--ui-accent-soft);
  border: 1px solid var(--ui-accent-soft);
  color: var(--ui-accent);
}
.badge-info::before { background: var(--ui-accent); }

.badge-neutral {
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line-soft);
  color: var(--ui-fg-muted);
}
.badge-neutral::before { background: var(--ui-fg-muted); }

.badge-login {
  background: rgba(255,140,0,.12);
  border: 1px solid rgba(255,140,0,.35);
  color: #ff9900;
}
.badge-login::before { background: #ff9900; }

/* ============================================================
   云端编号状态指示器
   ============================================================ */
.executor-status {
  margin-bottom: 16px;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.status-ready {
  background: rgba(34,197,94,.10);
  border: 1px solid rgba(34,197,94,.35);
  color: var(--ui-success);
}
.status-ready .status-dot {
  background: var(--ui-success);
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
}
.status-queued {
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.35);
  color: var(--ui-warning);
}
.status-queued .status-dot {
  background: var(--ui-warning);
  box-shadow: 0 0 0 3px rgba(245,158,11,.25);
}
.queue-badges {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.queue-badge {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.35);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.queue-badge-green {
  background: rgba(34,197,94,.15);
  border-color: rgba(34,197,94,.35);
  color: var(--ui-success);
}
.queue-badge-info {
  background: rgba(0,128,255,.12);
  border-color: rgba(0,128,255,.30);
  color: var(--ui-accent);
}
.status-dot.pulse {
  animation: dotPulse 1.5s ease-in-out infinite alternate;
}
@keyframes dotPulse {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ============================================================
   表单控件
   ============================================================ */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  line-height: 1.5;
}
/* 强制 date input 的文本部分也使用相同字体 */
input[type="date"]::-webkit-datetime-edit { font-family: var(--font-sans); }
input::placeholder,
textarea::placeholder { color: var(--ui-fg-muted); opacity: 0.6; }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

select {
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
}
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--ui-surface-2);
}

label, .label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ui-fg);
  margin-bottom: 6px;
  margin-top: 14px;
}
label:first-child, .label:first-child { margin-top: 0; }

/* ============================================================
   自定义搜索下拉 (Custom Select)
   ============================================================ */
.custom-select {
  position: relative;
  width: 100%;
  font-size: 14px;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg);
  cursor: pointer;
  user-select: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.custom-select-trigger:hover {
  border-color: var(--ui-accent);
}
.custom-select-placeholder {
  color: var(--ui-fg-muted);
  opacity: 0.6;
}
.readonly-pkg {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg-muted);
  font-weight: 500;
  font-size: 14px;
  opacity: 0.7;
  cursor: not-allowed;
}
.custom-select-value {
  color: var(--ui-fg);
  font-weight: 500;
}
.custom-select-arrow {
  font-size: 13px;
  color: var(--ui-fg-muted);
  transition: transform 200ms ease;
}
.custom-select-arrow.open {
  transform: rotate(180deg);
}
.custom-select-dropdown {
  display: none;
  position: fixed;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 9999;
  overflow: hidden;
}
.custom-select-dropdown.open {
  display: block;
}
.custom-select-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-line-soft);
  background: var(--ui-surface-2);
}
.custom-select-search i {
  font-size: 14px;
  color: var(--ui-fg-muted);
  flex-shrink: 0;
}
.custom-select-search input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ui-fg);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  padding: 0;
}
.custom-select-search input::placeholder {
  color: var(--ui-fg-muted);
  opacity: 0.5;
}
.custom-select-options {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}
.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease;
}
.custom-select-option:hover {
  background: var(--ui-accent-soft);
}
.custom-select-option.selected {
  background: var(--ui-accent-soft);
}
.cso-name {
  font-weight: 500;
  color: var(--ui-fg);
}
.cso-meta {
  font-size: 12px;
  color: var(--ui-fg-muted);
  margin-left: 12px;
  flex-shrink: 0;
}
.custom-select-empty {
  padding: 20px;
  text-align: center;
  color: var(--ui-fg-muted);
  font-size: 13px;
}

/* 多选下拉框 */
.multi-select {
  position: relative;
  width: 100%;
  font-size: 14px;
}
.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg);
  cursor: pointer;
  user-select: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.multi-select-trigger:hover {
  border-color: var(--ui-accent);
}
.multi-select-placeholder {
  color: var(--ui-fg-muted);
  opacity: 0.6;
}
.multi-select-value {
  color: var(--ui-accent);
  font-weight: 500;
}
.multi-select-arrow {
  font-size: 13px;
  color: var(--ui-fg-muted);
  transition: transform 200ms ease;
}
.multi-select-arrow.open {
  transform: rotate(180deg);
}
.multi-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 100;
  overflow: hidden;
}
.multi-select-dropdown.open {
  display: block;
}
.multi-select-dropdown--portal {
  position: fixed;
  z-index: 10000;
}
.multi-select-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.multi-select-option {
  padding: 0;
  cursor: pointer;
  transition: background 120ms ease;
}
.multi-select-option:hover {
  background: var(--ui-accent-soft);
}
.multi-select-option.selected {
  background: var(--ui-accent-soft);
}
.multi-select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  width: 100%;
  margin: 0;
  font-weight: 400;
}
.multi-select-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--ui-accent);
  cursor: pointer;
  flex-shrink: 0;
}
.mso-name {
  font-weight: 500;
  color: var(--ui-fg);
  flex-shrink: 0;
}
.mso-meta {
  font-size: 12px;
  color: var(--ui-fg-muted);
  margin-left: auto;
  flex-shrink: 0;
}

/* 多选账号组件（定时预设） */
.sched-account-multi {
  border: 1px solid var(--ui-line);
  border-radius: var(--radius-sm);
  background: var(--ui-surface);
  overflow: hidden;
}
.sched-account-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  min-height: 32px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.sched-account-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.sched-account-tag i {
  font-size: 13px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 120ms;
}
.sched-account-tag i:hover {
  opacity: 1;
}
.sched-account-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ui-line-soft);
  color: var(--ui-fg-muted);
}
.sched-account-search-wrap i {
  font-size: 14px;
  flex-shrink: 0;
}
.sched-account-checklist {
  max-height: 200px;
  overflow-y: auto;
}
.sched-account-option {
  display: flex !important;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 120ms ease;
  margin: 0 !important;
  font-weight: 400;
  gap: 6px;
}
.sched-account-option:hover {
  background: var(--ui-accent-soft);
}
.sched-account-option.checked {
  background: var(--ui-accent-soft);
}
.sched-account-option .cso-name {
  flex-shrink: 0;
}
.sched-account-option .cso-meta {
  margin-left: auto;
}

/* 时间选择器 */
.time-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time-select {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 180ms ease;
}
.time-select:hover {
  border-color: var(--ui-accent);
}
.time-select:focus {
  outline: none;
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 2px var(--ui-accent-soft);
}
.time-colon {
  font-size: 18px;
  font-weight: 600;
  color: var(--ui-fg-muted);
  user-select: none;
}

/* ============================================================
   表格 · Table
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th {
  text-align: left;
  padding: 10px 14px;
  color: var(--ui-fg-muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  background: var(--ui-surface-2);
  border-bottom: 1px solid var(--ui-line);
  white-space: nowrap;
}
th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ui-line-soft);
  color: var(--ui-fg);
}
tr:hover td { background: var(--ui-accent-soft); }
tr:last-child td { border-bottom: none; }

/* ============================================================
   分页
   ============================================================ */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
}
.pagination button {
  padding: 6px 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg);
  font-size: 13px;
  cursor: pointer;
  transition: all 180ms ease;
  font-weight: 500;
  font-family: inherit;
}
.pagination button:hover {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}
.pagination button.active {
  background: var(--ui-accent);
  color: #fff;
  border-color: var(--ui-accent);
}
.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   模态框 · Dialog
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
}
.modal-overlay.show {
  visibility: visible;
  opacity: 1;
  transition: opacity 280ms ease, visibility 280ms ease;
}
.modal-overlay.closing {
  opacity: 0;
  transition: opacity 200ms ease;
}

.modal {
  background: var(--ui-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--ui-line-soft);
  padding: 28px 30px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-dialog);
}
.modal-overlay.show .modal {
  animation: modalBounceIn 450ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.modal-overlay.closing .modal {
  animation: modalFadeOut 200ms ease forwards;
}
@keyframes modalBounceIn {
  from { opacity: 0; transform: scale(0.85) translateY(30px); }
  55%  { transform: scale(1.04) translateY(-6px); }
  78%  { transform: scale(0.98) translateY(3px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes modalFadeOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.95) translateY(10px); }
}
.modal h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  color: var(--ui-fg);
}
.modal .btn-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ── 确认弹窗 ── */
.confirm-dialog h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ui-fg);
}
.confirm-message {
  font-size: 14px;
  color: var(--ui-fg-muted);
  line-height: 1.6;
  margin: 0;
}
.confirm-dialog .btn-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.confirm-dialog .confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* ── 用户详情弹窗：内容较多，独立放宽并自适应 ── */
.modal:has(.user-detail-dialog) {
  max-width: 640px;
}
.user-detail-dialog {
  width: 100%;
  min-width: 0;
  max-width: 640px;
}
.user-detail-dialog table {
  table-layout: fixed;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.user-detail-info {
  width: 100%;
}
.user-detail-info td:first-child {
  width: 100px;
  min-width: 100px;
  color: var(--ui-fg-muted) !important;
}

.modal .error-msg {
  display: none;
  color: var(--ui-danger);
  font-size: 12.5px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.35);
  border-radius: var(--radius-xs);
}

.error-msg {
  display: none;
  color: var(--ui-danger);
  font-size: 12.5px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.35);
  border-radius: var(--radius-xs);
}

.modal label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-fg);
  margin-bottom: 6px;
  margin-top: 16px;
}
.modal label:first-of-type { margin-top: 0; }
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal input[type="number"],
.modal textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--ui-bg);
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  color: var(--ui-fg);
  outline: none;
  transition: border-color 180ms, box-shadow 180ms;
  box-sizing: border-box;
}
.modal input:focus,
.modal textarea:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.modal textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
.modal-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.modal-form-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.modal-form-header h3 {
  margin-bottom: 0;
}
.modal-form-header .modal-form-subtitle {
  font-size: 12px;
  color: var(--ui-fg-muted);
  font-weight: 400;
  margin-top: 2px;
}
.form-field {
  margin-top: 16px;
}
.form-field:first-child {
  margin-top: 0;
}
.form-field label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-field label i {
  font-size: 14px;
  color: var(--ui-fg-muted);
  width: 16px;
  text-align: center;
}
.form-readonly {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ui-fg-muted);
  line-height: 1.5;
}
.form-readonly-value {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}
.form-readonly-badge {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ui-fg-muted);
  background: var(--ui-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.modal .notify-hint {
  padding: 10px 14px;
  background: rgba(59,130,246,.06);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  color: var(--ui-fg-muted);
  line-height: 1.5;
  margin-bottom: 2px;
}
.modal .notify-progress {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(59,130,246,.06);
  border: 1px solid rgba(59,130,246,.20);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ui-accent);
}
.modal .notify-progress .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(59,130,246,.20);
  border-top-color: var(--ui-accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Toast
   ============================================================ */
#toastContainer {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ui-fg);
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  backdrop-filter: blur(12px);
  max-width: 380px;
  overflow: hidden;
  pointer-events: auto;
  flex-shrink: 0;
  max-height: 0;
  padding: 0 16px;
  margin-bottom: 0;
  opacity: 0;
  transform: translateX(calc(100% + 32px));
  transition: transform 350ms cubic-bezier(.22,.61,.36,1),
              opacity 300ms ease,
              max-height 350ms cubic-bezier(.22,.61,.36,1),
              padding 350ms cubic-bezier(.22,.61,.36,1),
              margin-bottom 350ms cubic-bezier(.22,.61,.36,1);
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
  max-height: 80px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.toast.success .toast-icon { color: var(--ui-success); }
.toast.error   .toast-icon { color: var(--ui-danger); }
.toast.warning .toast-icon { color: var(--ui-warning); }
.toast.info    .toast-icon { color: var(--ui-accent); }

.toast-msg {
  flex: 1;
  line-height: 1.4;
  min-width: 0;
  word-break: break-word;
}

.toast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  animation: toastBar 3s linear forwards;
}
.toast.success .toast-bar { background: var(--ui-success); }
.toast.error   .toast-bar { background: var(--ui-danger); }
.toast.warning .toast-bar { background: var(--ui-warning); }
.toast.info    .toast-bar { background: var(--ui-accent); }

@keyframes toastBar {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ============================================================
   日志终端
   ============================================================ */
.log-box {
  background: var(--ui-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-fg-muted) transparent;
}
.log-box::-webkit-scrollbar { width: 6px; }
.log-box::-webkit-scrollbar-thumb { background: var(--ui-fg-muted); border-radius: 3px; }
.log-box .line { color: var(--ui-fg-muted); }
.log-box .line.separator {
  color: var(--ui-fg-muted);
  opacity: 0.3;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 5px 0 3px;
}
.log-box .line.info { color: var(--ui-accent); }
.log-box .line.success { color: var(--ui-success); }
.log-box .line.error { color: var(--ui-danger); }
.log-box .line.warn { color: var(--ui-warning); }

/* ============================================================
   复选框组
   ============================================================ */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.checkbox-group label {
  display: flex !important;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  transition: all 180ms ease;
  margin: 0 !important;
}
.checkbox-group label:hover {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
}
.checkbox-group input[type="checkbox"] {
  accent-color: var(--ui-accent);
  width: 15px; height: 15px;
  cursor: pointer;
}
.checkbox-group label.checked {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

/* ============================================================
   点数消耗面板
   ============================================================ */
.cost-panel {
  background: var(--ui-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line-soft);
  padding: 12px 16px;
  margin-top: 6px;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.cost-row + .cost-row {
  border-top: 1px solid var(--ui-line-soft);
  margin-top: 4px;
  padding-top: 8px;
}
.cost-label {
  font-size: 13px;
  color: var(--ui-fg-muted);
}
.cost-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ui-accent);
}
.cost-total {
  font-weight: 700;
}
.cost-total .cost-value {
  font-size: 18px;
  font-weight: 700;
}
.cost-sufficient {
  color: var(--ui-success);
}
.cost-insufficient {
  color: var(--ui-danger);
}
.cost-admin {
  color: var(--ui-warning);
}
.cost-tag {
  font-size: 11px;
  color: var(--ui-accent);
  font-weight: 600;
  background: var(--ui-accent-soft);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-left: 2px;
}

/* ============================================================
   点数消耗列表
   ============================================================ */
.cost-list {
  margin: 2px 0 6px;
}
.cost-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}
.cost-list-item + .cost-list-item {
  border-top: 1px solid var(--ui-line-soft);
}
.cost-list-label {
  color: var(--ui-fg-muted);
}
.cost-list-value {
  font-weight: 600;
  color: var(--ui-accent);
}
.cost-list-item-total {
  font-weight: 700;
}
.cost-list-item-total .cost-list-value {
  font-size: 16px;
  font-weight: 700;
}
.cost-list-value.cost-sufficient {
  color: var(--ui-success);
}
.cost-list-value.cost-insufficient {
  color: var(--ui-danger);
}
.cost-list-value.cost-admin {
  color: var(--ui-warning);
}
.cost-list-divider {
  height: 1px;
  background: var(--ui-line);
  margin: 8px 0;
}
.cost-balance {
  font-size: 13px;
  font-weight: 600;
}
.cost-balance.cost-sufficient {
  color: var(--ui-success);
}
.cost-balance.cost-insufficient {
  color: var(--ui-danger);
}
.cost-balance.cost-admin {
  color: var(--ui-warning);
}

/* ============================================================
   定价管理
   ============================================================ */
.pricing-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.summary-card {
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ui-accent) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--ui-accent);
  flex-shrink: 0;
}
.summary-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.summary-label {
  font-size: 12px;
  color: var(--ui-fg-muted);
}
.summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ui-fg);
  font-family: var(--font-mono);
}

.pricing-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.pricing-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ui-fg-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.pricing-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--ui-line-soft);
}
.pricing-table tbody tr:hover td {
  background: var(--ui-accent-soft);
}
.pricing-table tbody tr:hover td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.pricing-table tbody tr:hover td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pricing-table tbody tr:last-child td {
  border-bottom: none;
}
.pricing-table tfoot td {
  padding: 14px 12px;
  border-top: 2px solid var(--ui-line);
}
.pricing-table tfoot tr:hover td {
  background: transparent;
}
.pricing-icon {
  text-align: center;
  font-size: 18px;
  color: var(--ui-accent);
}
.pricing-label {
  font-weight: 600;
  font-size: 14px;
}
.pricing-row-required {
  background: color-mix(in srgb, var(--ui-accent) 4%, transparent);
}
.pricing-row-base td {
  border-bottom: 2px solid var(--ui-line);
}
.pricing-total-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--ui-accent);
}

.pricing-input-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ui-surface-1);
}
.pricing-input {
  width: 56px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--ui-fg);
  padding: 6px 4px;
  outline: none;
  -moz-appearance: textfield;
}
.pricing-input::-webkit-outer-spin-button,
.pricing-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pricing-step {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ui-fg-muted);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms, background 150ms;
  border-radius: 0;
}
.pricing-step:hover {
  color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 8%, transparent);
}

.pricing-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.save-success {
  color: var(--success);
  font-size: 13px;
}
.save-error {
  color: var(--danger);
  font-size: 13px;
}

.pricing-row-disabled {
  opacity: 0.5;
}
.pricing-row-disabled:hover {
  opacity: 0.7;
}

/* ============================================================
   Toggle Switch
   ============================================================ */
.toggle-switch {
  position: relative;
  display: inline-block !important;
  width: 44px;
  height: 24px;
  cursor: pointer;
  margin: 0 !important;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ui-line-soft);
  border-radius: 24px;
  transition: background 200ms;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--ui-accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ============================================================
   Feedback
   ============================================================ */
.form-group {
  margin-bottom: 14px;
}
.form-group > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-fg);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--ui-surface-1);
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ui-fg);
  font-family: var(--font-sans);
  outline: none;
  box-sizing: border-box;
  transition: border-color 150ms;
}
.form-control:focus {
  border-color: var(--ui-accent);
}
.form-control::placeholder {
  color: var(--ui-fg-muted);
  opacity: 0.6;
}
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}
.feedback-content {
  background: var(--ui-surface-1);
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.feedback-reply {
  background: color-mix(in srgb, var(--ui-accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--ui-accent) 20%, transparent);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.radio-label {
  display: flex !important;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ui-fg-muted);
  margin: 0 !important;
}
.radio-label input[type="radio"] {
  accent-color: var(--ui-accent);
}

@media (max-width: 768px) {
  .pricing-summary {
    grid-template-columns: 1fr;
  }

  /* 移动端卡片式定价布局 */
  .pricing-mobile-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 0 16px;
  }
  .pricing-mobile-row {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line-soft);
    border-radius: 12px;
    padding: 12px 14px;
    transition: opacity 0.2s;
  }
  .pricing-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  .pricing-mobile-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .pricing-mobile-icon {
    font-size: 18px;
    color: var(--ui-accent);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
  }
  .pricing-mobile-right {
    flex-shrink: 0;
  }
  .pricing-mobile-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 38px;
  }
  .pricing-mobile-hint {
    font-size: 13px;
    color: var(--ui-fg-muted);
  }
  .pricing-mobile-row .pricing-input-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ui-line-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--ui-surface-1);
  }
  .pricing-mobile-row .pricing-input {
    width: 48px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: inherit;
    outline: none;
    -moz-appearance: textfield;
  }
  .pricing-mobile-row .pricing-input::-webkit-outer-spin-button,
  .pricing-mobile-row .pricing-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .pricing-mobile-row .pricing-step {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--ui-fg-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
  }
  .pricing-mobile-row .pricing-step:hover {
    color: var(--ui-accent);
    background: color-mix(in srgb, var(--ui-accent) 8%, transparent);
  }
  .pricing-mobile-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--ui-fg-muted);
    border-top: 1px solid var(--ui-line-soft);
    margin-top: 4px;
  }
  .pricing-mobile-total b {
    font-size: 18px;
    color: var(--ui-accent);
  }
  .pricing-mobile-row.pricing-row-disabled {
    opacity: 0.5;
  }
}

/* ============================================================
   空状态 / 加载状态
   ============================================================ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 48px 24px;
  color: var(--ui-fg-muted);
}
.empty .icon {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.4;
}
.empty p {
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* 加载动画：双环旋转 */
.loader-spinner {
  position: relative;
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
}
.loader-spinner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--ui-line);
  border-top-color: var(--ui-accent);
  animation: loaderSpin 0.75s linear infinite;
}
.loader-spinner::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--ui-accent);
  opacity: 0.45;
  animation: loaderSpin 1.1s linear infinite reverse;
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

/* 加载文字呼吸 */
.empty .loader-text {
  display: inline-block;
  animation: loaderBreath 1.6s ease-in-out infinite;
}
@keyframes loaderBreath {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ============================================================
   工具类
   ============================================================ */
.hidden { display: none !important; }
.flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--ui-fg-muted); }
.text-mono { font-family: var(--font-sans); font-size: 12px; }
.text-right { text-align: right; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.space-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.task-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.task-layout .card { margin: 0; }

/* ============================================================
   动效体系 · GLASS Motion
   弹簧参数: stiffness 320, damping 32, mass 0.8
   ============================================================ */

/* ── 页面入场：从下方滑入 + 淡入 ── */
@keyframes pageSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-enter {
  animation: pageSlideUp 380ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── 卡片弹簧入场 ── */
@keyframes cardScaleIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
/* ── 表格行瀑布入场 ── */
@keyframes rowSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ── 卡片悬浮：蓝边微光 ── */
.card-interactive {
  transition: border-color 220ms ease, box-shadow 220ms ease;
}
.card-interactive:hover {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 1px var(--ui-accent-soft);
}

/* ── 运行中状态脉冲 ── */
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 var(--ui-accent-soft); }
  50%      { box-shadow: 0 0 0 5px rgba(0,128,255,.08); }
}
.badge-info::before {
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDotOrange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,140,0,.25); }
  50%      { box-shadow: 0 0 0 5px rgba(255,140,0,.08); }
}
.badge-login::before {
  animation: pulseDotOrange 2s ease-in-out infinite;
}

/* ── 侧边栏导航：指示器滑动 ── */
.sidebar .nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 18px;
  background: var(--ui-accent);
  border-radius: 0 3px 3px 0;
  transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sidebar .nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}
.sidebar .nav-item:hover::before {
  transform: translateY(-50%) scaleY(0.45);
  opacity: 0.4;
}

/* ── 骨架屏 Shimmer ── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--ui-surface-2) 0%,
    var(--ui-accent-soft) 40%,
    var(--ui-surface-2) 80%
  );
  background-size: 400px 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

/* ── 按钮点击涟漪（Primary 按钮） ── */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.15);
  opacity: 0;
  transition: opacity 300ms ease;
}
.btn-primary:active::after {
  opacity: 1;
  transition: opacity 0ms;
}

/* ── 数字跳动 ── */
@keyframes numberPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.stat-card .value.counting {
  animation: numberPop 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── 复选框选中弹跳 ── */
.checkbox-group label {
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.checkbox-group label.checked {
  animation: cardScaleIn 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── 日志终端行入场 ── */
@keyframes logLineIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.log-box .line {
  animation: logLineIn 200ms ease both;
}

/* ── 排队徽标呼吸 ── */
@keyframes breathPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
.queue-badge {
  animation: breathPulse 2s ease-in-out infinite;
}

/* ── 页面标题入场 ── */
@keyframes titleSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.page-header h2 {
  animation: titleSlideIn 350ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── 设置页表单 ── */
.field-row {
  margin-bottom: 14px;
}
.field-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ui-fg);
  margin-bottom: 6px;
}
.field-row input[type="text"],
.field-row input[type="number"],
.field-row input[type="email"],
.field-row input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-sm);
  color: var(--ui-fg);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  box-sizing: border-box;
}
.field-row input:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 20%, transparent);
}
.field-row-check label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ui-fg);
  cursor: pointer;
  margin: 0 !important;
}
.field-row-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ui-accent);
}

/* ── 开关切换 (toggle) ── */
.toggle-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px !important;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 500;
  color: var(--ui-fg);
  padding: 8px 0;
}
.toggle-switch {
  position: relative;
  display: inline-block !important;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin: 0 !important;
}
.toggle-switch input {
  display: none;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--ui-line-soft);
  border-radius: 12px;
  transition: background 200ms;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle-switch input:checked + .toggle-track {
  background: var(--ui-accent);
}
.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}
.toggle-hint {
  font-size: 12px;
  color: var(--ui-fg-muted);
  margin: 4px 0 0 0;
  padding-left: 0;
}

/* ── 设置页表格 ── */
.card-body table td {
  border-bottom: 1px solid var(--ui-line-soft);
  color: var(--ui-fg);
}
.card-body table th {
  color: var(--ui-fg-muted);
  font-weight: 600;
}

/* ── 回到顶部按钮 ── */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ui-accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  z-index: 1050;
  opacity: 0;
  transform: translateX(120%) scale(.9);
  transition: opacity 280ms ease, transform 280ms cubic-bezier(.22,.61,.36,1), background 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  pointer-events: none;
}
.back-to-top.show {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--ui-accent-hover, var(--ui-accent));
  box-shadow: 0 6px 24px rgba(0,0,0,.26);
}
.back-to-top i {
  line-height: 1;
}

/* ── 子元素逐行淡入动画 ── */
@keyframes staggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.stagger-children > * {
  animation: staggerFadeIn 0.35s ease-out both;
  animation-delay: calc(var(--stagger-i, 0) * 0.05s);
}

/* ── 表格行瀑布入场动画（通过 staggerTableRows 内联设置触发） ── */
@keyframes rowStaggerIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*  
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    height: 100vh;
  }

  /* 侧边栏 → 仅顶部 Logo 横条 */
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 0 12px;
    border-right: none;
    border-bottom: 1px solid var(--ui-line-soft);
    min-height: 48px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .sidebar .logo-area {
    padding: 0;
    border: none;
    margin: 0;
    gap: 8px;
  }
  .sidebar .logo-mark {
    width: 28px;
    height: 28px;
    background: none;
    border-radius: 0;
  }
  .sidebar .logo-text h2 {
    font-size: 14px;
    color: var(--ui-fg);
    white-space: nowrap;
  }
  .sidebar .logo-text .sub {
    display: none;
  }
  .sidebar .nav-list {
    display: none;
  }
  .sidebar .nav-divider {
    display: none;
  }
  .sidebar .nav-group {
    display: none;
  }
  .sidebar .user-info {
    display: none;
  }

  /* ── 底部导航栏（悬浮） ── */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    left: 12px;
    right: 12px;
    background: var(--ui-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ui-line-soft, rgba(0,0,0,0.06));
    border-radius: 16px;
    padding: 6px 4px;
    justify-content: space-around;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 120;
  }
  .mn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 2px;
    min-width: 0;
    flex: 1;
    color: var(--ui-fg-muted);
    cursor: pointer;
    transition: color 180ms ease;
    border: none;
    background: none;
    font-size: 9.5px;
    font-weight: 500;
    position: relative;
  }
  .mn-item i {
    font-size: 18px;
    transition: transform 180ms ease;
  }
  .mn-item.active {
    color: var(--ui-accent);
  }
  .mn-item.mn-me {
    color: var(--ui-accent);
    margin-top: -18px;
  }
  .mn-item.mn-me i {
    font-size: 26px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ui-accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 300ms ease, background 300ms ease;
  }
  .mn-item.mn-me:active i {
    transform: scale(0.92);
    transition-duration: 100ms;
  }
  .mn-item.mn-me.active i {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--ui-accent) 25%, transparent), 0 4px 16px rgba(0,0,0,.2);
    animation: meActivePulse 2.8s ease-in-out infinite;
  }
  @keyframes meActivePulse {
    0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ui-accent) 25%, transparent), 0 4px 16px rgba(0,0,0,.2); }
    50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--ui-accent) 8%, transparent), 0 0 28px color-mix(in srgb, var(--ui-accent) 20%, transparent), 0 4px 16px rgba(0,0,0,.2); }
  }
  [data-theme="dark"] .mn-item.mn-me i {
    background: color-mix(in srgb, var(--ui-accent) 70%, #000);
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
  }
  [data-theme="dark"] .mn-item.mn-me.active i {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--ui-accent) 30%, transparent), 0 4px 16px rgba(0,0,0,.4);
    animation-name: meActivePulseDark;
  }
  @keyframes meActivePulseDark {
    0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ui-accent) 30%, transparent), 0 4px 16px rgba(0,0,0,.4); }
    50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--ui-accent) 10%, transparent), 0 0 28px color-mix(in srgb, var(--ui-accent) 25%, transparent), 0 4px 16px rgba(0,0,0,.4); }
  }

  /* ── 更多面板 ── */
  .mobile-more-panel {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ui-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px 20px 0 0;
    z-index: 200;
    padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 -4px 24px rgba(0,0,0,.1);
  }
  .mobile-more-panel.open {
    transform: translateY(0);
  }
  .mmp-handle {
    width: 36px;
    height: 4px;
    background: var(--ui-line);
    border-radius: 2px;
    margin: 10px auto;
    flex-shrink: 0;
  }
  .mmp-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px 16px;
    border-bottom: 1px solid var(--ui-line-soft);
  }
  .mmp-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
  }
  .mmp-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mmp-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-fg);
  }
  .mmp-role {
    font-size: 12px;
    color: var(--ui-fg-muted);
  }
  .mmp-menu {
    padding: 8px 0;
  }
  .mmp-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    color: var(--ui-fg);
    font-size: 14px;
    cursor: pointer;
    transition: background 160ms ease;
    font-weight: 500;
  }
  .mmp-item:hover {
    background: var(--ui-surface-2);
  }
  .mmp-item i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    color: var(--ui-fg-muted);
  }
  .mmp-divider {
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--ui-line-soft);
    margin-top: 4px;
  }
  .mmp-group-toggle {
    position: relative;
  }
  .mmp-chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 200ms ease;
    color: var(--ui-fg-muted);
  }
  .mmp-group.open .mmp-chevron {
    transform: rotate(180deg);
  }
  .mmp-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 280ms ease;
    background: var(--ui-surface-2);
  }
  .mmp-group.open .mmp-sub {
    max-height: 200px;
  }
  .mmp-sub-item {
    padding: 11px 20px 11px 54px;
    font-size: 13px;
    font-weight: 400;
  }
  .mmp-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--ui-line-soft);
  }
  .mmp-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    border: 1px solid var(--ui-line);
    border-radius: var(--radius-sm);
    background: var(--ui-surface);
    color: var(--ui-fg-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 180ms ease;
  }
  .mmp-action-btn:hover {
    background: var(--ui-surface-2);
    color: var(--ui-fg);
  }
  .mmp-action-btn i {
    font-size: 14px;
  }
  .mmp-logout {
    border-color: rgba(239,68,68,.3);
    color: var(--ui-danger);
  }
  .mmp-logout:hover {
    background: rgba(239,68,68,.08);
  }

  /* ── 遮罩层 ── */
  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 150;
    animation: overlayFadeIn 200ms ease;
  }
  .mobile-overlay.open {
    display: block;
  }
  @keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .main-content {
    padding: 16px 12px calc(env(safe-area-inset-bottom, 0px) + 88px);
    max-height: none;
  }

  /* 页面标题 */
  .page-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-header h2 {
    font-size: 17px;
  }
  .page-header .btn {
    font-size: 13px;
    padding: 8px 14px;
    min-height: 40px;
  }
  .page-header .btn i {
    font-size: 15px;
  }
  .page-header .btn-border {
    background: var(--ui-surface-2);
  }

  /* 表格 → 卡片 */
  .table-wrap {
    overflow-x: visible;
  }
  /* 移动端列表卡片容器：移除背景/padding/border，让卡片间隔透出页面底色 */
  .card:has(.table-wrap) {
    background: transparent !important;
    padding: 0 14px !important;
    border: none !important;
    box-shadow: none !important;
  }
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tr {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .table-wrap td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-bottom: 1px solid var(--ui-line-soft);
    font-size: 13px;
    text-align: right;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }
  .table-wrap td:last-child {
    border-bottom: none;
  }
  .table-wrap td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 12px;
    color: var(--ui-fg-muted);
    text-align: left;
    flex-shrink: 0;
    margin-right: 12px;
  }
  .table-wrap td .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  /* ── 定价表格移动端卡片化 ── */
  .pricing-table tr {
    padding: 12px 14px;
  }
  .pricing-table td::before {
    display: none;
  }
  .pricing-table .pricing-icon,
  .pricing-table .pricing-name {
    display: inline-flex;
    align-items: center;
    border-bottom: none;
    padding: 0;
  }
  .pricing-table .pricing-icon {
    width: auto;
    margin-right: 10px;
  }
  .pricing-table .pricing-name {
    flex: 1;
    text-align: left;
  }
  .pricing-table .pricing-points,
  .pricing-table .pricing-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-bottom: none;
    padding: 10px 0 0;
  }
  .pricing-table .pricing-points {
    flex: 1;
    justify-content: flex-start;
  }
  .pricing-table .pricing-toggle {
    width: auto;
    justify-content: flex-end;
  }
  .pricing-table tfoot tr {
    padding: 14px;
  }
  .pricing-table tfoot td {
    border: none;
    padding: 0;
  }
  .pricing-table tfoot td:empty {
    display: none;
  }
  .pricing-table .pricing-total-label,
  .pricing-table .pricing-total-value {
    display: inline-flex;
    align-items: center;
  }
  .pricing-table .pricing-total-label {
    flex: 1;
  }

  /* ── 定时预设专用卡片 ── */
  .sched-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .sched-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--ui-line-soft);
    gap: 10px;
  }
  .sched-card__account {
    min-width: 0;
    flex: 1;
  }
  .sched-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--ui-fg);
    line-height: 1.3;
    word-break: break-all;
  }
  .sched-card__meta {
    font-size: 11px;
    color: var(--ui-fg-muted);
    margin-top: 2px;
    word-break: break-all;
  }
  .sched-card__status {
    flex-shrink: 0;
  }
  .sched-card__body {
    padding: 4px 0;
  }
  .sched-card__row {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--ui-line-soft);
    font-size: 13px;
    gap: 8px;
  }
  .sched-card__row--compact {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }
  .sched-card__row--compact span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ui-fg-muted);
  }
  .sched-card__row--last {
    border-bottom: none;
  }
  .sched-card__label {
    font-size: 12px;
    color: var(--ui-fg-muted);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 48px;
  }
  .sched-card__value {
    text-align: right;
  }
  .sched-card__actions {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--ui-line-soft);
    background: var(--ui-surface-2);
    flex-wrap: wrap;
  }
  .sched-card__actions .btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  /* 卡片 */
  .card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }
  .announcement-card {
    padding: 14px 14px;
    border-radius: var(--radius-md);
    border-left-width: 3px;
  }

  /* 统计卡片 */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-card {
    padding: 14px 12px;
  }
  .stat-card .value {
    font-size: 22px;
  }
  .stat-card .label {
    font-size: 11px;
  }

  /* 网格 */
  .grid-2 { grid-template-columns: 1fr; }
  .task-layout { grid-template-columns: 1fr; }

  /* 下发任务页移动端适配 */
  .task-layout .card-title {
    flex-wrap: wrap;
    gap: 6px;
  }
  .task-layout .card-title span:first-child {
    width: 100%;
  }
  .account-multi-list {
    max-height: 40vh;
  }
  #submitTaskBtn {
    width: 100%;
    height: 44px;
    font-size: 15px;
  }
  .task-layout .task-right .card {
    height: auto !important;
  }
  /* 下发任务页移动端：放大触控图标 + 压缩页面高度 */
  .task-layout { gap: 10px; }
  .task-layout .card { padding: 12px 14px; }
  .task-layout .card-title { margin-bottom: 6px; }
  .account-search-bar input { height: 40px; font-size: 14px; }
  .account-search-bar > i.bi-search { font-size: 18px; }
  .account-multi-list { max-height: 28vh; }
  .account-multi-item { padding: 12px; gap: 12px; }
  .account-multi-item .account-checkbox { width: 20px; height: 20px; }
  .account-multi-name { font-size: 14px; }
  .account-multi-meta { font-size: 12px; }
  #taskOptions input[type="checkbox"] { width: 20px; height: 20px; }
  #taskOptions label { display: flex !important; align-items: center; gap: 7px; padding: 9px 12px; font-size: 13px; margin: 0 !important; }
  .task-layout + .card { margin-top: 10px !important; }

  /* 弹窗 */
  .modal {
    padding: 18px 16px;
    max-width: 95vw;
    border-radius: var(--radius-md);
  }
  .modal h3 {
    font-size: 16px;
  }
  .modal label {
    font-size: 12px;
  }
  .modal .btn-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal .btn-row .btn {
    font-size: 12px;
    padding: 8px 14px;
  }
  .modal-form-header {
    margin-bottom: 16px;
  }
  .modal-form-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  /* 时间选择器 */
  .time-select {
    font-size: 13px;
    padding: 8px 10px;
  }

  /* 复选框组 */
  .checkbox-group {
    gap: 6px;
  }
  .checkbox-group label {
    padding: 5px 10px;
    font-size: 12px;
  }

  .hide-mobile { display: none !important; }

  /* ── 搜索栏：手机端竖排 ── */
  .search-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .search-bar .search-bar__sep {
    display: none !important;
  }
  .search-bar input[type="text"] {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  .search-bar input[type="date"] {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .search-bar .btn {
    width: 100%;
    text-align: center;
  }

  .dash-row-2col { grid-template-columns: 1fr; }
  .dash-row-4col { grid-template-columns: 1fr 1fr; }
  .trend-bars { height: 120px; }
  .bill-category-grid { grid-template-columns: 1fr; }

  /* 回到顶部按钮：移动端更靠近底部，避免被底部导航遮挡 */
  .back-to-top {
    bottom: 90px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .back-to-top.show {
    opacity: .85;
  }

  /* ── 页面飞入动画：每个子元素依次飞入 ── */
  @keyframes pageFlyIn {
    from {
      transform: translateY(-40px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  #mainContent.page-enter > * {
    animation: pageFlyIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: calc(var(--stagger-i, 0) * 0.07s);
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .stat-card {
    padding: 10px 8px;
  }
  .stat-card .value {
    font-size: 18px;
  }
  .stat-card .label {
    font-size: 10px;
  }
  .page-header h2 {
    font-size: 15px;
  }
  .modal {
    padding: 14px 12px;
    max-width: 98vw;
  }
  .table-wrap th,
  .table-wrap td {
    padding: 8px 6px;
    font-size: 11px;
  }
}

/* ═══════════════════════════════════════════════════════════
   我 — 个人中心页面
   参考 mobile_overview.html 中"我的"页面风格
   ═══════════════════════════════════════════════════════════ */

.page-me {
  padding: 16px 16px 32px;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── 个人信息卡片 ── */
.me-profile-card {
  background: var(--ui-surface);
  border-radius: 20px;
  padding: 28px 20px 24px;
  text-align: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid var(--ui-line-soft);
}

.me-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  margin: 0 auto;
  flex-shrink: 0;
}

.me-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--ui-fg);
  margin-top: 12px;
  letter-spacing: -0.02em;
}

.me-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.me-role-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  border-radius: 999px;
  padding: 2px 12px;
  line-height: 1.6;
}

.me-meta {
  font-size: 12px;
  color: var(--ui-fg-muted);
}

/* ── 统计行 ── */
.me-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ui-line-soft);
}

.me-stat-item {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.me-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--ui-fg);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.me-stat-label {
  font-size: 11px;
  color: var(--ui-fg-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* 月卡特权卡片 */
.me-month-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.me-month-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.me-month-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.me-month-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ui-fg);
}
.me-month-sub {
  font-size: 12px;
  color: var(--ui-fg-muted);
  margin-top: 2px;
}
.me-month-body {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.me-priv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ui-fg);
}
.me-priv-item i {
  color: #f59e0b;
  font-size: 14px;
}

/* ── 菜单列表 ── */
.me-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.me-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ui-surface);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--ui-line-soft);
}
.me-menu-item:active {
  transform: scale(0.98);
}

.me-menu-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.me-menu-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--ui-fg);
  min-width: 0;
}

.me-menu-arrow {
  font-size: 14px;
  color: var(--ui-fg-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.me-menu-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  margin-top: 4px;
}
.me-menu-divider::before {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ui-line);
}
.me-menu-divider span {
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.me-menu-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ui-line);
}

/* ── 操作按钮 ── */
.me-actions {
  display: flex;
  gap: 10px;
}

.me-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  color: var(--ui-fg-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms ease;
  font-family: inherit;
}
.me-action-btn:hover {
  background: var(--ui-surface-2);
  color: var(--ui-fg);
  border-color: var(--ui-accent);
}
.me-action-btn i {
  font-size: 15px;
}

/* ── 退出登录 ── */
.me-logout {
  text-align: center;
  padding: 14px 0;
  color: var(--ui-danger);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px;
  background: var(--ui-surface);
  border: 1px solid rgba(239,68,68,0.25);
  transition: all 180ms ease;
}
.me-logout:hover {
  background: rgba(239,68,68,0.06);
}
.me-logout:active {
  transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════
   首页 · 代肝服务品牌形象页
   ═══════════════════════════════════════════════════════════ */

.home-page {
  position: relative;
  min-height: 100vh;
  background: var(--ui-bg);
  overflow: hidden;
}

/* ── 点阵背景 ── */
.home-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, var(--ui-line) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 70%);
}

/* ── 主题切换 ── */
.home-theme-bar {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 10;
}
.home-theme-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-fg-muted);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 180ms ease;
}
.home-theme-btn:hover {
  border-color: var(--ui-accent);
  color: var(--ui-fg);
  background: var(--ui-accent-soft);
}
.home-theme-icon {
  font-size: 15px;
  line-height: 1;
}
.home-theme-label {
  font-weight: 500;
}

/* ── Hero ── */
.home-hero {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 48px 100px;
  display: flex;
  align-items: flex-start;
  gap: 80px;
  animation: heroFadeIn 800ms 200ms ease both;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.home-hero-body {
  flex: 1;
  min-width: 0;
}

.home-hero-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 28px;
  border: 1px solid rgba(0,128,255,.15);
  font-family: var(--font-mono);
}

.home-hero-title {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--ui-accent) 0%, #6366f1 50%, var(--ui-accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.title-sub {
  font-size: 36px;
  font-weight: 600;
  color: var(--ui-fg);
  letter-spacing: -0.02em;
}

.home-hero-desc {
  font-size: 17px;
  color: var(--ui-fg-muted);
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 520px;
}

.home-hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.home-hero-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  letter-spacing: 0.02em;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(0,128,255,.2);
}
.home-hero-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,128,255,.35);
}

/* ── Hero 右侧装饰 ── */
.home-hero-decoration {
  flex-shrink: 0;
  width: 420px;
  position: relative;
  animation: heroFadeIn 800ms 400ms ease both;
}
.deco-line {
  position: absolute;
  border-radius: 2px;
  opacity: 0.12;
}
.deco-line.l1 {
  top: 60px;
  right: 40px;
  width: 200px;
  height: 1px;
  background: var(--ui-accent);
  animation: decoLine1 3s ease-in-out infinite;
}
.deco-line.l2 {
  top: 180px;
  right: 0;
  width: 120px;
  height: 1px;
  background: var(--ui-accent-2);
  animation: decoLine2 4s ease-in-out infinite;
}
@keyframes decoLine1 {
  0%, 100% { width: 200px; opacity: 0.12; }
  50%      { width: 260px; opacity: 0.25; }
}
@keyframes decoLine2 {
  0%, 100% { width: 120px; opacity: 0.12; }
  50%      { width: 180px; opacity: 0.22; }
}

.deco-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ui-accent);
  opacity: 0.3;
}
.deco-dot.d1 { top: 40px; right: 100px; animation: decoFloat 3s ease-in-out infinite; }
.deco-dot.d2 { top: 140px; right: 60px; animation: decoFloat 3.5s ease-in-out 0.5s infinite; }
.deco-dot.d3 { top: 200px; right: 140px; animation: decoFloat 4s ease-in-out 1s infinite; }
@keyframes decoFloat {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50%      { transform: translateY(-8px); opacity: 0.6; }
}

/* 代码块装饰 */
.deco-code-block {
  position: absolute;
  top: 90px;
  right: 20px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  min-width: 260px;
  animation: decoFloat 5s ease-in-out 1.5s infinite;
}
.code-keyword { color: var(--ui-accent); font-weight: 600; }
.code-var { color: var(--ui-fg); }
.code-op { color: var(--ui-fg-muted); }
.code-prop { color: #6366f1; }
.code-val { color: #22c55e; }
.code-ok { color: #22c55e; }
.code-dim { color: var(--ui-fg-muted); opacity: 0.5; }

/* ── 特性区块 ── */
.home-features {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px 100px;
  animation: featuresFadeIn 800ms 600ms ease both;
}
@keyframes featuresFadeIn {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-features-header {
  text-align: center;
  margin-bottom: 56px;
}
.home-features-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--ui-fg);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.home-features-header p {
  font-size: 15px;
  color: var(--ui-fg-muted);
}
.home-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.home-feature-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
}
.home-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
  border-color: var(--ui-accent-soft);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--ui-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-accent);
  margin-bottom: 18px;
}
.home-feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ui-fg);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.home-feature-card p {
  font-size: 13.5px;
  color: var(--ui-fg-muted);
  line-height: 1.65;
}

/* ── 底部 ── */
.home-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--ui-line-soft);
  padding: 28px 48px;
  text-align: center;
  animation: featuresFadeIn 800ms 800ms ease both;
}
.home-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ui-fg-muted);
}
.footer-brand {
  font-weight: 700;
  color: var(--ui-fg);
  letter-spacing: -0.02em;
}
.footer-divider {
  opacity: 0.3;
}
.footer-link {
  color: var(--ui-fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover {
  color: var(--ui-accent);
  text-decoration: underline;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .home-hero {
    flex-direction: column;
    padding: 80px 24px 60px;
    gap: 40px;
  }
  .home-hero-title {
    font-size: 40px;
  }
  .home-hero-title .title-sub {
    font-size: 26px;
  }
  .home-hero-decoration {
    width: 100%;
    height: 200px;
  }
  .deco-code-block {
    top: 20px;
    right: 10px;
    min-width: auto;
    font-size: 11px;
    padding: 12px 14px;
  }
  .home-features {
    padding: 0 24px 80px;
  }
  .home-features-header h2 {
    font-size: 26px;
  }
  .home-features-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   mobile_overview 风格组件（对齐 mobile_overview.html）
   概览首页 · 渐变欢迎卡 · 头像 · 大数字统计 · 胶囊按钮
   ============================================================ */

/* ── 深蓝渐变欢迎卡（图片背景：先缩略图，再淡入高清图） ── */
.gradient-card {
  border-radius: 20px;
  color: #fff;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
}
/* 背景层：先渲染缩略图（小、快）；高清图由 JS 预载后在对应用层淡入 */
.gc-bg,
.gc-bg-full {
  position: absolute; inset: 0;
  display: block; padding: 0; border: 0; margin: 0;
}
.gc-bg {
  position: absolute; inset: 0;
  display: flex;
  justify-content: flex-end;   /* 与高清层一致：右侧主图缩略，左侧延伸图缩略铺满 */
  align-items: stretch;
  overflow: hidden;
}
.gc-bg img.gc-th { height: 100%; width: auto; flex: 0 0 auto; display: block; }
.gc-bg::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(10,17,40,0.52) 0%, rgba(15,30,60,0.42) 55%, rgba(20,45,70,0.46) 100%);
}
.gc-bg-full {
  position: absolute; inset: 0;
  display: flex;
  justify-content: flex-end;   /* 内容整体靠右：主图贴右，延伸图紧贴其左 */
  align-items: stretch;         /* 图片满高，各自保持比例 */
  overflow: hidden;             /* 往左超出卡片的部分裁掉，不显示 */
  opacity: 0;                   /* 加载完成前隐藏高清层，先显示缩略图层 */
  will-change: opacity;
}
/* 主图+全部延伸图同属一个层：加载完成后整体淡入（共享一个动画） */
.gradient-card.gc-bg-loaded .gc-bg-full {
  animation: gcBgReveal .75s cubic-bezier(.22,1,.36,1) both;
}
@keyframes gcBgReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.gc-bg-full img { height: 100%; width: auto; flex: 0 0 auto; display: block; }
/* 主图与延伸图之上叠加半透明渐变遮罩，保证卡片文字可读 */
.gc-bg-full::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(10,17,40,0.52) 0%, rgba(15,30,60,0.42) 55%, rgba(20,45,70,0.46) 100%);
}
/* 窄屏：主图自动填满卡片、靠右对齐、cover 比例不拉伸 */
@media (max-width: 700px) {
  .gc-bg img.gc-th-tile, .gc-bg-full img.gc-tile { display: none; }
  .gc-bg img.gc-th-main, .gc-bg-full img.gc-main {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: calc(100% + 50px) center;
  }
}
.gradient-card > :not(.gc-bg) { position: relative; z-index: 1; }
.gradient-card::after {
  content: '';
  position: absolute;
  right: -20px; bottom: -20px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.gradient-card::before {
  content: '';
  position: absolute;
  right: 30px; bottom: 40px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.gc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}
.gc-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 8px;
}
.gc-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.60);
  line-height: 1.6;
  max-width: 85%;
}
/* 图片背景版（浅色主题：浅色遮罩亮出图片 + 深色文字保证可读） */
[data-theme="light"] .gradient-card {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 4px 20px rgba(2,6,23,0.08), 0 1px 4px rgba(0,0,0,0.05);
}
[data-theme="light"] .gradient-card .gc-title { color: #fff; }
[data-theme="light"] .gradient-card .gc-desc { color: #fff; }
[data-theme="light"] .gradient-card .gc-badge { color: #fff; background: rgba(15,25,50,0.30); }
/* 日间模式直接提亮图片本身，避免背景太黑压住文字 */
[data-theme="light"] .gc-bg img,
[data-theme="light"] .gc-bg-full img {
  filter: brightness(1.5) saturate(1.08);
}
[data-theme="light"] .gc-bg::after,
[data-theme="light"] .gc-bg-full::after {
  background: linear-gradient(145deg, rgba(8,14,30,0.30) 0%, rgba(8,14,30,0.16) 55%, rgba(8,14,30,0.22) 100%);
}
.btn-manage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ui-surface);
  color: var(--ui-fg);
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-manage:active { opacity: 0.85; }
.btn-manage i { color: var(--ui-accent); }
.gc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.50);
  cursor: pointer;
  transition: opacity 0.15s;
}
.gc-link:active { opacity: 0.6; }

/* ── 头像（渐变圆） ── */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* ── 大数字统计 ── */
.stat-number {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* ── 概览双列统计卡 ── */
.overview-stat {
  background: var(--ui-surface);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid var(--ui-line-soft);
}
.overview-stat .os-label {
  font-size: 12px;
  color: var(--ui-fg-muted);
  font-weight: 500;
}
.overview-stat .os-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ui-fg);
  margin-top: 4px;
}
.overview-stat .os-desc {
  font-size: 12px;
  color: var(--ui-fg-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── 概览页大卡片标题 ── */
.overview-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ui-fg);
  margin-bottom: 12px;
}

/* ── 卡片阴影（对齐 html） ── */
.card-shadow {
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
}

/* ── 概览首页容器 ── */
.overview-shell { padding: 0; }
.overview-stack { display: flex; flex-direction: column; gap: 14px; }
.overview-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 768px) {
  .overview-shell { padding: 0; }
  .gc-desc { max-width: 100%; }
}

/* ── 概览统计卡：兼容 dashboard.js 轮询将 class 替换为 "value xxx" 的情况 ── */
.overview-stat .value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ui-fg);
  margin-top: 4px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.overview-stat .os-value.accent,
.overview-stat .value.accent { color: var(--ui-accent); }
.overview-stat .os-value.success,
.overview-stat .value.success { color: var(--ui-success); }
.overview-stat .os-value.danger,
.overview-stat .value.danger { color: var(--ui-danger); }
.overview-stat .os-value.warning,
.overview-stat .value.warning { color: var(--ui-warning); }

/* ============================================================
   tasks / accounts 页面视觉增强（对齐 mobile_overview.html）
   仅调整视觉，不改变任何 DOM 结构与逻辑
   ============================================================ */

/* ── 移动端任务/账号卡片：更大圆角 + 柔和阴影 + 渐变顶部 ── */
.sched-card {
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid var(--ui-line-soft);
}
.sched-card__header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.sched-card__name {
  font-size: 15px;
  font-weight: 700;
}
.sched-card__body {
  padding: 4px 0;
}
.sched-card__row {
  padding: 9px 16px;
  font-size: 13px;
}
.sched-card__label {
  min-width: 56px;
}
.sched-card__actions {
  padding: 10px 16px;
  gap: 8px;
}
.sched-card__actions .btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
}
.sched-card__meta .badge {
  border-radius: 999px;
}

/* ── 搜索栏：卡片化 + 圆角输入框 ── */
.search-bar {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line-soft);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
}
.search-bar input[type="text"],
.search-bar input[type="date"] {
  border-radius: 10px;
  padding: 9px 12px;
}

/* ── 桌面表格容器：圆角与阴影对齐 html ── */
.table-wrap {
  border-radius: 14px;
  overflow: hidden;
}

/* ── 页面标题区小标签（tasks 的登录/跑图计数） ── */
.page-header .flex.gap-8[style*="12px"] span {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ui-bg-elevated);
}

/* ============================================================
   「光遇设备」页风格：账号 / 任务 移动卡片（对齐 mobile_overview.html page-1）
   仅移动端(<768)生效，独立命名避免影响定时预设 sched-card
   ============================================================ */
@media (max-width: 768px) {

  /* ── 顶部统计条（对齐 html 光遇设备页） ── */
  .dev-statbar {
    background: var(--ui-surface);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid var(--ui-line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .dev-statbar__total { font-size: 13px; color: var(--ui-fg-muted); }
  .dev-statbar__total b { color: var(--ui-fg); font-size: 15px; }
  .dev-statbar__counts { display: flex; gap: 12px; font-size: 11px; color: var(--ui-fg-muted); }
  .dev-statbar__stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
  .dev-statbar__stat-main { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
  .dev-statbar__stat-sub { font-size: 9px; color: var(--ui-fg-muted); opacity: 0.7; white-space: nowrap; }
  .dev-statbar__stat-sub b { color: var(--ui-fg); font-weight: 600; font-size: 10px; }
  .dev-statbar__counts > span { display: inline-flex; align-items: center; gap: 3px; }
  .dev-statbar__counts b { font-size: 13px; color: var(--ui-fg); }

  /* ── 设备/账号/任务卡片（对齐 html .device-item） ── */
  .dev-item {
    background: var(--ui-surface);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid var(--ui-line-soft);
    margin-bottom: 12px;
  }
  .dev-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
  }
  .dev-item__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .dev-item__name { font-size: 14px; font-weight: 700; color: var(--ui-fg); line-height: 1.3; word-break: break-all; }
  .dev-item__sub { font-size: 10px; color: var(--ui-fg-muted); margin-top: 1px; }
  .dev-item__status { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 12px; font-weight: 600; }
  .dev-item__status .status-dot-running { color: #3b82f6; }
  .dev-item__status .status-dot-done { color: #22c55e; }
  .dev-item__status .status-dot-idle { color: #94a3b8; }
  .dev-item__status .status-dot-danger { color: #ef4444; }

  /* ── 状态点（独立命名，不覆盖队列用的 .status-dot） ── */
  .dev-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
  }
  .dev-dot--running { background: #3b82f6; }
  .dev-dot--done { background: #22c55e; }
  .dev-dot--idle { background: #94a3b8; }
  .dev-dot--danger { background: #ef4444; }
  .dev-dot--banned { background: #f59e0b; }

  /* ── 功能标签（对齐 html .feature-tag） ── */
  .dev-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--ui-surface-2, #f1f5f9);
    color: var(--ui-fg-muted, #475569);
    margin: 1px 2px;
  }
  .dev-tags { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 8px; }

  /* ── 底部行：时间 + 货币/编号 ── */
  .dev-item__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ui-fg-muted);
    gap: 8px;
    flex-wrap: wrap;
  }
  .dev-item__foot .foot-key { color: var(--ui-fg-muted); }
  .dev-item__foot .foot-val { color: var(--ui-fg); font-weight: 500; }

  /* ── 明细网格（数据全：ID/备注/分配/云端/执行人/下发等） ── */
  .dev-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--ui-line-soft);
    border-bottom: 1px solid var(--ui-line-soft);
    margin: 8px 0;
    font-size: 11px;
  }
  .dev-grid__cell { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
  .dev-grid__k { color: var(--ui-fg-muted); flex-shrink: 0; }
  .dev-grid__v { color: var(--ui-fg); word-break: break-all; text-align: right; margin-left: auto; }

  /* ── 操作按钮（胶囊，保留全部操作） ── */
  .dev-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--ui-line-soft);
  }
  .dev-actions .btn {
    border-radius: 100px;
    font-size: 12px;
    padding: 6px 14px;
  }

  /* 货币统计（对齐 html 设备卡底部） */
  .dev-currency { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ui-fg); }
  .dev-currency b { color: var(--ui-fg); font-weight: 600; }
}

/* ============================================================
   「点击卡片进详情」交互：dev-tap-hint + dev-detail 详情弹窗
   ============================================================ */
.dev-tap-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--ui-line-soft);
  font-size: 11px;
  color: var(--ui-primary);
  opacity: .85;
}
.dev-tap-hint i { font-size: 12px; }

/* 账号详情弹窗（移动端） */
.dev-detail__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ui-line-soft);
  margin-bottom: 4px;
}
.dev-detail__head .dev-item__status { margin-left: auto; }
.dev-detail__body { margin-top: 8px; }
.dev-detail__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.dev-detail__row:last-child { border-bottom: none; }
.dev-detail__k { color: var(--ui-fg-muted); flex-shrink: 0; }
.dev-detail__v { color: var(--ui-fg); word-break: break-all; text-align: right; margin-left: auto; }
.dev-detail .dev-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dev-detail .dev-actions .btn { border-radius: 100px; font-size: 13px; padding: 8px 18px; flex: 1; min-width: 88px; }
/* ============================================================
   账号详情弹窗（更精致：渐变横幅 + 统计条 + 分区 + 货币）
   ============================================================ */
.dev-detail__banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-deep, #1d4ed8));
  color: #fff;
  margin: -1px -1px 12px;
}
.dev-detail__banner .avatar { border: 2px solid rgba(255,255,255,.35); flex-shrink: 0; }
.dev-detail__banner-info { flex: 1; min-width: 0; }
.dev-detail__banner-info .dev-detail__name { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.3; word-break: break-all; }
.dev-detail__banner-info .dev-detail__meta { font-size: 11px; color: rgba(255,255,255,.75); margin-top: 1px; }
.dev-detail__chip {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 100px;
  background: rgba(255,255,255,.2); color: #fff; flex-shrink: 0;
}
.dev-detail__chip--done { background: rgba(34,197,94,.9); }
.dev-detail__chip--running { background: rgba(255,255,255,.25); }
.dev-detail__chip--idle { background: rgba(148,163,184,.9); }
.dev-detail__chip--danger { background: rgba(239,68,68,.9); }

.dev-detail__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.dev-detail__stat {
  background: var(--ui-bg-soft, #f8fafc);
  border: 1px solid var(--ui-line-soft);
  border-radius: 10px;
  padding: 10px 8px; text-align: center;
}
.dev-detail__stat-num { display: block; font-size: 15px; font-weight: 700; color: var(--ui-fg); }
.dev-detail__stat-label { display: block; font-size: 10px; color: var(--ui-fg-muted); margin-top: 2px; }

.dev-detail__section {
  background: var(--ui-bg-soft, #f8fafc);
  border: 1px solid var(--ui-line-soft);
  border-radius: 12px;
  padding: 4px 14px;
  margin-bottom: 12px;
}

.dev-detail__currency {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.dev-detail__currency-title { font-size: 11px; color: #92400e; font-weight: 600; }

/* 卡片上"绑定用户"行 */
.dev-item__assigned {
  display: flex; align-items: center; gap: 6px;
  margin: 6px 0 8px;
  padding: 6px 10px;
  background: var(--ui-bg-soft, #f8fafc);
  border-radius: 10px;
  font-size: 12px;
}
.dev-item__assigned i { color: var(--ui-fg-muted); font-size: 13px; }
.dev-item__assigned-label { color: var(--ui-fg-muted); margin-right: 4px; }
.dev-user {
  display: inline-block; padding: 2px 9px; border-radius: 100px;
  background: var(--ui-primary); color: #fff; font-size: 11px; font-weight: 500;
  margin: 0 2px;
}
.dev-user--empty { background: var(--ui-surface-2, #e2e8f0); color: var(--ui-fg-muted, #64748b); }
.dev-detail__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dev-detail__name-row .dev-detail__name { flex: 0 0 auto; }
.dev-detail__name-row .dev-detail__chip { margin-left: auto; }
/* 弹窗横幅：信息不拉伸，状态chip紧贴账号名，消除右侧大片空白 */
.dev-detail__banner-info { flex: 0 1 auto; min-width: 0; }
.dev-detail__banner .dev-detail__name-row { display: flex; align-items: center; gap: 10px; }
.dev-detail__banner .dev-detail__chip { margin-left: 0; }
/* 横幅状态chip：强制紧贴账号名，消除中间空白 */
.dev-detail__banner { justify-content: flex-start; }
.dev-detail__banner-info { flex: 0 1 auto !important; min-width: 0; }
.dev-detail__banner .dev-detail__name-row { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
.dev-detail__banner .dev-detail__chip { margin-left: 0 !important; }
/* 卡片"上次执行"标签行 */
.dev-tags--last-task {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
  padding: 6px 10px;
  background: var(--ui-bg-soft, #f8fafc);
  border-radius: 10px;
  font-size: 12px;
}
.dev-tags--last-task .dev-item__assigned-label { margin-right: 4px; }
/* 弹窗横幅：状态chip固定在右上角 */
.dev-detail__banner { justify-content: space-between; }
.dev-detail__banner-info { flex: 1 !important; min-width: 0; }
.dev-detail__banner .dev-detail__chip { flex-shrink: 0; }
/* 弹窗：去掉头像后，状态chip固定在"上次执行日期"容器右上角 */
.dev-detail__stats { position: relative; }
.dev-detail__stats > .dev-detail__chip {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  margin-left: 0;
}
/* 账号详情弹窗：标题 + 紧凑布局 */
.dev-detail__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ui-fg);
  margin-bottom: 8px;
}
.dev-detail__banner {
  padding: 12px 14px !important;
  margin-bottom: 8px !important;
}
/* 账号详情标题加大 + 横幅备注 */
.dev-detail__title { font-size: 22px !important; font-weight: 800; }
.dev-detail__memo {
  font-size: 13px;
  color: var(--ui-fg);
  margin-top: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 4px 10px;
  display: inline-block;
}
/* 账号详情弹窗：紧凑头部（账号名+备注+右上角chip），无渐变大块 */
.dev-detail__top {
  position: relative;
  padding: 4px 0 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.dev-detail__top .dev-detail__name { font-size: 18px; font-weight: 700; color: var(--ui-fg); padding-right: 64px; word-break: break-all; }
.dev-detail__top .dev-detail__meta { font-size: 12px; color: var(--ui-fg-muted); margin-top: 2px; }
.dev-detail__top .dev-detail__memo {
  font-size: 12px;
  color: var(--ui-fg);
  margin-top: 5px;
  background: var(--ui-bg-soft, #f8fafc);
  border-radius: 8px;
  padding: 5px 10px;
  display: inline-block;
}
.dev-detail__top .dev-detail__chip { position: absolute; top: 0; right: 0; }
.dev-detail__stats { position: static; }
/* 卡片"绑定用户"用户名：改用深色字+浅底，确保清晰可见 */
.dev-user {
  background: var(--ui-accent-soft, #e0f2fe) !important;
  color: var(--ui-accent, #0369a1) !important;
}
.dev-user--empty { background: #e2e8f0 !important; color: #64748b !important; }
/* 卡片"绑定用户"用户名：统一主文字色，深浅模式均清晰 */
.dev-user {
  background: var(--ui-surface-2, #f1f5f9) !important;
  color: var(--ui-fg, #111827) !important;
  border: 1px solid var(--ui-line-soft, #e2e8f0);
}
.dev-user--empty { background: var(--ui-surface-2, #f1f5f9) !important; color: var(--ui-fg-muted, #64748b) !important; }
/* 搜索栏紧凑化：移动端友好 */
.search-bar { position: relative; }
.search-bar input { transition: border-color .15s; }
.search-bar input:focus { border-color: var(--ui-accent) !important; outline: none; }
/* 内嵌放大镜图标 */
.search-bar__icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ui-fg-muted); font-size: 14px; pointer-events: none; z-index: 1;
}
.search-bar--with-icon input { padding-left: 30px !important; }
/* 紧凑按钮：窄屏缩成纯图标 */
.search-bar .btn { padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.search-bar .btn--icon-only i { font-size: 14px; }
@media (max-width: 768px) {
  .search-bar { gap: 6px !important; }
  .search-bar .btn--hide-text-mobile span.btn-txt { display: none; }
  .search-bar .btn--hide-text-mobile { padding: 7px 10px; }
}
/* 覆盖：移动端搜索栏保持单行（不竖排），紧凑排列 */
@media (max-width: 768px) {
  .search-bar {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 8px 10px;
  }
  .search-bar input[type="date"] {
    min-width: 0 !important;
    width: auto !important;
    flex: 1 1 auto !important;
    max-width: 108px;
    padding: 6px 4px !important;
    font-size: 11px !important;
  }
  .search-bar .search-bar__sep,
  .search-bar > span { flex-shrink: 0; }
  .search-bar input[type="text"] { min-width: 0 !important; }
}
/* 覆盖修正：移动端搜索栏单行 + 按钮收紧 + 日期定宽，杜绝溢出 */
@media (max-width: 768px) {
  .search-bar { flex-direction: row !important; align-items: center !important; flex-wrap: nowrap !important; padding: 8px 10px; }
  .search-bar input[type="text"] { flex: 1 1 0 !important; min-width: 0 !important; padding: 7px 10px !important; }
  .search-bar input[type="date"] { flex: 0 0 auto !important; width: 92px !important; min-width: 0 !important; max-width: none !important; padding: 6px 2px !important; font-size: 11px !important; }
  .search-bar .search-bar__sep, .search-bar > span { flex: 0 0 auto !important; }
  .search-bar .btn { flex: 0 0 auto !important; padding: 6px 9px !important; min-width: 0 !important; }
  .search-bar .btn--hide-text-mobile span.btn-txt { display: none !important; }
  .search-bar .btn--hide-text-mobile { padding: 6px 9px !important; }
}
/* 修正：移动端搜索按钮恢复按内容宽度（覆盖旧 width:100% 撑满规则） */
@media (max-width: 768px) {
  .search-bar .btn { width: auto !important; min-width: 0 !important; max-width: none !important; flex: 0 0 auto !important; }
}

/* ═══════════════════════════════════════════════════
   深色模式：硬编码颜色覆盖
   ═══════════════════════════════════════════════════ */
[data-theme="dark"] .dev-detail__currency {
  background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(245,158,11,.06));
  border-color: rgba(245,158,11,.25);
}
[data-theme="dark"] .dev-detail__currency-title {
  color: #fbbf24;
}
[data-theme="dark"] .dev-user {
  background: var(--ui-surface-2) !important;
  color: var(--ui-fg) !important;
  border-color: var(--ui-line-soft);
}
/* 统一卡片与顶部统计条宽度：严格同宽、右缘对齐 */
.dev-statbar,
.dev-item {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
}
.dev-statbar__counts { margin-left: auto; }
/* 统计条计数贴右缘，与卡片同宽对齐（覆盖任何干扰） */
.dev-statbar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.dev-statbar__counts {
  margin-left: auto !important;
  justify-content: flex-end !important;
}
.dev-item {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* 决定性修复：统计条强制 flex + 两端对齐，counts 贴右缘 */
.dev-statbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: var(--ui-surface);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid var(--ui-line-soft);
  margin-bottom: 12px;
}
.dev-statbar__total { flex-shrink: 0; font-size: 13px; color: var(--ui-fg-muted); }
.dev-statbar__total b { color: var(--ui-fg); font-size: 15px; }
.dev-statbar--tasks .dev-statbar__counts { flex-shrink: 0; display: flex !important; flex-direction: column !important; justify-content: center !important; gap: 0 !important; font-size: 11px; color: var(--ui-fg-muted); }
.dev-statbar__row { display: flex; align-items: center; gap: 4px; flex: 1; line-height: 1; }
.dev-statbar__label { font-size: 10px; color: var(--ui-fg-muted); font-weight: 400; min-width: 28px; text-align: right; display: inline-block; }
/* 移动端：重试按钮触摸友好尺寸 */
@media (max-width: 768px) {
  .task-actions [data-retry],
  #btnRetryDetail {
    min-height: 36px;
    min-width: 56px;
    padding: 8px 16px;
    font-size: 13px;
  }
  }

/* ===== 协议同意弹窗（登录后强制显示） ===== */
.agreement-consent-overlay {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: agFadeIn .3s ease;
}
@keyframes agFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.agreement-consent-modal {
  background: var(--ui-surface);
  border-radius: 20px;
  width: 100%; max-width: 500px; max-height: 82vh;
  display: flex; flex-direction: column;
  box-shadow: 0 4px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06) inset;
  overflow: hidden;
  animation: agSlideUp .35s cubic-bezier(.22,.61,.36,1);
}
@keyframes agSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.agreement-consent-header {
  padding: 28px 28px 0;
  text-align: center;
  flex-shrink: 0;
}
.agreement-consent-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ui-fg);
}
.agreement-consent-date {
  font-size: 12px;
  color: var(--ui-fg-muted);
  margin: 6px 0 0;
  letter-spacing: .02em;
}
.agreement-consent-body {
  padding: 16px 28px 0;
  flex: 1;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.agreement-consent-body > p {
  font-size: 13px;
  color: var(--ui-fg-muted);
  margin: 0 0 14px;
  text-align: center;
  line-height: 1.6;
}
.agreement-consent-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 2;
  color: var(--ui-fg);
  white-space: pre-wrap;
  max-height: clamp(160px, calc(82vh - 330px), 420px);
  background: var(--ui-bg);
  border: 1px solid var(--ui-line-soft);
}
.agreement-consent-scroll::-webkit-scrollbar {
  width: 4px;
}
.agreement-consent-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.agreement-consent-scroll::-webkit-scrollbar-thumb {
  background: var(--ui-line);
  border-radius: 4px;
}
.agreement-consent-footer {
  padding: 0 28px 28px;
  text-align: center;
  flex-shrink: 0;
}
.agreement-consent-btn {
  width: 100%;
  padding: 13px 24px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  transition: all .25s !important;
}
.agreement-consent-btn:not(:disabled) {
  background: var(--ui-accent) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.agreement-consent-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99,102,241,0.45);
}
.agreement-consent-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.agreement-consent-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ui-fg-muted);
  text-decoration: none;
  transition: color .2s;
}
.agreement-consent-link:hover {
  color: var(--ui-accent);
}

@media (max-width: 640px) {
  .agreement-consent-overlay {
    padding: 12px;
    align-items: flex-end;
  }
  .agreement-consent-modal {
    border-radius: 20px 20px 8px 8px;
    max-height: 88vh;
  }
  .agreement-consent-header {
    padding: 22px 22px 0;
  }
  .agreement-consent-header h2 {
    font-size: 18px;
  }
  .agreement-consent-body {
    padding: 12px 22px 0;
  }
  .agreement-consent-scroll {
    padding: 14px;
    font-size: 12px;
    max-height: clamp(140px, calc(88vh - 300px), 340px);
  }
  .agreement-consent-footer {
    padding: 0 22px 22px;
  }
  .agreement-consent-btn {
    font-size: 14px !important;
    padding: 12px 20px !important;
  }
}