/**
 * 管理后台 Soft UI 壳样式（正式 + 内测共用）
 * 通过 html/body.admin-staging-shell 启用。
 */
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Fira+Sans:wght@400;500;600;700&display=swap");

html.admin-staging-shell,
html.admin-staging-shell body.admin-console {
  color-scheme: light;
  --stg-primary: #0f172a;
  --stg-accent: #059669;
  --stg-accent-soft: rgba(5, 150, 105, 0.12);
  --stg-bg: #e8edf5;
  --stg-border: #cbd5e1;
  --stg-sidebar: #0b1220;
  --stg-radius: 14px;
  --stg-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.06);
  --admin-accent: #059669;
  --admin-accent-soft: rgba(5, 150, 105, 0.15);
  font-family: "Fira Sans", "PingFang SC", "Noto Sans SC", sans-serif;
}

html.admin-staging-shell body.admin-console,
html.admin-staging-shell.theme-night body.admin-console,
html.admin-staging-shell body.admin-console.theme-night {
  color: #0f172a !important;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(21, 128, 61, 0.08), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(15, 23, 42, 0.08), transparent 50%),
    linear-gradient(180deg, #f3f6fb 0%, var(--stg-bg) 100%) !important;
  background-attachment: fixed !important;
}

/* 顶栏环境条：按需求隐藏，域名本身已表明内测 */
html.admin-staging-shell .admin-stg-env-banner {
  display: none !important;
}

.admin-stg-env-banner {
  display: none !important;
}

/* 旧顶栏 → 精简工具条 */
html.admin-staging-shell .hero-banner.hero-banner--admin-compact {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  position: static !important;
}

html.admin-staging-shell .hero-banner--admin-compact .hero-inner--sticky-bar {
  padding: 10px 20px 0 !important;
  max-width: none !important;
}

html.admin-staging-shell .admin-console .hero-bar-extra a,
html.admin-staging-shell .admin-console .hero-bar-extra .sep,
html.admin-staging-shell #meLabel {
  color: #475569 !important;
  text-shadow: none !important;
}

html.admin-staging-shell .admin-console .hero-bar-extra a:hover {
  color: var(--stg-accent) !important;
}

html.admin-staging-shell .admin-console .hero-bar-extra .admin-btn.ghost {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid var(--stg-border) !important;
  color: var(--stg-primary) !important;
  border-radius: 10px !important;
}

html.admin-staging-shell .admin-console .hero-bar-extra .admin-btn.ghost:hover:not(:disabled) {
  background: #fff !important;
  border-color: #86efac !important;
  color: var(--stg-accent) !important;
}

/* 主壳：侧栏贴左、内容铺满 */
html.admin-staging-shell .admin-shell {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 0 28px !important;
}

html.admin-staging-shell #appCard.admin-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

html.admin-staging-shell #appCard > .admin-h1 {
  display: none !important;
}

html.admin-staging-shell .admin-app-layout {
  display: grid !important;
  grid-template-columns: var(--admin-side-w, 240px) minmax(0, 1fr) !important;
  gap: 0 !important;
  margin: 8px 16px 0 !important;
  min-height: calc(100vh - 110px) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  border: 1px solid rgba(203, 213, 225, 0.95) !important;
  background: rgba(255, 255, 255, 0.55) !important;
  box-shadow: var(--stg-shadow) !important;
}

/* 与 layout-v2 登录后满高滚动对齐 */
html.admin-layout-v2.admin-staging-shell body.admin-state-app .admin-app-layout {
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
}

/* 深色侧栏 */
html.admin-staging-shell .admin-sidebar {
  flex: none !important;
  min-width: 0 !important;
  max-width: none !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
    var(--stg-sidebar) !important;
  border-right: 1px solid rgba(148, 163, 184, 0.18) !important;
  color: #e2e8f0 !important;
}

html.admin-staging-shell .admin-stg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 8px;
}

html.admin-staging-shell .admin-stg-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #1f2937, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: "Fira Code", ui-monospace, monospace;
  font-weight: 600;
  color: #86efac;
}

html.admin-staging-shell .admin-stg-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

html.admin-staging-shell .admin-stg-brand-text strong {
  font-size: 15px;
  color: #f8fafc;
}

html.admin-staging-shell .admin-stg-brand-text span {
  font-size: 11px;
  color: #94a3b8;
  font-family: "Fira Code", ui-monospace, monospace;
}

html.admin-staging-shell .admin-tabs {
  padding: 10px 12px 16px !important;
  max-height: none !important;
}

html.admin-staging-shell .admin-nav-group + .admin-nav-group {
  border-top-color: rgba(148, 163, 184, 0.18) !important;
}

html.admin-staging-shell .admin-nav-label {
  color: #64748b !important;
  letter-spacing: 0.12em !important;
}

html.admin-staging-shell .admin-tab {
  background: transparent !important;
  color: #cbd5e1 !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
}

html.admin-staging-shell .admin-tab:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

html.admin-staging-shell .admin-tab.active {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #bbf7d0 !important;
  box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.25) !important;
  border: 0 !important;
}

html.admin-staging-shell .admin-stg-side-foot {
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

html.admin-staging-shell .admin-stg-operator {
  display: flex;
  align-items: center;
  gap: 10px;
}

html.admin-staging-shell .admin-stg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #1e293b;
  color: #86efac;
  font-weight: 600;
  font-size: 13px;
}

html.admin-staging-shell .admin-stg-operator strong {
  display: block;
  font-size: 13px;
  color: #f1f5f9;
}

html.admin-staging-shell .admin-stg-operator span {
  font-size: 11px;
  color: #94a3b8;
}

html.admin-staging-shell .admin-stg-side-link {
  color: #94a3b8;
  font-size: 12px;
  text-decoration: none;
}

html.admin-staging-shell .admin-stg-side-link:hover {
  color: #bbf7d0;
}

/* 主内容区 */
html.admin-staging-shell .admin-main-panel {
  padding: 18px 22px 24px !important;
  max-height: calc(100vh - 120px) !important;
  background: transparent !important;
}

html.admin-staging-shell .admin-tab-loading-bar {
  background: linear-gradient(90deg, #15803d, #86efac) !important;
}

html.admin-staging-shell #appCard section .admin-card,
html.admin-staging-shell .dash-hub,
html.admin-staging-shell .dash-panel {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(203, 213, 225, 0.95) !important;
  border-radius: var(--stg-radius) !important;
  box-shadow: var(--stg-shadow) !important;
}

/* Soft UI 看板：隐藏标题区，直接展示 12 KPI + 实时动态 */
html.admin-staging-shell .dash-hub__head {
  display: none !important;
}

html.admin-staging-shell .admin-btn:not(.ghost):not(.danger) {
  background: var(--stg-accent) !important;
  border-color: var(--stg-accent) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(21, 128, 61, 0.18) !important;
}

html.admin-staging-shell .admin-btn:not(.ghost):not(.danger):hover:not(:disabled) {
  background: #166534 !important;
}

html.admin-staging-shell .admin-btn.ghost {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid var(--stg-border) !important;
  color: var(--stg-primary) !important;
}

html.admin-staging-shell .admin-btn.ghost:hover:not(:disabled) {
  border-color: #86efac !important;
  color: var(--stg-accent) !important;
}

html.admin-staging-shell #dashCards > div,
html.admin-staging-shell .admin-console #dashCards > div {
  border-radius: 14px !important;
  border-color: rgba(203, 213, 225, 0.95) !important;
  box-shadow: var(--stg-shadow) !important;
}

html.admin-staging-shell .admin-dash-kpi-more {
  display: none !important;
}

html.admin-staging-shell #dashCards > div[data-dash-card="deals"],
html.admin-staging-shell .admin-console #dashCards > div[data-dash-card="deals"] {
  outline: none !important;
}

html.admin-staging-shell .dash-seg__btn.is-active {
  background: var(--stg-accent) !important;
  color: #fff !important;
  border-color: var(--stg-accent) !important;
}

/* 与 inline .dash-seg{display:inline-flex} 叠加时，仍须尊重 hidden（新版单页看板） */
html.admin-staging-shell .dash-seg[hidden] {
  display: none !important;
}

html.admin-staging-shell code {
  font-family: "Fira Code", ui-monospace, monospace !important;
}

/* 会话检查：与内测后台同色背景，不闪登录 */
html.admin-staging-shell body.admin-state-booting .admin-boot-splash__mark {
  color: #0f172a !important;
  letter-spacing: 0.12em !important;
}
html.admin-staging-shell body.admin-state-booting .admin-boot-splash__hint {
  color: #64748b !important;
}
html.admin-staging-shell body.admin-state-booting .admin-boot-splash__dot {
  background: var(--stg-accent) !important;
}

/* 登录页：深色金调品牌卡（与正式登录一致），仅改居中与隐藏顶栏 */
html.admin-staging-shell body.admin-state-login .hero-banner,
html.admin-staging-shell body.admin-state-login .admin-stg-env-banner {
  display: none !important;
}

html.admin-staging-shell body.admin-state-login,
html.admin-staging-shell body.admin-console.admin-state-login {
  min-height: 100vh !important;
  color: #f7ead0 !important;
  background-color: #05070d !important;
  background-image:
    radial-gradient(circle at 50% 18%, rgba(212, 175, 55, 0.18), transparent 22%),
    radial-gradient(circle at 18% 28%, rgba(180, 83, 9, 0.12), transparent 26%),
    linear-gradient(135deg, #05070d 0%, #0b1020 42%, #14100a 100%) !important;
  background-attachment: fixed !important;
}

html.admin-staging-shell body.admin-state-login .admin-shell {
  min-height: 100vh !important;
  display: grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 28px 16px !important;
  box-sizing: border-box !important;
}

html.admin-staging-shell body.admin-state-login #loginCard.admin-card {
  width: min(460px, 100%) !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  padding: 36px 38px 30px !important;
  color: #f7ead0 !important;
  background:
    linear-gradient(145deg, rgba(18, 22, 32, 0.94), rgba(10, 12, 19, 0.92)),
    radial-gradient(circle at 20% 0%, rgba(212, 175, 55, 0.16), transparent 42%) !important;
  border: 1px solid rgba(212, 175, 55, 0.28) !important;
  border-radius: 22px !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 90px rgba(0, 0, 0, 0.48),
    0 10px 40px rgba(180, 83, 9, 0.12) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  position: relative !important;
  overflow: hidden !important;
}

html.admin-staging-shell body.admin-state-login #loginCard.admin-card::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 18px !important;
  right: 18px !important;
  top: 0 !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.72), transparent) !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .admin-login-title {
  margin: 0 0 26px !important;
  padding: 0 !important;
  text-align: center !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.16em !important;
  color: #f7d77a !important;
  text-shadow: 0 0 22px rgba(212, 175, 55, 0.35) !important;
}

html.admin-staging-shell body.admin-state-login .admin-login-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 18px !important;
  align-items: end !important;
}

html.admin-staging-shell body.admin-state-login #loginCard label,
html.admin-staging-shell body.admin-state-login #loginCard .admin-login-field label {
  margin: 0 0 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: rgba(247, 234, 208, 0.82) !important;
  letter-spacing: 0.04em !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .admin-login-field input,
html.admin-staging-shell body.admin-state-login #loginCard .pwd-wrap input {
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(212, 175, 55, 0.28) !important;
  border-radius: 11px !important;
  padding: 12px 13px !important;
  color: #f8fafc !important;
  background: rgba(4, 7, 14, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .pwd-wrap input {
  padding-right: 38px !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .admin-login-field input:focus,
html.admin-staging-shell body.admin-state-login #loginCard .pwd-wrap input:focus {
  border-color: rgba(250, 204, 21, 0.74) !important;
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  outline: none !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .admin-login-field input:-webkit-autofill,
html.admin-staging-shell body.admin-state-login #loginCard .admin-login-field input:-webkit-autofill:hover,
html.admin-staging-shell body.admin-state-login #loginCard .admin-login-field input:-webkit-autofill:focus,
html.admin-staging-shell body.admin-state-login #loginCard .pwd-wrap input:-webkit-autofill {
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc !important;
  transition: background-color 99999s ease-out 0s !important;
  box-shadow: inset 0 0 0 1000px rgba(4, 7, 14, 0.92) !important;
  border: 1px solid rgba(212, 175, 55, 0.28) !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .pwd-wrap .pwd-eye {
  color: rgba(247, 234, 208, 0.55) !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .pwd-wrap .pwd-eye:hover {
  color: #f7d77a !important;
}

html.admin-staging-shell body.admin-state-login .admin-login-actions {
  grid-column: 1 !important;
  grid-row: 2 !important;
  margin-top: 20px !important;
  width: auto !important;
}

html.admin-staging-shell body.admin-state-login .admin-login-actions .admin-login-btn {
  width: 100% !important;
  padding: 12px 20px !important;
  border-radius: 11px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  color: #120b02 !important;
  background: linear-gradient(135deg, #facc15 0%, #d97706 50%, #f59e0b 100%) !important;
  background-image: linear-gradient(135deg, #facc15 0%, #d97706 50%, #f59e0b 100%) !important;
  border: 1px solid rgba(255, 237, 160, 0.45) !important;
  box-shadow:
    0 10px 28px rgba(217, 119, 6, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

html.admin-staging-shell body.admin-state-login .admin-login-actions .admin-login-btn:hover:not(:disabled) {
  filter: brightness(1.08) !important;
  box-shadow:
    0 14px 34px rgba(217, 119, 6, 0.36),
    0 0 24px rgba(250, 204, 21, 0.16) !important;
}

html.admin-staging-shell body.admin-state-login #loginCard .admin-muted,
html.admin-staging-shell body.admin-state-login #loginCard .admin-login-msg {
  margin: 14px 0 0 !important;
  color: rgba(247, 234, 208, 0.62) !important;
  text-align: center !important;
  font-size: 13px !important;
}

html.admin-staging-shell body.admin-state-login #loginBootstrapWrap {
  grid-column: 1 / -1 !important;
  margin-top: 12px !important;
}

@media (max-width: 520px) {
  html.admin-staging-shell body.admin-state-login .admin-login-grid {
    grid-template-columns: 1fr !important;
  }

  html.admin-staging-shell body.admin-state-login .admin-login-actions {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  html.admin-staging-shell body.admin-state-login #loginCard.admin-card {
    padding: 28px 22px 24px !important;
  }
}

@media (max-width: 880px) {
  html.admin-staging-shell .admin-app-layout {
    grid-template-columns: 1fr !important;
    margin: 8px 10px 0 !important;
  }

  html.admin-staging-shell .admin-sidebar {
    max-height: none !important;
  }

  html.admin-staging-shell .admin-tabs {
    flex-direction: row !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }

  html.admin-staging-shell .admin-nav-group {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }

  html.admin-staging-shell .admin-nav-label,
  html.admin-staging-shell .admin-stg-side-foot {
    display: none !important;
  }

  html.admin-staging-shell .admin-tab {
    white-space: nowrap !important;
  }
}

/* —— 实时动态（仅内测后台） —— */
html.admin-staging-shell .dash-live-feed__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}

html.admin-staging-shell .dash-live-feed__list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
}

html.admin-staging-shell .dash-live-feed__list li:last-child {
  border-bottom: 0;
}

html.admin-staging-shell .dash-live-feed__dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

html.admin-staging-shell .dash-live-feed__dot.is-warn {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}

html.admin-staging-shell .dash-live-feed__dot.is-danger {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

html.admin-staging-shell .dash-live-feed__text {
  margin: 0;
  min-width: 0;
}

html.admin-staging-shell .dash-live-feed__time {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

html.admin-staging-shell .dash-live-feed__empty {
  display: block;
  padding: 14px 4px;
  grid-column: 1 / -1;
}
