/* ============================================================
 * 全局增强样式 - 公共资源交易平台专业风格
 * 在所有样式表之后引入
 * ============================================================ */

/* ---------- 0. CSS 变量 ---------- */
:root {
  --ui-primary: #0b68da;
  --ui-surface: #ffffff;
  --ui-bg: #f0f2f5;
  --ui-border: #dbe3ef;
  --ui-focus: 0 0 0 3px rgba(11, 104, 218, 0.22);
  --gov-blue: #0b68da;
  --gov-blue-light: #4293f4;
  --gov-blue-dark: #0954b0;
  --gov-green: #047857;
  --gov-red: #b91c1c;
  --gov-gold: #b45309;
  --gov-border: #d9d9d9;
  --gov-text: rgba(0, 0, 0, 0.85);
  --gov-text-secondary: rgba(0, 0, 0, 0.45);
  --transition: 0.18s ease;
}

/* ---------- 1. 全局 Body ---------- */
body {
  background: #f0f2f5 !important;
  min-height: 100vh;
  position: relative;
}

body::before,
body::after,
body > *:first-child::before {
  display: none !important;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ---------- 2. 顶部栏 ---------- */
.top-bar {
  background: #001529 !important;
  border-bottom: none !important;
}

.top-bar::after {
  display: none !important;
}

/* ---------- 3. 主头部 ---------- */
.main-header {
  background: #ffffff !important;
  border: none !important;
}

.main-header::after {
  display: none !important;
}

/* ---------- 4. 服务入口卡片 ---------- */
.service-portal-card {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: var(--dloa-radius-lg) !important;
}

.service-portal-card::before {
  display: none !important;
}

.service-portal-card:hover {
  transform: none !important;
}

.service-portal-card:hover .service-portal-name {
  color: var(--gov-blue) !important;
}

.service-portal-card:hover .service-portal-icon {
  background: rgba(11, 104, 218, 0.1) !important;
  box-shadow: none !important;
}

/* ---------- 5. 统计卡片 ---------- */
.stat-card,
.expert-center-summary-metric,
.expert-center-overview-item {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: var(--dloa-radius-lg) !important;
}

.stat-card::after,
.expert-center-summary-metric::after,
.expert-center-overview-item::after {
  display: none !important;
}

.stat-card .stat-number,
.stat-card .number,
.stat-card [class*='value'],
.stat-card [class*='count'],
.stat-card .stat-card-value,
.expert-center-summary-metric [class*='number'],
.expert-center-summary-metric [class*='value'],
.expert-center-summary-metric [class*='count'],
.expert-center-summary-metric strong,
.expert-center-overview-item [class*='number'],
.expert-center-overview-item [class*='value'],
.expert-center-overview-item strong {
  color: var(--gov-blue) !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}

.stat-card:hover,
.expert-center-summary-metric:hover,
.expert-center-overview-item:hover {
}

/* ---------- 6. 内容卡片 ---------- */
.card,
.transaction-section,
.bottom-card {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: var(--dloa-radius-lg) !important;
}

.card:hover,
.transaction-section:hover,
.bottom-card:hover {
  transform: none !important;
}

/* ---------- 7. 侧边栏 ---------- */
.sidebar {
  background: #001529 !important;
  border-right: none !important;
}

.sidebar .menu-item:hover,
.sidebar .nav-item:hover,
.sidebar [class*='menu'] > li:hover,
.sidebar a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.sidebar .menu-item.active,
.sidebar .nav-item.active,
.sidebar [class*='menu'] > li.active,
.sidebar a.active {
  background: var(--gov-blue) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* ---------- 8. 按钮 ---------- */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-info,
.btn-default,
[class*='btn-'] {
  position: relative !important;
  overflow: visible !important;
  transition: var(--dloa-transition-colors) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

[class*='btn-']::before {
  display: none !important;
}

[class*='btn-'] span,
[class*='btn-'] text,
[class*='btn-'] svg,
[class*='btn-'] i {
  position: relative !important;
  z-index: 1 !important;
}

.btn-primary {
  background: var(--gov-blue) !important;
  color: #ffffff !important;
  border-color: var(--gov-blue) !important;
}

.btn-primary:hover {
  background: var(--gov-blue-light) !important;
  border-color: var(--gov-blue-light) !important;
  box-shadow: none !important;
  transform: none !important;
}

.btn-secondary {
  background: #ffffff !important;
  color: rgba(0, 0, 0, 0.65) !important;
  border-color: var(--gov-border) !important;
}

.btn-secondary:hover {
  background: #ffffff !important;
  color: var(--gov-blue) !important;
  border-color: var(--gov-blue) !important;
  box-shadow: none !important;
}

.btn-success:hover {
  box-shadow: none !important;
}

.btn-warning:hover {
  box-shadow: none !important;
}

.btn-danger:hover {
  box-shadow: none !important;
}

/* ---------- 9. 表格 ---------- */
.card table,
.transaction-section table,
.bottom-card table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

.card table thead th,
.transaction-section table thead th,
.bottom-card table thead th {
  background: #fafafa !important;
  border-bottom: 1px solid #e8e8e8 !important;
  color: rgba(0, 0, 0, 0.85) !important;
  font-weight: 600 !important;
}

.card table tbody tr:hover,
.transaction-section table tbody tr:hover,
.bottom-card table tbody tr:hover {
  background: rgba(11, 104, 218, 0.04) !important;
  box-shadow: none !important;
}

.card table tbody tr:nth-child(even),
.transaction-section table tbody tr:nth-child(even),
.bottom-card table tbody tr:nth-child(even) {
  background: transparent !important;
}

/* ---------- 10. 弹窗 ---------- */
.modal-overlay,
.modal-backdrop {
  background: rgba(0, 0, 0, 0.45) !important;
}

.modal,
.modal-content,
.modal-box {
  background: #ffffff !important;
  border: none !important;
  border-radius: var(--dloa-radius-lg) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
}

.modal::before,
.modal-content::before,
.modal-box::before {
  display: none !important;
}

/* ---------- 11. 登录容器 ---------- */
.login-container {
  background: #f0f2f5 !important;
  min-height: 100vh;
}

.login-container::before,
.login-container::after {
  display: none !important;
}

.login-container .login-card,
.login-container [class*='card'] {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: var(--dloa-radius-lg) !important;
}

.login-container .login-card::before,
.login-container [class*='card']::before {
  display: none !important;
}

/* ---------- 12. 工作台头部 ---------- */
.portal-workspace-header,
.opening-hall-header {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: var(--dloa-radius-lg) !important;
}

/* ---------- 13. 表单元素 ---------- */
.form-group input,
.form-group select,
.form-group textarea,
.form-control {
  background: #ffffff !important;
  border: 1px solid var(--gov-border) !important;
  border-radius: var(--dloa-radius) !important;
  box-shadow: none !important;
  transition: var(--dloa-transition-colors) !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
  border-color: var(--gov-blue) !important;
  box-shadow: 0 0 0 2px rgba(11, 104, 218, 0.2) !important;
  background: #ffffff !important;
  outline: none !important;
}

/* ---------- 14. 徽章 ---------- */
.badge {
  border: none !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

.badge::before {
  display: none !important;
}

.badge:not(.badge-success):not(.badge-warning):not(.badge-danger):not(.badge-info):not(
    .badge-primary
  ):not(.badge-secondary):not(.badge-status-active):not(.badge-status-completed):not(
    .badge-status-terminated
  ) {
  background: var(--gov-blue) !important;
  color: #ffffff !important;
}

/* ---------- 15. 通知条 ---------- */
.notice-strip {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
}

/* ---------- 16. 页脚 ---------- */
.site-footer {
  background: #001529 !important;
  border-top: none !important;
  box-shadow: none !important;
}

.site-footer::before {
  display: none !important;
}

/* ---------- 17. 标签 / Tab ---------- */
.category-tab,
.sub-tab {
  background: #ffffff !important;
  border: 1px solid var(--gov-border) !important;
  border-radius: var(--dloa-radius) !important;
  box-shadow: none !important;
}

.category-tab.active,
.sub-tab.active {
  background: var(--gov-blue) !important;
  border-color: var(--gov-blue) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* ---------- 18. 快速链接 ---------- */
.quick-link-item {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: var(--dloa-radius-lg) !important;
}

.quick-link-item:hover {
  transform: none !important;
}

/* ============================================================
 * 文字可读性
 * ============================================================ */

h1,
.header-title-main,
.opening-hall-title,
.card-title,
.transaction-title,
.bottom-card-title,
.page-title,
.section-title,
.modal-header h3,
.expert-center-title,
.portal-workspace-header h1,
.expert-evaluate-title {
  color: rgba(0, 0, 0, 0.85) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  letter-spacing: normal !important;
}

h2,
.card-header h3,
.section-header h2,
.expert-center-panel-header .card-title,
.expert-evaluate-section-title {
  color: rgba(0, 0, 0, 0.85) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

h3,
.panel-title,
.sub-title {
  color: rgba(0, 0, 0, 0.85) !important;
  font-weight: 600 !important;
}

.card p,
.card span,
.card td,
.card li,
.transaction-section p,
.transaction-section td,
.bottom-card p,
.bottom-card li,
.policy-item-title,
.data-list-title,
.notice-strip-item a,
.quick-link-name,
.form-group label,
.portal-auth-card p,
.modal-body p,
.modal-body span,
.modal-body td,
.detail-label,
.detail-content {
  color: rgba(0, 0, 0, 0.65) !important;
  text-shadow: none !important;
}

.service-portal-name {
  color: rgba(0, 0, 0, 0.85) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

.header-nav a,
.top-bar a,
.footer-col a,
.sidebar-menu a,
.category-tab,
.sub-tab {
  text-shadow: none !important;
}

.stat-card .stat-card-label,
.expert-center-summary-metric span,
.expert-center-overview-item span {
  color: rgba(0, 0, 0, 0.45) !important;
  font-weight: 400 !important;
}

.card table thead th,
.transaction-section table thead th {
  color: rgba(0, 0, 0, 0.85) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

.card table tbody td,
.transaction-section table tbody td {
  color: rgba(0, 0, 0, 0.65) !important;
}

.sidebar .sidebar-header,
.sidebar .sidebar-menu,
.sidebar .sidebar-menu li,
.sidebar .sidebar-menu a {
  color: rgba(255, 255, 255, 0.85) !important;
}

.sidebar .sidebar-menu a:hover,
.sidebar a:hover {
  color: #ffffff !important;
}

.top-bar span,
.top-bar a,
.top-bar p {
  color: rgba(255, 255, 255, 0.85) !important;
}

.site-footer h4 {
  color: rgba(255, 255, 255, 0.85) !important;
}
.site-footer p,
.site-footer a {
  color: rgba(255, 255, 255, 0.65) !important;
}

a:hover {
  text-decoration: underline !important;
}

.text-muted,
.text-secondary,
.text-light,
.gov-muted,
[class*='muted'],
[class*='secondary'] {
  color: rgba(0, 0, 0, 0.45) !important;
}

/* ============================================================
 * 后台管理页面
 * ============================================================ */

.layout > .main-content,
.portal-workspace-shell > .portal-workspace-content,
.portal-workspace-shell main {
  background: #f0f2f5 !important;
}

.layout .card,
.layout .page-content,
.portal-workspace-content .card {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
}

.layout .card:hover {
  transform: none !important;
}

.layout .card table,
.layout .card table tbody tr,
.layout .card table tbody tr:hover,
.layout .card table thead th {
  background: transparent !important;
}

.layout .card table tbody tr:hover {
  background: rgba(11, 104, 218, 0.04) !important;
  box-shadow: none !important;
  border-left: none !important;
}

.layout .card table thead th {
  background: #fafafa !important;
  color: rgba(0, 0, 0, 0.85) !important;
}

.layout .card table tbody td {
  color: rgba(0, 0, 0, 0.65) !important;
}

.layout .card-title,
.layout .card-header h3 {
  color: rgba(0, 0, 0, 0.85) !important;
}

.layout .card p,
.layout .card span,
.layout .card label {
  color: rgba(0, 0, 0, 0.65) !important;
}

.layout > .main-content > .header {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
}

.layout > .main-content > .header h3,
.layout > .main-content > .header span {
  color: rgba(0, 0, 0, 0.85) !important;
}

.layout > .sidebar {
  background: #001529 !important;
  border-right: none !important;
}

.layout > .sidebar .sidebar-menu a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  color: #ffffff !important;
}

.layout > .sidebar .sidebar-menu a.active {
  background: var(--gov-blue) !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

.layout [class*='btn-'] {
  overflow: visible !important;
}
.layout [class*='btn-']::before {
  display: none !important;
}

.layout .btn-primary {
  background: var(--gov-blue) !important;
  color: #ffffff !important;
}
.layout .btn-primary:hover {
  background: var(--gov-blue-light) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
.layout .btn-secondary {
  background: #ffffff !important;
  color: rgba(0, 0, 0, 0.65) !important;
  border: 1px solid var(--gov-border) !important;
}
.layout .btn-secondary:hover {
  background: #ffffff !important;
  color: var(--gov-blue) !important;
  border-color: var(--gov-blue) !important;
}
.layout .btn-success {
  background: var(--gov-green) !important;
  color: #ffffff !important;
}
.layout .btn-danger {
  background: var(--gov-red) !important;
  color: #ffffff !important;
}
.layout .btn-warning {
  background: var(--gov-gold) !important;
  color: #ffffff !important;
}
.layout .btn-info {
  background: var(--gov-blue-light) !important;
  color: #ffffff !important;
}

.layout .form-group input,
.layout .form-group select,
.layout .form-group textarea {
  background: #ffffff !important;
  border: 1px solid var(--gov-border) !important;
  box-shadow: none !important;
  color: rgba(0, 0, 0, 0.85) !important;
}
.layout .form-group input:focus,
.layout .form-group select:focus,
.layout .form-group textarea:focus {
  border-color: var(--gov-blue) !important;
  box-shadow: 0 0 0 2px rgba(11, 104, 218, 0.2) !important;
}

.layout .modal-content,
.layout .modal-box {
  background: #ffffff !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
}
.layout .modal-content::before,
.layout .modal-box::before {
  display: none !important;
}

.portal-workspace-shell .card {
  background: #ffffff !important;
}
.portal-workspace-shell .card:hover {
  transform: none !important;
}
.portal-workspace-shell [class*='btn-']::before {
  display: none !important;
}
.portal-workspace-shell [class*='btn-'] {
  overflow: visible !important;
}

/* ============================================================
 * 辅助
 * ============================================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

::selection {
  background: rgba(11, 104, 218, 0.2);
  color: rgba(0, 0, 0, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  [class*='btn-']::before {
    transition: none !important;
  }
}
