:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg-base: #090d16;
  --bg-gradient: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 45%, #090d16 100%);
  --card-bg: rgba(30, 41, 59, 0.72);
  --card-hover: rgba(30, 41, 59, 0.88);
  --card-inner: rgba(255, 255, 255, 0.035);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.18);
  --glass-surface-rgb: 16, 24, 40;
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-border-soft: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.5);
  --glass-shadow: rgba(0, 0, 0, 0.42);
  --glass-inner-surface: rgba(255, 255, 255, 0.045);
  --glass-opacity: 0.65;
  --glass-blur: 20px;
  --border-glow-intensity: 1.0;
  --liquid-sheen-intensity: 1.0;
  --rim-half: 34deg;
  --rim-q: 12deg;
  --rim-mid: 24deg;
  --rim-end: 64deg;
  --accent-glow-rgb: 56, 189, 248;
  --accent-glow-sec-rgb: 139, 92, 246;
  --primary: #0078D4;
  --primary-hover: #0284C7;
  --accent: #38BDF8;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --text-main: #F8FAFC;
  --text-sub: #94A3B8;
  --text-muted: #64748B;
  --terminal-bg: rgba(5, 8, 15, 0.9);
  --modal-bg: #131c2e;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background: var(--bg-gradient);
  background-color: var(--bg-base);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  position: relative;
  isolation: isolate;
  transition: background 0.3s ease, color 0.3s ease;
}

/* WebGL2 全屏动态着色器背景画布 */
.bg-webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}

/* iOS 液态玻璃风格：模糊折射、静态材质渐变与边缘高光 */
.glass-surface.glass-surface {
  --glass-local-sheen: 1;
  background:
    linear-gradient(
      142deg,
      rgba(255, 255, 255, calc(0.085 * var(--liquid-sheen-intensity) * var(--glass-local-sheen))) 0%,
      rgba(255, 255, 255, 0.012) 32%,
      rgba(var(--accent-glow-rgb), calc(0.018 * var(--liquid-sheen-intensity) * var(--glass-local-sheen))) 68%,
      rgba(255, 255, 255, calc(0.045 * var(--liquid-sheen-intensity) * var(--glass-local-sheen))) 100%
    ),
    rgba(var(--glass-surface-rgb), var(--glass-opacity));
  backdrop-filter: blur(var(--glass-blur)) saturate(175%) contrast(108%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(175%) contrast(108%);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 22px 54px -20px var(--glass-shadow),
    0 2px 10px -5px var(--glass-shadow),
    inset 0 1px 1px rgba(255, 255, 255, calc(0.42 * var(--border-glow-intensity))),
    inset 0 -1px 1px rgba(0, 0, 0, 0.13),
    inset 0 0 24px rgba(255, 255, 255, calc(0.022 * var(--liquid-sheen-intensity)));
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background-color 0.28s ease;
}

/* 鼠标位置只驱动边框上的高光弧，不照亮卡片表面 */
body.mouse-follow-enabled .glass-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  pointer-events: none;
  z-index: 4;
  opacity: calc(min(1.5, var(--border-glow-intensity)) * 0.92);
  background: conic-gradient(
    from calc(var(--pointer-angle, -90deg) - var(--rim-half)),
    transparent 0deg,
    rgba(var(--accent-glow-rgb), 0.18) var(--rim-q),
    rgba(var(--accent-glow-rgb), 0.78) var(--rim-mid),
    var(--glass-highlight) var(--rim-half),
    rgba(255, 255, 255, 0.48) calc(var(--rim-half) + var(--rim-q)),
    transparent var(--rim-end),
    transparent 180deg,
    rgba(255, 255, 255, 0.16) calc(180deg + var(--rim-q)),
    transparent calc(180deg + var(--rim-mid)),
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  transition: opacity 0.2s ease;
}

.glass-surface > * {
  position: relative;
  z-index: 2;
}

/* 内层信息块保持低对比度，避免玻璃卡片套玻璃卡片后显得浑浊 */
.glass-surface .card-inner,
.glass-surface .acc-stat-box,
.glass-surface .browser-metric-row,
.glass-surface .timeline-item,
.glass-surface .diag-item-card,
.glass-surface .epic-record-row,
.glass-surface .step-action-box {
  background: var(--glass-inner-surface);
  border-color: var(--glass-border-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, calc(0.08 * var(--border-glow-intensity)));
}

.glass-surface .modal-box {
  --glass-local-sheen: 0.72;
}

.app-container {
  container-type: inline-size;
  container-name: app;
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== 顶层功能选项卡（微软积分 / Epic 游戏 / 施工中）===== */
.app-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px;
  gap: 3px;
  flex-shrink: 0;
}

.app-tab {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.app-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.app-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35);
}

.header-actions .btn {
  border-radius: 999px;
}

/* 选项卡面板：同一时刻只显示一个，切换时整页内容完全不同 */
.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-panel.active {
  display: flex;
}

/* 尚未实现的模块占位 */
.wip-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 70px 24px;
  text-align: center;
}

.wip-icon {
  font-size: 40px;
  line-height: 1;
}

.wip-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

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

/* ===== Epic 免费游戏领取 ===== */
.epic-demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.13), rgba(56, 189, 248, 0.04));
  color: var(--text-sub);
  font-size: 12.5px;
  line-height: 1.6;
}

.epic-demo-tag {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

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

.epic-stat-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  position: relative;
  overflow: hidden;
}

.epic-stat-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.55), transparent);
}

.epic-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 18px;
  background: rgba(56, 189, 248, 0.12);
}

.epic-stat-icon.pending { background: rgba(245, 158, 11, 0.14); }
.epic-stat-icon.accounts { background: rgba(16, 185, 129, 0.14); }
.epic-stat-icon.checked { background: rgba(148, 163, 184, 0.14); }

.epic-stat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.epic-stat-value {
  font-size: 23px;
  line-height: 1.15;
  color: var(--text-main);
  white-space: nowrap;
}

.epic-stat-value-time {
  font-size: 14px;
  font-weight: 700;
}

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

.epic-games-container,
.epic-games-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.epic-game-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 15px;
  background: var(--card-inner);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.epic-game-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.epic-game-card.card-upcoming {
  opacity: 0.92;
  border-style: dashed;
}

/* 卡片悬停各账号在库详情 Tooltip */
.epic-game-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--modal-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 250px;
  max-width: 320px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(24px);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.epic-game-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--border-light) transparent transparent transparent;
}

.epic-game-card:hover .epic-game-tooltip,
.epic-game-card:focus-within .epic-game-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.epic-tooltip-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
}

.epic-tooltip-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  padding: 5px 0;
}

.epic-tooltip-row:not(:last-child) {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.epic-tooltip-acc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.epic-tooltip-acc.claimed { color: #34D399; }
.epic-tooltip-acc.owned { color: #38BDF8; }
.epic-tooltip-acc.pending { color: #F59E0B; }

.epic-tooltip-time {
  font-size: 10px;
  color: var(--text-muted);
}

.epic-game-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(135deg, hsl(var(--cover-h, 205) 65% 40%), hsl(calc(var(--cover-h, 205) + 42) 70% 25%));
}

.epic-game-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.epic-game-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
}

.epic-game-cover-fallback span {
  font-size: 36px;
  font-weight: 800;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.epic-game-cover-fallback small {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.75);
}

.epic-game-free-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.epic-game-free-tag.tag-now {
  background: rgba(16, 185, 129, 0.85);
  color: #fff;
}

.epic-game-free-tag.tag-upcoming {
  background: rgba(245, 158, 11, 0.88);
  color: #fff;
}

.epic-game-card-body {
  padding: 12px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.epic-game-card-title {
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.epic-game-card-deadline {
  color: var(--text-sub);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.epic-game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 13px 12px;
}

.epic-game-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.epic-game-status.pending { color: #F59E0B; }
.epic-game-status.partial { color: #38BDF8; }
.epic-game-status.complete { color: #34D399; }

.epic-game-card-footer .btn {
  font-size: 11px;
  padding: 5px 8px;
}

/* Epic 周期预设按钮与游戏分组 */
.epic-games-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.epic-cycle-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  padding: 3px 6px;
  border-radius: 999px;
}

.epic-cycle-label {
  font-size: 11px;
  color: var(--text-sub);
  margin-left: 4px;
}

.cycle-pill {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cycle-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.cycle-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35);
}

.epic-games-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.epic-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.group-badge.free-now {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
}

.group-badge.upcoming {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FBBF24;
}

.group-count {
  font-size: 11.5px;
  color: var(--text-sub);
}

.epic-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
}

@media (max-width: 1100px) {
  .epic-cards-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 580px) {
  .epic-cards-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.epic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: start;
}

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

.epic-account-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--card-inner);
}

.epic-account-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.epic-account-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.epic-account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(16, 185, 129, 0.18));
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.epic-account-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.epic-account-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epic-account-order {
  font-size: 10.5px;
  color: var(--text-muted);
}

.epic-account-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.epic-account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.epic-account-meta-item {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.epic-account-meta-item span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  margin-bottom: 2px;
}

.epic-account-meta-item strong {
  display: block;
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.epic-account-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 5px 4px;
  font-size: 10.5px;
  white-space: nowrap;
}

.epic-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.epic-badge.ok { background: rgba(16, 185, 129, 0.15); color: #34D399; border-color: rgba(16, 185, 129, 0.35); }
.epic-badge.err { background: rgba(239, 68, 68, 0.15); color: #F87171; border-color: rgba(239, 68, 68, 0.35); }
.epic-badge.warn { background: rgba(245, 158, 11, 0.16); color: #F59E0B; border-color: rgba(245, 158, 11, 0.35); }
.epic-badge.idle { background: rgba(148, 163, 184, 0.14); color: var(--text-sub); }

.epic-side {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.epic-side-card {
  padding: 20px;
  border-radius: 16px;
  gap: 15px;
}

.epic-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.epic-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.epic-setting-row > span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.epic-setting-row strong {
  color: var(--text-main);
  font-size: 12px;
}

.epic-setting-row small {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.epic-setting-switch input {
  width: 38px;
  height: 21px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.epic-setting-input {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.epic-setting-input input {
  width: 68px;
  padding: 6px 7px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 12px;
  outline: none;
}

.epic-setting-input input:focus {
  border-color: var(--accent);
}

/* 时间选择器比数字输入宽：HH:MM 加上浏览器自带的时钟按钮需要更多横向空间 */
.epic-setting-input input[type="time"] {
  width: 104px;
}

.epic-setting-input em {
  color: var(--text-muted);
  font-size: 10.5px;
  font-style: normal;
}

.epic-browser-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.epic-browser-action {
  flex: 1 1 190px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.55;
}

.epic-browser-meta {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.7;
  word-break: break-word;
}

.epic-records {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.epic-record-row {
  display: grid;
  grid-template-columns: auto 132px minmax(0, 1fr) minmax(150px, 1.1fr);
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
}

.epic-record-time {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.epic-record-title {
  min-width: 0;
  color: var(--text-main);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epic-record-message {
  min-width: 0;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epic-empty {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--text-sub);
  padding: 20px 12px;
  text-align: center;
}

.section-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-sub);
}

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

@media (max-width: 720px) {
  .epic-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .epic-stat-card { padding: 12px; gap: 9px; border-radius: 13px; }
  .epic-stat-icon { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
  .epic-stat-value { font-size: 19px; }
  .epic-stat-value-time { font-size: 12px; }
  .epic-games-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
  .epic-side { grid-template-columns: 1fr; }
  .epic-account-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .epic-record-row { grid-template-columns: auto 1fr; }
  .epic-record-title,
  .epic-record-message { grid-column: 2; }
}

@media (max-width: 480px) {
  .epic-demo-banner { align-items: flex-start; padding: 10px 12px; font-size: 11.5px; }
  .epic-overview { gap: 8px; }
  .epic-stat-card { padding: 10px; gap: 7px; }
  .epic-stat-icon { width: 29px; height: 29px; font-size: 14px; }
  .epic-stat-value { font-size: 17px; }
  .epic-stat-label { font-size: 10.5px; }
  .epic-games-grid { grid-template-columns: 1fr; }
  .epic-account-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .epic-setting-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .epic-setting-input { width: 100%; }
  .epic-setting-input input { flex: 1; width: auto; }
}

/* ===== 微软积分多账号切换栏 (自动换行，无需左右滑动) ===== */
.account-selector-section {
  width: 100%;
}

.account-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap !important;
  width: 100%;
  padding: 2px 0;
}

/* ===== 微软积分操作工具条 ===== */
.ms-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 8px 14px;
  backdrop-filter: blur(20px);
}

.ms-toolbar-scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.ms-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ms-toolbar-actions .btn {
  border-radius: 999px;
}

/* ===== 全部日志弹窗 ===== */
.modal-logs {
  max-width: 920px;
  width: 92vw;
}

.logs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logs-list {
  height: min(56vh, 520px);
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.logs-line {
  display: flex;
  gap: 8px;
  color: #cbd5e1;
}

.logs-line .logs-time { color: #64748b; white-space: nowrap; }
.logs-line .logs-acc { color: #38bdf8; white-space: nowrap; }
.logs-empty { color: #64748b; text-align: center; padding: 20px 0; }

.modal-diagnostics {
  max-width: 980px;
  width: 94vw;
}

.diagnostics-warning {
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  font-size: 12px;
  line-height: 1.65;
}

.diagnostics-meta {
  margin-bottom: 8px;
  color: var(--text-sub);
  font-size: 12px;
}

.diagnostics-preview {
  width: 100%;
  min-height: min(56vh, 620px);
  resize: vertical;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  outline: none;
  background: #0f172a;
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
}

.diagnostics-preview:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

/* Master Header Dashboard */
.header {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 18px;
  box-shadow: var(--shadow-main);
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0284C7, #0369A1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

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

.title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Combined Version & Status Pill */
.version-status-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

.version-status-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.version-status-pill.status-idle {
  background: rgba(16, 185, 129, 0.14);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.version-status-pill.status-running {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* 检测到新版本时的高亮状态 */
.version-status-pill.has-update {
  background: rgba(245, 158, 11, 0.16);
  color: #FBBF24;
  border-color: rgba(245, 158, 11, 0.45);
}

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

.version-status-pill.status-running .status-dot {
  animation: pulse 1.2s infinite;
}

.update-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: pulse 1.5s infinite;
}

/* Dedicated Standalone Multi-Account Selector Section */
.account-selector-section {
  width: 100%;
}

/* Interactive Hardware & Network Metrics Pill */
.sys-metrics-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--card-inner);
  color: var(--text-sub);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.sys-metrics-pill:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-1px);
}

.sys-metrics-pill .metric-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-main);
  font-family: "JetBrains Mono", Consolas, monospace;
}

.sys-metrics-pill .metric-icon {
  font-size: 12px;
}

.sys-metrics-pill .metric-sep {
  color: var(--border-light);
  font-size: 10px;
}

.sys-metrics-pill .metric-refresh-icon {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 2px;
  transition: opacity 0.2s, transform 0.4s;
}

.sys-metrics-pill:hover .metric-refresh-icon {
  opacity: 1;
  color: var(--accent);
}

.sys-metrics-pill.refreshing .metric-refresh-icon {
  animation: spin 0.6s linear infinite;
  color: var(--accent);
}

.refresh-countdown {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.refresh-countdown strong {
  font-family: "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.5px;
  color: #FBBF24;
}

.status-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.status-idle {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-running {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

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

.status-running .status-dot {
  animation: pulse 1.2s infinite;
}

/* Tier 2: Navigation & Action Toolbar */
.header-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  padding: 8px 13px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.badge-mini {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--card-inner);
  color: var(--text-sub);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284C7, #0078D4);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-light);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #1F2937;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.btn-success {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

.btn-warning:hover,
.btn-success:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-text {
  background: transparent;
  color: var(--text-sub);
  border: none;
  font-size: 12px;
  cursor: pointer;
}

.btn-text:hover {
  color: #fff;
}

/* Multi-Account Selector Bar */
.account-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  flex-wrap: wrap;
  overflow-x: visible;
  flex: 1 1 auto;
  min-width: 0;
}

.account-chip {
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.account-chip:hover {
  background: var(--card-hover);
  border-color: var(--border-light);
}

.account-chip.active {
  background: rgba(0, 120, 212, 0.18);
  border-color: rgba(0, 120, 212, 0.5);
  color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.2);
}

.account-chip.active .chip-badge {
  background: rgba(0, 120, 212, 0.25);
  color: var(--accent) !important;
}

.account-chip.active .chip-sub {
  color: var(--accent) !important;
}

.account-chip.status-running {
  border-color: rgba(56, 189, 248, 0.55);
}

.account-chip.status-paused {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.08);
}

.account-chip.status-invalid {
  border-color: rgba(239, 68, 68, 0.5);
}

.account-chip.status-unknown {
  border-color: rgba(148, 163, 184, 0.35);
}

.chip-icon {
  font-size: 13px;
}

.chip-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}

.chip-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", Consolas, monospace;
}

.chip-add {
  background: transparent;
  border: 1px dashed var(--border-light);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
}

.chip-add:hover {
  background: var(--card-inner);
}

/* Accounts Overview Grid in All Mode */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  align-items: start;
}

.account-overview-card {
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: all 0.2s;
  cursor: pointer;
}

.account-overview-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

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

.acc-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1 1 auto;
  min-width: 0; /* 让内部名称可以收缩并显示省略号 */
}

/* 账号名过长时截断为省略号，悬停用即时提示显示完整名称 */
.acc-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 该账号正在执行任务时的高亮徽章 */
.badge-mini.badge-running {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  animation: pulse 1.5s infinite;
}

/* 账号凭据体检状态徽章：有效 / 失效 / 未检测 */
.badge-mini.badge-auth-valid {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.35);
}

.badge-mini.badge-auth-invalid {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.badge-mini.badge-auth-unknown {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-sub);
}

/* 已登录但 Cookie 不完整（例如缺少 _U），需要用户修复 */
.badge-mini.badge-auth-warn {
  background: rgba(245, 158, 11, 0.16);
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-mini.status-running {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.35);
}

.badge-mini.status-paused {
  background: rgba(245, 158, 11, 0.16);
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-mini.status-invalid {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.badge-mini.status-valid {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.35);
}

.badge-mini.status-unknown {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-sub);
}

.account-overview-card.status-running {
  border-color: rgba(56, 189, 248, 0.5);
}

.account-overview-card.status-paused {
  border-color: rgba(245, 158, 11, 0.45);
}

.account-overview-card.status-invalid {
  border-color: rgba(239, 68, 68, 0.45);
}

/* 下次自动启动时间 */
.badge-mini.badge-schedule {
  background: rgba(56, 189, 248, 0.13);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.3);
}

/* 呼吸动效：此前多处引用 pulse 但关键帧从未定义，动效一直是失效的 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.acc-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--glass-border-soft);
  padding: 6px;
  border-radius: 14px;
}

.acc-stat-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.acc-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.acc-stat-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.acc-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.acc-card-actions .btn {
  justify-content: center;
  white-space: nowrap;
  font-size: 11.5px;
  padding: 6px 8px;
}

.acc-card-actions .btn-run-single {
  flex: 1.2;
}

.acc-card-actions .btn-sync-single,
.acc-card-actions .btn-view-acc {
  flex: 1;
}

.acc-more-wrap {
  position: relative;
  display: inline-block;
}

.btn-more-actions {
  padding: 6px 8px !important;
  font-weight: 700;
  letter-spacing: 1px;
}

.acc-more-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--modal-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 6px;
  min-width: 175px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: none;
  flex-direction: column;
  gap: 3px;
}

.acc-more-dropdown.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--card-hover);
  color: var(--accent);
}

.dropdown-sep {
  height: 1px;
  background: var(--border-color);
  margin: 3px 0;
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #FCA5A5;
}

/* 触屏设备没有 hover，按钮常驻展开 */
@media (hover: none) {
  .acc-card-actions {
    max-height: none;
    opacity: 1;
    margin-top: 0;
  }
}

/* Account summary table */
.account-summary-card {
  gap: 12px;
}

.account-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.account-summary-updated {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.account-summary-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--glass-border-soft);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.2);
}

.account-summary-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.account-summary-table th,
.account-summary-table td {
  padding: 11px 12px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.account-summary-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.94);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border-color);
}

.account-summary-table th:first-child,
.account-summary-table td:first-child {
  text-align: left;
}

.account-summary-table tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--text-main);
  font-size: 12px;
}

.account-summary-row {
  cursor: pointer;
  transition: background 0.16s ease;
}

.account-summary-row:hover,
.account-summary-row:focus-visible {
  background: rgba(56, 189, 248, 0.075);
  outline: none;
}

.account-summary-row:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.account-summary-row:last-child td {
  border-bottom: none;
}

.summary-account-cell {
  min-width: 0;
}

.summary-account-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 650;
}

.summary-account-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-account-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94A3B8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.account-summary-row.status-running .summary-account-dot { background: #38BDF8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.17); }
.account-summary-row.status-paused .summary-account-dot { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16); }
.account-summary-row.status-invalid .summary-account-dot { background: #F87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16); }
.account-summary-row.status-valid .summary-account-dot { background: #34D399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }

.summary-account-dot.total {
  background: #FBBF24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16);
}

.summary-trend-trigger {
  display: inline-block;
  min-width: 52px;
  border-bottom: 1px dotted rgba(148, 163, 184, 0.4);
  cursor: help;
  outline: none;
}

.summary-trend-trigger:hover,
.summary-trend-trigger:focus-visible {
  color: #38BDF8;
  border-bottom-color: #38BDF8;
}

.summary-trend-trigger.is-earned {
  color: #34D399;
  font-weight: 700;
}

.summary-trend-trigger.is-claimable {
  color: #38BDF8;
  font-weight: 700;
}

.summary-trend-trigger[data-claim-points] {
  cursor: pointer;
  border-bottom-style: solid;
  border-bottom-color: rgba(56, 189, 248, 0.65);
}

.summary-trend-trigger[data-claim-points]:hover,
.summary-trend-trigger[data-claim-points]:focus-visible {
  color: #7DD3FC;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.summary-trend-trigger.is-claiming {
  opacity: 0.6;
  pointer-events: none;
}

.summary-trend-trigger.is-history {
  color: #A5B4FC;
}

.account-summary-total-row td {
  background: rgba(251, 191, 36, 0.075);
  border-top: 1px solid rgba(251, 191, 36, 0.24);
  color: #FDE68A;
  font-weight: 750;
}

.account-summary-total-empty {
  background:
    linear-gradient(90deg, rgba(251, 191, 36, 0.025), rgba(251, 191, 36, 0.075), rgba(251, 191, 36, 0.025)) !important;
  color: transparent !important;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  right: 2px;
  left: auto;
  width: 1px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.column-resize-handle:hover::after,
body.account-column-resizing .column-resize-handle::after {
  background: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

body.account-column-resizing,
body.account-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.account-summary-empty {
  padding: 28px 12px !important;
  text-align: center !important;
  color: var(--text-muted) !important;
}

.account-trend-tooltip {
  position: fixed;
  z-index: 1000000;
  width: 320px;
  padding: 12px 13px 10px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.68), 0 0 24px rgba(56, 189, 248, 0.16);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.account-trend-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-sub);
  font-size: 11px;
  margin-bottom: 6px;
}

.account-trend-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-size: 12px;
}

.account-trend-head span {
  flex: 0 0 auto;
  color: #38BDF8;
}

.account-trend-chart {
  height: 106px;
  cursor: crosshair;
  touch-action: none;
}

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

.account-trend-axis {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1;
}

.account-trend-grid {
  stroke: rgba(148, 163, 184, 0.09);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.account-trend-line {
  fill: none;
  stroke: #38BDF8;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-trend-dot {
  fill: #7DD3FC;
  stroke: #0EA5E9;
  stroke-width: 2;
}

.account-trend-focus-dot {
  fill: #E0F2FE;
  stroke: #0EA5E9;
  stroke-width: 2.4;
}

.account-trend-crosshair {
  stroke: rgba(125, 211, 252, 0.82);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.account-trend-focus {
  min-height: 20px;
  margin-top: 5px;
  padding: 4px 7px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.08);
  color: #BAE6FD;
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

.account-trend-empty {
  display: grid;
  place-items: center;
  height: 106px;
  color: var(--text-muted);
  font-size: 11px;
}

.account-trend-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 10.5px;
  margin-top: 5px;
}

/* Hero Grid */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* 待领取额外积分卡片 (点击可领) */
.hero-claimable-card {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.hero-claimable-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

.hero-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 24px;
}

.hero-claim-action {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.hero-claimable-card:hover .hero-claim-action {
  background: var(--primary);
  color: #fff;
}

.hero-claimable {
  color: #38BDF8;
}

.hero-account-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: none;
  overflow: visible;
  margin-top: 5px;
  padding: 4px 5px;
  background: rgba(0, 0, 0, 0.11);
  border: 1px solid var(--glass-border-soft);
  border-radius: 10px;
}

.hero-account-breakdown[hidden] {
  display: none;
}

.hero-account-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  padding: 3px 5px;
  font-size: 10.5px;
}

.hero-account-row + .hero-account-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-account-name {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  color: var(--text-sub);
}

.hero-account-value {
  flex: 0 0 auto;
  color: var(--text-main);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hero-account-empty {
  padding: 12px 6px;
  color: var(--text-muted);
  font-size: 10.5px;
  text-align: center;
}

.hero-streak-card .hero-label-row {
  align-items: center;
}

.hero-streak-stamps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #F59E0B;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.stamps-mini-bar {
  width: 100%;
  height: 4px;
  background: var(--card-inner);
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0 2px 0;
}

.stamps-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* 12 印章收集进度网格 (参考微软官网 1,000 奖励印章风格) */
.stamps-grid-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px 4px;
  margin: 7px 0 4px;
  padding: 7px 6px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--glass-border-soft);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.stamp-grid-item {
  width: 100%;
  max-width: 25px;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: help;
}

.stamp-grid-item.collected {
  background: linear-gradient(145deg, #FFD84D 0%, #F5A623 52%, #D97706 100%);
  border: 1.5px solid #FFF0A8;
  box-shadow:
    0 0 14px rgba(245, 158, 11, 0.52),
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    0 3px 7px rgba(120, 53, 15, 0.38);
}

.stamp-grid-item.collected svg {
  fill: #FFF8D6;
  width: 56%;
  height: 56%;
  filter: drop-shadow(0 1px 2px rgba(92, 45, 0, 0.55));
}

.stamp-grid-item.uncollected {
  background: rgba(8, 12, 22, 0.58);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.stamp-grid-item.uncollected svg {
  fill: rgba(148, 163, 184, 0.32);
  width: 56%;
  height: 56%;
}

.stamp-grid-item.is-goal {
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.13),
    0 0 16px rgba(245, 158, 11, 0.2);
}

.stamp-grid-item.is-goal.collected {
  background: linear-gradient(145deg, #FFE56B, #F59E0B 52%, #C2410C);
  border-color: #FFF7C2;
  box-shadow:
    0 0 18px rgba(245, 158, 11, 0.68),
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 3px 8px rgba(120, 53, 15, 0.42);
}

.stamp-grid-item.is-goal.collected svg {
  fill: #FFFFFF;
}

.stamp-grid-item:hover {
  transform: scale(1.15);
}

/* 账号汇总模式：每个账号一行迷你印章，全部展开 */
.stamps-account-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: none;
  overflow: visible;
  margin: 7px 0 3px;
  padding: 5px 6px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--glass-border-soft);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.stamps-account-list[hidden],
.stamps-grid-track[hidden],
.stamps-mini-bar[hidden] {
  display: none;
}

.stamp-account-row {
  padding: 4px 5px 5px;
  border-radius: 8px;
}

.stamp-account-row + .stamp-account-row {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.stamp-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.stamp-account-name {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  color: var(--text-sub);
  font-size: 10.5px;
  font-weight: 600;
}

.stamp-account-count {
  flex: 0 0 auto;
  color: #FBBF24;
  font-size: 10px;
  font-weight: 700;
}

.stamp-account-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}

.mini-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 11px;
  border: 1px solid transparent;
}

.mini-stamp svg {
  width: 64%;
  height: 64%;
}

.mini-stamp.collected {
  background: linear-gradient(145deg, #FFD84D, #F59E0B 58%, #C2410C);
  border-color: #FFF0A8;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.34);
}

.mini-stamp.collected svg {
  fill: #FFF8D6;
}

.mini-stamp.uncollected {
  background: rgba(8, 12, 22, 0.58);
  border-color: rgba(148, 163, 184, 0.28);
}

.mini-stamp.uncollected svg {
  fill: rgba(148, 163, 184, 0.3);
}

.mini-stamp.is-goal.collected {
  box-shadow: 0 0 7px rgba(245, 158, 11, 0.62);
}

.stamp-account-empty {
  padding: 14px 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.hero-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), transparent);
}

.hero-label {
  font-size: 12.5px;
  color: var(--text-sub);
  font-weight: 500;
  white-space: nowrap;
}

.hero-val {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  line-height: 1.1;
}

.hero-earned {
  background: linear-gradient(135deg, #34D399, #10B981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-accent {
  color: var(--accent);
}

.hero-gold {
  color: var(--warning);
}

.hero-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: normal;
  overflow: visible;
  line-height: 1.45;
  margin-top: auto;
}

/* Section Card */
.section-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-main);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  /* 防止在窄屏下被右侧按钮挤成竖排窄列 */
  min-width: min(100%, 240px);
}

.section-sub {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
}

/* 分区标题右侧的操作区：窄屏下自动换行，不再横向溢出 */
.accounts-header-actions,
.task-header-actions,
.history-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Instant Tooltip：悬停立即显示，替代原生 title 的约 1 秒延迟 */
.instant-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: min(440px, calc(100vw - 24px));
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.97);
  color: #E2E8F0;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  white-space: pre-line;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.08s ease, transform 0.08s ease;
}

.instant-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Task List Section & Spacing Alignment (仅在选中单账号时由 JS 显式设置为 flex) */
#task-list-section {
  flex-direction: column;
  gap: 18px;
}

#task-list-section .section-header {
  margin-bottom: 2px;
}

/* Task Grid */
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 14px;
}

.task-card {
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s;
}

.task-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.task-card-featured {
  min-height: 0;
  padding: 13px 15px;
  gap: 8px;
  border-color: rgba(var(--accent-glow-rgb), 0.26);
  box-shadow:
    0 20px 48px -24px var(--glass-shadow),
    inset 0 1px 1px rgba(255, 255, 255, calc(0.34 * var(--border-glow-intensity))),
    inset 0 0 28px rgba(var(--accent-glow-rgb), calc(0.035 * var(--liquid-sheen-intensity)));
}

.task-card-featured .task-icon {
  color: var(--text-main);
  border-color: rgba(var(--accent-glow-rgb), 0.3);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 58%),
    rgba(var(--accent-glow-rgb), 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.24);
}

.task-card-featured .task-name {
  font-size: 15px;
}

.task-card-featured .task-subtext {
  line-height: 1.35;
}

.task-card-featured .progress-wrap {
  gap: 4px;
}

.task-card-featured .streak-7day-wrap {
  margin-top: 2px;
  padding: 9px 11px;
  gap: 5px;
}

.task-card-featured .streak-7day-rail {
  height: 26px;
}

.task-card-clickable {
  cursor: pointer;
}

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

.task-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

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

.task-icon {
  font-size: 22px;
  width: 38px;
  height: 38px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.task-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.45;
}

.pts-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

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

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-sub);
}

.progress-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284C7, #10B981);
  transition: width 0.5s;
}

/* Rewards App 官方矢量图标 */
.rewards-app-icon-wrap {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
}

.rewards-app-icon-fallback {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.rewards-app-official-icon {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 7px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.32));
}

/* 官网原生 7 日连续打卡进度轨 (严格参考微软官网 Image #1) */
.streak-7day-wrap {
  margin-top: auto;
  padding: 11px 12px 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 58%),
    rgba(0, 0, 0, 0.13);
  border: 1px solid var(--glass-border-soft);
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065);
}

.streak-7day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  gap: 8px;
}

.streak-7day-title {
  color: var(--text-sub);
  font-weight: 600;
}

.streak-7day-badge {
  color: rgb(var(--accent-glow-rgb));
  font-weight: 700;
  background: rgba(var(--accent-glow-rgb), 0.11);
  border: 1px solid rgba(var(--accent-glow-rgb), 0.18);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  white-space: nowrap;
}

.streak-7day-rail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 1px;
}

.streak-7day-line {
  position: absolute;
  left: 11px;
  right: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.19);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.streak-7day-line-fill {
  position: absolute;
  left: 11px;
  height: 2px;
  max-width: calc(100% - 33px);
  background: linear-gradient(90deg, rgb(var(--accent-glow-sec-rgb)), rgb(var(--accent-glow-rgb)));
  box-shadow: 0 0 9px rgba(var(--accent-glow-rgb), 0.45);
  z-index: 2;
  transition: width 0.4s ease;
}

.streak-step-node {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  cursor: help;
}

/* 已打卡的前序天：实心白灰浅色圆圈带黑色对勾 (完全对齐官网 Image #1) */
.streak-step-node.done-circle {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(223, 227, 235, 0.92));
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

/* 当前已打卡的高亮里程碑：黑色圆角药丸带 ✓ N (完全对齐官网 Image #1) */
.streak-step-node.active-pill {
  height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(145deg, #27272a, #0b0b0d);
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.16),
    0 2px 6px rgba(0, 0, 0, 0.45);
}

/* 未打卡天：空心微透白圈 (完全对齐官网 Image #1) */
.streak-step-node.pending-circle {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 第 7 天目标大奖药丸 (✦ 100) */
.streak-step-node.goal-pill {
  height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.25s ease;
}

.streak-step-node.goal-pill.pending {
  background: rgba(255, 255, 255, 0.055);
  border: 1.5px solid rgba(255, 255, 255, 0.31);
  color: rgba(255, 255, 255, 0.85);
}

.streak-step-node.goal-pill.done {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border: 1.5px solid #FDE68A;
  color: #111827;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.streak-step-node:hover {
  transform: scale(1.15);
}

/* 视觉配置中心样式 */
.visual-settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.visual-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

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

.range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.range-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 7px;
  border-radius: 999px;
}

.form-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.preset-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Browser Monitor Card Styling (v1.4.0) */
.browser-monitor-card {
  position: relative;
}

.browser-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.browser-status-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.browser-monitor-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.browser-metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 16px;
}

.browser-metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.browser-metric-lbl {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.browser-metric-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-action-banner {
  background: var(--card-bg);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Slot Presets Pill Buttons */
.slot-presets-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.slot-pill-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.slot-pill-btn:hover {
  border-color: var(--border-light);
  color: var(--text-main);
  transform: translateY(-1px);
}

.slot-pill-btn.active {
  background: linear-gradient(135deg, #0284C7, #0078D4);
  border-color: transparent;
  color: #FFFFFF !important;
  box-shadow: 0 3px 10px rgba(0, 120, 212, 0.35);
}

.run-hour-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.run-hour-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 7px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-inner);
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
}

.run-hour-option:hover {
  border-color: rgba(56, 189, 248, 0.32);
  color: var(--text-main);
}

.run-hour-option:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.52);
  background: rgba(2, 132, 199, 0.16);
  color: var(--accent);
}

.run-hour-option.is-occupied,
.run-hour-option.is-occupied:has(input:checked) {
  border-color: rgba(245, 158, 11, 0.58);
  background: rgba(245, 158, 11, 0.14);
  color: #FBBF24;
}

.run-hour-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.run-hour-option.is-disabled:hover {
  border-color: rgba(245, 158, 11, 0.58);
  color: #FBBF24;
}

.run-hour-occupied-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #F59E0B;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.7);
}

.run-hour-option input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--primary);
}

/* Bottom Grid: Timeline + Terminal */
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}

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

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-main);
  background: var(--card-inner);
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.timeline-time {
  color: var(--text-sub);
  font-size: 11px;
  font-family: monospace;
}

.timeline-tag {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* Terminal */
.terminal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.terminal-auto-scroll {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.terminal-box {
  background: rgba(5, 8, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  height: 320px;
  overflow-y: auto;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: #E2E8F0;
}

.log-line {
  margin-bottom: 4px;
  word-break: break-all;
}

.log-time {
  color: #64748B;
  margin-right: 6px;
}

/* 日志行内的账号归属标签 */
.log-acc {
  color: #38BDF8;
  font-weight: 700;
}

.log-acc-system {
  color: #94A3B8;
  font-weight: 600;
}

.log-empty {
  color: #64748B;
  text-align: center;
  padding: 40px 0;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 0 20px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  background: var(--modal-bg);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.novnc-modal-box {
  width: min(94vw, 1400px);
  height: min(86vh, 900px);
  max-width: 96vw;
  max-height: 92vh;
  min-width: 640px;
  min-height: 420px;
  resize: both;
  overflow: hidden;
}

.novnc-modal-box.novnc-maximized {
  width: 98vw !important;
  height: 94vh !important;
  max-width: none !important;
  min-width: 0;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-save-status {
  margin-right: auto;
  align-self: center;
  color: var(--text-muted);
  font-size: 12px;
}

.settings-save-status.ok {
  color: #34D399;
}

.settings-save-status.err {
  color: #F87171;
}

.settings-save-status.warn {
  color: #FBBF24;
}

/* Epic 领取成功庆祝层 */
.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(10px);
}

.celebration-layer.show {
  display: flex;
}

.celebration-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.celebration-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 94vw);
  padding: 34px 30px 26px;
  border-radius: 18px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: var(--modal-bg);
  color: var(--text-main);
  text-align: center;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46), 0 0 0 1px rgba(16, 185, 129, 0.08) inset;
  animation: celebration-pop 0.46s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.celebration-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #10B981, #38BDF8, #F59E0B);
}

.celebration-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--success);
}

.celebration-title {
  margin: 10px 0 8px;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
  color: var(--text-main);
}

.celebration-message {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}

.celebration-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  text-align: left;
}

.celebration-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-inner);
  font-size: 12.5px;
  line-height: 1.45;
}

.celebration-item strong {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.celebration-item span {
  color: var(--text-sub);
}

.celebration-note {
  margin-top: 12px;
  color: var(--warning);
  font-size: 12px;
  line-height: 1.6;
}

.celebration-note:empty {
  display: none;
}

.celebration-close {
  width: 100%;
  margin-top: 22px;
  justify-content: center;
}

@keyframes celebration-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.action-status-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.65;
}

.action-progress-track {
  width: 100%;
  height: 8px;
  margin-top: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.action-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
  transition: width 0.35s ease;
}

.action-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
}

.action-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  font-size: 12px;
}

.action-step.active {
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(2, 132, 199, 0.12);
}

.action-step.done {
  color: #34D399;
}

.action-result {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.7;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border-color);
  white-space: pre-wrap;
}

.action-live-log {
  display: none;
  margin-top: 14px;
  max-height: 190px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.epic-login-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Tabs & Steps */
.tabs-nav, .steps-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.tab-btn, .step-nav-item {
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active, .step-nav-item.active {
  background: rgba(2, 132, 199, 0.18);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.4);
}

.tab-content, .step-content {
  display: none;
}

.tab-content.active, .step-content.active {
  display: block;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 13px;
}

.form-select {
  color-scheme: dark;
  background-color: #111827;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #94A3B8 50%),
    linear-gradient(135deg, #94A3B8 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.form-select option,
.form-select optgroup {
  background: #111827;
  color: #F8FAFC;
}

.form-select option:checked {
  background: #1D4ED8;
  color: #FFFFFF;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.credential-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

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

.form-grid-2 > .form-group {
  min-width: 0;
  margin-bottom: 0;
}

/* 多代理配置 */
.account-proxy-panel,
.proxy-policy-panel,
.notify-proxy-panel {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-inner);
}

.notify-proxy-panel {
  border-color: rgba(56, 189, 248, 0.26);
  background: rgba(2, 132, 199, 0.06);
}

.notify-proxy-input-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.notify-proxy-input-row .form-input {
  flex: 1 1 auto;
  min-width: 0;
}

.notify-proxy-input-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

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

.notify-channel-head .form-label {
  margin-bottom: 0;
}

.notify-proxy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
}

.notify-proxy-toggle input {
  margin: 0;
  accent-color: var(--accent);
}

.notify-test-actions {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.notify-test-actions .btn {
  white-space: nowrap;
}

/* 推送规则开关区（v1.10.22） */
.notify-report-panel {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.05);
}

.notify-report-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text);
  font-size: 12.5px;
}

.notify-report-toggle input {
  margin: 0;
  accent-color: var(--accent);
}

.notify-report-panel .form-hint {
  margin-top: 8px;
  display: block;
}

.notify-report-panel code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.18);
  font-size: 11.5px;
}

.guide-network-summary {
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: rgba(2, 132, 199, 0.08);
  color: var(--text-sub);
  font-size: 11.5px;
  line-height: 1.6;
}

.guide-network-summary:empty {
  display: none;
}

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

.proxy-section-head > div,
.proxy-section-title > div {
  min-width: 0;
}

.proxy-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.proxy-section-title small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 400;
}

.proxy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.proxy-card {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.proxy-card.is-default {
  border-color: rgba(56, 189, 248, 0.38);
}

.proxy-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.proxy-card-index {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.proxy-default-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.12);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
}

.proxy-card-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(240px, 1.45fr);
  gap: 9px;
}

.proxy-field {
  min-width: 0;
}

.proxy-field label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10.5px;
}

.proxy-card-assignments {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--glass-border-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.proxy-assignments-label {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
}

.proxy-assignment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proxy-assignment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--text-main);
  font-size: 10.5px;
}

.proxy-assignment-chip > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.proxy-assignment-chip small {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 9.5px;
}

.proxy-assignment-empty {
  color: var(--text-muted);
  font-size: 10.5px;
}

.proxy-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.proxy-card-actions .btn {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 11.5px;
}

.proxy-card-status {
  min-height: 16px;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.proxy-card-status.ok {
  color: #34D399;
}

.proxy-card-status.warn {
  color: #F59E0B;
}

.proxy-card-status.err {
  color: #F87171;
}

.proxy-empty {
  padding: 18px 14px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.proxy-policy-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 14px;
}

.proxy-policy-panel .form-group {
  margin-bottom: 0;
}

.network-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.network-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-inner);
  color: var(--text-sub);
  cursor: pointer;
}

.network-mode-option:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(2, 132, 199, 0.14);
  color: var(--text-main);
}

.network-mode-option input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.network-mode-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.network-mode-option strong {
  font-size: 12.5px;
}

.network-mode-option small {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

/* 凭据输入：默认隐藏内容，右侧眼睛按钮切换明文 */
.secret-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.secret-field .form-input {
  padding-right: 38px;
}

.secret-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.secret-toggle:hover {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-main);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

.step-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
  line-height: 1.5;
}

.step-action-box {
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
}

.step-action-box p {
  margin-bottom: 8px;
}

.step-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.hint-msg {
  margin-top: 8px;
  font-size: 12.5px;
}

.hint-msg.ok {
  color: #34D399;
}

.hint-msg.warn {
  color: #F59E0B;
}

.hint-msg.err {
  color: #EF4444;
}

/* Diagnosis Modal Styling */
.modal-diag {
  max-width: 620px;
}

.diag-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

.diag-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.diag-banner.ok {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
}

.diag-banner.partial {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
}

.diag-banner.failed {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}

.diag-banner-icon {
  font-size: 32px;
}

.diag-banner-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.diag-banner-sub {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.4;
}

.diag-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* 体检范围选择（单个账号 / 全部账号） */
.diag-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.diag-scope-label {
  font-size: 12.5px;
  color: var(--text-sub);
  white-space: nowrap;
}

.diag-scope-group {
  display: inline-flex;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}

.diag-scope-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.diag-scope-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.diag-account-select {
  flex: 1;
  min-width: 150px;
  max-width: 240px;
  padding: 6px 10px;
  font-size: 12.5px;
}

/* 全部账号体检结果 */
.diag-all-summary {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.diag-all-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diag-all-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
}

.diag-all-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diag-all-detail {
  font-size: 11.5px;
  color: var(--text-muted);
}

.diag-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diag-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diag-item-icon {
  font-size: 18px;
}

.diag-item-name {
  font-size: 13.5px;
  font-weight: 600;
  flex: 1;
}

.diag-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.diag-status-pill.pill-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.diag-status-pill.pill-err {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.diag-status-pill.pill-warn {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.diag-item-body {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.5;
  padding-left: 28px;
}

.diag-summary-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.diag-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.diag-summary-val {
  font-size: 15px;
  font-weight: 700;
  color: #F1F5F9;
}

.diag-tips {
  font-size: 12px;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.25);
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.5;
}

/* History Card & Chart Styling */
.history-card {
  position: relative;
  overflow: visible;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-group {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border-color);
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.pill-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}

.history-chart-wrap {
  position: relative;
  width: 100%;
  padding-top: 10px;
}

.chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 190px;
  padding-bottom: 26px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.chart-bar-wrap {
  width: 100%;
  max-width: 38px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #38BDF8 0%, #0284C7 60%, rgba(2, 132, 199, 0.4) 100%);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.chart-col.today .chart-bar {
  background: linear-gradient(180deg, #34D399 0%, #10B981 60%, rgba(16, 185, 129, 0.4) 100%);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

.chart-col:hover .chart-bar {
  filter: brightness(1.2);
  transform: scaleY(1.04);
}

.chart-val-hint {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  opacity: 0.85;
}

.chart-col.today .chart-val-hint {
  color: #34D399;
}

.chart-date-label {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.chart-col.today .chart-date-label {
  color: #34D399;
  font-weight: 700;
}

/* Tooltip */
.history-tooltip {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65), 0 0 25px rgba(56, 189, 248, 0.25);
  min-width: 220px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.tooltip-header {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tooltip-earned {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #34D399, #10B981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.tooltip-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 0;
  margin-bottom: 8px;
}

.tooltip-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 11.5px;
  color: #CBD5E1;
}

/* 汇总模式下的各账号占比明细 */
.tooltip-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0;
  margin-bottom: 2px;
}

.tooltip-breakdown:has(.tooltip-section-title) {
  max-height: 240px;
  overflow: hidden;
}

.tt-acc-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tt-acc-val {
  flex: 0 0 auto;
  font-weight: 600;
  color: #34D399;
  white-space: nowrap;
}

.tt-acc-val em {
  font-style: normal;
  font-weight: 500;
  color: #94A3B8;
  margin-left: 6px;
}

.tooltip-footer {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* Modern CSS Container Queries (Fluid Resizing for App Container) */
@container app (max-width: 900px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .task-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; }
  .bottom-grid { grid-template-columns: 1fr !important; }
  .browser-metric-row { grid-template-columns: repeat(3, 1fr) !important; }
}

@container app (max-width: 768px) {
  .header { padding: 14px 16px !important; border-radius: 16px !important; gap: 10px !important; }
  .header-top-bar { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; }
  .header-right-group { width: 100% !important; justify-content: flex-start !important; flex-wrap: wrap !important; }
  .hero-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .task-grid { grid-template-columns: 1fr !important; }
  .browser-metric-row { grid-template-columns: repeat(2, 1fr) !important; }
}

@container app (max-width: 480px) {
  .header { padding: 12px 14px !important; border-radius: 14px !important; gap: 10px !important; }
  .logo-icon { width: 36px !important; height: 36px !important; font-size: 20px !important; border-radius: 10px !important; }
  .title { font-size: 16px !important; }
  .badge-version { font-size: 10px !important; padding: 1px 6px !important; }
  
  .header-actions { gap: 5px !important; }
  .header-actions .btn { font-size: 11px !important; padding: 6px 9px !important; border-radius: 8px !important; }

  .account-selector-bar { width: 100% !important; padding-bottom: 2px !important; flex-wrap: wrap !important; overflow-x: visible !important; }
  .account-chip { font-size: 11.5px !important; padding: 6px 11px !important; }

  .sys-metrics-pill { font-size: 10px !important; padding: 4px 8px !important; gap: 5px !important; }
  .refresh-countdown { font-size: 10px !important; padding: 4px 8px !important; }

  .hero-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .hero-card { padding: 12px 10px !important; border-radius: 12px !important; gap: 4px !important; }
  .hero-val { font-size: 20px !important; }
  .hero-label { font-size: 11px !important; }
  .hero-desc { font-size: 10.5px !important; }

  .section-card { padding: 16px 14px !important; border-radius: 14px !important; gap: 14px !important; }
  .section-title { font-size: 14px !important; }
  .task-card { padding: 12px 12px !important; border-radius: 12px !important; }
  .task-card-featured { min-height: 0; }
  .task-name { font-size: 13px !important; }
  .task-icon { width: 32px !important; height: 32px !important; font-size: 18px !important; }
  .streak-7day-wrap { margin-top: 10px; padding: 9px 10px; }

  .account-overview-card { padding: 14px 12px !important; border-radius: 12px !important; }
  .acc-stat-box { gap: 2px !important; }
  .acc-stat-lbl { font-size: 10px !important; }
  .acc-stat-num { font-size: 13px !important; }
  .acc-card-actions { gap: 4px !important; }
  .acc-card-actions .btn { font-size: 11px !important; padding: 5px 8px !important; }

  .browser-metric-row { grid-template-columns: 1fr 1fr !important; padding: 10px 10px !important; gap: 8px !important; }
  .browser-metric-lbl { font-size: 10px !important; }
  .browser-metric-val { font-size: 12px !important; }

  .terminal-box { height: 220px !important; font-size: 11px !important; padding: 10px !important; }
  .timeline { max-height: 200px !important; }
  .chart-container { height: 150px !important; padding-bottom: 20px !important; }

  .modal-box { width: 96vw !important; max-height: 94vh !important; border-radius: 14px !important; }
  .modal-header { padding: 12px 14px !important; }
  .modal-body { padding: 14px 12px !important; }
  .modal-footer { padding: 10px 14px !important; }
  .tab-btn, .step-nav-item { font-size: 11px !important; padding: 5px 8px !important; }
}

/* Universal Responsive Adaptation (Desktop to iPhone 375px) */
@media (max-width: 1140px) {
  .header-top-bar { flex-wrap: nowrap; gap: 10px; }
  .header-right-group { flex-shrink: 0; flex-wrap: nowrap; gap: 8px; }
}

@media (max-width: 860px) {
  .header-top-bar { flex-wrap: wrap; gap: 10px; }
  .header-right-group { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .ms-context-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .ms-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .ms-toolbar-scope-badge {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ms-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .ms-toolbar-actions .btn { flex-shrink: 0; }
}

@media (max-width: 700px) {
  .novnc-modal-box {
    width: 96vw !important;
    height: 88vh !important;
    min-width: 0;
    min-height: 0;
    resize: none;
  }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .task-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
  .browser-metric-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  body { padding: 16px 14px; }
  .app-container, .main-content { gap: 20px; }
  .account-summary-actions { width: 100%; justify-content: space-between; }
  .account-summary-table th,
  .account-summary-table td { padding: 9px 10px; }
  .column-resize-handle { display: none; }
  .header { padding: 14px 16px; border-radius: 16px; gap: 10px; }
  .header-top-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .header-right-group { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .account-selector-bar { flex-wrap: wrap; overflow-x: visible; }
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .task-grid { grid-template-columns: 1fr; }
  .browser-metric-row { grid-template-columns: repeat(2, 1fr); }
  .proxy-card-fields,
  .proxy-policy-panel,
  .form-grid-2 { grid-template-columns: 1fr; }
  .network-mode-options { grid-template-columns: 1fr; }
  .notify-channel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .notify-proxy-input-row { flex-direction: column; }
  .notify-proxy-input-row .btn { width: 100%; }
  .notify-test-actions { flex-wrap: wrap; }
  .run-hour-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  body { padding: 10px 8px; }
  .app-container, .main-content { gap: 14px; }
  .header { padding: 12px 14px; border-radius: 14px; gap: 10px; }
  .logo-icon { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
  .title { font-size: 16px; }
  .proxy-section-head { align-items: stretch; flex-direction: column; }
  .proxy-section-head .btn { align-self: flex-start; }
  .proxy-card { padding: 10px; }
  .proxy-card-actions .btn { flex: 1 1 auto; }
  .run-hour-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .badge-version { font-size: 10px; padding: 1px 6px; }
  
  .header-actions { gap: 5px; }
  .header-actions .btn { font-size: 11px; padding: 6px 9px; border-radius: 8px; }

  .account-selector-bar { width: 100%; padding-bottom: 2px; flex-wrap: wrap; overflow-x: visible; }
  .account-chip { font-size: 11.5px; padding: 6px 11px; }

  .sys-metrics-pill { font-size: 10px; padding: 4px 8px; gap: 5px; }
  .refresh-countdown { font-size: 10px; padding: 4px 8px; }

  .hero-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-card { padding: 12px 10px; border-radius: 12px; gap: 4px; }
  .hero-val { font-size: 21px; }
  .hero-label { font-size: 11px; }
  .hero-desc { font-size: 10.5px; }

  .section-card { padding: 16px 14px; border-radius: 14px; gap: 14px; }
  .section-title { font-size: 14px; }
  .task-card { padding: 12px 12px; border-radius: 12px; }
  .task-card-featured { min-height: 0; }
  .task-name { font-size: 13px; }
  .task-icon { width: 32px; height: 32px; font-size: 18px; }
  .streak-7day-wrap { margin-top: 10px; padding: 9px 10px; }

  .ms-toolbar-actions {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .ms-toolbar-actions .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  .account-overview-card { padding: 14px 12px; border-radius: 12px; }
  .acc-stat-box { gap: 2px; }
  .acc-stat-lbl { font-size: 10px; }
  .acc-stat-num { font-size: 13px; }
  .acc-card-actions { gap: 4px; }
  .acc-card-actions .btn { font-size: 11px; padding: 5px 8px; }

  .browser-metric-row { grid-template-columns: 1fr 1fr; padding: 10px 10px; gap: 8px; }
  .browser-metric-lbl { font-size: 10px; }
  .browser-metric-val { font-size: 12px; }

  .terminal-box { height: 220px; font-size: 11px; padding: 10px; }
  .timeline { max-height: 200px; }
  .chart-container { height: 150px; padding-bottom: 20px; }

  .modal-box { width: 96vw; max-height: 94vh; border-radius: 14px; }
  .modal-header { padding: 12px 14px; }
  .modal-body { padding: 14px 12px; }
  .modal-footer { padding: 10px 14px; }
  .tab-btn, .step-nav-item { font-size: 11px; padding: 5px 8px; }
  .celebration-layer { padding: 14px; }
  .celebration-panel { padding: 28px 18px 22px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .celebration-panel {
    animation: none;
  }
}
