/* 海博识人CRM — 布局壳复刻（对齐截图） */

:root {
  --primary: #1677ff;
  --primary-soft: #e6f4ff;
  --text: rgba(0, 0, 0, 0.88);
  --text-secondary: rgba(0, 0, 0, 0.65);
  --text-muted: rgba(0, 0, 0, 0.45);
  --border: #f0f0f0;
  --bg-page: #f0f2f5;
  --bg-white: #ffffff;
  --header-h: 48px;
  --sidebar-w: 208px;
  --workspace-gap: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 960px;
}

/* —— 顶栏 —— */
.header {
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 12px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

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

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

.header-link,
.header-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.header-link:hover,
.header-user:hover {
  color: var(--primary);
  background: rgba(22, 119, 255, 0.06);
}

.header-link span,
.header-user span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-user {
  margin-left: 4px;
  cursor: default;
}

/* —— 主体：侧栏 + 工作区 —— */
.body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
}

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

.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  padding: 0 16px 0 24px;
  color: var(--text);
  line-height: 40px;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

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

.menu-parent {
  gap: 10px;
  font-weight: 400;
}

.menu-parent .menu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-parent .icon-caret {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s;
  opacity: 0.55;
}

.menu-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff;
  animation: badge-pulse 1.4s ease-in-out infinite;
}

.menu-parent .menu-badge {
  margin-left: 6px;
  margin-right: 4px;
}

.menu-child {
  position: relative;
}

.menu-child .menu-badge {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  animation: badge-pulse-child 1.4s ease-in-out infinite;
}

.menu-badge[hidden] {
  display: none !important;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 0 rgba(255, 77, 79, 0.45); }
  50% { box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(255, 77, 79, 0); }
}

@keyframes badge-pulse-child {
  0%, 100% {
    transform: translateY(-50%);
    box-shadow: 0 0 0 2px #fff, 0 0 0 0 rgba(255, 77, 79, 0.45);
  }
  50% {
    transform: translateY(-50%);
    box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(255, 77, 79, 0);
  }
}

.menu-group.open > .menu-parent .icon-caret {
  transform: rotate(180deg);
}

.menu-children {
  display: none;
}

.menu-group.open > .menu-children {
  display: block;
}

.menu-child {
  padding-left: 48px;
  color: var(--text-secondary);
}

.menu-child:hover {
  color: var(--primary);
  background: transparent;
}

.menu-child.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 500;
}

/* —— 侧栏底部版本 —— */
.sidebar-footer {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.ver-line {
  white-space: nowrap;
}

.ver-latest {
  margin-left: 4px;
  color: var(--primary);
}

.ver-link {
  display: inline-block;
  margin-top: 2px;
  color: var(--primary);
}

.ver-link:hover,
.ver-latest:hover {
  opacity: 0.85;
}

/* —— 右侧工作区：与顶栏/侧栏留间距，内层白底卡片 —— */
.workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--workspace-gap);
  background: var(--bg-page);
}

.workspace-panel {
  flex: 1;
  min-height: 0;
  background: var(--bg-white);
  border-radius: 8px;
  overflow: auto;
}

.workspace-panel.crawl-page {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* —— 微信达人抓取页 —— */
.tabular {
  font-variant-numeric: tabular-nums;
}

.crawl-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.crawl-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  text-wrap: balance;
  letter-spacing: 0.01em;
}

.crawl-desc {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  text-wrap: pretty;
}

.brief-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-height: 36px;
  padding: 0 2px;
  font-size: 13px;
  color: var(--text-secondary);
}

.brief-item strong {
  color: var(--text);
  font-weight: 600;
}

.brief-sep {
  color: rgba(0, 0, 0, 0.2);
}

.brief-bar[data-tone="warn"] .brief-item:first-child {
  color: #d46b08;
  font-weight: 600;
}

.brief-bar[data-tone="ok"] .brief-item:first-child {
  color: #389e0d;
  font-weight: 600;
}

.brief-bar[data-tone="run"] .brief-item:first-child {
  color: #1677ff;
  font-weight: 600;
}

.stage-quiet {
  margin: 14px 0 0;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.28);
}

.status-pill[hidden] {
  display: none !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f5f5f5;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: background 0.25s cubic-bezier(0.2, 0, 0, 1), color 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.status-pill[data-status="idle"] { color: #595959; background: #f5f5f5; }
.status-pill[data-status="waiting_login"],
.status-pill[data-status="error"] {
  color: #d46b08;
  background: #fff7e6;
  box-shadow: 0 0 0 1px rgba(250, 140, 22, 0.2);
}
.status-pill[data-status="running"] {
  color: #1677ff;
  background: #e6f4ff;
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.18);
}
.status-pill[data-status="running"] .status-pill-dot {
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.status-pill[data-status="success"] {
  color: #389e0d;
  background: #f6ffed;
  box-shadow: 0 0 0 1px rgba(82, 196, 26, 0.25);
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

/* 异常横幅 */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, #fff2f0 0%, #fff7e6 100%);
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.18),
    0 8px 24px rgba(255, 77, 79, 0.08);
  animation: slide-in-down 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.alert-banner[hidden] {
  display: none !important;
}

.alert-banner-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff4d4f;
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.alert-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-secondary);
}

.alert-banner-body strong {
  color: #cf1322;
  font-size: 14px;
}

@keyframes slide-in-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.crawl-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  max-width: 640px;
}

.crawl-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* 状态大卡 */
.status-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 16px 18px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fafcff 0%, #f5f8ff 55%, #f7fafc 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04),
    0 10px 28px rgba(22, 119, 255, 0.06);
  transition: box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1),
    background 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.status-hero[data-status="waiting_login"],
.status-hero[data-status="error"] {
  background: linear-gradient(145deg, #fffaf5 0%, #fff7e6 100%);
  box-shadow: 0 0 0 1px rgba(250, 140, 22, 0.18),
    0 10px 28px rgba(250, 140, 22, 0.08);
}

.status-hero[data-status="running"] {
  background: linear-gradient(145deg, #f5faff 0%, #eaf3ff 100%);
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.16),
    0 10px 28px rgba(22, 119, 255, 0.1);
}

.status-hero[data-status="success"] {
  background: linear-gradient(145deg, #f6ffed 0%, #f0fff0 100%);
  box-shadow: 0 0 0 1px rgba(82, 196, 26, 0.2),
    0 10px 28px rgba(82, 196, 26, 0.08);
}

.status-hero-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  grid-row: 1;
}

.status-hero-core {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #bfbfbf;
  transition: background 0.25s cubic-bezier(0.2, 0, 0, 1),
    transform 0.25s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.status-hero[data-status="idle"] .status-hero-core { background: #bfbfbf; }
.status-hero[data-status="waiting_login"] .status-hero-core,
.status-hero[data-status="error"] .status-hero-core {
  background: #fa8c16;
  box-shadow: 0 0 0 8px rgba(250, 140, 22, 0.15);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.status-hero[data-status="running"] .status-hero-core {
  background: #1677ff;
  box-shadow: 0 0 0 8px rgba(22, 119, 255, 0.15);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.status-hero[data-status="success"] .status-hero-core {
  background: #52c41a;
  box-shadow: 0 0 0 8px rgba(82, 196, 26, 0.18);
}

.status-hero-info {
  grid-column: 2;
  min-width: 0;
}

.status-hero-label {
  font-size: 12px;
  color: var(--text-muted);
}

.status-hero-name {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.status-hero-msg {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-wrap: pretty;
}

.status-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .status-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.metric {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
}

.metric-value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 控制卡 */
.control-card {
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05),
    0 6px 18px rgba(0, 0, 0, 0.03);
}

.control-card-title {
  font-size: 14px;
  font-weight: 600;
}

.control-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.schedule-block {
  margin-top: 18px;
  padding-top: 16px;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.06);
}

.schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.schedule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  position: relative;
}

.field-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* —— 时间选择器（对齐参考 UI） —— */
.time-picker {
  position: relative;
  width: 120px;
}

.time-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 36px;
  padding: 0 10px 0 12px;
  border: none;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d9d9d9;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
    background 0.2s cubic-bezier(0.2, 0, 0, 1),
    transform 0.12s cubic-bezier(0.2, 0, 0, 1);
}

.time-picker-trigger:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px #4096ff;
}

.time-picker-trigger:focus-visible,
.time-picker.is-open .time-picker-trigger:not(:disabled) {
  outline: none;
  box-shadow: inset 0 0 0 1px #1677ff, 0 0 0 2px rgba(22, 119, 255, 0.2);
}

.time-picker-trigger:active:not(:disabled) {
  transform: scale(0.98);
}

.time-picker-trigger:disabled {
  background: #f5f5f5;
  color: rgba(0, 0, 0, 0.25);
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px #d9d9d9;
}

.time-picker-value {
  line-height: 1;
}

.time-picker-clock {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.time-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  width: 120px;
  padding: 4px 0;
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 6px 16px rgba(0, 0, 0, 0.08),
    0 3px 6px rgba(0, 0, 0, 0.04);
  animation: fade-up 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.time-picker-dropdown[hidden] {
  display: none !important;
}

.time-picker-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 224px;
}

.time-picker-col {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 224px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.time-picker-col + .time-picker-col {
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.06);
}

.time-picker-option {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 0 4px;
  border-radius: 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: rgba(0, 0, 0, 0.88);
  cursor: pointer;
  user-select: none;
  transition:
    background 0.15s cubic-bezier(0.2, 0, 0, 1),
    color 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.time-picker-option:hover {
  background: #f5f5f5;
}

.time-picker-option.is-active {
  background: #1677ff;
  color: #fff;
  font-weight: 500;
}

.time-picker-option.is-active:hover {
  background: #1677ff;
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: #1677ff;
  box-shadow: inset 0 0 0 1px #91caff;
}

.btn-outline:hover:not(:disabled) {
  color: #4096ff;
  background: #f0f7ff;
  box-shadow: inset 0 0 0 1px #4096ff;
}

.btn-outline:disabled {
  color: rgba(0, 0, 0, 0.25);
  background: #f5f5f5;
  box-shadow: inset 0 0 0 1px #d9d9d9;
}

.btn-save-time {
  min-width: 64px;
}

.schedule-row.is-active .time-picker-trigger:not(:disabled) {
  box-shadow: inset 0 0 0 1px #91caff;
}

.schedule-row.is-active .btn-outline:not(:disabled) {
  box-shadow: inset 0 0 0 1px #1677ff;
}

/* Switch */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* 扩大可点热区到约 40×40 */
.switch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
}

.switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d9d9d9;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition:
    background 0.2s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
    transform 0.12s cubic-bezier(0.2, 0, 0, 1);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.2s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
    width 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.switch:hover .switch-track {
  background: #bfbfbf;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 0 0 3px rgba(0, 0, 0, 0.04);
}

.switch:hover input:checked + .switch-track {
  background: #4096ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.16);
}

.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.35);
}

.switch input:active + .switch-track {
  transform: scale(0.96);
}

.switch input:active + .switch-track::after {
  width: 24px;
}

.switch input:checked:active + .switch-track::after {
  transform: translateX(16px);
  width: 24px;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
  box-shadow: 0 1px 6px rgba(22, 119, 255, 0.35);
}

.schedule-row.is-active .btn-default:not(:disabled) {
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.35),
    0 2px 8px rgba(22, 119, 255, 0.12);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1),
    background 0.2s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
    color 0.2s cubic-bezier(0.2, 0, 0, 1),
    opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

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

.btn-lg {
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 119, 255, 0.25),
    0 4px 12px rgba(22, 119, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: #4096ff;
}

.btn-default {
  background: #fff;
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-default:hover:not(:disabled) {
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.35);
}

.btn-ghost {
  background: #f5f5f5;
  color: var(--text-secondary);
}

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

.btn-text {
  background: transparent;
  color: var(--text-muted);
  height: auto;
  padding: 4px 6px;
}

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

.btn-icon-play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 2px;
}

/* 右侧登录舞台 */
.login-stage {
  flex: 0 0 auto;
  min-height: 320px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 0%, #e8f4ff 0%, transparent 55%),
    linear-gradient(180deg, #f3f8fc 0%, #f7fafc 45%, #eef3f8 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04),
    0 10px 28px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 20px 28px;
  overflow: hidden;
}

.stage-status {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
  font-size: 13px;
  color: var(--text-secondary);
}

.login-stage[data-status="waiting_login"] .stage-status,
.login-stage[data-status="error"] .stage-status {
  background: #fff7e6;
  box-shadow: 0 0 0 1px rgba(250, 140, 22, 0.22);
}

.login-stage[data-status="running"] .stage-status {
  background: #f6ffed;
  box-shadow: 0 0 0 1px rgba(82, 196, 26, 0.22);
}

.stage-panel {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fade-up 0.35s cubic-bezier(0.2, 0, 0, 1);
  flex: 1;
  justify-content: center;
}

.stage-panel[hidden] {
  display: none !important;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-wrap: balance;
}

.stage-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.wx-shop-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #262626;
  font-size: 18px;
  font-weight: 600;
}

.qr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.qr-brand-text {
  font-size: 20px;
  font-weight: 600;
  color: #262626;
  letter-spacing: 0.02em;
}

.qr-card {
  width: 100%;
  padding: 22px 18px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 40, 70, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.qr-frame {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 4px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
  overflow: hidden;
  background: #fff;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.qr-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
}

.qr-overlay[hidden] {
  display: none !important;
}

.qr-overlay-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.qr-tip {
  margin: 14px 0 0;
  font-size: 13px;
  color: #8c8c8c;
}

.qr-expire {
  margin: 6px 0 0;
  font-size: 12px;
  color: #bfbfbf;
}

.scan-result {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  animation: fade-up 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.scan-result[hidden] {
  display: none !important;
}

.scan-result.is-ok {
  color: #389e0d;
  background: #f6ffed;
  box-shadow: 0 0 0 1px rgba(82, 196, 26, 0.25);
}

.scan-result.is-fail {
  color: #cf1322;
  background: #fff2f0;
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.22);
}

.scan-result-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.ok-badge {
  margin-bottom: 12px;
  animation: pop-in 0.4s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.25); filter: blur(4px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

.action-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.action-chip-warn {
  color: #d46b08;
  background: #fff7e6;
  box-shadow: 0 0 0 1px rgba(250, 140, 22, 0.28);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.action-chip-ok {
  color: #389e0d;
  background: #f6ffed;
  box-shadow: 0 0 0 1px rgba(82, 196, 26, 0.28);
}

/* 日志样式保留极少占用；业务页已移除日志区块 */

.demo-box {
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.demo-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}

.demo-box summary {
  cursor: pointer;
  padding: 10px 0;
  user-select: none;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
}

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  animation: fade-in 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.modal-mask[hidden] {
  display: none !important;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  position: relative;
  width: min(400px, 100%);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  animation: fade-up 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.modal-accent {
  height: 4px;
  background: linear-gradient(90deg, #ff4d4f, #fa8c16);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
}

.modal-close:hover {
  background: #f5f5f5;
  color: var(--text);
}

.modal-body {
  padding: 24px 24px 20px;
  text-align: center;
}

.modal-icon-warn {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fff1f0;
  color: #ff4d4f;
  font-weight: 700;
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.2);
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.modal-qr-wrap {
  width: 180px;
  height: 180px;
  margin: 18px auto 0;
  border-radius: 6px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background: #fff;
}

.modal-qr-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.modal-qr-tip {
  margin: 10px 0 0;
  font-size: 13px;
  color: #8c8c8c;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

/* Toast */
.toast-stack {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.toast.is-out {
  animation: toast-out 0.25s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}

.toast-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-dot { background: #52c41a; }
.toast.error .toast-dot { background: #ff4d4f; }
.toast.warn .toast-dot { background: #fa8c16; }
.toast.info .toast-dot { background: #1677ff; }

.toast-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

/* —— 简易线框图标 —— */
.icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.icon-user {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.icon-db {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5'/%3E%3Cpath d='M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5'/%3E%3Cpath d='M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E");
}

.icon-folder {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.icon-douyin {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 12a4 4 0 1 0 4 4V4'/%3E%3Cpath d='M13 4c0 3 2.5 5.5 5.5 5.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 12a4 4 0 1 0 4 4V4'/%3E%3Cpath d='M13 4c0 3 2.5 5.5 5.5 5.5'/%3E%3C/svg%3E");
}

.icon-kuaishou {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='M8 16V8l8 8V8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='M8 16V8l8 8V8'/%3E%3C/svg%3E");
}

.icon-wechat {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M8.5 14.5c-3.2 0-5.5-2-5.5-4.5S5.3 5.5 8.5 5.5s5.5 2 5.5 4.5c0 1.1-.4 2.1-1.1 2.9'/%3E%3Cpath d='M15.5 18.5c3 0 5.5-1.8 5.5-4s-2.5-4-5.5-4-5.5 1.8-5.5 4c0 1 .4 1.9 1.1 2.6L10 20l3.2-1.1c.7.4 1.5.6 2.3.6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M8.5 14.5c-3.2 0-5.5-2-5.5-4.5S5.3 5.5 8.5 5.5s5.5 2 5.5 4.5c0 1.1-.4 2.1-1.1 2.9'/%3E%3Cpath d='M15.5 18.5c3 0 5.5-1.8 5.5-4s-2.5-4-5.5-4-5.5 1.8-5.5 4c0 1 .4 1.9 1.1 2.6L10 20l3.2-1.1c.7.4 1.5.6 2.3.6z'/%3E%3C/svg%3E");
}

.icon-caret {
  width: 10px;
  height: 10px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.icon-shop {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 9l1.5-5h15L21 9'/%3E%3Cpath d='M3 9h18v11H3z'/%3E%3Cpath d='M9 14h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 9l1.5-5h15L21 9'/%3E%3Cpath d='M3 9h18v11H3z'/%3E%3Cpath d='M9 14h6'/%3E%3C/svg%3E");
}

.icon-link {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l2-2a5 5 0 0 0-7-7l-1.2 1.2'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-2 2a5 5 0 0 0 7 7l1.2-1.2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l2-2a5 5 0 0 0-7-7l-1.2 1.2'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-2 2a5 5 0 0 0 7 7l1.2-1.2'/%3E%3C/svg%3E");
}

.icon-doc {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='8' y1='13' x2='16' y2='13'/%3E%3Cline x1='8' y1='17' x2='16' y2='17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='8' y1='13' x2='16' y2='13'/%3E%3Cline x1='8' y1='17' x2='16' y2='17'/%3E%3C/svg%3E");
}
