/* ==========================================================================
   nanhu clientarea theme · custom.css
   楠狐风格用户中心换肤（绿色系）+ 响应式适配
   该文件由系统自动加载（子主题 custom.css 能力），用于覆盖父主题 default 样式
   ========================================================================== */

:root {
  --primary: #25a982;
  --primary-hover: #1e8c6c;
  --primary-active: #176c54;
  --txtcolor: #193f38;
  --borderS: #c6e8dc;
  --page-bg: #f4faf8;
  --enterprise-blue: linear-gradient(135deg, #176b5b, #2eae89, #82dcbc);
}

/* ============================ 全局 ============================ */
body {
  background-color: var(--page-bg);
  color: #33554c;
}

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.bg-soft-primary { background-color: rgba(37, 169, 130, 0.12) !important; color: var(--primary) !important; }

/* ============================ 按钮 ============================ */
.btn-primary {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover,
.btn-primary.hover {
  color: #fff;
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-primary:focus,
.btn-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(37, 169, 130, 0.25);
}
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--primary-active);
  border-color: var(--primary-active);
}
.btn-primary.disabled,
.btn-primary:disabled {
  background-color: #9fd6c4;
  border-color: #9fd6c4;
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:focus,
.btn-outline-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(37, 169, 130, 0.2);
}
.btn-link { color: var(--primary); }
.btn-link:hover { color: var(--primary-hover); }

/* ============================ 表单 ============================ */
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 169, 130, 0.15);
}
.custom-control-input:checked ~ .custom-control-label::before {
  border-color: var(--primary);
  background-color: var(--primary);
}
.custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(37, 169, 130, 0.25);
}
.form-control.is-valid,
.was-validated .form-control:valid {
  border-color: var(--primary);
}

/* ============================ 组件 ============================ */
.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--primary);
}
.nav-pills .nav-link.active {
  background-color: var(--primary);
}
.nav-tabs .nav-link.active {
  color: var(--primary);
  border-color: #e7f3ee #e7f3ee #fff;
}
.nav-tabs .nav-link:hover { border-color: #ecf7f2 #ecf7f2 #fff; }
.page-link { color: var(--primary); }
.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}
.badge-primary { background-color: var(--primary); }
.progress-bar { background-color: var(--primary); }
.custom-range::-webkit-slider-thumb { background-color: var(--primary); }
.spinner-border.text-primary { color: var(--primary) !important; }
a.text-primary:hover { color: var(--primary-hover) !important; }

/* ============================ 顶栏 / 侧边栏 ============================ */
#page-topbar {
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(25, 63, 56, 0.06);
}
.header-item { color: #48685f; }
.header-item:hover { color: var(--primary); }
#vertical-menu-btn:hover { color: var(--primary); }

body[data-sidebar="dark"] .vertical-menu {
  background: #0f2e28;
  box-shadow: 0 0.75rem 1.5rem rgba(15, 46, 40, 0.18);
}
body[data-sidebar="dark"] #sidebar-menu ul li a { color: #a5c3ba; }
body[data-sidebar="dark"] #sidebar-menu ul li a i { color: #77998d; }
body[data-sidebar="dark"] #sidebar-menu ul li a:hover { color: #ffffff; }
body[data-sidebar="dark"] #sidebar-menu ul li a:hover i { color: #ffffff; }
body[data-sidebar="dark"] #sidebar-menu ul li ul.sub-menu { background-color: #123129; }
body[data-sidebar="dark"] #sidebar-menu ul li ul.sub-menu li a { color: #8fb0a6; }
body[data-sidebar="dark"] #sidebar-menu ul li ul.sub-menu li a:hover { color: #ffffff; }
body[data-sidebar="dark"] .mm-active { color: #3ecf9e !important; }
body[data-sidebar="dark"] .mm-active > a { color: #3ecf9e !important; }
body[data-sidebar="dark"] .mm-active > a i { color: #3ecf9e !important; }
body[data-sidebar="dark"] .mm-active .active { color: #3ecf9e !important; }
body[data-sidebar="dark"] .mm-active .active i { color: #3ecf9e !important; }
body[data-sidebar="dark"] .menu-title { color: #77998d; }
body[data-sidebar="dark"].vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a {
  background: #123129;
  color: #ffffff;
}
body[data-sidebar="dark"].vertical-collpsed .vertical-menu #sidebar-menu > ul ul {
  background-color: #0f2e28;
}
body[data-sidebar="dark"].vertical-collpsed .vertical-menu #sidebar-menu ul li.mm-active .active {
  color: #3ecf9e !important;
}

/* ============================ 内容区 / 卡片 ============================ */
.page-title-box h4 { color: var(--txtcolor); }
.card {
  border: 1px solid #e7f3ee;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(23, 107, 91, 0.05);
}
.card-title { color: var(--txtcolor); }
.card-header { color: var(--txtcolor); }
.footer {
  background: #ffffff;
  border-top: 1px solid #e7f3ee;
  color: #7c9a90;
}
.table thead th {
  color: #4a6b60;
  border-bottom-color: #e7f3ee;
}
.table td { border-top-color: #eef6f2; }
hr { border-top-color: #e7f3ee; }
.alert-primary {
  color: #1e8c6c;
  background-color: #e8f7f1;
  border-color: #c6e8dc;
}

/* ============================ 用户中心卡片组件 ============================ */
.user-center_header {
  background: var(--enterprise-blue) !important;
  color: #fff;
}
.user-center_safety_wrapper .user-center_safety {
  background-color: var(--primary);
}
.user-center_safety_wrapper .user-center_safety:hover {
  background-color: var(--primary-hover);
}
.user-center_product_grid .user-center_product {
  border-color: #e7f3ee;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.user-center_product_grid .user-center_product:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(37, 169, 130, 0.12);
}
.user-center_notice_item .notice_item_title:hover { color: var(--primary); }

/* ============================ 响应式（手机端） ============================ */
@media (max-width: 768px) {
  .page-title-box {
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-title-box h4 { font-size: 16px; }
  .card { border-radius: 8px; }
  .user-center_calc {
    height: auto;
    min-height: 320px;
  }
  .user-center_product_grid { grid-template-columns: 1fr; }
  .user-center_h300 { height: auto; min-height: 240px; }
  .container-fluid { padding-left: 12px; padding-right: 12px; }
  .page-title-box { padding-bottom: 14px; }
  .vertical-menu { top: 62px; }
}

/* ============================ UI 修复层（2026-09-23 全站巡检） ============================ */
/* 注意：custom.css 在 module.css 之前加载，覆盖 sky 布局属性需 !important */

/* 修复1：≤768px 侧栏改为抽屉（默认收起，点顶栏汉堡按钮 .menuButtons 滑出），消除整页横向溢出 */
@media (max-width: 768px) {
  .sky-container .sky-sidebar {
    width: 200px !important;
    transform: translateX(-105%);
  }
  .sky-container .sky-sidebar.isswitch {
    transform: translateX(0);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  }
  .sky-container .sky-main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .sky-container .sky-container-fluid {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .sky-footer-Copyright { left: 20px !important; }
  .sky-container .sky-navbar .sky-logo { min-width: auto !important; }
  /* 置顶公告小屏允许换行，避免文字被截 */
  .top-notice .notice-content,
  .top-notice .notice-content p { overflow-wrap: anywhere; }
}

/* 修复2：找回密码页 logo（原图 1000px）撑破页面 */
img.cursor { max-width: 100%; height: auto; }

/* 修复3：QQ群二维码未配置时的占位（替代 /qq.png 404 破图） */
.qrcode-img.qrcode-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: #b9d8cc;
  color: #7fa294;
  font-size: 12px;
  letter-spacing: 1px;
}

/* 修复4：移动端汉堡按钮（侧栏抽屉开关）——模板有标记但此前全站无样式，手机端不可见 */
.menuButtons {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: var(--nav-top-h, 48px);
  cursor: pointer;
}
.menu-btn {
  position: relative;
  width: 20px;
  height: 16px;
}
.menu-btn i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #48685f;
  border-radius: 2px;
  transition: all 0.25s ease;
}
.menu-btn i:nth-child(1) { top: 0; }
.menu-btn i:nth-child(2) { top: 7px; }
.menu-btn i:nth-child(3) { top: 14px; }
.menu-btn.close i:nth-child(1) { top: 7px; transform: rotate(45deg); }
.menu-btn.close i:nth-child(2) { opacity: 0; }
.menu-btn.close i:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* 修复5：≤991px 首页左右栏堆叠 + 用户信息卡收缩（消除 792px 硬性最小宽度导致的整页溢出） */
@media (max-width: 991px) {
  /* 左右两列（66%/33%）改为上下堆叠、各占满宽，不再并排挤压 */
  .sky-content .sky-flex-container {
    display: block !important;
    flex-wrap: wrap !important;
  }
  .sky-content .sky-flex-container .sky-flex-66,
  .sky-content .sky-flex-container .sky-flex-33,
  .sky-content .sky-flex-container .sky-container-left,
  .sky-content .sky-flex-container .sky-container-right,
  .sky-content .sky-flex-container .sky-column {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  /* 用户信息卡：默认 min-width:200px 会把卡片撑到 792px 宽，必须放开并允许换行 */
  .userInformation .userInformation-itme {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .userInformation .sky-row,
  .userInformation .binding {
    flex-wrap: wrap !important;
  }
  /* 二维码区窄屏不再挤出卡片 */
  .userInformation .qrcode-section {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ==========================================================================
   修复7：PC 桌面端用户中心(/clientarea)整页横向溢出 + "异步内容注入后闪回"
   --------------------------------------------------------------------------
   实测根因（1440 宽溢出 200px，1600 溢出 108px，1024/1280/1366/1440 均溢出）：
   1) .sky-main-content { width:100%; margin-left:var(--nav-l-w) } —— width:100% 没扣掉
      侧栏宽度，而它在 .sky-container(flex) 里又因 min-width:auto 无法收缩到可用宽度；
   2) 卡片固有 min-content 过大（.userInformation-itme 默认 min-width:200px，8 个 →
      用户信息卡 ≈984px；资源卡/待办卡/帮助卡等也偏大），左右两列固有宽度之和
      （≈1458px）超过可用宽度（≈1230px）；
   3) 首屏靠"加载占位"时 min-content 较小（只溢 54px），约 1.7s 后异步内容
      （资源列表/最新帮助）注入并替换占位，min-content 变大 → 主内容被顶到满宽 →
      溢出 200px。这就是用户看到的"打开一瞬间正常、随后闪回/溢出"。
   修复思路：让主内容区与内层容器/卡片一律可收缩(min-width:0)，主内容改为 flex 占位，
   并把用户信息项放开换行。仅在 >991px 生效（≤991px 已由修复5改为上下堆叠）。
   ========================================================================== */

/* 1) 主内容区：改为 flex 自适应并允许收缩，彻底消除 width:100% + margin-left 的溢出 */
.sky-container .sky-main-content {
  width: auto !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* 2) 内容链路上的容器一律允许收缩，避免 min-content 把父级顶破 */
.sky-container .sky-content,
.sky-container .sky-flex-container,
.sky-container .sky-container-left,
.sky-container .sky-container-right,
.sky-container .sky-column,
.sky-container .sky-card {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* 3) 用户信息卡：默认每个字段 min-width:200px（8 个）会把卡片撑到 ≈984px，必须放开并允许换行 */
.userInformation .userInformation-itme {
  min-width: 0 !important;
  max-width: 100% !important;
}
.userInformation .sky-row {
  flex-wrap: wrap !important;
  min-width: 0 !important;
}

/* 4) 首页各卡片兜底：允许收缩，避免异步内容注入后把整页顶宽 */
.dashboard-resource-card,
.dashboard-todo-card,
.latest-help-card,
.newsInformation,
.apiInformation,
.balance-card,
.earnCommission {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* ==========================================================================
   修复8：用户信息卡片间距紧凑化（PC + 手机端统一收紧）
   --------------------------------------------------------------------------
   实测（线上 /clientarea）：module.css 里针对 .clientarea-dashboard 的那套"紧凑
   样式"是死代码（该 class 在所有模板中都不存在），实际生效的是旧的基础间距：
     卡片 padding 20px；首行 gap 16px；.sky-column 右侧多出 10px；
     信息行(.userInformation-xs1) gap 20px；信息项 padding 10px 14px、margin-bottom 12px，
     且信息项宽度按内容(≈123px)不铺满 → 视觉上间距大、留白多。
   此处统一收紧行距/内边距，并让信息项等宽铺满以消除零散留白。
   注：module.css 中相关规则带 !important，故用 .sky-container .sky-content 前缀
   提高优先级确保覆盖生效（该前缀在 /clientarea 的真实 DOM 链路上有效）。
   ========================================================================== */
.sky-container .sky-content .userInformation {
  padding: 14px 16px !important;
}
.sky-container .sky-content .userInformation > .sky-row:first-of-type {
  gap: 10px !important;
}
.sky-container .sky-content .userInformation .sky-column {
  margin-right: 0 !important;
}
.sky-container .sky-content .userInformation .userInformation-xs1 {
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.sky-container .sky-content .userInformation .userInformation-itme {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin: 0 0 6px !important;
  padding: 6px 10px !important;
}
.sky-container .sky-content .userInformation .binding {
  margin-top: 2px !important;
  gap: 6px !important;
}
.sky-container .sky-content .userInformation .sky-interval {
  margin-top: 8px !important;
}
.sky-container .sky-content .userInformation .userInformation-xs202 {
  margin-top: 10px !important;
  padding-top: 10px !important;
  gap: 8px !important;
}
