/* =========================================================
   哦维星图中台 · v2 平台组件
   (应用管理 / 应用中心 / 星币 / 审计 / 接入指南)
   沿用 tokens.css 的电光蓝设计系统
========================================================= */

/* —— 侧边栏:分组变多后可滚动 —— */
.sidebar { gap: 14px; }
.sb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;
  padding: 0 8px;
  scrollbar-width: thin;
}
.sb-scroll .sb-section { margin-top: 10px; }
.sb-scroll .sb-section:first-child { margin-top: 0; }

/* —— 品牌 logo(OWS · 哦维星图)—— */
.sb-brand {
  flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 2px 8px 16px; text-decoration: none; color: inherit;
}
.sb-brand .sb-logo { display: block; width: 184px; max-width: 100%; height: auto; }
.sb-brand .sb-sub {
  margin-top: 0; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted); letter-spacing: .02em; white-space: nowrap;
}
.sb-tag {
  font-size: 11px; font-weight: 600; line-height: 18px; padding: 0 7px; border-radius: 6px;
  color: var(--brand-600); background: var(--brand-50); border: 1px solid var(--brand-100);
}

/* 登录页左侧:改为与 logo 同色系的深蓝,白字 logo */
.login-hero-bg {
  background:
    radial-gradient(900px 520px at 85% 110%, rgba(56,189,248,.22), transparent 60%),
    radial-gradient(700px 420px at 0% 0%, rgba(61,90,254,.30), transparent 60%),
    linear-gradient(160deg, #050b26 0%, #0a1850 45%, #1236b0 100%);
}
.login-hero-brand { flex-direction: column; align-items: flex-start; gap: 12px; }
.login-hero-logo-img { display: block; width: 300px; max-width: 100%; height: auto; }
.login-hero-sub { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.login-hero-sub span {
  font-family: "Noto Sans SC", var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: .08em;
  color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  border-radius: 6px; padding: 1px 8px;
}
.login-form-logo { display: none; }
@media (max-width: 768px) {
  .login-form-logo { display: block; width: 200px; height: auto; margin: 0 0 22px; }
}

/* —— 布局:主区域允许收缩,宽表格在卡片内横向滚动,而不是撑宽整页 —— */
.main { min-width: 0; }
.table-wrap { overflow-x: auto; }

/* —— 登录页:SSO 目标应用 —— */
.sso-target {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-muted);
}
.sso-target strong { color: var(--text-strong); }
.sso-target-icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: #fff;
}
.sso-target-icon svg { width: 15px; height: 15px; }

/* —— 通用组件(原在 admin.css,用户端页面也需要)—— */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all .25s var(--ease);
  cursor: pointer;
}
.quick-card:hover {
  border-color: rgba(61,90,254,.32);
  background: linear-gradient(135deg, rgba(61,90,254,.05), transparent 60%);
  transform: translateY(-1px);
}
.quick-card .qi {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--grad-iso);
  border: 1px solid rgba(61,90,254,.18);
  display: grid; place-items: center;
  color: var(--brand-600);
  flex-shrink: 0;
}
.quick-card .qi svg { width: 20px; height: 20px; }
.quick-card .nm {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
}
.quick-card .ds {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* —— 段落标题 —— */
.section-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.005em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 3px; height: 14px;
  background: var(--grad-electric);
  border-radius: 2px;
}


.topbar-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* —— 行点击高亮 —— */

/* —— 修正:KPI 卡片副标题中的数字使用正文字号(v1 遗留:被 .kpi-card .num 放大)—— */
.kpi-card .sub .num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-muted);
  line-height: inherit;
}
/* 状态胶囊 / 表头不换行(窄列中避免"退/款"竖排) */
.pill { white-space: nowrap; }
.tbl th { white-space: nowrap; }
.self-badge { white-space: nowrap; }
.tbl .actions { flex-wrap: nowrap; }

/* —— 通用:标签页 —— */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-soft);
  margin: 4px 0 18px;
  overflow-x: auto;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.tab-btn svg { width: 15px; height: 15px; }
.tab-btn:hover { color: var(--text-strong); }
.tab-btn.active {
  color: var(--brand-600);
  font-weight: 600;
  border-bottom-color: var(--brand-500);
}
.tab-btn .count {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-muted);
}
.tab-btn.active .count { background: rgba(61,90,254,.12); color: var(--brand-600); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* —— 通用:小工具 —— */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.row-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; }
.hint-text { font-size: 12px; color: var(--text-faint); line-height: 1.6; }
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s var(--ease);
}
.copy-btn:hover { color: var(--brand-600); border-color: var(--brand-300); }
.copy-btn svg { width: 13px; height: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  color: var(--text-body);
  white-space: nowrap;
}
.chip.brand { background: rgba(61,90,254,.08); border-color: rgba(61,90,254,.2); color: var(--brand-600); }
.chip.mono { font-family: var(--font-mono); font-size: 11.5px; }
.chip svg { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* —— 应用卡片(后台应用列表 / 用户应用中心)—— */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  overflow: hidden;
}
.app-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--app-color, var(--brand-500));
  opacity: .85;
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-brand); border-color: rgba(61,90,254,.28); }
.app-card.disabled { opacity: .62; }
.app-card-head { display: flex; align-items: flex-start; gap: 14px; }
.app-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--app-color, var(--brand-500));
  box-shadow: 0 10px 22px -12px var(--app-color, var(--brand-500));
  flex-shrink: 0;
}
.app-icon svg { width: 24px; height: 24px; }
.app-icon.lg { width: 64px; height: 64px; border-radius: 18px; }
.app-icon.lg svg { width: 32px; height: 32px; }
.app-icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.app-icon.sm svg { width: 16px; height: 16px; }
.app-title { min-width: 0; flex: 1; }
.app-title .nm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.app-title .cd { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.app-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px dashed var(--border-soft);
}
.app-stats .lbl { font-size: 11px; color: var(--text-faint); letter-spacing: .04em; }
.app-stats .val { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-strong); }
.app-stats .val.val-sm { font-family: inherit; font-size: 13px; line-height: 22px; }
.app-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.app-card-foot .spacer { flex: 1; }
.app-client-id {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  min-width: 0;
}
.app-client-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* —— 应用详情头部 —— */
.app-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.app-hero::after {
  content: "";
  position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, var(--app-color-soft, rgba(61,90,254,.12)), transparent 70%);
  pointer-events: none;
}
.app-hero .meta { flex: 1; min-width: 0; }
.app-hero h1 {
  font-family: var(--font-display);
  font-size: 22px; margin: 0;
  color: var(--text-strong);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.app-hero .sub { margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.app-hero .actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }

/* —— 键值列表(接入配置)—— */
.kv-list { display: flex; flex-direction: column; }
.kv-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-soft);
  align-items: center;
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k { font-size: 12.5px; color: var(--text-muted); }
.kv-row .v { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.kv-row .v .mono { word-break: break-all; color: var(--text-strong); font-size: 12.5px; }

/* —— 一次性密钥展示 —— */
.secret-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: #0b1230;
  color: #e0e7ff;
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
  display: flex; align-items: center; gap: 10px;
}
.secret-box .copy-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #c7d2fe; }
.notice {
  display: flex; gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.65;
  background: var(--warning-bg);
  color: #8a5a00;
  border: 1px solid rgba(245,158,11,.3);
  margin: 0 0 14px;
}
.notice svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.notice.info { background: rgba(61,90,254,.06); color: var(--text-body); border-color: rgba(61,90,254,.18); }
.notice.info svg { color: var(--brand-500); }

/* —— 代码块 —— */
.code-block {
  position: relative;
  margin: 10px 0 16px;
  border-radius: 12px;
  background: #0b1230;
  border: 1px solid #1d2756;
  overflow: hidden;
}
.code-block .code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: #8a93c6;
  background: #10183d;
  border-bottom: 1px solid #1d2756;
}
.code-block .copy-btn { background: transparent; border-color: #2a3570; color: #a5b4fc; }
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #dbe3ff;
}

/* —— 勾选卡片网格(授权应用 / 角色 / 权限选择)—— */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.check-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.check-card:hover { border-color: var(--brand-300); }
.check-card:has(input:checked) {
  border-color: var(--brand-400);
  background: rgba(61,90,254,.05);
  box-shadow: inset 0 0 0 1px rgba(61,90,254,.2);
}
.check-card input { margin-top: 3px; accent-color: var(--brand-500); }
.check-card .ct { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.check-card .cs { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; font-family: var(--font-mono); word-break: break-all; }
.check-card .cd { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* —— 用户选择器 —— */
.user-picker { border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; }
.user-picker .picker-search { padding: 10px; border-bottom: 1px solid var(--border-soft); background: var(--bg-elev); }
.user-picker .picker-list { max-height: 260px; overflow-y: auto; }
.user-picker .picker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  font-size: 13px;
}
.user-picker .picker-row:last-child { border-bottom: none; }
.user-picker .picker-row:hover { background: var(--bg-soft); }
.user-picker .picker-row.disabled { opacity: .5; cursor: not-allowed; }
.user-picker .picker-row input { accent-color: var(--brand-500); }
.user-picker .picker-row .nm { font-weight: 600; color: var(--text-strong); }
.user-picker .picker-row .co { color: var(--text-faint); font-size: 12px; }
.user-picker .picker-foot {
  padding: 8px 14px; font-size: 12px; color: var(--text-muted);
  background: var(--bg-elev); border-top: 1px solid var(--border-soft);
}

/* —— 星币 —— */
.coin-amount { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.coin-amount.plus { color: var(--success); }
.coin-amount.minus { color: var(--danger); }
.coin-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7e0, #ffe9b8);
  border: 1px solid rgba(245,158,11,.35);
  color: #8a5a00;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.coin-chip .coin-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
}
.coin-chip .coin-dot svg { width: 14px; height: 14px; }
.coin-chip .num { font-family: var(--font-display); font-size: 15px; }
.coin-hero {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 18px;
}
.coin-hero > div { padding: 22px 24px; border-right: 1px dashed var(--border-soft); }
.coin-hero > div:last-child { border-right: none; }
.coin-hero .main-balance {
  background: linear-gradient(135deg, rgba(251,191,36,.16), rgba(245,158,11,.06));
  display: flex; align-items: center; gap: 16px;
}
.coin-hero .big-coin {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  box-shadow: 0 14px 28px -14px rgba(245,158,11,.8);
  flex-shrink: 0;
}
.coin-hero .big-coin svg { width: 28px; height: 28px; }
.coin-hero .lbl { font-size: 12px; color: var(--text-muted); letter-spacing: .04em; }
.coin-hero .val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-strong);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.coin-hero .main-balance .val { font-size: 32px; color: #8a5a00; }
.coin-hero .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* —— 简易柱状图(单序列:一种颜色;细柱、顶部 4px 圆角、整列作为悬停热区)—— */
.bar-chart-wrap { position: relative; }
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 170px;
  padding: 22px 0 0;
  border-bottom: 1px solid var(--border-soft);
}
.bar-chart .bar-col {
  flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  position: relative; cursor: default; border-radius: 6px;
}
.bar-chart .bar-col:hover { background: var(--bg-soft); }
.bar-chart .bar {
  width: 100%;
  max-width: 24px;
  border-radius: 4px 4px 0 0;
  background: var(--brand-500);
  min-height: 2px;
}
.bar-chart .bar.zero { background: var(--border-soft); }
.bar-chart .bar-peak {
  position: absolute; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  transform: translateY(-16px); white-space: nowrap;
}
.bar-chart .bar-tip {
  display: none;
  position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%);
  background: #0b1230; color: #fff; font-size: 11.5px; line-height: 1.6;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; z-index: 5;
  box-shadow: var(--shadow-soft);
}
.bar-chart .bar-col:hover .bar-tip { display: block; }
.bar-axis { display: flex; gap: 2px; margin-top: 6px; }
.bar-axis span { flex: 1; min-width: 0; text-align: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* —— 接入指南 —— */
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.doc-body { min-width: 0; }
.doc-toc {
  position: sticky; top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 14px;
  font-size: 13px;
}
.doc-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-muted); }
.doc-toc a:hover { background: var(--bg-soft); color: var(--brand-600); }
.doc-body .card { scroll-margin-top: 20px; }
.doc-body h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 8px; color: var(--text-strong); }
.doc-body h3 { font-size: 14.5px; margin: 18px 0 6px; color: var(--text-strong); }
.doc-body p, .doc-body li { font-size: 13.5px; color: var(--text-body); line-height: 1.8; }
.doc-body code:not(pre code) {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  padding: 1px 6px; border-radius: 5px; color: var(--brand-700);
  word-break: break-all;
}
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 10px 0; }
.step-list li { counter-increment: step; position: relative; padding-left: 38px; margin-bottom: 10px; }
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-electric); color: #fff;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
}
.endpoint-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.endpoint-table th, .endpoint-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.endpoint-table th { font-size: 12px; color: var(--text-faint); font-weight: 500; letter-spacing: .04em; }
.endpoint-table td.mono { font-size: 12px; color: var(--text-strong); word-break: break-all; }
.method {
  display: inline-block; min-width: 46px; text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 5px;
}
.method.get { background: var(--success-bg); color: var(--success); }
.method.post { background: rgba(61,90,254,.1); color: var(--brand-600); }
.method.put { background: var(--warning-bg); color: #b45309; }
.method.delete { background: var(--danger-bg); color: var(--danger); }

/* —— 用户工作台:欢迎区 —— */
.portal-hero {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 26px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(6,182,212,.14), transparent 60%),
    linear-gradient(135deg, #0b1230, #1b2a78);
  color: #fff;
  margin-bottom: 22px;
  box-shadow: var(--shadow-brand);
  position: relative;
  overflow: hidden;
}
.portal-hero h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.portal-hero p { margin: 6px 0 0; color: rgba(255,255,255,.72); font-size: 13.5px; }
.portal-hero .spacer { flex: 1; }
.portal-hero .hero-stats { display: flex; gap: 26px; }
.portal-hero .hero-stats .num { font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.portal-hero .hero-stats .lbl { font-size: 12px; color: rgba(255,255,255,.66); }
.portal-hero .orbit {
  width: 58px; height: 58px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
}
.portal-hero .orbit svg { width: 28px; height: 28px; }

/* —— 控制台双栏 —— */
.dash-two-col { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.dash-two-col .card { margin-bottom: 0; }
#dash-apps .quick-card { padding: 14px 16px; }

/* —— 右上角账号菜单(_user_menu.html)—— */
.user-menu { position: relative; margin-left: auto; flex-shrink: 0; }
.topbar .user-menu .who-chip {
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.topbar .user-menu .who-chip:hover { border-color: var(--brand-200); }
.topbar .user-menu .who-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(61,90,254,.22); border-color: var(--brand-400); }
.user-menu.open .who-chip { border-color: var(--brand-300); background: var(--bg-elev); }
.topbar .user-menu .who-chip .who-name {
  font-weight: 600; color: var(--text-strong);
  max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu .ava {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad-electric); color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
}
.user-menu .who-caret { display: inline-grid; place-items: center; color: var(--text-faint); transition: transform .18s var(--ease); }
.user-menu .who-caret svg { width: 15px; height: 15px; }
.user-menu.open .who-caret { transform: rotate(180deg); color: var(--brand-500); }

.user-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 272px; max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 22px 48px -20px rgba(11,18,48,.30), 0 6px 16px -8px rgba(11,18,48,.12);
  padding: 6px;
  transform-origin: top right;
  animation: um-in .14s var(--ease);
}
.user-menu-panel[hidden] { display: none; }
@keyframes um-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.um-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 10px 12px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(61,90,254,.07), rgba(6,182,212,.05));
}
.um-head .ava { width: 40px; height: 40px; font-size: 16px; }
.um-id { min-width: 0; flex: 1; }
.um-name {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--text-strong); letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.um-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 0; }
.um-account {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.um-role {
  flex-shrink: 0; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 999px;
  color: var(--text-muted); background: var(--bg-soft); white-space: nowrap;
}
.um-role.admin { color: var(--brand-600); background: var(--brand-50); }
.um-company {
  margin-top: 4px; font-size: 12px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.um-group { display: flex; flex-direction: column; gap: 1px; padding: 2px 0; }
.um-group + .um-group { border-top: 1px solid var(--border-soft); margin-top: 4px; padding-top: 6px; }
.um-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 9px; background: transparent;
  font: inherit; font-size: 13.5px; color: var(--text-body); text-align: left; text-decoration: none;
  cursor: pointer; transition: background .12s var(--ease), color .12s var(--ease);
}
.um-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-faint); transition: color .12s var(--ease); }
.um-item em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--text-faint); }
.um-item:hover, .um-item:focus-visible { background: var(--bg-soft); color: var(--text-strong); outline: none; }
.um-item:hover svg, .um-item:focus-visible svg { color: var(--brand-500); }
.um-item.danger { color: var(--danger); }
.um-item.danger svg { color: var(--danger); opacity: .85; }
.um-item.danger:hover, .um-item.danger:focus-visible { background: var(--danger-bg); color: #c81e1e; }
.um-item.danger:hover svg, .um-item.danger:focus-visible svg { color: #c81e1e; opacity: 1; }

/* —— 响应式 —— */
@media (min-width: 1680px) {
  .dash-two-col { grid-template-columns: 1fr 1.4fr; }
}
@media (max-width: 1100px) {
  .coin-hero { grid-template-columns: 1fr 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; }
}
@media (max-width: 720px) {
  .topbar .user-menu .who-chip .who-name { max-width: 96px; }
  .kv-row { grid-template-columns: 1fr; gap: 4px; }
  .coin-hero { grid-template-columns: 1fr; }
  .portal-hero { flex-wrap: wrap; }
}
