/**
 * 管理后台：在 Tabler theme-dark 上只做布局与少量皮肤补全。
 * 按钮 / 徽章 / 卡片优先使用 Tabler 官方 class（btn-success、badge bg-*-lt 等），避免再模拟一套。
 */

:root {
  --app-bg: #0b1220;
  --app-border: rgba(148, 163, 184, 0.12);
  --shell-sidebar-width: 16rem;
  --shell-sidebar-base-x: 1.25rem;
  --shell-sidebar-icon-size: 1.375rem;
}

html.theme-dark body,
body {
  background-color: var(--app-bg) !important;
  overflow-x: hidden;
}

body.page-login-standalone:not(.brand-login-page) {
  min-height: 100vh;
}

.page {
  background: var(--app-bg);
  min-height: 100vh;
}

/* 侧边栏：贴近 Tabler vertical navbar，保留轻微层次 */
.navbar-vertical {
  width: var(--shell-sidebar-width);
  background: linear-gradient(180deg, #070d18 0%, #0f172a 50%, #0b1220 100%);
  border-right: 1px solid var(--app-border);
}

.navbar-vertical .navbar-brand {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.navbar-vertical .navbar-brand-image {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.navbar-vertical .nav-link {
  border-radius: var(--tblr-border-radius);
  margin: 0.125rem 0.625rem;
  padding-left: calc(var(--shell-sidebar-base-x) - 0.625rem);
  padding-right: 0.875rem;
  justify-content: flex-start;
  text-align: left;
}

.navbar-vertical .nav-link .nav-link-icon {
  width: var(--shell-sidebar-icon-size);
  min-width: var(--shell-sidebar-icon-size);
  margin-right: 0.75rem;
  text-align: center;
}

.navbar-vertical .nav-link .nav-link-title {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.navbar-vertical .nav-link.active {
  font-weight: 600;
}

/* 无权限模块：全量展示但不可点、无 hover 高亮（企业 SaaS 侧栏规范） */
.navbar-vertical .nav-link.nav-link-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  color: var(--tblr-secondary) !important;
}

.navbar-vertical .nav-link.nav-link-disabled:hover,
.navbar-vertical .nav-link.nav-link-disabled:focus {
  background-color: transparent !important;
  color: var(--tblr-secondary) !important;
}

/* 侧栏：一级为 button、二级为独立 li>a，避免可点层叠遮挡子级链接命中区域 */
#platform-sidebar-accordion .js-sidebar-row {
  position: relative;
}
#platform-sidebar-accordion .js-sidebar-row > a.nav-link {
  position: relative;
  z-index: 2;
}

/* 顶栏：高度与呼吸感（去 logo 后仍保持会员产品级留白） */
.platform-shell-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(15, 23, 42, 0.94) 45%, rgba(11, 18, 32, 0.9) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
}

.platform-shell-header-inner {
  width: 100%;
}

/* 顶栏主行：标题固定左侧，用户区贴右（Portal/Admin 共用） */
.platform-shell-header .platform-shell-header-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.9rem;
  min-height: 76px;
  width: 100%;
}

.platform-shell-hamburger {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.58);
  color: #dbeafe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.platform-shell-hamburger:hover {
  border-color: rgba(45, 212, 191, 0.5);
  background: rgba(15, 23, 42, 0.86);
}

.platform-shell-hamburger:active {
  transform: translateY(1px);
}

.platform-shell-hamburger:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.58);
  outline-offset: 2px;
}

.platform-shell-hamburger-lines {
  width: 1rem;
  height: 0.85rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.platform-shell-hamburger-lines > span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.platform-shell-header .platform-shell-header-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0.25rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

/* 顶栏品牌全称：用户端与后台统一（仅文字，无重复图标） */
.page-header-brand {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  line-height: 1.5;
}

.platform-shell-header .platform-shell-header-title.page-header-brand {
  display: block;
}

.platform-shell-header .platform-shell-header-title.page-header-brand:hover {
  color: #cbd5e1;
}

/* 顶栏右上角：极简「姓名 + 退出」 */
.platform-shell-header .header-user-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

.platform-shell-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1038;
  width: var(--shell-sidebar-width);
  transform: translateX(0);
  transition: transform 0.22s ease;
}

.platform-shell-sidebar .container-fluid {
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}

.platform-shell-sidebar .platform-sidebar-brand {
  min-height: 76px;
  display: flex;
  align-items: center;
  padding-left: var(--shell-sidebar-base-x);
  padding-right: 0.625rem;
  margin-bottom: 0.25rem;
}

.platform-shell-sidebar .platform-sidebar-brand a {
  width: 100%;
  justify-content: flex-start;
}

.platform-shell-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0.5rem;
}

.platform-shell-sidebar-scroll > .navbar-nav {
  padding-left: 0;
  padding-right: 0;
}

.platform-shell-sidebar .sidebar-divider {
  height: 1px;
  margin: 0.25rem 0.625rem;
  background: rgba(148, 163, 184, 0.2);
}

.platform-shell-sidebar .sidebar-account-start {
  margin-top: auto !important;
}

.platform-shell-sidebar-scroll .nav-item.mt-2.pt-2.border-top {
  margin-top: 0.6rem !important;
  padding-top: 0.55rem !important;
  margin-left: 0.625rem;
  margin-right: 0.625rem;
  border-top: 0 !important;
}

.platform-shell-sidebar-scroll .nav-item.mt-2.pt-2.border-top > .nav-link {
  margin-left: 0;
  margin-right: 0;
}

.platform-shell-sidebar-scroll .nav-item.mt-2.pt-2.border-top::before {
  content: '';
  display: block;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  margin-bottom: 0.45rem;
}

.platform-shell-sidebar .collapse > .nav {
  margin-left: calc(var(--shell-sidebar-base-x) + 0.125rem) !important;
  padding-left: 0.75rem !important;
  border-left-width: 1px !important;
  border-left-color: rgba(148, 163, 184, 0.34) !important;
}

.platform-shell-sidebar .collapse > .nav .nav-link {
  margin: 0.075rem 0.375rem 0.075rem 0;
  padding-left: 0.55rem !important;
  padding-right: 0.5rem !important;
}

.platform-shell-sidebar .collapse > .nav .nav-link .nav-link-icon {
  width: 1.25rem;
  min-width: 1.25rem;
  margin-right: 0.625rem;
}

.platform-shell-sidebar .collapse > .nav .nav-link-title {
  font-size: 0.875rem;
}

.page .page-wrapper {
  width: calc(100% - var(--shell-sidebar-width));
  margin-left: var(--shell-sidebar-width);
  min-width: 0;
  transition: margin-left 0.22s ease;
}

body.platform-shell-desktop-sidebar-hidden .platform-shell-sidebar {
  transform: translateX(-100%);
}

body.platform-shell-desktop-sidebar-hidden .page .page-wrapper {
  width: 100%;
  margin-left: 0;
}

.platform-shell-header .header-username {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-shell-header .header-logout-link {
  font-size: 13px;
  opacity: 0.75;
  color: rgba(226, 232, 240, 0.95);
  text-decoration: none;
  flex-shrink: 0;
}

.platform-shell-header .header-logout-link:hover {
  opacity: 1;
  color: #f8fafc;
}

/* 个人中心：Admin / Portal 共用 typography 与等高卡片 */
.platform-profile-page-head .platform-profile-page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.platform-profile-page-head .platform-profile-page-subtitle {
  font-size: 0.95rem;
}

.platform-profile-page .card {
  border-radius: var(--tblr-border-radius-lg, 0.5rem);
}

.platform-profile-page .card-header .card-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.platform-profile-page .card-body {
  font-size: 1rem;
}

.platform-profile-page dt,
.platform-profile-page .form-label {
  font-size: 0.95rem;
}

.platform-profile-page dd,
.platform-profile-page .form-control {
  font-size: 1rem;
}

.platform-profile-page .form-hint,
.platform-profile-page .text-secondary.small {
  font-size: 0.875rem !important;
}

/* 侧栏：折叠父级用 button，避免 <a href="#id"> 与 collapse 抢导航、导致无法再次收起 */
.navbar-vertical button.nav-link.sidebar-collapse-toggle {
  background-color: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
}

.navbar-vertical button.nav-link.sidebar-collapse-toggle:focus {
  outline: none;
  box-shadow: none;
}

.navbar-vertical button.nav-link.sidebar-collapse-toggle:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
}

.page-body {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

/* 页面标题区块（page_header partial） */
.page-header .page-title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* 表格：在 Tabler table 基础上补层次（hover、表头） */
.table thead th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(148, 163, 184, 0.95);
  border-bottom-width: 1px;
}

.table tbody tr {
  transition: background-color 0.12s ease;
}

.table-hover tbody tr:hover,
.table tbody tr:hover {
  background-color: rgba(32, 107, 196, 0.06) !important;
}

.table-vcenter td,
.table-vcenter th {
  vertical-align: middle !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --tblr-table-accent-bg: rgba(255, 255, 255, 0.02);
}

/* 表单焦点与深主题一致 */
.form-control:focus,
.form-select:focus {
  border-color: rgba(32, 196, 144, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(32, 196, 144, 0.15);
}

/* 管理台统一：满宽内容区内的横向单行表单 + 表格横向滚动 */
.admin-form-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-inline: -0.125rem;
  padding-inline: 0.125rem;
  padding-bottom: 2px;
}
.admin-form-scroll-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  min-width: min-content;
}
.admin-form-scroll-inner .admin-field-stack {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 0.2rem;
}
.admin-form-scroll-inner .admin-field-stack .form-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 0;
  white-space: nowrap;
}
.admin-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  max-width: 100%;
}
.admin-table-scroll .table {
  min-width: 1080px;
}

/* --------------------------------------------------------------------------
 * 行业资讯：筛选工具栏（新闻快讯 / 周报列表等）
 * 统一 sm 输入框与「筛选」按钮高度，避免按钮偏矮、行内不齐。
 * -------------------------------------------------------------------------- */
.intel-filter-toolbar {
  --intel-filter-control-height: 2.375rem;
}

.intel-filter-toolbar .form-control-sm,
.intel-filter-toolbar .form-select-sm {
  min-height: var(--intel-filter-control-height);
}

.intel-filter-toolbar .btn.btn-sm {
  min-height: var(--intel-filter-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* 占位 label：与其它列 label 占位一致，保证底对齐时按钮列垂直位置正确 */
.intel-filter-toolbar .intel-filter-toolbar-spacer {
  color: transparent;
  user-select: none;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
 * 周报中心：卡片头部（元信息 + 标题行 + 预览按钮）
 * 元信息单独一行，标题与按钮同一行收紧留白。
 * -------------------------------------------------------------------------- */
.intel-report-card-head {
  margin-bottom: 1rem;
}

.intel-report-card-head .intel-report-meta {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.intel-report-card-head .intel-report-title-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
}

.intel-report-card-head .intel-report-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.intel-report-card-head .intel-report-actions {
  flex: 0 0 auto;
  padding-top: 0.125rem;
}

.intel-report-card-head .intel-report-actions .btn {
  white-space: nowrap;
}

/* Shell：移动端抽屉 + 遮罩 */
.platform-shell-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1036;
  background: rgba(2, 6, 15, 0.54);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.platform-shell-sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 1023.98px) {
  body.platform-shell-mobile-open {
    overflow: hidden;
  }

  .platform-shell-sidebar {
    transform: translateX(-100%);
    width: min(17rem, calc(100vw - 2.5rem));
    z-index: 1038;
  }

  body.platform-shell-mobile-open .platform-shell-sidebar {
    transform: translateX(0);
  }

  .page .page-wrapper,
  body.platform-shell-desktop-sidebar-hidden .page .page-wrapper {
    width: 100%;
    margin-left: 0;
  }

  .platform-shell-sidebar .platform-sidebar-brand {
    min-height: 72px;
  }
}

@media (max-width: 575.98px) {
  .platform-shell-header .platform-shell-header-row {
    min-height: 68px;
    gap: 0.65rem;
  }

  .platform-shell-header .platform-shell-header-title-wrap {
    margin-left: 0.1rem;
  }

  .platform-shell-header .platform-shell-header-title.page-header-brand {
    font-size: 12px;
    line-height: 1.35;
  }

  .platform-shell-header .header-username {
    max-width: 7rem;
  }
}

/* 新闻治理：与深色情报页按钮一致 */
.news-govern-actions .btn-govern {
  --tblr-btn-border-width: 1px;
  border-color: rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.92);
  background: rgba(15, 23, 42, 0.5);
}

.news-govern-actions .btn-govern:hover {
  border-color: rgba(94, 234, 212, 0.45);
  color: #f8fafc;
  background: rgba(13, 148, 136, 0.12);
}

.news-govern-actions .btn-govern-danger:hover {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.2);
}

/* 无权限页：居中卡片 + 金色描边（与 dashboard 提醒卡片层次一致） */
.no-access-page {
  min-height: calc(100vh - 8rem);
}

.no-access-card {
  max-width: 28rem;
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: var(--tblr-border-radius-xl, 1rem);
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.06),
    0 24px 56px rgba(0, 0, 0, 0.45);
  background: linear-gradient(
    165deg,
    rgba(17, 24, 39, 0.97) 0%,
    rgba(15, 23, 42, 0.94) 48%,
    rgba(11, 18, 32, 0.92) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.no-access-card__avatar {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.18), rgba(15, 23, 42, 0.6)) !important;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.12);
}

.no-access-card__lead {
  max-width: 22rem;
  line-height: 1.65;
  font-size: 0.9375rem;
}

.letter-spacing-tight {
  letter-spacing: -0.02em;
}
