/* ===== DLJ_CONSOLE_AICOST_THEME_V1 (2026-11-19) =====
   参考 aicost API 控制台的浅色紧凑风格：
   - 白色顶栏 + 顶部导航
   - 浅灰侧栏、蓝色选中态
   - 白卡片、细边框、小字号、紧凑表格
   - 蓝色主按钮、浅色次按钮、红色删除、绿色成功
   只作用于用户中心 body.userConsoleV3。 */
:root {
  --accent: #4b6bfb;
  --accent-soft: #eef3ff;
  --line: #e8ecf1;
  --text: #1f2937;
  --muted: #6b7280;
  --ok: #0f9d76;
  --danger: #e5484d;
}
body.userConsoleV3 {
  background: #f7f8fa !important;
  color: var(--text) !important;
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif !important;
  font-size: 13px !important;
}
body.userConsoleV3 * { scrollbar-width: thin; }

/* ---------- 顶栏 ---------- */
.topbar.userTopbar {
  height: 56px !important;
  padding: 0 20px !important;
  background: #fff !important;
  border-bottom: 1px solid #e9edf2 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.topbar .consoleTopLeft { gap: 22px !important; }
.brand img { width: 30px !important; height: 30px !important; border-radius: 8px !important; }
.brandText b { font-size: 15px !important; font-weight: 700 !important; color: #111827 !important; letter-spacing: 0 !important; }
.brandText small { font-size: 9.5px !important; color: #9aa3b2 !important; }
.topNav { display: flex; align-items: center; gap: 24px; height: 56px; }
.topNav a {
  display: inline-flex; align-items: center; height: 56px;
  color: #6b7280; text-decoration: none; font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.topNav a:hover { color: #111827; }
.topNav a.active { color: #111827; font-weight: 600; border-bottom-color: #111827; }
.topbar .nav { gap: 8px !important; }
.topbar .langBtn, .topbar .nav > .btn {
  height: 30px !important; min-height: 30px !important; padding: 0 10px !important;
  border: 1px solid #e3e8ef !important; border-radius: 7px !important;
  background: #fff !important; color: #4b5563 !important; font-size: 12px !important;
  box-shadow: none !important;
}
.userBalancePill {
  height: 30px; display: inline-flex; align-items: center; gap: 4px;
  padding: 0 9px; border: 1px solid #eceff3; border-radius: 7px;
  background: #f6f7f9; color: #6b7280; font-size: 11.5px;
}
.userBalancePill b { color: #111827; font-weight: 700; }
.topIdentity { font-size: 11.5px !important; color: #6b7280 !important; }

/* ---------- 左侧栏 ---------- */
.console { grid-template-columns: 200px minmax(0, 1fr) !important; min-height: calc(100vh - 56px) !important; }
.sidebar.userSidebar {
  top: 56px !important; height: calc(100vh - 56px) !important;
  padding: 12px 10px !important;
  background: #f8f9fb !important;
  border-right: 1px solid #edf0f4 !important;
}
.userConsoleV3 .sideSectionLabel {
  margin: 6px 10px 8px !important; font-size: 10.5px !important;
  color: #9aa3b2 !important; font-weight: 600 !important; letter-spacing: .02em !important;
}
.userConsoleV3 .sideBtn {
  height: 36px !important; margin: 2px 0 !important; border-radius: 8px !important;
  padding: 0 10px !important; gap: 9px !important;
  font-size: 12.5px !important; font-weight: 500 !important; color: #4b5563 !important;
}
.userConsoleV3 .sideBtn:hover { background: #eef1f6 !important; color: #1f2937 !important; }
.userConsoleV3 .sideBtn.active { background: #eaf1ff !important; color: #2f6bff !important; font-weight: 600 !important; }
.userConsoleV3 .sideIcon { width: 16px !important; font-size: 13px !important; color: #8a94a6 !important; opacity: 1 !important; }
.userConsoleV3 .sideBtn.active .sideIcon { color: #2f6bff !important; }
/* 顶部导航已有模型广场；桌面隐藏侧栏重复项，移动端顶栏隐藏时保留侧栏入口 */
.userConsoleV3 .sideBtn[data-tab="models"] { display: none !important; }
@media (max-width: 980px) { .userConsoleV3 .sideBtn[data-tab="models"] { display: flex !important; } }
.sidebarCollapseHint {
  border: 1px solid #e3e8ef !important; background: #fff !important; color: #6b7280 !important;
  height: 30px !important; border-radius: 7px !important; font-size: 11.5px !important;
}

/* ---------- 主区域 ---------- */
.consoleMain.userMain {
  padding: 24px 28px 40px !important;
  max-width: calc(100vw - 200px) !important;
  background: transparent !important;
}
.welcomeRow h1, .pageTitle h1 { font-size: 22px !important; letter-spacing: -.3px !important; color: #111827 !important; font-weight: 700 !important; }
.welcomeRow p, .pageTitle p { font-size: 12.5px !important; color: #6b7280 !important; }
.marketHeader h1 { font-size: 27px !important; letter-spacing: -.6px !important; color: #111827 !important; }
.marketHeader p { font-size: 12.5px !important; color: #6b7280 !important; }
.card, .feature { border: 1px solid #e8ecf1 !important; border-radius: 10px !important; box-shadow: none !important; background: #fff !important; }
.tableCard { margin-top: 14px !important; border-radius: 10px !important; }
.tableToolbar { min-height: 48px !important; padding: 11px 14px !important; background: #fff !important; }
.tableToolbar b { font-size: 13px !important; color: #1f2937 !important; }
.toolbarSub { font-size: 11.5px !important; color: #8a94a6 !important; }

/* ---------- 表格 ---------- */
.userConsoleV3 .table { font-size: 12.5px !important; color: #374151 !important; }
.userConsoleV3 .table th {
  height: 38px !important; padding: 9px 12px !important;
  background: #f8f9fb !important; color: #6b7280 !important;
  font-size: 11.5px !important; font-weight: 600 !important;
  border-bottom: 1px solid #edf0f4 !important;
}
.userConsoleV3 .table td { padding: 10px 12px !important; border-bottom: 1px solid #f1f3f6 !important; color: #374151 !important; }
.userConsoleV3 .table tbody tr:hover { background: #fafbfd !important; }
.userConsoleV3 .tokenReferenceTable td { padding: 9px 10px !important; font-size: 12px !important; }
.userConsoleV3 .tokenReferenceTable th { padding: 8px 10px !important; font-size: 11px !important; }
.userConsoleV3 .denseTable td { padding: 8px 10px !important; }
.tableWrap { border: 0 !important; }

/* ---------- 按钮 ---------- */
.btn {
  height: 32px !important; min-height: 32px !important; padding: 0 12px !important;
  border-radius: 7px !important; border: 1px solid #e3e8ef !important;
  background: #fff !important; color: #374151 !important;
  font-size: 12.5px !important; font-weight: 600 !important; box-shadow: none !important;
}
.btn:hover { background: #f8fafc !important; border-color: #d6dde8 !important; }
.btn.primary {
  background: #eef4ff !important; border-color: #dbe5ff !important; color: #2f6bff !important;
}
.btn.primary:hover { background: #e3edff !important; border-color: #cfdcff !important; }
.dljFieldActions .btn.primary { background: #fff !important; border-color: #dfe5ee !important; color: #374151 !important; }
.dljFieldActions .btn.primary:hover { background: #f8fafc !important; border-color: #d6dde8 !important; }
.btn.ghost { background: #fff !important; border-color: #e3e8ef !important; color: #4b5563 !important; }
.btn.ghost:hover { background: #f8fafc !important; color: #1f2937 !important; }
.btn.sm { height: 29px !important; min-height: 29px !important; padding: 0 10px !important; font-size: 12px !important; }
.btn.danger, .btn.danger:hover { background: #fff5f5 !important; border-color: #f5d0d0 !important; color: #e5484d !important; }
.btn:disabled { opacity: .5 !important; }
.textDanger, .linkDanger, .dangerText { color: #e5484d !important; }
.linkAction { color: #2f6bff !important; }

/* ---------- 状态标签 ---------- */
.pill, .dljStatusPill { border: 0 !important; box-shadow: none !important; font-size: 11.5px !important; font-weight: 600 !important; }
.pill.success, .pill.ok, .dljStatusPill.success { background: #eaf8f1 !important; color: #0f9d76 !important; }
.pill.failed, .pill.error, .dljStatusPill.failed { background: #fff0f0 !important; color: #e5484d !important; }
.pill.processing, .pill.pending, .dljStatusPill.processing { background: #eef3ff !important; color: #2f6bff !important; }
.statusOnline { color: #0f9d76 !important; }

/* ---------- 输入 / 筛选 ---------- */
.userConsoleV3 .input, .userConsoleV3 .select {
  height: 34px !important; min-height: 34px !important;
  border: 1px solid #e3e8ef !important; border-radius: 8px !important;
  font-size: 12.5px !important; background: #fff !important; color: #374151 !important;
}
.userConsoleV3 .input:focus, .userConsoleV3 .select:focus {
  border-color: #4b6bfb !important; box-shadow: 0 0 0 3px rgba(75,107,251,.10) !important;
}
.dljField > span { font-size: 11.5px !important; color: #6b7280 !important; font-weight: 600 !important; }
.dljFilterCard { border-color: #e8ecf1 !important; border-radius: 10px !important; padding: 12px 14px !important; }

/* ---------- 日志页 ---------- */
#tab-usage, #tab-tasks {
  --u-accent: #4b6bfb; --u-text: #1f2937; --u-muted: #6b7280;
  --warm-card: #fff; --warm-line: #e8ecf1;
}
.dljSummaryChip { border-radius: 8px !important; background: #f8fafc !important; border-color: #e8ecf1 !important; font-size: 11.5px !important; }
.dljSummaryChip b { font-size: 14px !important; color: #1f2937 !important; }
.dljSummaryChip.net, .dljSummaryChip.ok { background: #f3fbf7 !important; border-color: #d9f0e5 !important; }
.dljSummaryChip.net b, .dljSummaryChip.ok b { color: #0f9d76 !important; }
.dljTaskId { color: #2f6bff !important; background: #f6f8ff !important; border-color: #e3e9ff !important; border-radius: 6px !important; }
.dljTaskId:hover { background: #eef3ff !important; color: #2f6bff !important; }
.dljResultLink { color: #2f6bff !important; font-weight: 600 !important; }
.dljResultLink:hover { text-decoration: underline; }
.dljPageBtn { border-radius: 7px !important; border-color: #e3e8ef !important; background: #fff !important; color: #4b5563 !important; }
.dljPageBtn:hover:not(:disabled):not(.active) { border-color: #cfd9ff !important; color: #2f6bff !important; }
.dljPageBtn.active { background: #4b6bfb !important; border-color: #4b6bfb !important; color: #fff !important; }
.dljLogCard, .dljTaskTable { border-color: #e8ecf1 !important; border-radius: 10px !important; }

/* ---------- 模型广场 ---------- */
.hotTags button { border-color: #e3e8ef !important; background: #fff !important; color: #4b5563 !important; font-size: 11.5px !important; border-radius: 7px !important; }
.modelFilter.active { background: #eef3ff !important; color: #2f6bff !important; border-color: #dbe5ff !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .topNav { display: none !important; }
  .console { grid-template-columns: 64px minmax(0, 1fr) !important; }
  .sidebar.userSidebar .sideSectionLabel, .sidebar.userSidebar .sideBtn span:not(.sideIcon) { display: none !important; }
  .sidebar.userSidebar .sideBtn { justify-content: center; padding: 0 !important; }
  .consoleMain.userMain { padding: 18px 16px 34px !important; max-width: calc(100vw - 64px) !important; }
}

/* ---------- models marketplace standalone (desktop only) ---------- */
@media (min-width: 981px) {
  body.userConsoleV3.modelsStandalone .sidebar.userSidebar { display: none !important; }
  body.userConsoleV3.modelsStandalone .console { grid-template-columns: minmax(0, 1fr) !important; }
  body.userConsoleV3.modelsStandalone .consoleMain.userMain { max-width: 100vw !important; padding: 24px 40px 40px !important; }
  body.userConsoleV3.modelsStandalone .sidebarCollapseHint { display: none !important; }
}

/* ---------- sidebar icons + collapsed layout ---------- */
.userConsoleV3 .sideIcon{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:18px!important;height:18px!important;flex:0 0 18px!important;color:#8a94a6!important}
.userConsoleV3 .sideIcon svg{width:16px!important;height:16px!important;display:block!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important;stroke-linecap:round!important;stroke-linejoin:round!important}
.userConsoleV3 .sideBtn.active .sideIcon{color:#2f6bff!important}
.userConsoleV3 .sideBtn{font-weight:550!important;letter-spacing:.01em}
.userConsoleV3.sidebarCollapsed .console{grid-template-columns:56px minmax(0,1fr)!important}
.userConsoleV3.sidebarCollapsed .sidebar.userSidebar{padding:10px 6px!important}
.userConsoleV3.sidebarCollapsed .consoleMain.userMain{max-width:calc(100vw - 56px)!important;padding:18px 18px 34px!important}
.userConsoleV3.sidebarCollapsed .sideBtn{width:44px!important;height:36px!important;padding:0!important;margin:2px auto!important;justify-content:center!important}
.userConsoleV3.sidebarCollapsed .sideBtn span:not(.sideIcon){display:none!important}
.userConsoleV3.sidebarCollapsed .sideSectionLabel{display:none!important}
.userConsoleV3.sidebarCollapsed .sidebarCollapseHint{width:44px!important;left:6px!important;right:6px!important;padding:0!important;font-size:16px!important}
.userConsoleV3.sidebarCollapsed .sideBtn.active{background:#eaf1ff!important}
.userConsoleV3 .sidebarCollapseHint{height:32px!important;border-radius:8px!important;color:#6b7280!important;font-size:12px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important}
/* task status select: avoid clipped text */
#taskStatusFilter, .dljTaskFilters .select {
  height: 36px !important;
  min-height: 36px !important;
  line-height: 34px !important;
  padding: 0 32px 0 10px !important;
  font-size: 12.5px !important;
}
/* selects styled with .input (referral contact etc.): prevent clipped font */
.userConsoleV3 select.input,
.userConsoleV3 select.select {
  height: 36px !important;
  min-height: 36px !important;
  line-height: 34px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-right: 28px !important;
}