/* =============================================
   Law Theme — 律师行业主题 CSS 变量覆盖
   =============================================
   配色方案：深蓝 #1a2744（主色）+ 暗金 #c9a84c（强调色）
   风格：直角边框、高密度布局、深色侧边栏、庄重专业感
   使用方式：<html class="law-theme">
   说明：所有 CSS 变量用 !important 覆盖 inline style，
         不与 app.css 对抗，仅为 law 模式提供独立皮肤。
   ============================================= */

html.law-theme {
  /* ---------- 主要配色 ---------- */
  --primary: #1a2744 !important;
  --primary-rgb: 26,39,68 !important;
  --primary-hover: #2a3d66 !important;
  --primary-active: #101a30 !important;
  --primary-bg: rgba(26,39,68,0.10) !important;
  --primary-border: rgba(26,39,68,0.35) !important;

  /* ---------- 金色强调色 ---------- */
  --gold: #c9a84c !important;
  --gold-rgb: 201,168,76 !important;
  --gold-hover: #ddc06a !important;
  --gold-active: #b08e30 !important;
  --gold-bg: rgba(201,168,76,0.12) !important;

  /* ---------- 语义色 ---------- */
  --success: #2d6a4f !important;
  --warning: #b8860b !important;
  --danger: #a8322a !important;
  --info: var(--primary) !important;

  /* ---------- 正文色 ---------- */
  --text-primary: #1a1a2e !important;
  --text-secondary: #4a4a5a !important;
  --text-tertiary: #8a8a9a !important;
  --text-deep: #0f0f1e !important;
  --text-mid: #555 !important;
  --text-light: #999 !important;

  /* ---------- 背景色 ---------- */
  --bg-page: #eef0f4 !important;
  --bg-card: #ffffff !important;
  --bg-hover: #f2f3f7 !important;
  --bg-muted: #e8e9ee !important;
  --bg-elevated: #ffffff !important;

  /* ---------- 边框 ---------- */
  --border: rgba(0,0,0,0.10) !important;
  --border-light: #d0d2d8 !important;
  --border-hover: #a0a2b0 !important;

  /* ---------- 直角边框（核心特征） ---------- */
  --radius-sm: 0 !important;
  --radius-md: 0 !important;
  --radius-lg: 0 !important;

  /* ---------- 紧凑间距（高密度布局） ---------- */
  --space-xxs: 1px !important;
  --space-xs: 3px !important;
  --space-sm: 6px !important;
  --space-md: 12px !important;
  --space-lg: 18px !important;
  --space-xl: 24px !important;

  /* ---------- 阴影（更稳重） ---------- */
  --shadow: 0 1px 6px rgba(0,0,0,0.08) !important;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06) !important;
  --shadow-md: 0 3px 12px rgba(0,0,0,0.09) !important;
  --shadow-lg: 0 6px 28px rgba(0,0,0,0.14) !important;

  /* ---------- 遮罩 ---------- */
  --mask: rgba(0,0,0,0.55) !important;
}

/* =============================================
   TOPBAR — 深色顶栏
   ============================================= */
html.law-theme .topbar {
  background: linear-gradient(135deg, #1a2744, #243456) !important;
  box-shadow: 0 2px 12px rgba(26,39,68,0.3) !important;
}
html.law-theme .topbar .tab.on {
  background: rgba(201,168,76,0.2) !important;
  box-shadow: inset 0 -3px 0 var(--gold) !important;
  color: var(--gold) !important;
}
html.law-theme .topbar .tab:hover {
  background: rgba(255,255,255,0.10) !important;
}
html.law-theme .topbar .btns button {
  border-color: rgba(201,168,76,0.35) !important;
  background: rgba(201,168,76,0.08) !important;
}
html.law-theme .topbar .btns button:hover {
  background: rgba(201,168,76,0.18) !important;
  border-color: var(--gold) !important;
}
html.law-theme .user-btn {
  border-color: rgba(201,168,76,0.35) !important;
  background: rgba(201,168,76,0.08) !important;
}
html.law-theme .user-avatar-text {
  background: var(--gold) !important;
  color: #1a2744 !important;
  font-weight: 700 !important;
}

/* =============================================
   SUBBAR — 次级导航栏
   ============================================= */
html.law-theme .subbar {
  background: #f8f9fc !important;
  border-bottom: 1px solid rgba(26,39,68,0.08) !important;
}
html.law-theme .subbar .sub.on {
  background: #1a2744 !important;
  color: var(--gold) !important;
}
html.law-theme .subbar .sub:hover {
  background: rgba(201,168,76,0.1) !important;
  color: var(--gold) !important;
}

/* =============================================
   SIDEBAR — 深蓝侧边栏（白色/金色文字）
   ============================================= */
html.law-theme .page-wrap {
  background: #eef0f4 !important;
}
html.law-theme .sidebar {
  background: linear-gradient(180deg, #1a2744 0%, #141f38 100%) !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.law-theme .sidebar-hd {
  color: var(--gold) !important;
  border-bottom-color: rgba(201,168,76,0.2) !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
}
html.law-theme .sidebar-item {
  color: rgba(255,255,255,0.65) !important;
  border-radius: 0 !important;
}
html.law-theme .sidebar-item:hover {
  background: rgba(201,168,76,0.10) !important;
  color: #fff !important;
  transform: none !important;
}
html.law-theme .sidebar-item.on {
  background: rgba(201,168,76,0.15) !important;
  color: var(--gold) !important;
  box-shadow: inset 3px 0 0 var(--gold) !important;
}
html.law-theme .sidebar-item i {
  color: inherit !important;
}
html.law-theme .sidebar-item.on .sidebar-item-meta {
  color: rgba(201,168,76,0.7) !important;
}
html.law-theme .sidebar-empty {
  color: rgba(255,255,255,0.35) !important;
}

/* =============================================
   CONTENT — 内容面板
   ============================================= */
html.law-theme .content {
  border-radius: 0 !important;
  border-color: rgba(0,0,0,0.06) !important;
  background: rgba(255,255,255,0.88) !important;
}
html.law-theme .ctitle {
  background: #1a2744 !important;
  border-radius: 0 !important;
  padding: 0.375rem 1rem !important;
}
html.law-theme .ctitle-t {
  color: #fff !important;
}
html.law-theme .cbtn-title {
  border-radius: 0 !important;
  font-weight: 500 !important;
}
html.law-theme .mac-close {
  border-radius: 0 !important;
}
html.law-theme .ctitle-pin {
  border-radius: 0 !important;
}
html.law-theme .ctitle-pin.pinned {
  background: var(--gold) !important;
  color: #1a2744 !important;
}

/* =============================================
   TABS — 标签页
   ============================================= */
html.law-theme .ctab.on {
  color: #1a2744 !important;
  border-bottom-color: var(--gold) !important;
}
html.law-theme .ctab:hover {
  color: var(--gold) !important;
}

/* =============================================
   CARD TABS — 卡片式标签
   ============================================= */
html.law-theme .ctab-card {
  border-radius: 0 !important;
}
html.law-theme .ctab-card:hover {
  border-color: var(--gold) !important;
  background: rgba(201,168,76,0.06) !important;
}
html.law-theme .ctab-card.on {
  border-color: #1a2744 !important;
  background: rgba(26,39,68,0.06) !important;
  box-shadow: 0 2px 8px rgba(26,39,68,0.12) !important;
}
html.law-theme .ctab-card .tab-icon {
  color: #1a2744 !important;
}

/* =============================================
   BUTTONS — 按钮
   ============================================= */
html.law-theme .bk-btn {
  border-radius: 0 !important;
}
html.law-theme .bk-btn-primary {
  background: #1a2744 !important;
}
html.law-theme .bk-btn-primary:hover {
  background: #2a3d66 !important;
}
html.law-theme .bk-btn-ghost:hover {
  color: #1a2744 !important;
  border-color: #1a2744 !important;
  background: rgba(26,39,68,0.06) !important;
}

/* =============================================
   MODAL — 模态框
   ============================================= */
html.law-theme .bk-modal {
  border-radius: 0 !important;
}
html.law-theme .bk-modal-hd {
  background: #1a2744 !important;
  padding: 0.625rem 1rem !important;
  border-bottom-color: rgba(255,255,255,0.1) !important;
}
html.law-theme .bk-modal-hd .title {
  color: #fff !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
}
html.law-theme .bk-modal-hd .close {
  color: rgba(255,255,255,0.6) !important;
  border-radius: 0 !important;
}
html.law-theme .bk-modal-hd .close:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}
html.law-theme .bk-modal-ft {
  padding: 0.5rem 1rem !important;
}

/* =============================================
   FORM — 表单
   ============================================= */
html.law-theme .bk-input {
  border-radius: 0 !important;
}
html.law-theme .bk-input:focus {
  border-color: #1a2744 !important;
  box-shadow: 0 0 0 3px rgba(26,39,68,0.10) !important;
}
html.law-theme .bk-form-preview {
  border-radius: 0 !important;
  border-color: rgba(26,39,68,0.15) !important;
}
html.law-theme .bk-form-preview-tag {
  background: #1a2744 !important;
  border-radius: 0 !important;
}

/* =============================================
   STEPS — 步骤条
   ============================================= */
html.law-theme .steps span.on {
  background: rgba(26,39,68,0.10) !important;
  color: #1a2744 !important;
}
html.law-theme .steps span.clickable:hover {
  background: rgba(201,168,76,0.08) !important;
}

/* =============================================
   DROPDOWNS — 下拉菜单
   ============================================= */
html.law-theme .user-drop {
  border-radius: 0 !important;
}
html.law-theme .user-drop .ud-item:hover {
  background: rgba(26,39,68,0.06) !important;
  color: #1a2744 !important;
}
html.law-theme .logo-drop {
  border-radius: 0 !important;
}
html.law-theme .logo-drop .ld-item:hover {
  background: rgba(26,39,68,0.06) !important;
  color: #1a2744 !important;
}

/* =============================================
   TOAST — 通知提示
   ============================================= */
html.law-theme .toast-info {
  background: rgba(26,39,68,0.08) !important;
  border-color: rgba(26,39,68,0.2) !important;
}

/* =============================================
   LAYER SWITCH — 图层切换
   ============================================= */
html.law-theme .layer-switch {
  border-radius: 0 !important;
}
html.law-theme .layer-switch button.on {
  background: #1a2744 !important;
}

/* =============================================
   SIDEBAR TOGGLE — 侧边栏切换按钮
   ============================================= */
html.law-theme .sidebar-toggle {
  border-radius: 0 !important;
}

/* =============================================
   BUTTON OVERLAY — 按钮叠加面板
   ============================================= */
html.law-theme .btn-overlay-panel {
  border-radius: 0 !important;
}
html.law-theme .btn-overlay-hd {
  background: #1a2744 !important;
  border-radius: 0 !important;
}

/* =============================================
   ICON BUTTONS — 通用图标按钮
   ============================================= */
html.law-theme .pd-btn-icon,
html.law-theme .cw-btn-icon,
html.law-theme .dkb-btn-icon,
html.law-theme .page-btn-icon {
  border-radius: 0 !important;
  color: #1a2744 !important;
  background: rgba(26,39,68,0.08) !important;
}
html.law-theme .pd-btn-icon:hover,
html.law-theme .cw-btn-icon:hover,
html.law-theme .dkb-btn-icon:hover,
html.law-theme .page-btn-icon:hover {
  background: rgba(26,39,68,0.15) !important;
}
html.law-theme .dkb-btn-toggle {
  border-radius: 0 !important;
  color: #1a2744 !important;
  background: rgba(26,39,68,0.08) !important;
}

/* =============================================
   PAGINATION — 分页器
   ============================================= */
html.law-theme .bk-pager {
  gap: 0.125rem !important;
}
html.law-theme .bk-pager button {
  border-radius: 0 !important;
  min-width: 1.625rem !important;
  height: 1.625rem !important;
  padding: 0 !important;
  font-size: 0.8125rem !important;
}

/* =============================================
   BOTTOM MENU — 底部菜单栏
   ============================================= */
html.law-theme .cbottom {
  border-radius: 0 !important;
  background: rgba(26,39,68,0.06) !important;
  padding: 0.375rem 1rem !important;
}
html.law-theme .cbtn-bottom {
  border-radius: 0 !important;
}
html.law-theme .cbtn-bottom:hover {
  background: rgba(201,168,76,0.08) !important;
}

/* =============================================
   COVER — 欢迎封面
   ============================================= */
html.law-theme .cover .title {
  color: #1a2744 !important;
}
html.law-theme .cover .sub {
  color: #4a4a5a !important;
}

/* =============================================
   DESKTOP ICONS — 桌面图标
   ============================================= */
html.law-theme .desktop-icon.active {
  background: rgba(26,39,68,0.15) !important;
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.3) !important;
}

/* =============================================
   金色徽章（额外辅助类）
   ============================================= */
html.law-theme .badge-gold {
  display: inline-block;
  padding: 0.0625rem 0.4375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #1a2744;
  background: var(--gold-bg);
  border: 1px solid rgba(201,168,76,0.3);
  line-height: 1.4;
}

/* =============================================
   KB-LIKE SIDEBAR (知识库弹出侧边栏)
   ============================================= */
html.law-theme .cmain-body.kb-sidebar > .sidebar.open {
  border-radius: 0 !important;
  background: rgba(26,39,68,0.98) !important;
  border-color: rgba(201,168,76,0.2) !important;
}

/* =============================================
   移动端适配 — 保持直角 + 紧凑
   ============================================= */
@media (max-width: 48rem) {
  html.law-theme .ul-list-item {
    border-radius: 0 !important;
  }
}

/* =============================================
   TABLE — 表格
   ============================================= */
html.law-theme .bk-table th,
html.law-theme .bk-table td,
html.law-theme table th,
html.law-theme table td {
  border-radius: 0 !important;
}
