:root {
  --bg: #0c0c10;
  --bg-elevated: #101014;
  --card: #1a1a22;
  --card-hover: #22222c;
  --surface-muted: #14141a;
  --surface-hover: #252530;
  --bg-soft: #14141a;
  --input-bg: #14141a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --primary-border: rgba(59, 130, 246, 0.35);
  --accent: #6366f1;
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --muted: #71717a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
  --radius: 16px;
  --radius-btn: 12px;
  --radius-btn-sm: 10px;
  --radius-input: 10px;
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --gradient-accent: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 55%, #ec4899 100%);
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* —— Dark theme ambient background (pure glow gradients) —— */
.theme-dark {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 100% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 58%),
    radial-gradient(ellipse 65% 45% at 0% 100%, rgba(99, 102, 241, 0.1) 0%, transparent 52%),
    radial-gradient(ellipse 50% 35% at 50% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 65%),
    var(--bg);
}

.theme-dark .app-shell {
  position: relative;
  z-index: 1;
}

/* —— Light theme —— */
.theme-light {
  --bg: #f4f4f5;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-hover: #f4f4f5;
  --surface-muted: #f0f0f3;
  --surface-hover: #e4e4e7;
  --bg-soft: #fafafa;
  --input-bg: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --primary-soft: rgba(59, 130, 246, 0.1);
  --primary-border: rgba(59, 130, 246, 0.28);
  --text: #18181b;
  --text-secondary: #52525b;
  --muted: #71717a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 100% 0%, rgba(59, 130, 246, 0.07) 0%, transparent 58%),
    radial-gradient(ellipse 65% 45% at 0% 100%, rgba(99, 102, 241, 0.05) 0%, transparent 52%),
    var(--bg);
}

.theme-light .app-shell {
  position: relative;
  z-index: 1;
}

.theme-light .sidebar {
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(0, 0, 0, 0.06);
  --sidebar-text: #52525b;
  --sidebar-text-hover: #27272a;
  --sidebar-text-active: #18181b;
  --sidebar-hover-bg: rgba(0, 0, 0, 0.04);
  --sidebar-active-bg: rgba(59, 130, 246, 0.08);
  --sidebar-title: #18181b;
  --sidebar-sub: #71717a;
}

.theme-light button.secondary {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.theme-light button.secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(59, 130, 246, 0.32);
  color: var(--text);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.theme-light button.secondary:active:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}

.theme-light .overview-flow-table th[scope="row"] {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .overview-flow-table td {
  background: rgba(0, 0, 0, 0.015);
}

.theme-light .overview-flow-tag-none {
  background: rgba(0, 0, 0, 0.04);
}

.theme-light .overview-flow-tag-moderate {
  color: #a16207;
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.4);
}

.theme-light .overview-flow-tag-good {
  color: #15803d;
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.4);
}

.theme-light .overview-flow-tag-high {
  color: #047857;
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
}

.theme-light .overview-flow-tag-tight {
  color: #b91c1c;
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
}

.theme-light .overview-flow-event {
  color: #2563eb;
}

/* —— App shell (sidebar + main) —— */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  --sidebar-bg: #18181b;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: #a1a1aa;
  --sidebar-text-hover: #e4e4e7;
  --sidebar-text-active: #fafafa;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(255, 255, 255, 0.08);
  --sidebar-title: #fafafa;
  --sidebar-sub: #71717a;
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 600;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.sidebar-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--sidebar-title);
  line-height: 1.2;
}

.sidebar-sub {
  display: block;
  font-size: 13px;
  color: var(--sidebar-sub);
  margin-top: 2px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 4px;
  font-size: 11px;
  color: var(--sidebar-sub);
}

.sidebar-foot-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* —— Topbar —— */
.topbar,
header.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 500;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  grid-column: 1;
  justify-self: start;
}

.topbar-menu-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  min-height: unset;
  box-shadow: none;
  transform: none;
  font-weight: inherit;
  letter-spacing: normal;
}

.topbar-menu-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: none;
  box-shadow: none;
}

.topbar-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 650;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar-backdrop:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  grid-column: 3;
  justify-self: end;
  min-width: 0;
}

.header-account-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.header-adv-name-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  opacity: 0.95;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  padding: 0;
  cursor: pointer;
  box-shadow: none;
}

.header-adv-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
}

.header-adv-name-btn:hover:not(:disabled),
.header-adv-name-btn:focus-visible:not(:disabled) {
  background: transparent;
  color: inherit;
  border-color: transparent;
  opacity: 1;
  text-decoration: none;
}

.header-adv-name-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.header-sub-picker {
  position: relative;
  flex-shrink: 0;
}

.header-sub-picker.hidden {
  display: none;
}

.header-sub-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  box-shadow: none;
}

.header-sub-picker-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.header-sub-picker-btn:hover,
.header-sub-picker-btn:focus-visible,
.header-sub-picker-btn[aria-expanded="true"] {
  color: var(--text);
  background: var(--surface-muted);
}

.account-more-info-dialog {
  max-width: 420px;
}

.account-more-info-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 2px;
}

.account-more-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.account-more-info-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.account-more-info-text {
  min-width: 0;
  word-break: break-word;
}

/* —— 子户选择（概览） —— */
.sub-account-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.sub-account-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
}

.sub-account-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.overview-sub-switch-block .sub-account-head h2 {
  margin: 0;
}

.overview-sub-switch-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.sub-account-head-label {
  font-size: 14px;
}

.sub-account-head-meta {
  font-size: 13px;
}

.sub-account-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.sub-account-select-wrap {
  display: block;
  flex: 0 1 auto;
  min-width: 440px;
  max-width: 560px;
  width: 100%;
}

.sub-account-picker {
  position: relative;
  width: 100%;
  max-width: none;
}

.sub-account-toolbar #btnReloadSubAccounts {
  flex-shrink: 0;
  min-height: 44px;
  margin: 0;
  align-self: flex-end;
}

.sub-account-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sub-account-picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--card);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sub-account-picker-btn:hover {
  border-color: var(--primary);
}

.sub-account-picker-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.sub-account-picker-arrow {
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
}

.tag-sub-name {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-sub-official {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-sub-cost {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}

.tag-sub-bal {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(74, 222, 128, 0.12);
  color: #047857;
  font-size: 13px;
  font-weight: 500;
}

.tag-sub-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.tag-sub-status-ok {
  background: var(--primary-soft);
  color: #1d4ed8;
}

.tag-sub-status-paused {
  background: rgba(251, 191, 36, 0.12);
  color: #c2410c;
}

.tag-sub-status-default {
  background: var(--surface-muted);
  color: var(--muted);
}

.sub-account-picker-list {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.sub-account-picker-list.hidden {
  display: none;
}

.header-account-group > .header-sub-picker-list {
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  width: min(260px, calc(100vw - 24px));
  min-width: 0;
  max-width: min(260px, calc(100vw - 16px));
  z-index: 600;
}

.sub-account-picker-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}

.sub-account-picker-item:hover,
.sub-account-picker-item.active {
  background: var(--primary-soft);
}

.sub-account-picker-item.empty {
  color: var(--muted);
  cursor: default;
}

.sub-account-picker-item.empty:hover {
  background: transparent;
}

.recent-sub {
  margin-top: 12px;
}

.recent-sub-label {
  font-size: 14px;
  color: var(--muted);
}

.recent-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 8px;
}

.chip-sub-wrap {
  position: relative;
  display: inline-flex;
}

.chip-sub-wrap.active .chip-sub {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 500;
}

.chip-sub {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  max-width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.chip-sub .tag-sub-name {
  max-width: 140px;
}

.chip-sub:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.chip-sub-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.chip-sub-remove:hover {
  color: var(--danger, #e34d59);
  border-color: var(--danger, #e34d59);
  background: rgba(248, 113, 113, 0.12);
}

.conn-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.conn-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.conn-status.ok .dot { background: #4ade80; }
.conn-status.err .dot { background: #f87171; }
.conn-status.pending .dot { background: #fbbf24; animation: pulse 1.2s infinite; }

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  gap: 2px;
}

.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  min-height: unset;
  box-shadow: none;
  transform: none;
  letter-spacing: normal;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.theme-switch-btn svg {
  flex-shrink: 0;
}

.theme-switch-btn:hover:not(.active) {
  color: var(--text-secondary);
  background: var(--surface-hover);
  transform: none;
  box-shadow: none;
}

.theme-switch-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.theme-light .theme-switch-btn.active {
  color: var(--primary);
}

.theme-dark .theme-switch-btn.active {
  color: #93c5fd;
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

/* —— Layout —— */
.wrap,
.main-content {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.overview-dashboard {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  align-items: start;
}

.overview-metrics-col,
.overview-side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.overview-metrics-col .overview-card-metrics,
.overview-side-col .overview-card-project-search,
.overview-side-col .overview-card-recent {
  margin-bottom: 0;
}

.overview-metrics-col .overview-alerts {
  margin-bottom: 0;
  width: 100%;
}

@media (max-width: 1024px) {
  .overview-dashboard {
    grid-template-columns: 1fr;
  }
}

.overview-card-metrics .toolbar {
  margin-bottom: 16px;
}

.overview-card-metrics .sub-account-panel,
.overview-card-metrics .sub-account-toolbar,
.overview-card-sub .sub-account-panel,
.overview-card-sub .sub-account-toolbar {
  margin-top: 0;
}

.overview-card-recent {
  margin-bottom: 0;
}

.overview-card-recent .recent-sub-wrap {
  margin-top: 0;
}

.overview-card-sub .recent-sub-wrap {
  margin-top: 16px;
}

.recent-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.recent-sub-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.recent-sub-hint {
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 8px;
}

.recent-sub-hint strong {
  font-weight: 600;
  color: #c2410c;
}

.recent-sub-label {
  display: block;
  font-size: 12px;
  margin-bottom: 0;
}

.tag-sub-plan {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.tag-sub-plan-on {
  background: rgba(251, 191, 36, 0.2);
  color: #c2410c;
}

.tag-sub-plan-off,
.tag-sub-plan-none {
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 500;
}

.tag-sub-plan-loading {
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 400;
}

.tag-sub-plan-err {
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
}

.chip-sub-wrap.warn-plan-on .chip-sub {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.overview-violation {
  margin-top: 0;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
}

.overview-violation-loading {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}

.overview-violation-err {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}

.overview-violation-has {
  border-color: rgba(239, 68, 68, 0.55);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.35), rgba(248, 113, 113, 0.12));
}

.overview-violation-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.overview-violation-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
}

.overview-violation-loading .overview-violation-icon {
  background: #f59e0b;
}

.overview-violation-body {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
}

.overview-violation-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #b91c1c;
}

.overview-violation-body p {
  margin: 0 0 6px;
}

.overview-violation-meta {
  font-size: 12px;
  margin-bottom: 0 !important;
}

.overview-violation-link {
  flex-shrink: 0;
  align-self: stretch;
  text-align: center;
}

.overview-violation-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  align-self: center;
  min-width: 108px;
}

.btn-violation-dismiss {
  white-space: nowrap;
}

.tag-sub-violation {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.overview-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.overview-alerts:empty {
  display: none;
}

.overview-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--border);
}

.overview-alert-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-weight: 700;
}

.overview-alert-body {
  flex: 1;
  min-width: 0;
}

.overview-alert-action {
  flex-shrink: 0;
  margin-left: auto;
}

.overview-alert-ok {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.25);
  color: #86efac;
}

.overview-alert-warn {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

.overview-alert-err {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

.overview-flow-forecast {
  margin-top: 16px;
  margin-bottom: 16px;
}

.overview-project-search {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.overview-project-search h2 {
  margin-bottom: 10px;
}

.overview-project-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.overview-project-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.overview-project-search-input-wrap .overview-project-search-input {
  width: 100%;
  min-width: 0;
  padding-right: 34px;
  box-sizing: border-box;
}

.overview-project-search-input-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  min-height: unset;
  box-shadow: none;
}

.overview-project-search-input-clear:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: translateY(-50%);
  box-shadow: none;
}

.overview-project-search-input-clear:active:not(:disabled) {
  transform: translateY(-50%);
}

.overview-project-search-input {
  flex: none;
}

.overview-project-search-results {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.overview-project-search-summary {
  margin-bottom: 8px;
}

.overview-project-search-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-project-search-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.overview-project-search-item-main {
  flex: 1;
  min-width: 0;
}

.overview-project-search-item-name {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  word-break: break-all;
}

.overview-project-search-item-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.overview-project-search-item-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.overview-flow-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.overview-flow-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.overview-flow-tip {
  font-size: 14px;
  cursor: help;
}

.overview-flow-body {
  min-height: 72px;
}

.overview-flow-table-wrap {
  overflow-x: auto;
}

.overview-flow-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.overview-flow-table th,
.overview-flow-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.overview-flow-table th[scope="row"] {
  width: 88px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.overview-flow-table td {
  background: rgba(255, 255, 255, 0.015);
}

.overview-flow-date {
  white-space: nowrap;
}

.overview-flow-event {
  display: inline-block;
  margin-left: 6px;
  color: #60a5fa;
  font-size: 12px;
}

.overview-flow-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.overview-flow-tag-moderate {
  color: #ca8a04;
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.35);
}

.overview-flow-tag-good {
  color: #16a34a;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
}

.overview-flow-tag-high {
  color: #059669;
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.4);
}

.overview-flow-tag-tight {
  color: #dc2626;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

.overview-flow-tag-none {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.overview-flow-foot {
  margin: 10px 0 0;
  font-size: 12px;
}

.overview-flow-link {
  color: #60a5fa;
  text-decoration: none;
}

.overview-flow-link:hover {
  text-decoration: underline;
}

.overview-flow-err {
  color: #fecaca;
}

.overview-empty-hint {
  margin: 8px 0;
  font-size: 13px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* —— Config —— */
.cfg-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.cfg-quick label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cfg-advanced {
  margin-top: 8px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0 12px 12px;
  background: var(--surface-muted);
}

.cfg-advanced summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 10px 0;
  user-select: none;
}

.cfg-advanced summary:hover { color: var(--primary); }

.cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 14px;
}

.cfg-grid label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cfg-grid input { width: 100%; }

/* —— Sidebar nav (tabs) —— */
.sidebar .tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: static;
}

.sidebar .tabs button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar .tabs button .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.75;
}

.sidebar .tabs button .nav-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.sidebar .tabs button:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.sidebar .tabs button.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.sidebar .tabs button.active .nav-icon {
  opacity: 1;
  color: var(--sidebar-text-active);
}

.sidebar .tabs button:hover .nav-icon {
  opacity: 0.95;
}

.panel { display: none; position: relative; z-index: 0; }
.panel.active { display: block; }

/* —— 竞价投放：项目 / 单元 —— */
.bidding-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bidding-head {
  padding: 16px 18px 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-muted) 0%, transparent 72%);
}

.bidding-subtabs.segmented {
  margin-bottom: 14px;
}

.bidding-subtabs .bidding-subtab {
  min-width: 88px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
}

.bidding-subtabs .bidding-subtab.active {
  font-weight: 600;
}

.bidding-subpanels {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 18px 18px;
  min-height: 0;
}

.bidding-subpanel {
  display: none;
}

.bidding-subpanel.active {
  display: block;
  animation: biddingSubFade 0.2s ease;
}

@keyframes biddingSubFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.bidding-subpanel > .card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 16px 0 0;
  margin-bottom: 0;
}

.bidding-subpanel > .card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.bidding-subpanel > .card.cfg-card {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* —— Toolbar —— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.toolbar label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.batch-bar.hidden {
  display: none;
}

.ads-metrics-bar {
  margin-bottom: 12px;
}

.ads-metrics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.ads-metrics-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ads-metrics-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button.btn.btn-ads-action-refresh,
button.btn-sm.btn-ads-action-refresh {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.38);
  color: #67e8f9;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(34, 211, 238, 0.1);
}

button.btn.btn-ads-action-refresh:hover:not(:disabled),
button.btn-sm.btn-ads-action-refresh:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.55);
  color: #a5f3fc;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(34, 211, 238, 0.14);
}

button.btn.btn-ads-action-official,
button.btn-sm.btn-ads-action-official {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.42);
  color: #c4b5fd;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(167, 139, 250, 0.1);
}

button.btn.btn-ads-action-official:hover:not(:disabled),
button.btn-sm.btn-ads-action-official:hover:not(:disabled) {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.58);
  color: #ddd6fe;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(167, 139, 250, 0.14),
    inset 0 1px 0 rgba(167, 139, 250, 0.16);
}

button.btn.btn-ads-action-fund,
button.btn-sm.btn-ads-action-fund {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.42);
  color: #fcd34d;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(251, 191, 36, 0.1);
}

button.btn.btn-ads-action-fund:hover:not(:disabled),
button.btn-sm.btn-ads-action-fund:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.58);
  color: #fde68a;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(251, 191, 36, 0.14),
    inset 0 1px 0 rgba(251, 191, 36, 0.16);
}

.theme-light button.btn.btn-ads-action-refresh,
.theme-light button.btn-sm.btn-ads-action-refresh {
  background: rgba(8, 145, 178, 0.08);
  border-color: rgba(8, 145, 178, 0.35);
  color: #0e7490;
}

.theme-light button.btn.btn-ads-action-refresh:hover:not(:disabled),
.theme-light button.btn-sm.btn-ads-action-refresh:hover:not(:disabled) {
  background: rgba(8, 145, 178, 0.14);
  border-color: rgba(8, 145, 178, 0.5);
  color: #155e75;
}

.theme-light button.btn.btn-ads-action-official,
.theme-light button.btn-sm.btn-ads-action-official {
  background: rgba(109, 40, 217, 0.08);
  border-color: rgba(109, 40, 217, 0.32);
  color: #6d28d9;
}

.theme-light button.btn.btn-ads-action-official:hover:not(:disabled),
.theme-light button.btn-sm.btn-ads-action-official:hover:not(:disabled) {
  background: rgba(109, 40, 217, 0.14);
  border-color: rgba(109, 40, 217, 0.48);
  color: #5b21b6;
}

.theme-light button.btn.btn-ads-action-fund,
.theme-light button.btn-sm.btn-ads-action-fund {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.35);
  color: #b45309;
}

.theme-light button.btn.btn-ads-action-fund:hover:not(:disabled),
.theme-light button.btn-sm.btn-ads-action-fund:hover:not(:disabled) {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.5);
  color: #92400e;
}

.ads-metrics-balance {
  font-size: 16px;
  text-align: right;
  line-height: 1.5;
}

.ads-metrics-balance strong {
  color: var(--text);
  font-weight: 600;
}

.ads-metrics-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ads-metrics-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ads-metric-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 88px;
}

.ads-metric-card-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
}

.ads-metric-card-text {
  min-width: 0;
  flex: 1;
}

.ads-metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.ads-metric-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.ads-metric-rate {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
}

.ads-metric-rate.up { color: #e54d42; }
.ads-metric-rate.down { color: #00a870; }
.ads-metric-rate.flat { color: var(--muted); }

.ads-metric-spark {
  width: 88px;
  height: 36px;
  flex-shrink: 0;
}

.ads-metric-spark-line {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.ads-metric-spark-area {
  fill: rgba(59, 130, 246, 0.12);
  stroke: none;
}

@media (max-width: 1100px) {
  .ads-metrics-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ads-metrics-cards {
    grid-template-columns: 1fr;
  }
}

.batch-bar strong { color: var(--text); }

/* —— Forms —— */
input, select, textarea {
  font: inherit;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--text);
}

button {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    color 0.2s ease;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  border-color: rgba(99, 102, 241, 0.45);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 4px 16px rgba(59, 130, 246, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

button:hover:not(:disabled):where(
  :not(.btn-link):not(.btn-icon):not(.sub-account-picker-btn):not(.topbar-menu-btn):not(.chip-sub-remove):not(.promo-chip-remove):not(.promo-title-chip-remove):not(.btn-edit-metric):not(.btn-mat-rename):not(.btn-audit-reject):not(.btn-mgmt-audit-tag):not(.btn-ads-col-config):not(.btn-ad-opt-suggest):not(.btn-blue-accent):not(.btn-fill-aweme):not(.order-phase2-memo-tag-btn):not(.order-phase2-memo-tag-del):not(.order-phase2-memo-add):not(.header-adv-name-btn):not(.aweme-auth-subtab):not(.opt-switch):not(.multi-monitor-sub-tag):not(.mat-conv-rank-del):not(.theme-switch-btn):not(.mgmt-mat-title-text):not(.auth-session-user-btn):not(.auth-session-menu-action)
) {
  background: linear-gradient(135deg, #5090f8 0%, #7577f5 100%);
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 6px 22px rgba(59, 130, 246, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

button:active:not(:disabled):where(
  :not(.btn-link):not(.btn-icon):not(.sub-account-picker-btn):not(.topbar-menu-btn):not(.chip-sub-remove):not(.promo-chip-remove):not(.promo-title-chip-remove):not(.btn-edit-metric):not(.btn-mat-rename):not(.btn-audit-reject):not(.btn-mgmt-audit-tag):not(.btn-ads-col-config):not(.btn-ad-opt-suggest):not(.btn-blue-accent):not(.btn-fill-aweme):not(.order-phase2-memo-tag-btn):not(.order-phase2-memo-tag-del):not(.order-phase2-memo-add):not(.header-adv-name-btn):not(.aweme-auth-subtab):not(.opt-switch):not(.multi-monitor-sub-tag):not(.mat-conv-rank-del):not(.theme-switch-btn):not(.mgmt-mat-title-text):not(.auth-session-user-btn):not(.auth-session-menu-action)
) {
  transform: translateY(0);
}

button:focus-visible:where(
  :not(.btn-link):not(.btn-icon):not(.sub-account-picker-btn):not(.topbar-menu-btn):not(.chip-sub-remove):not(.promo-chip-remove):not(.promo-title-chip-remove):not(.btn-edit-metric):not(.btn-mat-rename):not(.btn-audit-reject):not(.btn-mgmt-audit-tag):not(.btn-ads-col-config):not(.btn-ad-opt-suggest):not(.btn-blue-accent):not(.btn-fill-aweme):not(.order-phase2-memo-tag-btn):not(.order-phase2-memo-tag-del):not(.order-phase2-memo-add):not(.header-adv-name-btn):not(.aweme-auth-subtab):not(.opt-switch):not(.multi-monitor-sub-tag):not(.mat-conv-rank-del):not(.theme-switch-btn):not(.mgmt-mat-title-text):not(.auth-session-user-btn):not(.auth-session-menu-action)
) {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px rgba(59, 130, 246, 0.45);
}

button.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  border-color: rgba(99, 102, 241, 0.45);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #5090f8 0%, #7577f5 100%);
  border-color: rgba(129, 140, 248, 0.55);
}

.btn-blue-accent,
.proj-create-name-row .btn-fill-aweme {
  background: var(--primary);
  border: 1px solid rgba(96, 165, 250, 0.55);
  color: #fff;
  font-weight: 400;
  letter-spacing: 0.02em;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(59, 130, 246, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-blue-accent:hover:not(:disabled),
.proj-create-name-row .btn-fill-aweme:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: rgba(147, 197, 253, 0.65);
  color: #fff;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.28),
    0 4px 14px rgba(37, 99, 235, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-blue-accent:active:not(:disabled),
.proj-create-name-row .btn-fill-aweme:active:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(0);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(37, 99, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

button.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

button.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(59, 130, 246, 0.32);
  color: var(--text);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

button.secondary:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(0);
}

button.ok {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  border-color: rgba(52, 211, 153, 0.45);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 4px 16px rgba(16, 185, 129, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

button.ok:hover:not(:disabled) {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 6px 22px rgba(16, 185, 129, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button.danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 4px 16px rgba(239, 68, 68, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

button.danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #fb8989 0%, #f55 100%);
  border-color: rgba(252, 165, 165, 0.5);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 6px 22px rgba(239, 68, 68, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button.warn {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  border-color: rgba(251, 146, 60, 0.45);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 4px 16px rgba(249, 115, 22, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

button.warn:hover:not(:disabled) {
  background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
  border-color: rgba(253, 186, 116, 0.5);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 6px 22px rgba(249, 115, 22, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button.btn-sm {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-btn-sm);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 3px 10px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

button.btn-sm.secondary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* 单元预约投放：已预约 */
button.btn-sm.ok.btn-ad-schedule.is-scheduled {
  background: linear-gradient(180deg, #34d399 0%, #16a34a 100%);
  border-color: rgba(74, 222, 128, 0.55);
  color: #ecfdf5;
  font-weight: 600;
}

button.btn-sm.ok {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 3px 10px rgba(16, 185, 129, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

button.btn-sm.danger {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 3px 10px rgba(239, 68, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

button.btn-sm.warn {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 3px 10px rgba(249, 115, 22, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

nav.tabs button {
  display: flex;
  justify-content: flex-start;
  background: transparent;
  border: none;
  min-height: unset;
  padding: 10px 12px;
  box-shadow: none;
  transform: none;
  font-weight: inherit;
  letter-spacing: normal;
}

nav.tabs button:hover:not(:disabled),
nav.tabs button:active:not(:disabled),
nav.tabs button:focus-visible {
  transform: none;
}

.sidebar nav.tabs button:hover:not(:disabled):not(.active) {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
  box-shadow: none;
}

.sidebar nav.tabs button.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  box-shadow: none;
}

.segmented button,
.bidding-subtab,
.aweme-auth-subtab {
  min-height: unset;
  box-shadow: none;
  transform: none;
  letter-spacing: normal;
  font-weight: inherit;
}

.segmented button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-btn-sm);
}

.segmented button:hover:not(:disabled):not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.segmented button.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.segmented button.active:hover:not(:disabled) {
  transform: none;
}

button.sub-account-picker-btn {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  min-height: unset;
  box-shadow: none;
  transform: none;
  font-weight: inherit;
  letter-spacing: normal;
}

button.sub-account-picker-btn:hover:not(:disabled) {
  background: var(--card-hover);
  border-color: var(--primary-border);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

button.multi-monitor-sub-tag {
  min-height: unset;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16) 0%, rgba(30, 64, 175, 0.08) 100%);
  border: 1px solid rgba(96, 165, 250, 0.38);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

button.multi-monitor-sub-tag:hover:not(:disabled),
button.multi-monitor-sub-tag:focus-visible,
button.multi-monitor-sub-tag:active:not(:disabled) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28) 0%, rgba(37, 99, 235, 0.16) 100%);
  border-color: rgba(147, 197, 253, 0.62);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px rgba(37, 99, 235, 0.22),
    0 0 0 1px rgba(59, 130, 246, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

button.btn-icon {
  padding: 2px 6px;
  font-size: 12px;
  min-width: 28px;
  min-height: unset;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
  transform: none;
  font-weight: inherit;
  letter-spacing: normal;
}

button.btn-icon:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--primary);
  transform: none;
  box-shadow: none;
}

button.btn-icon:active:not(:disabled),
button.btn-icon:focus-visible {
  transform: none;
}

button:disabled,
button.loading {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button:disabled:hover {
  transform: none;
}

.chip-sub-remove,
.promo-chip-remove,
.promo-title-chip-remove,
.header-adv-name-btn,
.btn-edit-metric,
.btn-mat-rename,
.btn-audit-reject,
.btn-ads-col-config,
.btn-ad-opt-suggest,
.order-phase2-memo-tag-btn,
.order-phase2-memo-tag-del,
.order-phase2-memo-add {
  min-height: unset;
  box-shadow: none;
  transform: none;
  letter-spacing: normal;
  font-weight: inherit;
}

.chip-sub-remove {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

.chip-sub-remove:hover:not(:disabled) {
  color: var(--danger, #e34d59);
  border-color: var(--danger, #e34d59);
  background: rgba(248, 113, 113, 0.12);
  transform: none;
  box-shadow: none;
}

.header-adv-name-btn {
  background: transparent;
  border: none;
  box-shadow: none;
}

.btn-edit-metric,
.btn-mat-rename,
.btn-audit-reject,
.btn-ads-col-config,
.btn-ad-opt-suggest {
  background: transparent;
  border-color: transparent;
}

.btn-audit-reject {
  background: #f53f3f;
  border: none;
}

.order-phase2-memo-tag-btn {
  background: transparent;
  border: none;
  box-shadow: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

input.input-sm { width: 70px; }
input.input-date {
  width: 138px;
  min-width: 138px;
}

.table-footer-date-controls input[type="date"] {
  width: 138px;
  min-width: 138px;
}
input.input-md { width: 140px; }
input.input-lg { width: 200px; }

textarea {
  width: 100%;
  min-height: 120px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.form-row .field { min-width: 130px; flex: 1; }

.form-row label {
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}

.muted { color: var(--muted); font-size: 12px; }

code, .id-code {
  font-size: 11px;
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

/* —— KPI / Overview —— */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

#overviewGrid.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

@media (max-width: 1200px) {
  #overviewGrid.overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #overviewGrid.overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #overviewGrid .stat {
    min-height: 0;
    padding: 10px 8px;
  }

  #overviewGrid .stat label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  #overviewGrid .stat span,
  #overviewGrid .stat.stat-highlight .stat-sub-name {
    font-size: 14px;
  }

  #overviewGrid .stat-current-sub .btn-edit-sub-remark {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  #overviewGrid .stat-sub-name-row {
    gap: 2px;
  }
}

#overviewGrid .stat {
  min-height: 88px;
  display: flex;
  flex-direction: column;
}

#overviewGrid .stat-loading .stat-loading-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: overview-spin 0.75s linear infinite;
}

@keyframes overview-spin {
  to { transform: rotate(360deg); }
}

.stat {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.15s, background 0.15s;
}

.stat:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}

.stat label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat span {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.stat.stat-highlight span { color: var(--primary); }

.stat.stat-highlight .stat-sub-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-sub-name-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.stat-sub-name-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.overview-sub-remark-input {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--text);
}

.stat-current-sub .btn-edit-sub-remark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s, background 0.15s, border-color 0.15s;
}

.stat-sub-name-row:hover .btn-edit-sub-remark,
.stat-current-sub.is-editing-sub-remark .btn-edit-sub-remark,
.btn-edit-sub-remark:focus-visible {
  opacity: 1;
}

.stat-current-sub .btn-edit-sub-remark:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.stat-current-sub .overview-sub-remark-save,
.stat-current-sub .overview-sub-remark-cancel {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
}

.stat-current-sub .overview-sub-remark-save:hover {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.12);
}

.stat-current-sub .overview-sub-remark-cancel:hover {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
}

#overviewGrid .overview-err span,
#overviewGrid .overview-err label { color: var(--danger); }

.skeleton-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

.skeleton {
  height: 72px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--card-hover) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-row td { padding: 12px 8px !important; }

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--card-hover) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* —— Table —— */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ads-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 10px;
}

.proj-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
  margin-top: 10px;
}

.ads-auto-refresh-hint {
  font-size: 12px;
  white-space: nowrap;
}

.table-footer-date-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  flex: 1;
  min-width: 0;
}

.table-footer-date-controls label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.proj-table-footer .table-footer-controls,
.ads-table-footer .table-footer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  margin-left: auto;
}

.proj-table-footer .table-footer-controls label,
.ads-table-footer .table-footer-controls label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td {
  border-bottom: 1px solid var(--border);
  border-left: none;
  border-right: none;
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-muted);
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-secondary);
}

tr:hover td { background: var(--surface-hover); }

tr.selected td {
  background: var(--primary-soft) !important;
}

tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

tr.row-active td {
  background: var(--primary-soft) !important;
  color: var(--text);
}

tr.row-active td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

tr.row-active:hover td {
  background: var(--primary-soft) !important;
}

tr.row-active .muted,
tr.row-active .name-text,
tr.row-active .metric-val {
  color: inherit;
}

td.col-actions {
  white-space: nowrap;
  min-width: 168px;
  width: 1%;
}

th.col-config,
td.col-config {
  width: 36px;
  min-width: 36px;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
}

.btn-ads-col-config {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  color: #4e5969;
  cursor: pointer;
}

.btn-ads-col-config:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.ads-col-config-dialog {
  width: min(720px, calc(100vw - 32px));
  max-width: min(720px, calc(100vw - 32px));
  max-height: min(88vh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.ads-col-config-dialog .metric-edit-head {
  flex-shrink: 0;
  margin-bottom: 10px;
}

.ads-col-config-hint {
  flex-shrink: 0;
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.5;
}

.ads-col-config-panels {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
  margin-bottom: 12px;
  overflow: hidden;
}

.ads-col-config-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-hover);
  overflow: hidden;
}

.ads-col-panel-title {
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.ads-col-config-available,
.ads-col-config-selected {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.ads-col-group {
  margin-bottom: 10px;
}

.ads-col-group:last-child {
  margin-bottom: 0;
}

.ads-col-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
  text-transform: none;
}

.ads-col-config-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  padding: 4px 2px;
  border-radius: 4px;
}

.ads-col-config-item:hover {
  background: var(--surface-hover);
}

.ads-col-config-item input {
  margin: 0;
  flex-shrink: 0;
}

.ads-col-config-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 12px 4px;
  text-align: center;
}

.ads-col-sort-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.ads-col-sort-item.is-editing {
  border-color: #93b4f5;
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.12);
}

.ads-col-sort-main {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.ads-col-sort-editing {
  gap: 6px;
}

.ads-col-sort-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-col-sort-label.is-renamed {
  color: #166534;
}

.ads-col-rename {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.ads-col-rename:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

.ads-col-rename-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.ads-col-rename-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.12);
}

.ads-col-rename-save,
.ads-col-rename-cancel {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  cursor: pointer;
}

.ads-col-rename-save {
  color: #166534;
}

.ads-col-rename-save:hover {
  background: rgba(74, 222, 128, 0.12);
  border-color: #86efac;
}

.ads-col-rename-cancel {
  color: var(--muted);
}

.ads-col-rename-cancel:hover {
  background: var(--surface-muted);
}

.ads-col-sort-item:last-child {
  margin-bottom: 0;
}

.ads-col-sort-item.is-locked {
  background: var(--surface-muted);
}

.ads-col-sort-item.is-locked .ads-col-sort-label::after {
  content: '固定';
  margin-left: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  vertical-align: middle;
}

.ads-col-sort-btns {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

.ads-col-sort-btns .btn-icon {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  color: #4e5969;
  cursor: pointer;
}

.ads-col-sort-btns .btn-icon:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.ads-col-sort-btns .btn-icon:disabled {
  opacity: 0.35;
  cursor: default;
}

.ads-col-sort-btns .ads-col-remove {
  color: #f53f3f;
  margin-left: 2px;
}

.ads-col-config-actions {
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .ads-col-config-dialog {
    max-height: min(92vh, 720px);
  }

  .ads-col-config-panels {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .ads-col-config-panel {
    min-height: 140px;
    max-height: 32vh;
  }
}

.action-group .opt-switch {
  flex-shrink: 0;
  margin-left: 2px;
}

.action-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}

.action-group .btn-sm {
  flex: 0 0 auto;
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-muted);
  color: #4e5969;
}

.badge.ok { background: #dcfce7; color: #166534; }
.badge.pause { background: var(--surface-muted); color: #4e5969; }
.badge.warn { background: #fef3c7; color: #92400e; }

.bid-strategy-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.bid-strategy-stable {
  background: var(--primary-soft);
  color: #1456c8;
}
.bid-strategy-max {
  background: #fff4e8;
  color: #d46b08;
}
.bid-strategy-optimal {
  background: #f3e8ff;
  color: #7c3aed;
}
.bid-strategy-default {
  background: var(--surface-muted);
  color: #4e5969;
}

.cell-name { max-width: 280px; }

.data-table tr.ads-table-summary {
  background: var(--surface-muted);
}
.data-table tr.ads-table-summary td {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  padding-top: 10px;
  padding-bottom: 10px;
}
.data-table tr.ads-table-summary .ads-summary-label {
  white-space: nowrap;
}
.data-table tr.ads-table-summary .ads-summary-metric {
  font-variant-numeric: tabular-nums;
}

/* 复选框列 ↔ 开关：间距收紧；开关 ↔ 名称：间距加大（项目 / 单元表一致） */
#projBody tr td:first-child,
#adsBody tr td:first-child {
  width: 1%;
  padding-right: 4px;
  padding-left: 8px;
}

#projBody tr td.cell-name,
#adsBody tr td.cell-name {
  padding-left: 2px;
}

.cell-name-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.name-text {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 项目 / 单元名称列：官网胶囊投放开关（缩小版） */
.opt-switch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 18px;
  min-width: 36px;
  min-height: 18px;
  padding: 2px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  transform: none;
  transition: background 0.2s;
}

.opt-switch:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: none;
  box-shadow: none;
}

.opt-switch.is-on {
  background: var(--primary);
  justify-content: flex-end;
}

.opt-switch.is-on:hover:not(:disabled) {
  background: var(--primary-dark);
}

.opt-switch:not(.is-on) {
  justify-content: flex-start;
}

.opt-switch-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.opt-switch-check {
  display: block;
  color: var(--primary);
}

.opt-switch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 单元状态列：圆点 + 学/保 标签（对齐官方） */
.cell-status .status-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-ok { background: #00b42a; }
.status-dot-pause { background: #f53f3f; }
.status-dot-warn { background: #ff7d00; }

.status-text {
  font-size: 13px;
  color: var(--text, #1d2129);
}

.cell-status .status-sub {
  margin-top: 1px;
  padding-left: 12px;
}

.status-time-ago {
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted, #86909c);
  white-space: nowrap;
}

.ad-neg-comment {
  display: inline;
  font-size: 12px;
  line-height: 1.4;
  color: #f53f3f;
  white-space: nowrap;
  cursor: default;
}

.btn-ad-opt-suggest {
  display: inline;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #ff7d00;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn-ad-opt-suggest:hover:not(:disabled) {
  background: transparent;
  color: #d25f00;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-ad-opt-suggest:active:not(:disabled) {
  background: transparent;
  color: #b84f00;
}

.btn-ad-opt-suggest:focus-visible {
  outline: 2px solid #ff7d00;
  outline-offset: 2px;
  border-radius: 2px;
}

.xb-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.xb-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  box-sizing: border-box;
  white-space: nowrap;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.xb-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.xb-ico svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* 学/保 标签：按主题区分配色 */
.theme-dark .xb-learn-ing {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.55);
  color: #93c5fd;
}

.theme-dark .xb-learn-done {
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.5);
  color: #86efac;
}

.theme-dark .xb-protect-ok {
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.5);
  color: #86efac;
}

.theme-dark .xb-protect-bad {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fca5a5;
}

.theme-light .xb-tag {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.theme-light .xb-learn-ing {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.theme-light .xb-learn-done {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.theme-light .xb-protect-ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.theme-light .xb-protect-bad {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.theme-light .status-text {
  color: var(--text);
  font-weight: 500;
}

.theme-light .ad-neg-comment {
  color: #dc2626;
}

.theme-light .btn-ad-opt-suggest {
  color: #c2410c;
}

.theme-light .btn-ad-opt-suggest:hover:not(:disabled) {
  color: #9a3412;
}

.theme-light .btn-ad-opt-suggest:active:not(:disabled) {
  color: #7c2d12;
}

.cell-id {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.err-text { color: var(--danger); }
.warn-text { color: #d97706; }
.date-range-stale-hint {
  flex: 0 0 100%;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.btn-audit-reject {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f53f3f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.btn-audit-reject:hover { background: #cb2634; }

.btn-audit-reject:focus-visible {
  outline: 2px solid #f53f3f;
  outline-offset: 2px;
}

.audit-reject-ico {
  display: block;
  transform: translateY(-0.5px);
}

.audit-reject-dialog {
  max-width: 860px;
  width: min(860px, calc(100vw - 32px));
}

.audit-reject-sub {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.audit-reject-body {
  max-height: min(60vh, 420px);
  overflow: auto;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.55;
}

.audit-reject-section + .audit-reject-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.audit-reject-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1d2129);
}

.audit-reject-section ul {
  margin: 0;
  padding-left: 1.15em;
}

.audit-reject-section li {
  margin: 4px 0;
  color: #4e5969;
}

.audit-reject-section li::marker { color: #f53f3f; }

.audit-reject-lines {
  margin: 10px 0 0;
  padding-left: 1.15em;
}

.audit-mat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.audit-mat-card + .audit-mat-card {
  border-top: 1px dashed var(--border);
}

.audit-mat-cover {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-muted);
}

.audit-mat-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}

.audit-mat-meta {
  min-width: 0;
  flex: 1;
}

.audit-mat-title {
  font-weight: 500;
  color: var(--text, #1d2129);
  word-break: break-all;
}

.audit-mat-id {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

/* —— 编辑单元弹窗 —— */
.edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.edit-overlay.hidden { display: none; }

/* 从其它 edit-overlay 内打开的二级弹窗（须高于主弹窗 1500 与 lightbox 2500） */
.edit-overlay.edit-overlay-nested {
  z-index: 2600;
}

.metric-edit-overlay {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.metric-edit-dialog {
  width: 100%;
  max-width: 600px;
  padding: 18px 20px;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.metric-edit-dialog.ads-col-config-dialog {
  width: min(720px, calc(100vw - 32px));
  max-width: min(720px, calc(100vw - 32px));
}

.metric-edit-dialog.paused-proj-dialog {
  width: min(960px, calc(100vw - 32px));
  max-width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.paused-proj-sub {
  margin: 0 0 10px;
  font-size: 13px;
}

.paused-proj-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.paused-proj-batch-bar {
  margin-bottom: 10px;
}

.paused-proj-table-wrap {
  flex: 1;
  min-height: 200px;
  max-height: min(52vh, 480px);
  overflow: auto;
}

.paused-proj-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.paused-proj-table-footer label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.metric-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.metric-edit-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.metric-edit-head .btn-icon.edit-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
  font-weight: 400;
  font-family: system-ui, sans-serif;
}

.metric-edit-head .btn-icon.edit-close:hover:not(:disabled),
.metric-edit-head .btn-icon.edit-close:focus-visible {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
  transform: none;
  box-shadow: none;
}

.metric-edit-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric-edit-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.metric-edit-input-wrap .metric-edit-input {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  padding-right: 34px;
  box-sizing: border-box;
}

.metric-edit-input-wrap:focus-within .metric-edit-input {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.metric-edit-spin {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  display: flex;
  flex-direction: column;
  width: 26px;
  border-left: 1px solid var(--border);
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
  overflow: hidden;
}

.metric-edit-spin-btn {
  flex: 1;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
}

.metric-edit-spin-btn + .metric-edit-spin-btn {
  border-top: 1px solid var(--border);
}

.metric-edit-spin-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.metric-edit-spin-btn:active {
  background: var(--primary-soft);
  color: var(--primary);
}

.metric-edit-input {
  width: 100%;
  margin-bottom: 16px;
}

.metric-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cell-metric-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cell-metric-edit .metric-val {
  min-width: 2.5em;
}

.btn-edit-metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-btn-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s, color 0.15s, background 0.15s, border-color 0.15s;
}

tr:hover .btn-edit-metric,
tr.row-active .btn-edit-metric,
.cell-metric-edit:hover .btn-edit-metric,
.btn-edit-metric:focus-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.btn-edit-metric:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.btn-edit-metric svg {
  display: block;
}

.cell-remark-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

.cell-remark-edit .remark-val {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-edit-remark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-btn-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s, color 0.15s, background 0.15s, border-color 0.15s;
}

tr:hover .btn-edit-remark,
.multi-monitor-aweme-remark.is-editing .btn-edit-remark,
.cell-remark-edit:hover .btn-edit-remark,
.btn-edit-remark:focus-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.btn-edit-remark:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.multi-monitor-remark-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-btn-sm);
  background: var(--card);
  color: var(--text);
}

.multi-monitor-remark-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.multi-monitor-aweme-remark.is-editing .cell-remark-edit {
  width: 100%;
}

.multi-monitor-remark-save,
.multi-monitor-remark-cancel {
  flex-shrink: 0;
}

.edit-panel {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 640px;
  max-height: min(90dvh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.edit-header h2 {
  margin: 0;
  font-size: 17px;
}

.edit-header .edit-close {
  font-size: 22px;
  line-height: 1;
  padding: 4px 10px;
}

.edit-body {
  padding: 16px 18px 18px;
  overflow-y: auto;
}

.edit-plan-info-wrap {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.edit-plan-info-wrap .edit-plan-info + .edit-plan-info {
  margin-top: 8px;
}

.edit-plan-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.edit-plan-info-value--copy {
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.edit-plan-info-label {
  font-size: 13px;
  flex-shrink: 0;
}

.edit-plan-info-value {
  font-size: 13px;
}

.edit-section-title {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.edit-material-meta {
  font-weight: 400;
  font-size: 12px;
  margin-left: 8px;
}

.edit-material-grid {
  max-height: 280px;
  overflow-y: auto;
  margin-top: 8px;
}

.edit-material-grid .material-name-row {
  align-items: flex-start;
}

.edit-material-grid .material-name-row .material-name {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.edit-ad-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.edit-ad-form-grid {
  display: grid;
  grid-template-columns: 1fr 140px 140px;
  gap: 12px 14px;
  align-items: end;
}

@media (max-width: 640px) {
  .edit-ad-form-grid {
    grid-template-columns: 1fr;
  }
}

.edit-ad-form .field span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.edit-ad-form .field input {
  width: 100%;
}

.edit-ad-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

/* —— Material —— */
.segmented {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  background: var(--surface-hover);
  border-radius: var(--radius-btn);
  margin-bottom: 12px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.material-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  font-size: 11px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.material-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.material-card .thumb {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 180px;
  object-fit: cover;
  background: var(--surface-muted);
  display: block;
}

.material-card .thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  min-height: 120px;
}

.material-card .material-thumb-wrap {
  cursor: pointer;
}

.material-card .meta {
  padding: 8px;
  line-height: 1.45;
}

.material-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.material-name-row .material-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.material-name-row.is-editing {
  gap: 2px;
}

.material-rename-input {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.btn-mat-rename {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s, color 0.15s, background 0.15s;
}

.material-card:hover .btn-mat-rename,
.material-name-row.is-editing .btn-mat-rename,
.btn-mat-rename:focus-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.btn-mat-rename:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.material-name-row .material-rename-save,
.material-name-row .material-rename-cancel {
  width: 22px;
  height: 22px;
  padding: 0;
  flex-shrink: 0;
}

.material-sub {
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-monitor-toolbar {
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.batch-topup-panel {
  max-width: 460px;
  border-radius: 16px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.45);
}

.batch-topup-panel .edit-header {
  padding: 18px 20px 14px;
  background:
    radial-gradient(ellipse 70% 120% at 0% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
    var(--surface-muted);
}

.batch-topup-panel .edit-header h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.batch-topup-progress {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.batch-topup-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 18px;
}

.batch-topup-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.batch-topup-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card-hover) 55%, transparent);
  min-height: 38px;
}

.batch-topup-chip-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.batch-topup-chip-value {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.batch-topup-chip-unit {
  font-size: 11px;
  color: var(--muted);
}

.batch-topup-chip.is-zero .batch-topup-chip-value {
  color: var(--danger);
}

.batch-topup-chip.is-amt {
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}

.batch-topup-chip.is-amt .batch-topup-chip-value {
  color: var(--warn);
}

.batch-topup-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.batch-topup-item {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 14px 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-hover) 70%, transparent) 0%, var(--surface-muted) 100%);
  font-size: 13px;
}

.batch-topup-item.is-ready {
  border-color: color-mix(in srgb, var(--warn) 42%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--warn) 8%, var(--surface-muted)) 0%, var(--surface-muted) 100%);
}

.batch-topup-item.is-skip {
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ok) 8%, var(--surface-muted)) 0%, var(--surface-muted) 100%);
}

.batch-topup-item.is-need {
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 8%, var(--surface-muted)) 0%, var(--surface-muted) 100%);
}

.batch-topup-item.is-fail {
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--danger) 8%, var(--surface-muted)) 0%, var(--surface-muted) 100%);
}

.batch-topup-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.batch-topup-item-name {
  min-width: 0;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-topup-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
}

.batch-topup-badge.is-ready {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn) 28%, transparent);
}

.batch-topup-badge.is-skip {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok) 28%, transparent);
}

.batch-topup-badge.is-need {
  color: #93c5fd;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.batch-topup-badge.is-fail {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-topup-item-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.batch-topup-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}

.batch-topup-stat-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.batch-topup-stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.batch-topup-stat-unit {
  margin-left: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.batch-topup-item-calc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

.batch-topup-item-calc-label {
  color: var(--text-secondary);
}

.batch-topup-item-calc strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}

.batch-topup-item-calc-unit {
  color: var(--muted);
  font-size: 12px;
}

.batch-topup-item-calc-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.batch-topup-cost-stepper {
  display: inline-flex;
  align-items: stretch;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 70%, var(--surface-muted));
  vertical-align: middle;
}

button.batch-topup-cost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  min-height: 0;
  height: auto;
  padding: 0;
  gap: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  transform: none;
  cursor: pointer;
}

button.batch-topup-cost-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: transparent;
  box-shadow: none;
  color: var(--text);
  transform: none;
}

button.batch-topup-cost-btn:active:not(:disabled) {
  background: var(--primary-soft);
  box-shadow: none;
  color: var(--primary);
  transform: none;
}

button.batch-topup-cost-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.batch-topup-cost-input {
  width: 44px;
  min-width: 0;
  height: 100%;
  padding: 0 2px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.batch-topup-cost-input:focus {
  outline: none;
  background: var(--surface);
}

.batch-topup-cost-input::-webkit-inner-spin-button,
.batch-topup-cost-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.batch-topup-item-calc.is-muted {
  color: var(--muted);
  border-top-style: solid;
}

.batch-topup-form-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-muted) 88%, #000);
}

.batch-topup-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.batch-topup-form .field.hidden {
  display: none;
}

.batch-topup-form:has(.batch-topup-expected-wrap.hidden) {
  grid-template-columns: 1fr;
}

.batch-topup-expected-wrap,
.batch-topup-amount-wrap {
  margin: 0;
  min-width: 0;
}

.batch-topup-expected-wrap label,
.batch-topup-amount-wrap label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.batch-topup-form .input-md {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.batch-topup-form-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.batch-topup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.batch-topup-actions-side,
.batch-topup-actions-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.batch-topup-actions-main {
  margin-left: auto;
}

.batch-topup-actions .btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

.batch-topup-actions .btn.primary {
  min-width: 120px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.batch-topup-abort {
  color: var(--muted) !important;
}

.batch-topup-abort:hover {
  color: var(--danger) !important;
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

@media (max-width: 520px) {
  .batch-topup-form {
    grid-template-columns: 1fr;
  }

  .batch-topup-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .batch-topup-actions-side,
  .batch-topup-actions-main {
    width: 100%;
  }

  .batch-topup-actions-main .btn,
  .batch-topup-actions-side .btn {
    flex: 1;
  }

  .batch-topup-actions-main {
    margin-left: 0;
  }
}

.multi-monitor-filter,
.multi-monitor-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.multi-monitor-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
}

.multi-monitor-auto-hint {
  font-size: 12px;
}

.multi-monitor-hint {
  margin: 0 0 12px;
  font-size: 13px;
}

.multi-monitor-table th,
.multi-monitor-table td {
  font-size: 14px;
  padding: 11px 10px;
  vertical-align: middle;
  line-height: 1.5;
}

.multi-monitor-table th {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.multi-monitor-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.multi-monitor-table td.multi-monitor-balance-cell,
.multi-monitor-table td:nth-child(4),
.multi-monitor-table td:nth-child(7),
.multi-monitor-table td.multi-monitor-convcost-cell {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.multi-monitor-table .badge {
  font-size: 12px;
  padding: 4px 10px;
}

.multi-monitor-aweme-cell {
  min-width: 140px;
  max-width: 240px;
}

.multi-monitor-aweme-nick {
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: 1px;
}

.multi-monitor-aweme-remark {
  margin-top: 6px;
}

.multi-monitor-aweme-remark .tag-sub-name {
  max-width: 100%;
  padding: 2px 7px;
  font-size: 12px;
  border-radius: 5px;
  line-height: 1.35;
}

.multi-monitor-balance-cell {
  color: color-mix(in srgb, var(--ok) 80%, transparent);
  font-weight: 600;
  white-space: nowrap;
}

.multi-monitor-balance-cell.is-zero {
  color: color-mix(in srgb, var(--danger) 80%, transparent);
}

.multi-monitor-balance-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.multi-monitor-balance-val {
  font-variant-numeric: tabular-nums;
}

.btn-multi-monitor-topup {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  margin: 0;
  padding: 0 7px;
  min-height: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--warn, #f59e0b) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn, #f59e0b) 16%, transparent);
  color: color-mix(in srgb, var(--warn, #f59e0b) 92%, #fff);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.12s ease, visibility 0.12s ease, background 0.12s ease;
}

.multi-monitor-balance-cell:hover .btn-multi-monitor-topup,
.multi-monitor-table tr:hover .btn-multi-monitor-topup,
.btn-multi-monitor-topup:focus-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.btn-multi-monitor-topup:hover {
  background: color-mix(in srgb, var(--warn, #f59e0b) 28%, transparent);
}

.btn-multi-monitor-topup:active {
  transform: translateY(0.5px);
}

.multi-monitor-table td:nth-child(4),
.multi-monitor-table td:nth-child(7),
.multi-monitor-table td.multi-monitor-convcost-cell {
  font-weight: 700;
}

.multi-monitor-convcost-cell.is-high {
  color: color-mix(in srgb, var(--primary) 80%, transparent);
}

.multi-monitor-convcost-cell.is-mid {
  color: color-mix(in srgb, #f97316 80%, transparent);
}

.multi-monitor-convcost-cell.is-low {
  color: color-mix(in srgb, var(--ok) 80%, transparent);
}

.multi-monitor-sub-cell {
  min-width: 112px;
  max-width: 168px;
}

.multi-monitor-sub-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  line-height: 1.3;
  cursor: pointer;
  overflow: hidden;
}

.multi-monitor-sub-tag-accent {
  flex-shrink: 0;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #93c5fd 0%, #2563eb 100%);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.55);
}

.multi-monitor-sub-tag-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-monitor-table th:nth-child(1),
.multi-monitor-table td:nth-child(1) {
  min-width: 112px;
  max-width: 168px;
}

.multi-monitor-table th:nth-child(2),
.multi-monitor-table td:nth-child(2) {
  min-width: 140px;
  max-width: 240px;
}

.multi-monitor-table th:nth-child(9),
.multi-monitor-table td.multi-monitor-recharge-cell {
  width: 64px;
  min-width: 64px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.multi-monitor-recharge-cell button.btn-sm.btn-multi-monitor-recharge {
  min-width: 44px;
  min-height: 24px;
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  border-radius: 999px;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

.multi-monitor-unit-status-cell {
  min-width: 96px;
  padding-left: 8px;
  vertical-align: middle;
}

.multi-monitor-unit-status-cell .cell-status {
  display: block;
  min-height: 100%;
}

.multi-monitor-unit-status-cell .cell-status .status-main {
  gap: 4px;
}

.multi-monitor-unit-status-cell .status-sub {
  margin-top: 2px;
  padding-left: 12px;
}

.multi-monitor-unit-status-cell .status-time-ago {
  font-size: 11px;
}

.multi-monitor-unit-status-cell .status-text {
  font-size: 12px;
}

.multi-monitor-unit-status-cell .xb-group {
  gap: 3px;
}

.multi-monitor-unit-status-cell .xb-tag {
  height: 16px;
  padding: 0 5px 0 4px;
  font-size: 10px;
  gap: 2px;
  letter-spacing: 0;
  box-shadow: none;
}

.multi-monitor-unit-status-cell .xb-ico {
  width: 10px;
  height: 10px;
}

.multi-monitor-unit-status-cell .xb-ico svg {
  width: 10px;
  height: 10px;
}

.multi-monitor-proj-switch-cell {
  min-width: 110px;
  padding-left: 8px;
  vertical-align: middle;
}

.multi-monitor-status-cell {
  min-width: 88px;
  padding-left: 8px;
}

.multi-monitor-proj-switch-cell .multi-monitor-status-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.multi-monitor-status-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.multi-monitor-status-row .badge {
  font-size: 10px;
  padding: 2px 6px;
  line-height: 1.3;
  height: 17px;
  box-sizing: border-box;
}

.multi-monitor-status-row .opt-switch {
  flex-shrink: 0;
  width: 32px;
  min-width: 32px;
  height: 17px;
  min-height: 17px;
  padding: 2px;
  border-radius: 999px;
}

.multi-monitor-status-row .opt-switch-thumb {
  width: 13px;
  height: 13px;
}

.multi-monitor-status-row .opt-switch-check {
  width: 6px;
  height: 6px;
}

.multi-monitor-share-from {
  font-size: 12px;
  margin-top: 2px;
}

.multi-monitor-balance-convert {
  min-width: 140px;
}

.multi-monitor-recent-cost {
  font-size: 13px;
  margin-bottom: 4px;
}

.multi-monitor-recent-conv {
  font-size: 14px;
  color: var(--text);
}

.multi-monitor-recent-cost strong {
  font-size: 15px;
  color: var(--primary);
}

.multi-monitor-recent-cost.is-zero strong {
  color: var(--danger);
}

.multi-monitor-recent-conv strong {
  font-size: 15px;
  color: var(--ok);
}

.multi-monitor-log-wrap {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.multi-monitor-log-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 10px;
}

.multi-monitor-log-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.multi-monitor-log-desc {
  font-size: 12px;
  flex: 1;
}

.multi-monitor-log-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.multi-monitor-log-search {
  display: flex;
  align-items: center;
  gap: 6px;
}

.multi-monitor-log-search .input-sm {
  width: 168px;
  height: 30px;
  padding: 3px 10px;
  font-size: 12px;
}

.multi-monitor-log-table tr.is-log-search-hit td {
  background: rgba(34, 197, 94, 0.1);
  box-shadow: none;
  border-top: 2px solid #22c55e;
  border-bottom: 2px solid #22c55e;
  border-left: none;
  border-right: none;
}

.multi-monitor-log-table tr.is-log-search-hit td:first-child {
  border-left: 2px solid #22c55e;
}

.multi-monitor-log-table tr.is-log-search-hit td:last-child {
  border-right: 2px solid #22c55e;
}

.multi-monitor-log-table-wrap {
  max-height: 280px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.multi-monitor-log-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.multi-monitor-log-table th,
.multi-monitor-log-table td {
  font-size: 13px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
  line-height: 1.55;
  padding: 10px 12px;
  letter-spacing: normal;
}

.multi-monitor-log-table th:nth-child(1),
.multi-monitor-log-table td.cell-time {
  white-space: nowrap;
  min-width: 132px;
}

.multi-monitor-log-table th:nth-child(2),
.multi-monitor-log-table td.cell-sub {
  min-width: 108px;
  max-width: 180px;
}

.multi-monitor-log-table th:nth-child(3),
.multi-monitor-log-table .cell-name {
  min-width: 140px;
  max-width: 280px;
}

.multi-monitor-log-table th:nth-child(4),
.multi-monitor-log-table td.cell-nick {
  min-width: 88px;
  max-width: 140px;
}

.multi-monitor-log-table th:nth-child(5),
.multi-monitor-log-table th:nth-child(6),
.multi-monitor-log-table td.cell-metric {
  white-space: nowrap;
  min-width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.multi-monitor-errors {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.multi-monitor-error-item {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--danger, #e34d59);
  background: rgba(227, 77, 89, 0.08);
  border: 1px solid rgba(227, 77, 89, 0.35);
  border-radius: var(--radius);
}

.multi-monitor-log-empty {
  margin: 10px 0 0;
  font-size: 13px;
  text-align: center;
  padding: 16px;
  background: var(--surface-muted);
  border-radius: var(--radius);
}

.multi-monitor-log-empty.hidden {
  display: none;
}

.btn-link {
  display: inline;
  min-height: unset;
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.btn-link:hover:not(:disabled) {
  text-decoration: underline;
  background: none;
  transform: none;
  box-shadow: none;
}

.dev-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-hover);
}

.dev-panel summary {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.dev-panel textarea { min-height: 60px; margin: 0 8px 8px; border: none; background: var(--card); }

/* —— AI —— */
.ai-box {
  background: var(--surface-hover);
  border: 1px dashed var(--border);
}

/* —— Log —— */
.log-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.log-panel summary {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  background: var(--surface-muted);
}

.log {
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  padding: 12px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
}

.log.err { border-top: 2px solid #7f1d1d; }

.log-box {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-box.err { color: #fecaca; }

.ai-export {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

.material-raw {
  width: 100%;
  margin-top: 10px;
  font-size: 11px;
  font-family: ui-monospace, monospace;
}

.edit-material-titles-wrap {
  display: block;
  margin-top: 12px;
}

.edit-material-titles-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.edit-material-titles {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  resize: vertical;
  min-height: 72px;
}

/* —— Embed —— */
.embed-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 12px;
}

.embed-overlay.hidden { display: none; }

.embed-panel {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.embed-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.embed-toolbar strong { font-size: 15px; flex-shrink: 0; }

.embed-toolbar .embed-hint {
  flex: 1;
  min-width: 120px;
  font-size: 11px;
  color: var(--muted);
}

.embed-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.embed-panel iframe {
  flex: 1;
  width: 100%;
  min-height: min(85dvh, calc(100vh - 88px));
  border: none;
  background: var(--card);
}

@media (max-width: 640px) {
  .embed-actions { width: 100%; }
  .embed-actions button { flex: 1; }
}

/* —— Toast —— */
#toastRoot {
  position: fixed;
  top: 16px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(90vw, 480px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-left-color: var(--primary);
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
}

.toast.ok {
  border-left-color: var(--ok);
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.28);
}

.toast.err {
  border-left-color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.32);
}

.toast.warn {
  border-left-color: var(--warn);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

.toast.info {
  border-left-color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* —— 财务 / 转账 —— */
.finance-table-wrap {
  max-height: min(58vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.finance-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-muted);
  box-shadow: 0 1px 0 var(--border);
}

.finance-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.finance-transfer-panel {
  max-width: 720px;
  overflow-x: hidden;
}

.finance-transfer-log-panel {
  width: min(96vw, 1100px);
  max-width: 1100px;
  max-height: 90vh;
}

.finance-transfer-log-toolbar {
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.finance-transfer-log-table-wrap {
  max-height: calc(90vh - 200px);
  overflow: auto;
}

.finance-transfer-log-table th,
.finance-transfer-log-table td {
  font-size: 13px;
  vertical-align: top;
}

.finance-transfer-log-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.finance-transfer-log-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.finance-transfer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 6px;
  align-items: center;
}

.finance-transfer-form .field-transfer-from,
.finance-transfer-form .field-transfer-to {
  display: contents;
}

.finance-transfer-form .field-transfer-from label,
.finance-transfer-form .field-transfer-to label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.finance-transfer-form .field-transfer-from label {
  grid-column: 1;
  grid-row: 1;
}

.finance-transfer-form .field-transfer-from select {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
}

.finance-transfer-form .field-transfer-to label {
  grid-column: 3;
  grid-row: 1;
}

.finance-transfer-form .field-transfer-to select {
  grid-column: 3;
  grid-row: 2;
  width: 100%;
  min-width: 0;
}

.transfer-swap-wrap {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: center;
  padding: 0;
}

#btnTransferSwap {
  min-width: 32px;
  min-height: unset;
  height: calc(1em + 14px + 2px);
  font-size: 16px;
  line-height: 1;
  padding: 0 8px;
  box-sizing: border-box;
}

.finance-transfer-amount-block {
  margin-top: 4px;
}

.finance-transfer-amount-block label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
}

.transfer-calc {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.transfer-calc-input,
.transfer-calc-result-input {
  width: 88px;
  min-width: 72px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  font: inherit;
  color: var(--text);
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.transfer-calc-result-input {
  width: 96px;
  font-weight: 500;
}

.transfer-calc-input[type="number"]::-webkit-inner-spin-button,
.transfer-calc-input[type="number"]::-webkit-outer-spin-button,
.transfer-calc-result-input[type="number"]::-webkit-inner-spin-button,
.transfer-calc-result-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.transfer-calc-input:focus,
.transfer-calc-result-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.transfer-calc-op {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.transfer-calc-unit {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
}

/* —— 抖音授权 —— */
.aweme-auth-send {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-input);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.aweme-auth-send-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(260px, 1fr);
  gap: 20px 24px;
  align-items: start;
}

@media (max-width: 720px) {
  .aweme-auth-send-grid {
    grid-template-columns: 1fr;
  }
}

.aweme-auth-form {
  display: block;
}

.aweme-auth-fields {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 320px;
}

.aweme-auth-form .field {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.aweme-auth-form .field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.aweme-auth-form .field input {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

#btnAwemeInvite.btn-aweme-invite {
  margin: 4px 0 0;
  padding: 10px 28px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

#btnAwemeInvite.btn-aweme-invite:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

#btnAwemeInvite.btn-aweme-invite:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.22);
}

.aweme-auth-form input::placeholder {
  font-size: 11px;
  color: var(--muted);
}

.aweme-auth-form input:focus::placeholder {
  color: transparent;
}

.aweme-auth-batch {
  min-width: 0;
}

.aweme-auth-batch .field {
  max-width: 240px;
}

.aweme-auth-batch .field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.aweme-auth-batch-select {
  width: 100%;
  max-width: 240px;
}

.aweme-auth-batch-selected {
  margin-top: 10px;
  min-height: 40px;
  max-width: 360px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.aweme-auth-batch-empty {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.aweme-auth-batch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  color: var(--text);
}

.aweme-auth-batch-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.aweme-auth-batch-chip-id {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.aweme-auth-batch-chip-remove {
  flex-shrink: 0;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: none;
}

.aweme-auth-batch-chip-remove:hover:not(:disabled) {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
  border-color: transparent;
}

.aweme-auth-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
}

.aweme-auth-preview.hidden {
  display: none;
}

.aweme-auth-preview img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.aweme-auth-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.aweme-auth-cross-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.aweme-auth-cross-search .input-md {
  width: 160px;
  min-width: 120px;
}

.aweme-auth-search-panel {
  margin-bottom: 12px;
}

.aweme-auth-search-meta {
  margin-bottom: 8px;
}

.aweme-auth-search-type-direct {
  color: #34d399;
}

.aweme-auth-search-type-shared {
  color: #67e8f9;
}

.aweme-auth-subtabs {
  display: inline-flex;
  gap: 4px;
  margin-right: 8px;
}

.aweme-auth-subtab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  min-height: unset;
  box-shadow: none;
  transform: none;
  font-weight: inherit;
  letter-spacing: normal;
}

.aweme-auth-subtab:hover:not(:disabled):not(.active) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.aweme-auth-subtab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}

.aweme-auth-subtab.active:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  transform: none;
  box-shadow: none;
}

.aweme-auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aweme-auth-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.badge-auth-pending {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.badge-auth-ok {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.badge-auth-off {
  color: var(--muted);
  background: var(--surface-muted);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.badge-auth-shared {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.38);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 4px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.aweme-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.aweme-share-panel {
  max-width: 640px;
  width: 96vw;
}

.aweme-share-info {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 14px;
}

.aweme-share-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.aweme-share-toolbar .field {
  margin: 0;
}

.aweme-share-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.aweme-share-list-head .aweme-share-hint {
  margin: 0;
  flex: 1;
}

.aweme-share-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.aweme-share-hint {
  margin: 0 0 8px;
  font-size: 13px;
}

.aweme-share-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.aweme-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.aweme-share-item:last-child {
  border-bottom: none;
}

.aweme-share-item.disabled {
  opacity: 0.55;
}

.aweme-share-item-main {
  flex: 1;
  min-width: 0;
}

.aweme-share-item-name {
  font-weight: 500;
}

.aweme-share-item-id {
  font-size: 12px;
  color: var(--muted);
}

.aweme-share-tag {
  font-size: 12px;
  color: #047857;
  background: rgba(74, 222, 128, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.aweme-share-actions {
  margin-top: 14px;
  justify-content: flex-end;
  gap: 8px;
}

/* —— 新建计划弹窗 —— */
.project-create-panel {
  max-width: 880px;
  width: 96vw;
}

.project-create-body {
  max-height: 75vh;
  overflow-y: auto;
}

.project-create-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.project-create-section:last-of-type {
  border-bottom: none;
}

.project-create-row {
  flex-wrap: wrap;
  gap: 12px 16px;
}

.project-create-row .field {
  flex: 1 1 180px;
  min-width: 160px;
}

.proj-create-aweme-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proj-create-aweme-row .aweme-picker {
  flex: 1;
  min-width: 0;
  position: relative;
}

.proj-create-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proj-create-name-row input {
  flex: 1;
  min-width: 0;
}

.proj-create-name-row .btn-sm {
  flex-shrink: 0;
  white-space: nowrap;
}

.aweme-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.aweme-picker-trigger:hover {
  border-color: var(--border-strong);
}

.aweme-picker-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.aweme-picker-trigger-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.aweme-picker-avatar-wrap {
  flex-shrink: 0;
  display: flex;
}

.aweme-picker-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--surface-muted);
}

.aweme-picker-avatar.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
}

.aweme-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.aweme-picker-caret {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}

.aweme-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 120;
  max-height: 240px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 4px;
}

.aweme-picker-menu.hidden {
  display: none;
}

.aweme-picker-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.aweme-picker-option:hover,
.aweme-picker-option.selected {
  background: var(--card-hover);
}

.aweme-picker-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.4;
}

.project-create-row .field-age {
  flex: 1 1 100%;
}

.proj-create-age {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 4px;
}

.proj-create-age .chk-label {
  font-size: 13px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.project-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.project-create-hint {
  margin: 0 0 8px;
  font-size: 13px;
}

.field-grow {
  flex: 2 1 280px;
  min-width: 220px;
}

.proj-create-static {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 14px;
  color: var(--text);
}

.proj-create-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  align-items: flex-start;
}

.proj-schedule-col {
  flex: 1 1 200px;
  min-width: 180px;
}

.proj-schedule-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.proj-schedule-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proj-schedule-fields .field {
  flex: none;
  min-width: 0;
  width: 100%;
}

.proj-create-bid-strategy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.proj-bid-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  width: 100%;
  box-sizing: border-box;
}

.proj-bid-opt:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.proj-bid-opt input {
  margin: 0;
}

/* —— 新建单元弹窗 —— */
.promotion-create-panel {
  max-width: 920px;
  width: 96vw;
}

#promoCreateProjectSelect {
  padding: 7px 30px;
}

.promotion-create-panel .promo-create-bid-memo-wrap {
  display: none !important;
}

.promo-create-remark-field {
  margin-top: 4px;
}

.promo-create-remark-input {
  width: 200px;
  max-width: 200px;
}

.promo-create-remark-presets-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 4px;
}

.promotion-create-body {
  max-height: 78vh;
  overflow-y: auto;
}

.promotion-create-panel .proj-create-name-row {
  max-width: 50%;
}

.promotion-create-panel .proj-create-name-row input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.promo-create-aweme {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  max-width: 50%;
  min-width: 240px;
}

.promo-create-aweme.hidden {
  display: none;
}

.promo-create-aweme img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.promo-create-aweme-text {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
}

.promo-aweme-ph.warn {
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
}

.promo-aweme-warn {
  color: #b45309;
  font-size: 12px;
  line-height: 1.45;
}

.promo-aweme-ph {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.promo-mat-hint {
  font-size: 12px;
  margin: 0 0 8px;
  line-height: 1.5;
}

.metric-edit-dialog.mail-settings-dialog {
  width: min(640px, 94vw);
  max-width: min(640px, 94vw);
  padding: 20px 24px;
}

.mail-settings-dialog {
  max-height: 90vh;
  overflow-y: auto;
}

.mail-settings-dialog .input-md,
.mail-settings-dialog .input-sm {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.mail-settings-hint {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.mail-settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.mail-settings-row-checks .mail-field-check {
  flex: 1 1 200px;
  margin-bottom: 0;
}

.mail-settings-row-fields .field {
  flex: 1 1 calc(50% - 8px);
  min-width: 0;
  margin-bottom: 0;
}

.mail-settings-dialog .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.mail-field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  cursor: pointer;
}

.mail-notify-types {
  margin: 8px 0 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}

.mail-notify-types .muted {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: 12px;
}

.mail-notify-types .mail-field-check {
  margin-bottom: 4px;
}

.mail-settings-actions {
  flex-wrap: wrap;
}

.account-config-dialog {
  max-width: 720px;
}

.system-config-dialog {
  width: min(720px, 94vw);
  max-width: min(720px, 94vw);
}

.system-config-section + .system-config-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.system-config-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.system-config-section-head {
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
}

.system-config-section:not(.is-collapsed) .system-config-section-head {
  margin-bottom: 12px;
}

.system-config-section-toggle {
  flex-shrink: 0;
  border: none;
  background: none;
  box-shadow: none;
  padding: 0 2px;
  margin: 0;
  min-width: 0;
  min-height: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  color: var(--primary);
  cursor: pointer;
  transform: none;
}

.system-config-section-toggle:hover:not(:disabled) {
  color: #93c5fd;
  background: none;
  box-shadow: none;
  transform: none;
}

.system-config-section-head:hover .system-config-section-toggle {
  color: #93c5fd;
}

.system-config-section.is-collapsed .system-config-section-body {
  display: none;
}

.system-config-section-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.account-config-actions {
  justify-content: space-between;
}

.sub-account-prefix-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.sub-account-prefix-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 140px minmax(88px, 0.7fr);
  gap: 16px 24px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
}

.sub-account-prefix-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sub-account-prefix-cell-label {
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}

.sub-account-prefix-cell-body {
  min-height: 36px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.sub-account-prefix-origin .sub-account-prefix-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-all;
}

.sub-account-prefix-alias-field {
  margin: 0;
}

.sub-account-prefix-alias-field .sub-account-prefix-input {
  width: 100%;
  box-sizing: border-box;
}

.sub-account-prefix-preview-text {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .sub-account-prefix-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.unit-settings-memo-block {
  margin-top: 12px;
}

.unit-settings-memo-heading {
  margin: 0 0 8px;
  font-size: 13px;
}

.unit-settings-memo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.unit-settings-memo-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
}

.unit-settings-memo-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.unit-settings-memo-row label span {
  font-size: 12px;
  color: var(--muted);
}

.unit-settings-memo-add {
  margin-top: 4px;
}

.system-config-footer-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.account-config-meta {
  margin: 0 0 12px;
  font-size: 12px;
}

.account-config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.account-config-cookie {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
}

.account-config-cookie:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.promo-create-mat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.promo-mat-view-tabs {
  display: inline-flex;
  flex-shrink: 0;
  gap: 0;
  margin-left: auto;
  border: 1px solid var(--border, #e5e6eb);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
}

.promo-mat-view-tab {
  border: none;
  background: var(--surface-muted);
  color: #4e5969;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  line-height: 1.2;
}

.promo-mat-view-tab + .promo-mat-view-tab {
  border-left: 1px solid var(--border, #e5e6eb);
}

.promo-mat-view-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.promo-mat-view-tab.active {
  background: var(--primary, #2563eb);
  color: #fff;
}

.promo-mat-view-tab.active:hover {
  background: #1d4ed8;
  color: #fff;
}

#promoCreateMatMeta {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
}

.upload-progress {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 160px;
  flex-shrink: 0;
}

.upload-progress.hidden {
  display: none;
}

.upload-progress-label {
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.2;
  white-space: nowrap;
}

.upload-progress-track {
  width: 100%;
  height: 3px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary, #2563eb);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.upload-progress.is-processing .upload-progress-fill {
  transition: none;
  animation: upload-progress-pulse 1.4s ease-in-out infinite;
}

@keyframes upload-progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.promo-create-video-picker {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.promo-create-video-picker .promo-mat-card {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}

.promo-create-video-picker .promo-mat-card:active {
  transform: scale(0.98);
}

.promo-create-video-picker .promo-mat-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.promo-mat-card .mgmt-mat-eval-tags {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  margin-bottom: 0;
  gap: 3px;
  max-width: calc(100% - 12px);
}

.promo-mat-card .mgmt-mat-eval-tag {
  font-size: 10px;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 3px;
}

.promo-mat-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.promo-mat-dur {
  position: absolute;
  bottom: 52px;
  right: 6px;
  z-index: 2;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

.promo-mat-cost {
  font-variant-numeric: tabular-nums;
}

.promo-create-selected-label {
  font-size: 12px;
  margin: 8px 0 6px;
}

.promo-create-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.promo-create-aigc-wrap {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
}

.promo-create-aigc-wrap.hidden {
  display: none;
}

.promo-create-aigc-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

.promo-create-aigc-hint {
  margin: 6px 0 0 24px;
  font-size: 12px;
  line-height: 1.4;
}

.promo-create-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  background: #1e293b;
  border-radius: 8px;
  font-size: 12px;
  color: #f8fafc;
  max-width: 100%;
}

.promo-chip-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #334155;
}

.promo-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.promo-chip-remove,
.promo-title-chip-remove {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transform: none;
  letter-spacing: normal;
  font-weight: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.promo-create-chip .promo-chip-remove {
  position: static;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

.promo-chip-remove:hover:not(:disabled),
.promo-title-chip-remove:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.15);
  transform: none;
  box-shadow: none;
}

.promo-create-chip .promo-chip-remove:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.22);
}

.promo-create-bid-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.promo-create-bid-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.promo-bid-tag {
  border: 1px solid var(--border-strong);
  background: var(--card-hover);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}

.promo-bid-tag:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

.promo-title-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.promo-create-title-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.promo-title-chip-wrap {
  position: relative;
  max-width: 100%;
}

.promo-title-chip {
  display: block;
  border: 1px solid var(--border-strong);
  background: var(--card-hover);
  color: var(--text-secondary);
  border-radius: 12px;
  padding: 8px 28px 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  word-break: break-word;
}

.promo-title-chip-wrap:hover .promo-title-chip,
.promo-title-chip:hover {
  border-color: var(--primary-border);
  background: var(--surface-hover);
  color: var(--text);
}

.promo-title-chip-wrap.active .promo-title-chip {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

.promo-title-chip-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 1;
}

.promo-title-add-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--card-hover);
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.promo-title-add-btn:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

.promo-title-composer,
.promo-title-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.promo-title-composer.hidden {
  display: none;
}

.promo-title-composer input,
.promo-title-edit-row input {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
}

.promo-title-composer .btn-sm,
.promo-title-edit-row .btn-sm {
  flex-shrink: 0;
  border-radius: 12px;
}

.promo-create-title-editor-actions button.danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

.promo-create-title-editor-actions button.danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

.promo-copy-count-panel {
  max-width: 420px;
}

.promo-copy-count-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 8px;
}

.promo-copy-count-input {
  width: 72px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.promo-create-copy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: var(--surface-muted);
}

.promo-create-copy-tabs.hidden {
  display: none;
}

.promo-copy-tab {
  border: 1px solid #94a3b8;
  background: var(--card);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-copy-tab:hover {
  border-color: #60a5fa;
  color: #2563eb;
}

.promo-copy-tab.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

.promotion-create-panel.has-copy-tabs .edit-body {
  padding-top: 12px;
}

/* —— 素材管理 —— */
button.btn-sm.btn-mgmt-clean-all {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.48);
  color: #c4b5fd;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(167, 139, 250, 0.12);
}

button.btn-sm.btn-mgmt-clean-all:hover:not(:disabled) {
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(167, 139, 250, 0.62);
  color: #ddd6fe;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(167, 139, 250, 0.14),
    inset 0 1px 0 rgba(167, 139, 250, 0.16);
}

.theme-light button.btn-sm.btn-mgmt-clean-all {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.35);
  color: #6d28d9;
}

.theme-light button.btn-sm.btn-mgmt-clean-all:hover:not(:disabled) {
  background: rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.48);
  color: #5b21b6;
}

.mgmt-mat-table-wrap {
  position: relative;
  z-index: 0;
  max-height: min(70vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  contain: paint;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mgmt-mat-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-muted);
}

.mgmt-mat-table th.mgmt-mat-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.mgmt-mat-table th.mgmt-mat-sort.sort-desc::after {
  content: ' ↓';
  color: var(--accent);
  font-size: 11px;
}

.mgmt-mat-table th.mgmt-mat-sort.sort-asc::after {
  content: ' ↑';
  color: var(--accent);
  font-size: 11px;
}

.mgmt-mat-chk-col {
  width: 36px;
  padding-left: 8px;
  padding-right: 4px;
  text-align: center;
}

.mgmt-mat-chk-col input[type="checkbox"] {
  cursor: pointer;
}

.mgmt-mat-thumb-col {
  width: 72px;
}

.mgmt-mat-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
}

.mgmt-mat-thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--bg-soft, #f3f4f6);
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
}

.mgmt-mat-row {
  cursor: pointer;
}

.mgmt-mat-row:hover {
  background: rgba(236, 72, 153, 0.06);
}

.mgmt-mat-title {
  max-width: 200px;
}

.mgmt-mat-title-text {
  display: inline;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-align: left;
  word-break: break-all;
  cursor: pointer;
  gap: 0;
  transform: none;
  transition: color 0.15s ease;
}

.mgmt-mat-title-text:hover,
.mgmt-mat-title-text:hover:not(:disabled) {
  background: none;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  color: #3b82f6;
}

.mgmt-mat-title-text:active:not(:disabled) {
  background: none;
  box-shadow: none;
  transform: none;
}

.mgmt-mat-title-text:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
  box-shadow: none;
}

.mgmt-mat-eval-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.mgmt-mat-eval-tag {
  display: inline-block;
  padding: 0 6px;
  font-size: 11px;
  line-height: 18px;
  border-radius: 2px;
  white-space: nowrap;
}

.mgmt-mat-eval-tag-quality {
  color: #2a55e5;
  background: #edf2ff;
}

.mgmt-mat-eval-tag-first {
  color: #0da600;
  background: #ecf8eb;
}

.mgmt-mat-eval-tag-bad {
  color: #e54545;
  background: #fff1f0;
}

.mgmt-mat-eval-tag-warn {
  color: #d48806;
  background: #fffbe6;
}

.mgmt-mat-audit-status {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.mgmt-mat-audit-status .dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mgmt-mat-audit-reject {
  color: #e54545;
}

.mgmt-mat-audit-reject .dot {
  background: #e54545;
}

.mgmt-mat-audit-pass {
  color: #0da600;
}

.mgmt-mat-audit-pass .dot {
  background: #0da600;
}

.mgmt-mat-actions {
  white-space: nowrap;
}

.va-hint {
  margin: 0 0 12px;
  font-size: 13px;
}

.va-table-wrap {
  margin-top: 8px;
}

.va-video-table .va-video-cell {
  min-width: 220px;
}

.va-video-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.va-video-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}

.va-video-thumb {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
}

.va-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.va-video-info {
  min-width: 0;
}

.va-video-name {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}

.va-video-id {
  font-size: 12px;
  margin-top: 2px;
}

.va-protect-row {
  margin-top: 6px;
}

.va-protect-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  background: rgba(13, 166, 0, 0.15);
  color: #0da600;
}

.va-eval-col,
.va-aigc-col {
  font-size: 13px;
  white-space: nowrap;
}


.va-actions {
  white-space: nowrap;
}

.va-actions .btn-link {
  color: var(--primary, #5090f8);
  font-size: 13px;
}

.va-action-sep {
  color: var(--muted, #86909c);
  margin: 0 6px;
  user-select: none;
  font-size: 12px;
}

.va-detail-meta {
  margin-bottom: 12px;
  font-size: 13px;
}

.va-detail-table-wrap {
  overflow: auto;
  max-height: 50vh;
}

.va-account-perf-panel {
  max-width: 920px;
  width: 96vw;
}

.va-account-perf-body {
  max-height: 72vh;
  overflow: auto;
}

.va-account-perf-table-wrap {
  margin-top: 4px;
}

.va-account-perf-table th {
  font-size: 13px;
  font-weight: 500;
}

.va-account-perf-table th.va-acct-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.va-account-perf-table th.va-acct-sort.sort-desc::after {
  content: ' ↓';
  opacity: 0.85;
}

.va-account-perf-table th.va-acct-sort.sort-asc::after {
  content: ' ↑';
  opacity: 0.85;
}

.va-acct-cell {
  min-width: 180px;
}

.va-acct-name {
  font-size: 13px;
  line-height: 1.4;
}

.va-acct-id {
  font-size: 12px;
  margin-top: 2px;
}

.va-account-perf-pager {
  margin-top: 12px;
  font-size: 13px;
  text-align: right;
}

.va-account-perf-pager .btn-link[disabled] {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

.va-acct-err {
  color: var(--warn, #f59e0b);
  line-height: 1.5;
  white-space: normal;
}

.va-detail-table th,
.va-detail-table td {
  font-size: 13px;
  white-space: nowrap;
}

.material-analysis-panel {
  max-width: 760px;
  width: 96vw;
}

.material-analysis-body {
  max-height: 72vh;
  overflow: auto;
}

.material-analysis-media {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.material-analysis-media img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.material-analysis-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background: var(--bg-soft, #f2f3f5);
  color: var(--muted, #86909c);
  font-size: 13px;
  flex-shrink: 0;
}

.material-analysis-meta {
  flex: 1;
  min-width: 0;
}

.material-analysis-meta-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  word-break: break-all;
}

.material-analysis-meta-sub {
  margin-top: 6px;
  font-size: 13px;
}

.material-analysis-meta-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

button.btn-mgmt-audit-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

button.btn-mgmt-audit-tag.btn-mgmt-audit-pass {
  color: #0da600;
  background: rgba(13, 166, 0, 0.08);
  border: 1px solid rgba(13, 166, 0, 0.35);
}

button.btn-mgmt-audit-tag.btn-mgmt-audit-pass:hover:not(:disabled) {
  background: rgba(13, 166, 0, 0.16);
  border-color: rgba(13, 166, 0, 0.55);
  transform: none;
  box-shadow: none;
}

button.btn-mgmt-audit-tag.btn-mgmt-audit-pass.is-active {
  color: #fff;
  background: #0da600;
  border-color: #0da600;
}

button.btn-mgmt-audit-tag.btn-mgmt-audit-reject {
  color: #e54545;
  background: rgba(229, 69, 69, 0.08);
  border: 1px solid rgba(229, 69, 69, 0.35);
}

button.btn-mgmt-audit-tag.btn-mgmt-audit-reject:hover:not(:disabled) {
  background: rgba(229, 69, 69, 0.16);
  border-color: rgba(229, 69, 69, 0.55);
  transform: none;
  box-shadow: none;
}

button.btn-mgmt-audit-tag.btn-mgmt-audit-reject.is-active {
  color: #fff;
  background: #e54545;
  border-color: #e54545;
}

.theme-light button.btn-mgmt-audit-tag.btn-mgmt-audit-pass {
  background: #f0faf0;
}

.theme-light button.btn-mgmt-audit-tag.btn-mgmt-audit-reject {
  background: #fff1f0;
}

.material-analysis-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.material-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.material-analysis-section {
  margin-top: 4px;
}

.material-analysis-section .edit-section-title {
  margin: 0 0 10px;
}

.material-analysis-table-wrap {
  overflow-x: auto;
}

.material-analysis-table-wrap .data-table {
  min-width: 520px;
}

.material-analysis-play-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.material-analysis-note {
  margin: 0;
  font-size: 13px;
}

/* —— Lightbox —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}

.lightbox.hidden { display: none; }

.lightbox img, .lightbox video {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}

/* —— 下单管理 —— */
.order-mgmt-hint {
  margin: 0 0 12px;
  font-size: 13px;
}

.order-mgmt-toolbar {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.order-mgmt-load-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 420px;
}

.order-mgmt-load-bar.hidden {
  display: none;
}

.order-mgmt-load-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  overflow: hidden;
}

.order-mgmt-load-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, #6366f1 100%);
  transition: width 0.35s ease;
}

.order-mgmt-load-text {
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.order-mgmt-meta {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
}

.order-mgmt-template-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}

.order-mgmt-template-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.order-mgmt-template-hint {
  font-size: 12px;
  flex-shrink: 0;
}

.order-mgmt-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.order-mgmt-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) minmax(72px, auto) minmax(88px, auto) minmax(160px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 10px;
}

.order-mgmt-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.order-mgmt-metrics .tag-sub-bal,
.order-mgmt-metrics .tag-sub-cost {
  font-size: 12px;
  white-space: nowrap;
}

.order-mgmt-row-pick {
  text-align: left;
  justify-content: flex-start;
  min-height: 40px;
  white-space: normal;
  line-height: 1.35;
}

.theme-dark button.secondary.order-mgmt-row-pick {
  color: #fff;
}

.theme-dark button.secondary.order-mgmt-row-pick:hover:not(:disabled),
.theme-dark button.secondary.order-mgmt-row-pick:focus-visible,
.theme-dark button.secondary.order-mgmt-row-pick:active:not(:disabled) {
  color: #fff;
}

.theme-light button.secondary.order-mgmt-row-pick {
  color: var(--text);
  font-weight: 600;
}

.theme-light button.secondary.order-mgmt-row-pick:hover:not(:disabled),
.theme-light button.secondary.order-mgmt-row-pick:focus-visible,
.theme-light button.secondary.order-mgmt-row-pick:active:not(:disabled) {
  color: var(--text);
}

.theme-light .order-mgmt-status.ok {
  color: #15803d;
}

.theme-light .order-mgmt-status.warn {
  color: #b45309;
}

.theme-light .order-mgmt-status.bad {
  color: #b91c1c;
}

.order-mgmt-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  background: var(--surface-muted);
  color: var(--muted);
}

.order-mgmt-status.ok {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.order-mgmt-status.warn {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.order-mgmt-status.bad {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.order-mgmt-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

button.btn-sm.btn-order-action-refresh {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.38);
  color: #67e8f9;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(34, 211, 238, 0.1);
}

button.btn-sm.btn-order-action-refresh:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.55);
  color: #a5f3fc;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(34, 211, 238, 0.14);
}

button.btn-sm.btn-order-action-share {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.42);
  color: #c4b5fd;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(167, 139, 250, 0.1);
}

button.btn-sm.btn-order-action-share:hover:not(:disabled) {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.58);
  color: #ddd6fe;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(167, 139, 250, 0.14),
    inset 0 1px 0 rgba(167, 139, 250, 0.16);
}

button.btn-sm.btn-order-action-switch {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.42);
  color: #93c5fd;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(96, 165, 250, 0.1);
}

button.btn-sm.btn-order-action-switch:hover:not(:disabled) {
  background: rgba(96, 165, 250, 0.22);
  border-color: rgba(96, 165, 250, 0.58);
  color: #bfdbfe;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(96, 165, 250, 0.14),
    inset 0 1px 0 rgba(96, 165, 250, 0.16);
}

.theme-light button.btn-sm.btn-order-action-refresh {
  background: rgba(8, 145, 178, 0.08);
  border-color: rgba(8, 145, 178, 0.35);
  color: #0e7490;
}

.theme-light button.btn-sm.btn-order-action-refresh:hover:not(:disabled) {
  background: rgba(8, 145, 178, 0.14);
  border-color: rgba(8, 145, 178, 0.5);
  color: #155e75;
}

.theme-light button.btn-sm.btn-order-action-share {
  background: rgba(109, 40, 217, 0.08);
  border-color: rgba(109, 40, 217, 0.32);
  color: #6d28d9;
}

.theme-light button.btn-sm.btn-order-action-share:hover:not(:disabled) {
  background: rgba(109, 40, 217, 0.14);
  border-color: rgba(109, 40, 217, 0.48);
  color: #5b21b6;
}

.theme-light button.btn-sm.btn-order-action-switch {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.32);
  color: #1d4ed8;
}

.theme-light button.btn-sm.btn-order-action-switch:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.48);
  color: #1e40af;
}

.order-mgmt-list {
  margin-bottom: 12px;
}

.order-mgmt-add-btn {
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.order-mgmt-log-wrap {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.order-mgmt-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-mgmt-log-head h3 {
  margin: 0;
  font-size: 15px;
}

.order-mgmt-log-box {
  max-height: 220px;
  margin: 0;
  font-size: 12px;
}

.order-auth-panel,
.order-fund-panel {
  max-width: 720px;
  width: 94vw;
}

.order-auth-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 240px);
  gap: 16px 20px;
  align-items: start;
}

.order-auth-form-col .field:last-child {
  margin-bottom: 0;
}

.order-auth-paste-input {
  min-height: 88px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.order-auth-paste-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

.order-auth-aweme-col {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  overflow: hidden;
}

.order-auth-aweme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.order-auth-aweme-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}

.order-auth-aweme-head .muted {
  font-size: 12px;
  white-space: nowrap;
}

.order-auth-aweme-list {
  flex: 1;
  min-height: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
}

.order-auth-aweme-empty {
  margin: 12px 8px;
  font-size: 12px;
  line-height: 1.5;
}

.order-auth-aweme-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  font: inherit;
  text-align: left;
  line-height: 1.35;
  min-height: 52px;
  box-sizing: border-box;
}

.order-auth-aweme-item:last-child {
  margin-bottom: 0;
}

.order-auth-aweme-item:hover,
.order-auth-aweme-item.active {
  border-color: var(--primary);
  background: var(--primary-soft, #eff6ff);
}

.order-auth-aweme-item-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-hover);
}

.order-auth-aweme-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-auth-aweme-item-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}

.order-auth-aweme-item-nick-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  width: 100%;
  line-height: 1.35;
}

.order-auth-aweme-item-nick {
  max-width: 100%;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-auth-aweme-item-badge {
  flex-shrink: 0;
  margin-left: 0;
  max-width: 100%;
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.3;
}

.order-auth-aweme-item-id {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-auth-sub-picker {
  width: 100%;
}

.order-auth-panel .sub-account-picker-list {
  z-index: 20;
}

.order-auth-panel .edit-body {
  padding: 22px 20px 26px;
}

.order-auth-panel .edit-body .field {
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .order-auth-main {
    grid-template-columns: 1fr;
  }
  .order-auth-aweme-col {
    min-height: 160px;
  }
}

.order-auth-panel .field label {
  display: block;
  margin-bottom: 8px;
}

.order-auth-panel .project-create-actions {
  margin-top: 28px;
}

.order-phase2-panel {
  max-width: 920px;
  width: 96vw;
}

.order-phase2-section:has(#orderPhase2Bid) > .order-phase2-memo-wrap,
#orderPhase2BidMemoTags,
#btnOrderPhase2AddBidMemo {
  display: none !important;
}

.order-phase2-panel .edit-body {
  max-height: 78vh;
  overflow-y: auto;
}

.order-phase2-section {
  margin-bottom: 16px;
}

.order-phase2-section-block {
  padding: 14px 16px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.order-phase2-section-block > .edit-section-title {
  margin-top: 0;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.order-phase2-section-block + .order-phase2-section-block {
  margin-top: 4px;
}

.order-phase2-tpl-bid-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  max-width: 360px;
}

.order-phase2-tpl-bid-col .order-tpl-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0;
  width: 100%;
}

.order-phase2-tpl-bid-col .order-tpl-field .input-md {
  width: 100%;
  max-width: 280px;
  box-sizing: border-box;
}

.order-phase2-section label {
  display: block;
  margin: 8px 0;
  font-size: 13px;
}

.order-phase2-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.order-phase2-hint {
  font-size: 13px;
  margin: 0 0 12px;
}

.order-phase2-transfer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
  margin: 8px 0 4px;
}

.order-phase2-transfer-amount-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.order-phase2-transfer-field-label {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.order-phase2-sub-balance-inline {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--text, #e2e8f0);
}

.order-phase2-sub-balance-inline #orderPhase2SubBalanceValText {
  font-size: 15px;
  font-weight: 600;
  color: var(--ok, #34d399);
}

.order-phase2-sub-balance-inline.is-loading {
  opacity: 0.75;
}

.order-phase2-sub-balance-inline.is-loading #orderPhase2SubBalanceValText {
  font-weight: 400;
  color: inherit;
}

.order-phase2-transfer-amount-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-width: 0;
}

.order-phase2-transfer-amount-controls .order-phase2-amount-input {
  flex: 0 0 auto;
  width: 140px;
  max-width: 100%;
}

.order-phase2-transfer-amount-controls .btn-sm {
  flex: 0 0 auto;
}

.order-phase2-transfer-memo-wrap {
  width: 100%;
  margin: 0 0 8px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.order-phase2-amount-label {
  flex: 0 0 auto;
  margin: 0;
}

.order-phase2-remark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.order-phase2-remark-input {
  width: 180px;
  min-width: 180px;
  max-width: 100%;
  flex: 0 0 auto;
}

.order-phase2-memo-tag:has(.order-phase2-remark-preset-btn) {
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-left: 3px solid #22d3ee;
  border-radius: 8px;
  box-shadow: none;
}

.order-phase2-memo-tag:has(.order-phase2-remark-preset-btn):hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.4);
  border-left-color: #22d3ee;
  box-shadow: 0 2px 10px rgba(34, 211, 238, 0.12);
  transform: translateY(-1px);
}

.order-phase2-remark-preset-btn .order-phase2-memo-tag-title {
  max-width: 180px;
  color: #cbd5e1;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.order-phase2-memo-tag:has(.order-phase2-remark-preset-btn):hover .order-phase2-memo-tag-title {
  color: #67e8f9;
}

.order-phase2-memo-tag:has(.order-phase2-remark-preset-btn) .order-phase2-memo-tag-del {
  background: transparent;
  color: #64748b;
  opacity: 0.55;
}

.order-phase2-memo-tag:has(.order-phase2-remark-preset-btn):hover .order-phase2-memo-tag-del {
  opacity: 0.9;
  color: #94a3b8;
}

.order-phase2-memo-tag:has(.order-phase2-remark-preset-btn) .order-phase2-memo-tag-del:hover {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
}

.order-phase2-memo-wrap {
  flex: 1 1 260px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.order-phase2-memo-label {
  font-size: 12px;
  white-space: nowrap;
}

.order-phase2-memo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.order-phase2-memo-tag {
  position: relative;
  display: inline-flex;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.order-phase2-memo-tag:hover {
  border-color: var(--primary-border);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.order-phase2-memo-tag-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 7px 30px 7px 12px;
  min-width: 56px;
  max-width: 220px;
  cursor: pointer;
  text-align: left;
}

.order-phase2-memo-tag-title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  flex: 1 1 auto;
  min-width: 0;
}

.order-phase2-memo-tag-amt {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--primary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.45);
}

.order-phase2-memo-tag-btn:hover .order-phase2-memo-tag-title {
  color: var(--text);
}

.order-phase2-memo-tag-btn:hover .order-phase2-memo-tag-amt {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.5);
}

.order-phase2-memo-tag-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--card-hover);
  padding: 0;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.order-phase2-memo-tag:hover .order-phase2-memo-tag-del {
  opacity: 1;
}

.order-phase2-memo-tag-del:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.order-phase2-memo-add {
  flex-shrink: 0;
  border-radius: 10px;
  border-style: dashed;
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: var(--muted);
  padding: 9px 12px;
  align-self: flex-start;
}

.order-phase2-memo-add:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

.order-phase2-memo-empty {
  font-size: 12px;
}

/* 创建计划 · 出价备忘录：简洁单行胶囊 */
.order-phase2-memo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  color: #cbd5e1;
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.order-phase2-memo-pill:hover {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.55);
  color: #f1f5f9;
}

.order-phase2-memo-pill-amt {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.01em;
}

.order-phase2-memo-pill-sep {
  font-size: 12px;
  color: rgba(203, 213, 225, 0.72);
  user-select: none;
}

.order-phase2-memo-pill-label {
  font-size: 12px;
  font-weight: 400;
  color: #cbd5e1;
  white-space: nowrap;
}

.order-phase2-memo-pill:hover .order-phase2-memo-pill-label {
  color: #e2e8f0;
}

.order-phase2-footer {
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.order-phase2-footer.is-running {
  justify-content: space-between;
}

.order-phase2-run-progress {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-phase2-run-progress.hidden {
  display: none;
}

.order-phase2-run-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  overflow: hidden;
}

.order-phase2-run-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, #6366f1 100%);
  transition: width 0.35s ease;
}

.order-phase2-run-text {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.order-phase2-footer-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.88;
  min-width: 96px;
}

.btn.is-loading .btn-label {
  visibility: hidden;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: overview-spin 0.75s linear infinite;
}

.btn.secondary.is-loading::after {
  border-color: rgba(148, 163, 184, 0.35);
  border-top-color: var(--text);
}

.order-memo-label-panel {
  width: min(420px, 92vw);
}

.order-memo-label-body label {
  display: block;
  margin: 0 0 12px;
}

.order-memo-label-body .project-create-actions {
  margin-top: 4px;
}

.order-template-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.order-template-chip {
  min-width: 100px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-hover);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.order-template-chip:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--text);
}

.order-template-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.order-template-chip.add {
  background: var(--surface-muted);
  border-style: dashed;
  color: var(--muted);
}

.order-template-chip.add:hover {
  color: var(--primary);
}

.order-template-panel {
  max-width: 560px;
  width: 96vw;
}

.order-template-body {
  max-height: 75vh;
  overflow-y: auto;
}

.order-template-section {
  margin: 14px 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.order-template-section .proj-bid-opt {
  display: inline-flex;
  width: auto;
  margin: 4px 8px 4px 0;
}

.order-tpl-field {
  display: block;
  margin: 10px 0;
  font-size: 13px;
}

.order-tpl-titles {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

.order-tpl-name-hint {
  font-size: 12px;
  margin: 8px 0 0;
}

.order-tpl-mat-pick {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}

.order-tpl-mat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

@media (max-width: 720px) {
  .order-mgmt-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .order-mgmt-row-pick {
    grid-column: 1 / -1;
  }
  .order-mgmt-row > .order-mgmt-metrics {
    grid-column: 1 / -1;
  }
  .order-mgmt-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .order-mgmt-row > .order-mgmt-status {
    width: 100%;
    box-sizing: border-box;
  }
  .order-mgmt-template-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .order-template-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
  }
  .order-template-chip {
    flex-shrink: 0;
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* —— Dark theme: component overrides —— */
.theme-dark code,
.theme-dark .id-code {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.theme-dark .tag-sub-name {
  background: var(--card-hover);
  border-color: var(--border);
  color: var(--primary);
}

.theme-dark .multi-monitor-sub-tag {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.55) 0%, rgba(15, 23, 42, 0.72) 100%);
  border: 1px solid rgba(96, 165, 250, 0.42);
  color: #f8fafc;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-dark .multi-monitor-sub-tag-accent {
  background: linear-gradient(180deg, #bfdbfe 0%, #3b82f6 100%);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.7);
}

.theme-dark .multi-monitor-sub-tag:hover,
.theme-dark .multi-monitor-sub-tag:focus-visible {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.62) 0%, rgba(30, 64, 175, 0.48) 100%);
  border-color: rgba(147, 197, 253, 0.72);
  color: #ffffff;
  box-shadow:
    0 6px 20px rgba(37, 99, 235, 0.32),
    0 0 0 1px rgba(96, 165, 250, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}


.theme-dark .tag-sub-cost {
  background: var(--surface-muted);
  color: var(--muted);
}

.theme-dark .tag-sub-bal {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.theme-dark .order-phase2-sub-name-tag {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

.theme-dark .tag-sub-status-ok {
  background: var(--primary-soft);
  color: #93c5fd;
}

.theme-dark .tag-sub-status-paused {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.theme-dark .badge.pause { background: var(--surface-muted); color: var(--muted); }
.theme-dark .badge.warn { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.theme-dark .badge.ok { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.theme-dark .badge.err { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.theme-dark .log-box {
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.theme-dark .segmented,
.theme-dark .material-tabs {
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.theme-dark .segmented button.active,
.theme-dark .material-tabs button.active {
  background: var(--card-hover);
  color: var(--text);
}

.theme-dark .bidding-shell {
  background: var(--card);
  border-color: var(--border);
}

.theme-dark .bidding-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

.theme-dark .bidding-subtabs.segmented button:not(.active):hover {
  color: var(--text);
}

.theme-dark .bidding-subtabs.segmented .bidding-subtab.active {
  background: var(--card-hover);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.theme-dark .toast {
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.theme-dark .material-card {
  background: var(--card);
  border-color: var(--border);
}

.theme-dark .material-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.theme-dark select option {
  background: var(--card);
  color: var(--text);
}

.theme-dark .ads-col-config-available,
.theme-dark .ads-col-config-selected,
.theme-dark .ads-col-panel-title {
  background: var(--surface-muted);
}

.theme-dark .embed-panel,
.theme-dark .edit-panel,
.theme-dark .lightbox {
  background: var(--card);
}

.theme-dark [style*="background: #fff"],
.theme-dark [style*="background:#fff"] {
  background: var(--card) !important;
}

.theme-dark .order-phase2-memo-tag-amt {
  background: var(--primary);
  color: #fff;
}

.theme-dark .order-phase2-memo-tag-btn:hover .order-phase2-memo-tag-amt {
  background: var(--primary-dark);
  color: #fff;
}

.theme-dark .order-phase2-memo-add {
  background: var(--surface-muted);
  color: var(--muted);
}

.theme-dark .order-phase2-memo-add:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* —— Light theme: component overrides —— */
.theme-light code,
.theme-light .id-code {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.theme-light .tag-sub-name {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary-dark);
}

.theme-light .multi-monitor-sub-tag {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98) 0%, rgba(219, 234, 254, 0.92) 100%);
  border: 1px solid rgba(59, 130, 246, 0.32);
  color: #1e3a8a;
  box-shadow:
    0 2px 8px rgba(37, 99, 235, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.theme-light .multi-monitor-sub-tag-accent {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.35);
}

.theme-light .multi-monitor-sub-tag:hover,
.theme-light .multi-monitor-sub-tag:focus-visible {
  background: linear-gradient(135deg, rgba(219, 234, 254, 1) 0%, rgba(191, 219, 254, 0.95) 100%);
  border-color: rgba(37, 99, 235, 0.48);
  color: #1d4ed8;
  box-shadow:
    0 4px 14px rgba(37, 99, 235, 0.16),
    0 0 0 1px rgba(59, 130, 246, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}


.theme-light .tag-sub-cost {
  background: var(--surface-muted);
  color: var(--muted);
}

.theme-light .tag-sub-bal {
  background: rgba(74, 222, 128, 0.14);
  color: #15803d;
}

.theme-light .order-phase2-sub-name-tag {
  background: rgba(100, 116, 139, 0.12);
  color: #334155;
}

.theme-light .tag-sub-status-ok {
  background: var(--primary-soft);
  color: #2563eb;
}

.theme-light .tag-sub-status-paused {
  background: rgba(251, 191, 36, 0.16);
  color: #b45309;
}

.theme-light .badge.pause { background: #f4f4f5; color: #71717a; }
.theme-light .badge.warn { background: #fef3c7; color: #92400e; }
.theme-light .badge.ok { background: #dcfce7; color: #166534; }
.theme-light .badge.err { background: #fee2e2; color: #b91c1c; }

.theme-light .log-box {
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.theme-light .segmented,
.theme-light .material-tabs {
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.theme-light .segmented button.active,
.theme-light .material-tabs button.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.theme-light .bidding-shell {
  background: var(--card);
  border-color: var(--border);
}

.theme-light .bidding-head {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%);
}

.theme-light .bidding-subtabs.segmented button:not(.active):hover {
  color: var(--text);
}

.theme-light .bidding-subtabs.segmented .bidding-subtab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.theme-light .toast {
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.theme-light .material-card {
  background: var(--card);
  border-color: var(--border);
}

.theme-light .material-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.theme-light select option {
  background: var(--card);
  color: var(--text);
}

.theme-light .ads-col-config-available,
.theme-light .ads-col-config-selected,
.theme-light .ads-col-panel-title {
  background: var(--surface-muted);
}

.theme-light .embed-panel,
.theme-light .edit-panel,
.theme-light .lightbox {
  background: var(--card);
}

.theme-light .order-phase2-memo-tag-amt {
  background: var(--primary);
  color: #fff;
}

.theme-light .order-phase2-memo-tag-btn:hover .order-phase2-memo-tag-amt {
  background: var(--primary-dark);
  color: #fff;
}

.theme-light .order-phase2-memo-add {
  background: var(--surface-muted);
  color: var(--muted);
}

.theme-light .order-phase2-memo-add:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.theme-light .order-phase2-memo-pill {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.32);
  color: #1e3a8a;
}

.theme-light .order-phase2-memo-pill:hover {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.45);
  color: #1e3a8a;
}

.theme-light .order-phase2-memo-pill-amt {
  color: #1d4ed8;
}

.theme-light .order-phase2-memo-pill-sep {
  color: #64748b;
}

.theme-light .order-phase2-memo-pill-label {
  color: #334155;
}

.theme-light .order-phase2-memo-pill:hover .order-phase2-memo-pill-label {
  color: #1e293b;
}

.theme-light .order-phase2-memo-tag:has(.order-phase2-remark-preset-btn) {
  background: #ecfeff;
  border: 1px dashed rgba(6, 182, 212, 0.4);
  border-left: 3px solid #0891b2;
  box-shadow: none;
}

.theme-light .order-phase2-memo-tag:has(.order-phase2-remark-preset-btn):hover {
  background: #cffafe;
  border-color: rgba(6, 182, 212, 0.55);
  border-left-color: #0e7490;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.15);
}

.theme-light .order-phase2-remark-preset-btn .order-phase2-memo-tag-title {
  color: #0e7490;
}

.theme-light .order-phase2-memo-tag:has(.order-phase2-remark-preset-btn):hover .order-phase2-memo-tag-title {
  color: #155e75;
}

.theme-light .order-phase2-memo-tag:has(.order-phase2-remark-preset-btn) .order-phase2-memo-tag-del {
  background: rgba(255, 255, 255, 0.65);
  color: #64748b;
  opacity: 0.85;
}

.theme-light .order-phase2-memo-tag:has(.order-phase2-remark-preset-btn):hover .order-phase2-memo-tag-del {
  color: #475569;
  opacity: 1;
}

.theme-light .order-phase2-memo-tag-title {
  color: var(--text-secondary);
}

.theme-light .order-phase2-memo-tag-btn:hover .order-phase2-memo-tag-title {
  color: var(--text);
}

.theme-light .promo-bid-tag {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.28);
  color: #1e40af;
}

.theme-light .promo-bid-tag:hover {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
}

.theme-light .promo-create-chip {
  background: var(--surface-muted);
  color: var(--text);
}

.theme-light .promo-chip-thumb {
  background: var(--surface-hover);
}

/* —— 移动端整站自适应 —— */
@media (max-width: 768px) {
  :root {
    --topbar-h: 52px;
  }

  body.nav-open {
    overflow: hidden;
  }

  .topbar-menu-btn {
    display: inline-flex;
  }

  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    max-width: 86vw;
    height: 100dvh;
    height: 100vh;
    padding: 16px 12px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-right: 1px solid var(--sidebar-border);
    border-bottom: none;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 700;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open .topbar,
  body.nav-open header.topbar {
    z-index: 750;
  }

  .sidebar-brand {
    width: 100%;
    margin-bottom: 8px;
    padding-bottom: 16px;
  }

  .sidebar .tabs {
    flex-direction: column;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .tabs button {
    width: 100%;
    min-height: 44px;
  }

  .sidebar-foot {
    display: block;
  }

  .topbar,
  header.topbar {
    padding: 0 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    gap: 8px;
  }

  .header-meta {
    gap: 8px;
    flex-shrink: 0;
  }

  .header-adv-name-btn {
    max-width: min(42vw, 160px);
  }

  .header-sub-picker-btn {
    width: 36px;
    height: 36px;
  }

  .header-sub-picker-btn svg {
    width: 20px;
    height: 20px;
  }

  #connStatusText {
    display: none;
  }

  .theme-switch-btn span {
    display: none;
  }

  .theme-switch-btn {
    padding: 6px 8px;
  }

  .conn-status {
    padding: 6px 8px;
  }

  .auth-session-bar {
    display: none !important;
  }

  .main-content,
  .wrap {
    padding: 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .card {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .card h2 {
    font-size: 15px;
  }

  .toolbar {
    gap: 8px;
  }

  .toolbar > .btn,
  .toolbar > .btn-sm,
  .overview-card-metrics .toolbar > .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    justify-content: center;
    text-align: center;
  }

  .overview-flow-forecast {
    display: none;
  }

  .order-mgmt-toolbar > .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 10px;
  }

  .order-mgmt-toolbar .order-mgmt-meta,
  .order-mgmt-toolbar .order-mgmt-load-bar {
    flex: 1 1 100%;
    width: 100%;
  }

  .order-mgmt-toolbar .order-mgmt-auto,
  .order-mgmt-toolbar > label:not(.order-mgmt-auto) {
    flex: 0 1 auto;
    width: auto;
  }

  .toolbar label,
  .sub-account-toolbar label {
    flex: 1 1 100%;
    width: 100%;
  }

  .sub-account-select-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .sub-account-picker-list .tag-sub-cost {
    display: none;
  }

  .sub-account-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sub-account-toolbar #btnReloadSubAccounts {
    align-self: stretch;
    line-height: 1.4;
    margin: 0;
  }

  .batch-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .batch-bar label {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .batch-bar label input {
    flex: 1;
    max-width: 120px;
  }

  .ads-metrics-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ads-metrics-head-right {
    width: 100%;
    justify-content: flex-start;
  }

  .ads-metrics-balance {
    text-align: left;
  }

  .ads-metrics-cards {
    display: none;
  }

  .ads-table-footer,
  .proj-table-footer,
  .multi-monitor-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .table-footer-date-controls,
  .proj-table-footer .table-footer-controls,
  .ads-table-footer .table-footer-controls {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .table-footer-date-controls label,
  .ads-table-footer .table-footer-controls label {
    flex: 1 1 auto;
  }

  input.input-md,
  input.input-lg,
  input.input-date,
  .table-footer-date-controls input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  input.input-sm {
    width: 64px;
  }

  .finance-transfer-form {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .finance-transfer-form .field-transfer-from,
  .finance-transfer-form .field-transfer-to {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .finance-transfer-form .field-transfer-from label,
  .finance-transfer-form .field-transfer-from select,
  .finance-transfer-form .field-transfer-to label,
  .finance-transfer-form .field-transfer-to select {
    grid-column: auto;
    grid-row: auto;
  }

  .transfer-swap-wrap {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    padding: 0;
  }

  .transfer-calc {
    gap: 6px;
  }

  .transfer-calc-input,
  .transfer-calc-result-input {
    flex: 1 1 72px;
    width: auto;
  }

  .mail-settings-row-fields .field {
    flex: 1 1 100%;
  }

  .mail-notify-types {
    grid-template-columns: 1fr;
  }

  .promotion-create-panel .proj-create-name-row {
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .promo-mat-view-tabs {
    margin-left: 0;
    width: 100%;
  }

  .promo-mat-view-tab {
    flex: 1;
    text-align: center;
  }

  .promo-create-mat-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #promoCreateMatMeta {
    flex: 1 1 100%;
  }

  .proj-create-schedule {
    flex-direction: column;
  }

  .proj-schedule-col {
    width: 100%;
    min-width: 0;
  }

  .edit-overlay,
  .metric-edit-overlay,
  .embed-overlay {
    padding: 0;
    align-items: stretch;
  }

  .edit-panel,
  .project-create-panel,
  .promotion-create-panel,
  .order-phase2-panel,
  .order-auth-panel,
  .aweme-share-panel,
  .material-analysis-panel,
  .finance-transfer-panel,
  .finance-transfer-log-panel {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }

  #transferOverlay.edit-overlay {
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    align-items: center;
    justify-content: center;
    overflow-y: auto;
  }

  #transferOverlay .finance-transfer-panel {
    width: min(420px, calc(100vw - 32px));
    max-width: min(420px, calc(100vw - 32px));
    max-height: min(85dvh, 640px);
    border-radius: 12px;
    flex-shrink: 0;
  }

  #orderAuthOverlay.edit-overlay {
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    align-items: center;
    justify-content: center;
    overflow-y: auto;
  }

  #orderAuthOverlay .order-auth-panel {
    width: min(480px, calc(100vw - 32px));
    max-width: min(480px, calc(100vw - 32px));
    max-height: min(85dvh, 720px);
    border-radius: 12px;
    flex-shrink: 0;
  }

  .finance-transfer-log-table-wrap {
    max-height: calc(100dvh - 220px);
  }

  .finance-table-wrap {
    max-height: min(52vh, 420px);
  }

  .metric-edit-dialog,
  .audit-reject-dialog,
  .ads-col-config-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    min-height: 100dvh;
  }

  .embed-panel {
    max-width: 100%;
    border-radius: 0;
    min-height: 100dvh;
  }

  .embed-overlay {
    padding: 0;
  }

  .embed-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .material-analysis-media {
    flex-direction: column;
  }

  .mgmt-mat-table-wrap {
    max-height: none;
  }

  .data-table {
    font-size: 12px;
  }

  th, td {
    padding: 8px 6px;
  }

  td.col-actions {
    min-width: 140px;
  }

  .action-group {
    flex-wrap: wrap;
    gap: 4px;
  }

  .cell-name {
    max-width: 160px;
  }

  #toastRoot {
    top: max(12px, env(safe-area-inset-top));
    max-width: calc(100vw - 24px);
  }

  .order-phase2-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .order-phase2-run-progress {
    max-width: none;
  }

  .order-phase2-footer-actions {
    width: 100%;
    justify-content: stretch;
  }

  .order-phase2-footer-actions .btn {
    flex: 1;
  }

  .order-mgmt-load-bar {
    max-width: none;
    flex: 1 1 100%;
  }

  .aweme-auth-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .aweme-auth-cross-search {
    margin-left: 0;
    width: 100%;
  }

  .aweme-auth-cross-search .input-md {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .aweme-auth-subtabs {
    width: 100%;
    margin-right: 0;
  }

  .aweme-auth-subtab {
    flex: 1;
    text-align: center;
  }

  .multi-monitor-toolbar label {
    flex: 1 1 auto;
  }

  .multi-monitor-toolbar > .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 10px;
  }

  .multi-monitor-toolbar .multi-monitor-filter,
  .multi-monitor-toolbar .multi-monitor-auto,
  .multi-monitor-toolbar > label:not(.multi-monitor-filter):not(.multi-monitor-auto) {
    flex: 0 1 auto;
    width: auto;
    white-space: nowrap;
    font-size: 12px;
  }

  .multi-monitor-toolbar #multiMonitorMeta {
    flex: 1 1 100%;
    width: 100%;
    font-size: 12px;
  }

  .multi-monitor-table {
    min-width: 880px;
  }

  .multi-monitor-table th:nth-child(3),
  .multi-monitor-table td:nth-child(3),
  .multi-monitor-table th:nth-child(4),
  .multi-monitor-table td:nth-child(4) {
    min-width: 72px;
  }

  .multi-monitor-hint {
    font-size: 12px;
  }

  .multi-monitor-log-wrap {
    display: none;
  }

  #panel-materials .toolbar > .btn:not(.btn-sm) {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    width: auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 8px;
  }

  #panel-materials .toolbar #mgmtMatBatchCount {
    flex: 1 1 100%;
    width: 100%;
  }

  #panel-materials .toolbar > .btn-sm {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 8px;
  }

  #panel-materials .toolbar #mgmtUploadProgress,
  #panel-materials .toolbar > label,
  #panel-materials .toolbar #mgmtMatMeta {
    flex: 1 1 100%;
    width: 100%;
  }

  #panel-bidding .toolbar > .btn {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    width: auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 8px;
  }

  #panel-bidding .batch-bar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    font-size: 0;
  }

  #panel-bidding .batch-bar > * {
    font-size: 12px;
  }

  #panel-bidding .batch-bar #projBatchCount,
  #panel-bidding .batch-bar #batchCount {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #panel-bidding .batch-bar #projBatchCount::after,
  #panel-bidding .batch-bar #batchCount::after {
    content: ' 已选';
  }

  #panel-bidding .batch-bar > .btn-sm.ok,
  #panel-bidding .batch-bar > .btn-sm.danger {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    white-space: nowrap;
    font-size: 11px;
    padding: 7px 4px;
  }

  #panel-bidding .batch-bar > label,
  #panel-bidding .batch-bar > .btn-sm.secondary {
    flex: 1 1 100%;
    width: 100%;
    font-size: 12px;
  }

  #panel-bidding #bidding-sub-ads .batch-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .topbar-title {
    font-size: 15px;
  }

  .header-adv-name-btn {
    max-width: 36vw;
    font-size: 15px;
  }

  .toolbar > .btn,
  .toolbar > .btn-sm {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .order-mgmt-toolbar > .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
  }

  .multi-monitor-toolbar > .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
  }

  #panel-materials .toolbar > .btn:not(.btn-sm) {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    width: auto;
  }

  #panel-materials .toolbar > .btn-sm {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
  }

  #panel-bidding .toolbar > .btn {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    width: auto;
  }

  #panel-bidding .batch-bar > .btn-sm.ok,
  #panel-bidding .batch-bar > .btn-sm.danger {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .chip-sub .tag-sub-name {
    max-width: 100px;
  }

  .ads-metric-value {
    font-size: 18px;
  }
}

/* 素材转化排行榜 */
.mat-conv-card {
  padding-bottom: 32px;
  min-height: 420px;
}

.mat-conv-rank-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.mat-conv-rank-head-text {
  flex: 1;
  min-width: 0;
}

.mat-conv-rank-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 600;
}

.mat-conv-rank-sub {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.mat-conv-rank-count {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 5px 12px;
  background: var(--surface-muted);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.mat-conv-rank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 12px 4px;
}

.mat-conv-rank-card {
  width: 188px;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--border);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-strong);
  box-shadow: none;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.mat-conv-rank-card:hover {
  transform: translateY(-2px);
}

.mat-conv-rank-card--top1 {
  border-color: rgba(245, 208, 66, 0.65);
}

.mat-conv-rank-card--top2 {
  border-color: rgba(192, 192, 192, 0.55);
}

.mat-conv-rank-card--top3 {
  border-color: rgba(205, 127, 50, 0.55);
}

.mat-conv-rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(12, 12, 16, 0.78);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mat-conv-rank-card--top1 .mat-conv-rank-badge {
  background: linear-gradient(135deg, #f5d042 0%, #e6a817 100%);
  color: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.35);
}

.mat-conv-rank-card--top2 .mat-conv-rank-badge {
  background: linear-gradient(135deg, #e8e8e8 0%, #a8a8a8 100%);
  color: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.35);
}

.mat-conv-rank-card--top3 .mat-conv-rank-badge {
  background: linear-gradient(135deg, #e8a86a 0%, #b87333 100%);
  color: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.25);
}

.mat-conv-rank-del {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 22px;
  height: 22px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transform: none;
}

.mat-conv-rank-del:hover {
  background: rgba(220, 53, 69, 0.9);
  transform: none;
  box-shadow: none;
}

.mat-conv-rank-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.mat-conv-rank-name {
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mat-conv-rank-stats {
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.mat-conv-rank-stats--rate-only {
  justify-content: center;
}

.mat-conv-rank-stats--rate-only .mat-conv-rank-rate {
  min-width: 88px;
  padding: 4px 10px 6px;
}

.mat-conv-rank-stats--rate-only .mat-conv-rank-rate-val {
  font-size: 1.15rem;
}

.mat-conv-rank-rate {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  padding: 4px 6px 5px;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.mat-conv-rank-rate-label {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mat-conv-rank-rate-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.mat-conv-rank-packs {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.mat-conv-rank-pack-line {
  font-size: 0.62rem;
  line-height: 1.25;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mat-conv-rank-empty {
  text-align: center;
  padding: 56px 24px 32px;
}

.mat-conv-rank-empty-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.mat-conv-rank-empty-hint {
  margin: 0 0 20px;
  font-size: 0.875rem;
}

.mat-rank-dialog {
  max-width: 420px;
}

.mat-rank-mat-name {
  margin: -6px 0 14px;
  font-size: 0.9rem;
  word-break: break-all;
}

.mat-rank-input {
  width: 100%;
  margin-bottom: 12px;
}

.mat-rank-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 16px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mat-rank-rate-preview {
  font-size: 1.25rem;
  color: var(--primary);
}

.mgmt-mat-actions .btn-mgmt-rank {
  margin-right: 4px;
}

/* —— 登录门禁 —— */
body.auth-pending .app-shell,
body.auth-locked .app-shell {
  display: none !important;
}

body.auth-ok .login-gate {
  display: none !important;
}

.login-gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  display: block;
  margin: 0 auto 12px;
  border-radius: 12px;
}

.login-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.login-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.config-field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 覆盖全局 button 的 min-height/padding，强制正圆问号 */
button.config-field-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
  min-height: 18px;
  max-height: 18px;
  padding: 0;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
  transform: none;
}

button.config-field-help-btn:hover:not(:disabled),
button.config-field-help-btn:focus-visible,
button.config-field-help-btn:active:not(:disabled) {
  color: var(--text);
  border-color: var(--primary-border);
  background: var(--primary-soft);
  box-shadow: none;
  transform: none;
  outline: none;
}

.config-field-help-dialog {
  width: min(560px, 94vw);
  max-height: min(88vh, 680px);
}

.config-field-help-body {
  padding: 4px 2px 8px;
  overflow: auto;
  max-height: min(60vh, 460px);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.config-field-help-body h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}

.config-field-help-body ol {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-field-help-body li strong {
  color: var(--text);
}

.config-field-help-body .help-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.config-field-help-body code {
  font-size: 0.85em;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-muted);
}

.user-guide-card {
  min-height: calc(100vh - 140px);
}

.user-guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.user-guide-head h2 {
  margin: 0;
}

.user-guide-intro {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.user-guide-status {
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.user-guide-content {
  margin: 0;
  padding: 16px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.welcome-guide-dialog {
  width: min(560px, 94vw);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
}

.welcome-guide-body {
  padding: 4px 4px 8px;
  overflow: auto;
}

.welcome-guide-lead {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.welcome-guide-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-guide-steps li {
  line-height: 1.45;
}

.welcome-guide-steps li strong {
  display: block;
  margin-bottom: 4px;
}

.welcome-guide-steps li span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.welcome-guide-tip {
  margin: 14px 0 0;
  font-size: 0.85rem;
}

.welcome-guide-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.login-tab {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}

.login-tab.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--text);
  font-weight: 600;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.95rem;
}

.login-field input:focus {
  outline: none;
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px 16px;
}

.auth-session-bar {
  position: relative;
  flex-shrink: 0;
  min-width: 0;
}

.auth-session-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 140px;
  min-height: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  cursor: pointer;
  line-height: 1.2;
  font-family: inherit;
  box-shadow: none !important;
  transform: none !important;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-session-user-btn:hover:not(:disabled),
.auth-session-user-btn:active:not(:disabled),
.auth-session-user-btn:focus,
.auth-session-user-btn:focus-visible {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none !important;
  transform: none !important;
  outline: none;
}

.auth-session-user-btn[aria-expanded="true"] {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text);
  box-shadow: none !important;
}

.auth-session-user-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-session-caret {
  flex-shrink: 0;
  opacity: 0.7;
}

.auth-session-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.auth-session-menu.hidden {
  display: none;
}

.auth-session-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-session-menu-row strong {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.auth-session-menu-label {
  flex-shrink: 0;
}

.auth-session-menu-action {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.auth-session-menu-action:hover {
  background: var(--primary-soft);
}

.auth-session-menu-logout {
  color: var(--danger);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  border-radius: 0 0 8px 8px;
}

.auth-session-menu-logout:hover {
  background: rgba(248, 113, 113, 0.12);
}

.change-password-dialog {
  width: min(420px, 92vw);
}

.change-password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 4px 0;
}

body.auth-pending .auth-session-bar,
body.auth-locked .auth-session-bar {
  display: none;
}
