/* ============================================================
   天龙八部 · 武侠主题皮肤 (wuxia theme)
   风格基准：怀旧代理系统 —— 宣纸底 / 墨色栏 / 朱砂钮 / 鎏金线
   ============================================================ */
:root{
  --wx-ink:#171510;
  --wx-ink-2:#0f0e0b;
  --wx-ink-3:#221d16;
  --wx-page:#eee8dc;
  --wx-surface:#fffdf8;
  --wx-surface-2:#faf6ec;
  --wx-surface-3:#f4eddd;
  --wx-border:#ddd1bd;
  --wx-border-2:#e5dccd;
  --wx-text:#2b2418;
  --wx-text-2:#4a4030;
  --wx-muted:#817765;
  --wx-faint:#9a8d7a;
  --wx-gold:#ad812b;
  --wx-gold-2:#d8af56;
  --wx-gold-3:#e1c174;
  --wx-gold-dim:rgba(216,175,86,.18);
  --wx-red:#8c2d25;
  --wx-red-2:#9e3429;
  --wx-red-d:#6d211b;
  --wx-green:#4c7b62;
  --wx-serif:"Noto Serif SC","Source Han Serif SC",STKaiti,KaiTi,STSong,SimSun,serif;
  --wx-sans:Inter,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;

  /* 覆盖各页面内联变量（旧主题变量名复用） */
  --primary-color:#8c2d25;
  --text-light:#efe7d6;
  --text-muted:#a99f8a;
  --bg-dark:#171510;
  --bg-card:#fffdf8;
}

::selection{color:#fff8e8;background:#9e3429}

body{
  font-family:var(--wx-sans);
  color:var(--wx-text);
  background:
    radial-gradient(circle at 8% 0%,rgba(173,129,43,.10),transparent 24rem),
    radial-gradient(circle at 92% 100%,rgba(140,45,37,.06),transparent 30rem),
    linear-gradient(135deg,rgba(255,255,255,.45),transparent 34rem),
    var(--wx-page) !important;
  background-attachment:fixed;
}

/* ============ 顶栏 ============ */
.navbar{
  background:linear-gradient(180deg,#1c1813,#14110c) !important;
  border-bottom:1px solid rgba(216,175,86,.18) !important;
  box-shadow:0 2px 14px rgba(15,14,11,.35);
}
.navbar-brand{
  font-family:var(--wx-serif) !important;
  font-weight:800;
  letter-spacing:.08em;
  color:#f4ead7 !important;
}
.navbar-brand i,.navbar-brand .bi{color:var(--wx-gold-2) !important}
.navbar .nav-link{
  color:#a99f8a !important;
  font-size:.85rem;
}
.navbar .nav-link:hover,.navbar .nav-link:focus{color:#efe3cb !important}
.navbar .nav-link.active{color:var(--wx-gold-2) !important}
.navbar .dropdown-toggle{color:#c8bda6 !important}
.navbar-toggler{border-color:rgba(216,175,86,.3) !important;color:#d8af56 !important}
.navbar .text-white,.navbar .text-light{color:#efe7d6 !important}
.navbar .badge{background:var(--wx-red-2) !important;color:#fff}

/* ============ 侧栏 ============ */
.offcanvas-md.sidebar,
.offcanvas.sidebar,
.sidebar .offcanvas-body,
.sidebar{
  background:linear-gradient(180deg,#1a1610 0%,#12100c 60%,#0f0d0a 100%) !important;
  background-color:#12100c !important;
  border-right:1px solid rgba(216,175,86,.12);
  color:#a99f8a;
}
.sidebar .nav-link,
.offcanvas.sidebar .nav-link{
  color:#9a8f7c !important;
  border-radius:8px;
  margin:2px 8px;
  padding:.62rem .85rem;
  font-size:.85rem;
  transition:background .15s ease,color .15s ease;
}
.sidebar .nav-link i,
.offcanvas.sidebar .nav-link i{color:#7d725f !important;transition:color .15s ease}
.sidebar .nav-link:hover,
.offcanvas.sidebar .nav-link:hover{
  background:rgba(255,255,255,.05) !important;
  color:#e8dfce !important;
}
.sidebar .nav-link:hover i{color:var(--wx-gold-2) !important}
.sidebar .nav-link.active,
.offcanvas.sidebar .nav-link.active{
  background:linear-gradient(90deg,rgba(216,175,86,.18),rgba(216,175,86,.06)) !important;
  color:#f0d895 !important;
  box-shadow:inset 3px 0 0 var(--wx-gold-2);
}
.sidebar .nav-link.active i{color:var(--wx-gold-2) !important}
.sidebar hr,.sidebar .dropdown-divider{border-color:rgba(216,175,86,.12) !important;opacity:1}
.offcanvas-header{background:#171510;border-bottom:1px solid rgba(216,175,86,.15)}
.offcanvas-title,.offcanvas .btn-close{color:#efe7d6}
.offcanvas .btn-close{filter:invert(.85) sepia(.3)}

/* ============ 卡片 ============ */
.card{
  background:var(--wx-surface) !important;
  border:1px solid var(--wx-border) !important;
  border-radius:12px !important;
  box-shadow:0 10px 30px rgba(90,70,30,.07) !important;
  color:var(--wx-text);
}
.card-header{
  background:var(--wx-surface-2) !important;
  border-bottom:1px solid var(--wx-border-2) !important;
  color:var(--wx-text-2);
  font-family:var(--wx-serif);
  font-weight:700;
}
.card-body{color:var(--wx-text)}
.card-footer{background:var(--wx-surface-2);border-top:1px solid var(--wx-border-2)}

/* ============ 标题/文字 ============ */
h1,h2,h3,.h1,.h2,.h3,.modal-title,.page-title,h4.h4{
  font-family:var(--wx-serif);
  color:var(--wx-text);
}
h4,h5,h6,.h4,.h5,.h6{color:var(--wx-text-2)}
.text-muted{color:var(--wx-muted) !important}
.text-primary{color:var(--wx-red-2) !important}
a{color:#8a6628}
a:hover{color:#6d4f1d}
.text-success{color:var(--wx-green) !important}
.text-danger{color:var(--wx-red-2) !important}
.text-warning{color:#a97a2c !important}
.text-info{color:#6e7b8d !important}
.border{border-color:var(--wx-border-2) !important}
hr{border-color:var(--wx-border-2);opacity:.8}

/* ============ 按钮 ============ */
.btn{border-radius:8px;font-weight:600;letter-spacing:.02em;transition:filter .15s ease,transform .15s ease}
.btn:hover{transform:translateY(-1px)}
.btn-primary,.btn-primary:focus{
  background:linear-gradient(110deg,#9e3429,#8a2d25) !important;
  border:1px solid #76231c !important;
  color:#fff8ea !important;
  box-shadow:0 6px 16px rgba(158,52,41,.24);
}
.btn-primary:hover,.btn-primary:active{filter:brightness(1.05);color:#fff !important}
.btn-outline-primary{
  border:1px solid #cdbd9f !important;color:#735b32 !important;background:#fffaf1 !important;
}
.btn-outline-primary:hover,.btn-outline-primary:active{
  background:#f4ead7 !important;color:#5b4523 !important;border-color:#bfa87c !important;
}
.btn-secondary,.btn-outline-secondary{
  background:#fffaf1 !important;border:1px solid #cdbd9f !important;color:#735b32 !important;
}
.btn-secondary:hover,.btn-outline-secondary:hover{background:#f4ead7 !important;color:#5b4523 !important;border-color:#bfa87c !important}
.btn-success{background:#4c7b62 !important;border-color:#3d634e !important;color:#fff !important}
.btn-success:hover{background:#426b55 !important}
.btn-danger{background:#a53a2d !important;border-color:#8c2d25 !important;color:#fff !important}
.btn-warning{background:#b8883c !important;border-color:#96692b !important;color:#fff !important}
.btn-warning:hover{background:#a17a2e !important;color:#fff !important}
.btn-info{background:#6e7b8d !important;border-color:#5a6675 !important;color:#fff !important}
.btn-dark{background:#3a3226 !important;border-color:#2b2418 !important;color:#efe7d6 !important}
.btn-outline-danger{border-color:#c89087 !important;color:#9e3429 !important}
.btn-outline-danger:hover{background:#a53a2d !important;color:#fff !important;border-color:#8c2d25 !important}
.btn-outline-success{border-color:#9bb8a7 !important;color:#4c7b62 !important}
.btn-outline-success:hover{background:#4c7b62 !important;color:#fff !important}
.btn-outline-warning{border-color:#d3be91 !important;color:#a97a2c !important}
.btn-outline-warning:hover{background:#b8883c !important;color:#fff !important}
.btn-outline-info{border-color:#b0b7c3 !important;color:#6e7b8d !important}
.btn-outline-info:hover{background:#6e7b8d !important;color:#fff !important}
.btn-link{color:#8a6628}
.btn-close{filter:sepia(.5)}

/* ============ 表单 ============ */
.form-control,.form-select,.form-check-input{
  background-color:#fff !important;
  border:1px solid #d5c5a8 !important;
  color:var(--wx-text) !important;
  border-radius:8px;
}
.form-control:focus,.form-select:focus{
  border-color:var(--wx-gold-2) !important;
  box-shadow:0 0 0 3px rgba(216,175,86,.22) !important;
  background-color:#fff !important;
}
.form-control::placeholder{color:#b0a48c}
.form-label,.col-form-label{color:#5d5240;font-weight:600;font-size:.82rem}
.form-text{color:var(--wx-muted)}
.input-group-text{background:#f4eddd;border:1px solid #d5c5a8;color:#735b32}
.form-check-input:checked{background-color:var(--wx-red-2) !important;border-color:var(--wx-red-2) !important}
.form-select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23735b32' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}
.form-switch .form-check-input{border-color:#c9b896}
.form-control[readonly],.form-control:disabled,.form-select:disabled{background-color:#f3eee4 !important;color:#988c79}

/* ============ 表格 ============ */
.table{color:var(--wx-text);border-color:var(--wx-border-2)}
.table>thead{background:#f3ead9}
.table>thead th{
  color:#6b5b3d !important;border-bottom:2px solid #d8c7a8 !important;
  font-weight:700;font-size:.78rem;letter-spacing:.05em;
  background:#f3ead9 !important;
}
.table>tbody>tr{border-color:#ece3d5}
.table>td,.table>th{border-color:#ece3d5 !important;color:var(--wx-text)}
.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background:#faf3e5 !important}
.table-striped>tbody>tr:nth-of-type(odd)>td,.table-striped>tbody>tr:nth-of-type(odd)>th{background:#fbf7ee}
.table-dark{--bs-table-bg:#221d16;--bs-table-color:#e8dfce}
.table-bordered,.table-bordered td,.table-bordered th{border-color:#dfd4bd !important}

/* ============ 徽章 ============ */
.badge{font-weight:600;letter-spacing:.02em}
.bg-primary{background:var(--wx-red-2) !important;color:#fff}
.bg-success{background:var(--wx-green) !important;color:#fff}
.bg-danger{background:#a53a2d !important;color:#fff}
.bg-warning{background:#b8883c !important;color:#fff}
.bg-info{background:#6e7b8d !important;color:#fff}
.bg-secondary{background:#7d7568 !important;color:#fff}
.bg-dark{background:#3a3226 !important;color:#efe7d6}
.bg-light{background:#f0e6d5 !important;color:#6b5b3d}
.text-bg-primary{background:var(--wx-red-2) !important;color:#fff !important}
.text-bg-success{background:var(--wx-green) !important;color:#fff !important}
.text-bg-danger{background:#a53a2d !important;color:#fff !important}
.text-bg-warning{background:#b8883c !important;color:#fff !important}
.text-bg-info{background:#6e7b8d !important;color:#fff !important}
.text-bg-secondary{background:#7d7568 !important;color:#fff !important}
.text-bg-dark{background:#3a3226 !important;color:#efe7d6 !important}
.badge.bg-primary,.badge.text-bg-primary{background:var(--wx-red-2) !important}

/* ============ 下拉/弹窗 ============ */
.dropdown-menu{
  background:var(--wx-surface) !important;
  border:1px solid var(--wx-border) !important;
  box-shadow:0 14px 34px rgba(90,70,30,.16) !important;
  border-radius:10px;
}
.dropdown-item{color:var(--wx-text-2)}
.dropdown-item:hover,.dropdown-item:focus{background:#faf3e5;color:#6b5330}
.dropdown-item.active,.dropdown-item:active{background:var(--wx-red-2) !important;color:#fff !important}
.dropdown-divider{border-color:var(--wx-border-2)}

.modal-content{
  background:var(--wx-surface) !important;
  border:1px solid var(--wx-border) !important;
  border-radius:14px !important;
  color:var(--wx-text);
}
.modal-header{background:var(--wx-surface-2);border-bottom:1px solid var(--wx-border-2);border-radius:14px 14px 0 0}
.modal-title{font-family:var(--wx-serif);font-weight:700;color:var(--wx-text-2)}
.modal-footer{border-top:1px solid var(--wx-border-2);background:var(--wx-surface-2);border-radius:0 0 14px 14px}
.modal-backdrop.show{opacity:.55}

/* ============ 分页/导航 ============ */
.pagination .page-link{
  color:#735b32;background:var(--wx-surface);border:1px solid var(--wx-border);
}
.pagination .page-link:hover{background:#f4ead7;color:#5b4523;border-color:#cdbd9f}
.page-item.active .page-link{background:var(--wx-red-2) !important;border-color:var(--wx-red-2) !important;color:#fff}
.page-item.disabled .page-link{background:#f3eee4;color:#b0a48c;border-color:var(--wx-border)}

.nav-tabs{border-bottom-color:#d8c7a8}
.nav-tabs .nav-link{color:var(--wx-muted);border-color:transparent}
.nav-tabs .nav-link:hover{color:#8a6628;border-color:#e0d2b4}
.nav-tabs .nav-link.active{
  color:var(--wx-red-2) !important;font-weight:700;
  background:var(--wx-surface) !important;
  border-color:#d8c7a8 #d8c7a8 var(--wx-surface) !important;
}
.nav-pills .nav-link{color:#735b32;border-radius:8px}
.nav-pills .nav-link.active{background:var(--wx-red-2) !important;color:#fff !important}
.nav-pills .nav-link:hover:not(.active){background:#f4ead7}

/* ============ 提示/警告 ============ */
.alert{border-radius:10px;border-width:1px}
.alert-success{background:#edf4e8;border-color:#c7d3b9;color:#3f6237}
.alert-danger,.alert-warning:not(.alert-warning){}
.alert-danger{background:#faf1ed;border-color:#e2bbb3;color:#8c2d25}
.alert-warning{background:#faf4e3;border-color:#e5cfac;color:#7a5a1d}
.alert-info{background:#eef1f4;border-color:#cdd4dd;color:#4a5879}
.alert-primary{background:#faf1ed;border-color:#e2bbb3;color:#8c2d25}
.alert-secondary{background:#f3eee4;border-color:#ddd1bd;color:#5d5240}

/* ============ 进度/其它 ============ */
.progress{background:#ede4d3}
.progress-bar{background:var(--wx-red-2)}
.progress-bar.bg-success{background:var(--wx-green) !important}
.progress-bar.bg-warning{background:#b8883c !important}
.progress-bar.bg-info{background:#6e7b8d !important}
.progress-bar.bg-danger{background:#a53a2d !important}
.list-group-item{background:var(--wx-surface);border-color:var(--wx-border-2);color:var(--wx-text)}
.list-group-item.active{background:var(--wx-red-2) !important;border-color:var(--wx-red-2) !important}
.list-group-item-action:hover{background:#faf3e5;color:#6b5330}
.form-check-label{color:var(--wx-text-2)}
.tooltip{--bs-tooltip-bg:#2b2418}
.spinner-border,.spinner-grow{color:var(--wx-gold)}
input[type="range"]::-webkit-slider-thumb{background:var(--wx-red-2)}

/* 统计卡中常见的渐变/深色块统一转墨金风 */
.stat-card,.stats-card,.metric-card{
  border:1px solid var(--wx-border) !important;
  background:linear-gradient(150deg,#fffdf8,#faf3e5) !important;
}

/* toast */
.toast{background:var(--wx-surface);border:1px solid var(--wx-border);color:var(--wx-text)}
.toast-header{background:var(--wx-surface-2);border-bottom:1px solid var(--wx-border-2);color:var(--wx-text-2)}

/* 暗色区块（页面里残留的深空底）提亮为宣纸 */
.bg-dark:not(.badge):not(.btn):not(.text-bg-dark){background:var(--wx-ink-3) !important;color:#efe7d6}

/* 滚动条 */
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#e9e1d2}
::-webkit-scrollbar-thumb{background:#c9b896;border-radius:6px;border:2px solid #e9e1d2}
::-webkit-scrollbar-thumb:hover{background:#ad812b}

/* 打印 */
@media print{body{background:#fff !important}}

/* ===== 补丁：覆盖各页内联暗色规则 ===== */
:root{--text-light:#4a4030;--text-muted:#817765;--bg-dark:#eee8dc;--bg-card:#fffdf8}
body{color:var(--wx-text) !important}
main h1,main h2,main h3,main h4,main h5,main h6{color:var(--wx-text) !important;font-family:var(--wx-serif)}
main .form-control,main .form-select,
.content .form-control,.content .form-select{
  background-color:#fff !important;border:1px solid #d5c5a8 !important;color:var(--wx-text) !important;
}
main .input-group-text,.content .input-group-text{background:#f4eddd !important;border-color:#d5c5a8 !important;color:#735b32 !important}
option{background:#fffdf8 !important;color:var(--wx-text) !important}
.modal-content[style]{background:var(--wx-surface) !important;color:var(--wx-text) !important;border:1px solid var(--wx-border) !important}
.modal-content .form-label[style]{color:#5d5240 !important}
.quick-action{color:var(--wx-text-2) !important}
.quick-action:hover{color:var(--wx-red-2) !important}
.card .text-light,main .text-light{color:var(--wx-text-2) !important}
.card .text-white,main .text-white{color:var(--wx-text) !important}

/* ===== 充值页深色卡片提亮 ===== */
.card-recharge{background:var(--wx-surface) !important;border:1px solid var(--wx-border) !important;box-shadow:0 14px 36px rgba(60,45,20,.16) !important}
.card-recharge h2,.card-recharge h3,.card-recharge h4{color:var(--wx-text) !important;font-family:var(--wx-serif)}
.card-recharge .form-label{color:#5d5240 !important}
.card-recharge .text-muted,.card-recharge small{color:var(--wx-text-3) !important}

/* 品牌名去掉渐变字，统一鎏金 */
.navbar-brand{background:none !important;-webkit-text-fill-color:currentColor !important;color:var(--wx-gold-3) !important;font-family:var(--wx-serif) !important}

/* ===== 保持"该白"的元素（彩色按钮/激活态/暗色弹窗/暗侧栏）===== */
.btn-approve,.btn-approve:hover,.btn-reject,.btn-reject:hover,
.btn-outline-light,.btn-outline-light:hover,
.pagination .page-item.active .page-link,
.filter-tabs .nav-link.active,.nav-pills .nav-link.active{color:#fff !important}
.user-sidebar,.user-sidebar .brand,.user-sidebar .nav-link{color:#efe7d6 !important}
.user-sidebar .nav-link.active{color:var(--wx-gold-3) !important}
.modal-dark .modal-content{background:#1f1c15 !important;color:#efe7d6 !important}
.modal-dark .modal-content [style]{color:#efe7d6 !important}
.modal-dark .form-label,.modal-dark label{color:#b3a88f !important}
.modal-dark .form-control,.modal-dark .form-select{background:rgba(255,255,255,.08) !important;border-color:rgba(255,255,255,.2) !important;color:#efe7d6 !important}
.modal-dark option{background:#1f1c15 !important;color:#efe7d6 !important}
.ngm-result,.swal2-textarea{color:#efe7d6 !important}
/* 弹窗内输入框（modal 不在 main 里）补白底 */
.modal-content .form-control,.modal-content .form-select{background:#fff !important;border-color:#d5c5a8 !important;color:var(--wx-text) !important}
.modal-content .input-group-text{background:#f4eddd !important;border-color:#d5c5a8 !important;color:#735b32 !important}
