/* 后台深色主题 —— 与官网 frontend 保持一致（bg #07090d / surface #10141b / gold #d8b878） */

[data-bs-theme="dark"] {
  --bs-body-bg: #07090d;
  --bs-body-color: #f5f5f5;
  --bs-border-color: #202631;
  --bs-secondary-bg: #10141b;
  --bs-tertiary-bg: #151a22;
  --bs-secondary-color: #bfc7d7;
  --bs-link-color: #d8b878;
  --bs-link-hover-color: #e5c996;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: rgba(216, 184, 120, 0.06);
  --bs-table-border-color: #202631;
  --bs-input-bg: #10141b;
  --bs-input-border-color: #202631;
  --bs-form-control-bg: #10141b;
  --bs-form-control-border-color: #202631;
  --bs-card-bg: #10141b;
  --bs-card-border-color: #202631;
  --bs-dropdown-bg: #10141b;
  --bs-dropdown-border-color: #202631;
  --bs-dropdown-link-color: #f5f5f5;
  --bs-dropdown-link-hover-bg: rgba(216, 184, 120, 0.08);
  --bs-pagination-bg: #10141b;
  --bs-pagination-border-color: #202631;
  --bs-pagination-disabled-bg: #10141b;
  --bs-pagination-disabled-border-color: #202631;
  --bs-pagination-hover-bg: rgba(216, 184, 120, 0.08);
  --bs-pagination-hover-border-color: #202631;
  --bs-pagination-focus-bg: rgba(216, 184, 120, 0.08);
  --bs-pagination-active-bg: #d8b878;
  --bs-pagination-active-border-color: #d8b878;
}

body[data-bs-theme="dark"] {
  background-color: #07090d;
  color: #f5f5f5;
  font-family: 'Inter', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

/* 顶栏 */
.admin-topbar {
  background: rgba(7, 9, 13, 0.85);
  border-bottom: 1px solid #202631 !important;
  backdrop-filter: blur(12px);
}

.admin-topbar .brand {
  color: #f5f5f5;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.admin-topbar .brand .dot {
  color: #d8b878;
}

.admin-topbar .user-link {
  color: #bfc7d7;
  text-decoration: none;
}

.admin-topbar .user-link:hover {
  color: #d8b878;
}

/* 内容区 */
.admin-content-body {
  min-height: 650px;
  background-color: #07090d !important;
  padding: 16px 0;
  width: 100% !important;
}

/* 左侧菜单 */
.admin-sidebar {
  border-right: 1px solid #202631;
  min-height: 100%;
}

.btn-toggle {
  width: 100%;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 14px;
  color: #bfc7d7;
  background-color: transparent;
  justify-content: flex-start;
}

.btn-toggle:hover,
.btn-toggle:focus {
  color: #f5f5f5;
  background-color: rgba(216, 184, 120, 0.08);
  box-shadow: none;
}

/* 子菜单选中时父菜单的激活态 */
.btn-toggle.parent-active {
  color: #d8b878;
  background-color: rgba(216, 184, 120, 0.1);
  font-weight: 600;
}

.btn-toggle.parent-active::after {
  border-color: #d8b878;
}

.btn-toggle::after {
  content: '';
  margin-left: auto;
  border: solid #bfc7d7;
  border-width: 0 1.5px 1.5px 0;
  padding: 3px;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.btn-toggle:not(.collapsed)::after {
  transform: rotate(-135deg);
}

.side-link {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 8px;
  color: #bfc7d7;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.side-link:hover {
  color: #f5f5f5;
  background: rgba(216, 184, 120, 0.08);
}

.side-link.active {
  color: #d8b878;
  background: rgba(216, 184, 120, 0.1);
  font-weight: 600;
}

.side-link.sub {
  padding-left: 30px;
  font-size: 13.5px;
}

.btn-toggle-nav .side-link {
  margin-bottom: 2px;
}

/* 控制台 */
.console-page .console-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.console-page .console-head .muted {
  font-size: 13px;
}

.stat-card {
  background: linear-gradient(160deg, #151a22, #0b0e14);
  border: 1px solid #202631;
  border-radius: 14px;
  padding: 20px 22px;
  height: 100%;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.stat-card:hover {
  border-color: rgba(216, 184, 120, 0.45);
  transform: translateY(-2px);
}

.stat-card.highlight {
  border-color: rgba(216, 184, 120, 0.35);
}

.stat-card .stat-label {
  color: #bfc7d7;
  font-size: 13px;
  letter-spacing: 1px;
}

.stat-card .stat-value {
  font-size: 34px;
  font-weight: 700;
  margin: 8px 0 10px;
  color: #f5f5f5;
}

.stat-card .stat-value.gold {
  color: #d8b878;
}

.stat-card .stat-foot {
  font-size: 13px;
}

.panel {
  background: #0b0e14;
  border: 1px solid #202631;
  border-radius: 14px;
  overflow: hidden;
}

.panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #202631;
}

.panel .panel-title {
  font-weight: 600;
  font-size: 15px;
}

.gold-link {
  color: #d8b878 !important;
  text-decoration: none;
}

.gold-link:hover {
  color: #e5c996 !important;
}

.muted {
  color: #bfc7d7;
}

.source-badge {
  background: rgba(216, 184, 120, 0.12);
  color: #d8b878;
  border: 1px solid rgba(216, 184, 120, 0.35);
  font-weight: 500;
}

/* 表格通用微调 */
.table th {
  color: #bfc7d7;
  font-size: 13px;
  font-weight: 600;
  border-bottom-color: #202631;
}

.table td {
  color: #f5f5f5;
  border-bottom-color: #202631;
}

/* 表单控件 */
.form-control,
.form-select {
  background-color: #10141b;
  border-color: #202631;
  color: #f5f5f5;
}

.form-control:focus,
.form-select:focus {
  background-color: #10141b;
  border-color: #d8b878;
  box-shadow: 0 0 0 0.2rem rgba(216, 184, 120, 0.15);
  color: #f5f5f5;
}

.form-control::placeholder {
  color: #bfc7d7;
  opacity: 0.7;
}

.btn-primary {
  background-color: #d8b878;
  border-color: #d8b878;
  color: #07090d;
  font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #e5c996;
  border-color: #e5c996;
  color: #07090d;
}

/* 列表页旧模板的白色容器统一压暗（navbar / custom-table-box 的 bg-white） */
[data-bs-theme="dark"] .bg-white {
  background-color: #10141b !important;
}

[data-bs-theme="dark"] .custom-table-box {
  background: #0b0e14;
  border: 1px solid #202631;
  border-radius: 12px;
}

[data-bs-theme="dark"] .navbar {
  border-radius: 10px;
}

[data-bs-theme="dark"] .navbar-brand {
  color: #f5f5f5;
}

[data-bs-theme="dark"] .navbar .nav-link {
  color: #bfc7d7;
}

[data-bs-theme="dark"] .navbar .nav-link:hover {
  color: #f5f5f5;
}

[data-bs-theme="dark"] .navbar .nav-link.active {
  color: #d8b878;
}

[data-bs-theme="dark"] .link-dark {
  color: #bfc7d7 !important;
}

[data-bs-theme="dark"] .link-dark:hover {
  color: #d8b878 !important;
}

[data-bs-theme="dark"] .text-bg-light {
  background-color: #10141b !important;
  color: #bfc7d7 !important;
}

/* 旧模板的深色描边按钮在深色主题下反转 */
[data-bs-theme="dark"] .btn-outline-dark {
  --bs-btn-color: #bfc7d7;
  --bs-btn-border-color: #202631;
  --bs-btn-hover-color: #d8b878;
  --bs-btn-hover-bg: rgba(216, 184, 120, 0.08);
  --bs-btn-hover-border-color: #d8b878;
  --bs-btn-active-color: #07090d;
  --bs-btn-active-bg: #d8b878;
  --bs-btn-active-border-color: #d8b878;
}

/* 需求详情弹框 */
[data-bs-theme="dark"] .modal-content {
  background: linear-gradient(160deg, #151a22, #0b0e14);
  border: 1px solid #202631;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
  border-color: #202631;
}

[data-bs-theme="dark"] .modal-title {
  color: #f5f5f5;
}

/* form-floating 内校验错误提示：脱离浮动 label 定位，改为输入框下方静态展示 */
.form-floating label.error {
  position: static !important;
  transform: none !important;
  opacity: 1 !important;
  display: block;
  padding: 4px 0 0 2px;
  margin: 0;
  height: auto;
  border: none;
  color: #e26d6d;
  font-size: 13px;
}

.pr-detail dl {
  display: grid;
  grid-template-columns: 84px 1fr;
  row-gap: 14px;
  column-gap: 12px;
  margin: 0;
}

.pr-detail dt {
  color: #bfc7d7;
  font-weight: 500;
  font-size: 14px;
}

.pr-detail dd {
  margin: 0;
  color: #f5f5f5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 官网首页（后端渲染版） */
[data-bs-theme="dark"] .content-body {
  max-width: none !important;
  padding: 0 !important;
}

.site-hero {
  min-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}

.site-hero .hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  margin-bottom: 24px;
}

.site-hero .hero-brand {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 14px;
}

.site-hero .hero-brand .dot {
  color: #d8b878;
}

.site-hero .hero-slogan {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 14px;
}

.site-hero .hero-desc {
  max-width: 680px;
  color: #bfc7d7;
  font-size: 15px;
  line-height: 1.9;
  margin-bottom: 32px;
}

.site-hero .hero-actions {
  display: flex;
  gap: 16px;
}

/* 官网页脚 */
.site-footer {
  border-top: 1px solid #202631;
  padding: 24px 0;
  text-align: center;
}

.site-footer .footer-brand {
  font-size: 16px;
  font-weight: 600;
}

.site-footer .footer-brand .dot {
  color: #d8b878;
}

.site-footer .footer-muted {
  color: #bfc7d7;
  font-size: 13px;
  margin: 8px 0 0;
}

/* 后台登录页 */
.auth-login-dark {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07090d;
}

.auth-login-dark .auth-card {
  width: 380px;
  max-width: 92vw;
  background: linear-gradient(160deg, #151a22, #0b0e14);
  border: 1px solid #202631;
  border-radius: 16px;
  padding: 40px 36px;
}

.auth-login-dark .auth-brand {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-login-dark .auth-brand .dot {
  color: #d8b878;
}

.auth-login-dark .auth-sub {
  text-align: center;
  color: #bfc7d7;
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 28px;
}
