/* =========================================================
   星辉阁 API 管理系统 · 液态毛玻璃设计层
   依赖：assets/css/codebase.min-5.4.css（原始模板）
   作用：只做视觉覆盖，不改动任何 PHP 逻辑与数据结构
   ========================================================= */

:root {
    --xhg-ink: #16202c;
    --xhg-ink-2: #4b5b6b;
    --xhg-ink-3: #7f8d9c;
    --xhg-brand: #2f5e88;
    --xhg-brand-2: #4d80aa;

    --xhg-glass: rgba(255, 255, 255, 0.72);
    --xhg-glass-strong: rgba(255, 255, 255, 0.88);
    --xhg-glass-line: rgba(255, 255, 255, 0.8);
    --xhg-glass-edge: rgba(255, 255, 255, 0.95);
    --xhg-field-bg: #ffffff;
    --xhg-field-line: rgba(120, 134, 152, 0.34);
    --xhg-shadow: 0 6px 20px rgba(24, 35, 48, 0.08);
    --xhg-shadow-lg: 0 14px 38px rgba(24, 35, 48, 0.13);
    --xhg-r: 14px;
    --xhg-r-sm: 10px;

    --xhg-blur: blur(20px) saturate(140%);
    --xhg-spring: cubic-bezier(.22, 1.2, .36, 1);
}

/* ---------------- 背景：柔和渐变网格 ---------------- */
html, body {
    min-height: 100%;
}

body {
    background: #f3f6fa !important;
    color: var(--xhg-ink);
    font-feature-settings: "tnum";
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: -12%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(50% 46% at 4% -6%, rgba(47, 94, 136, .20), transparent 66%),
        radial-gradient(44% 42% at 104% 104%, rgba(47, 94, 136, .11), transparent 64%);
    filter: none;
    animation: none;
}

@keyframes xhgDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(-3%, 2.5%, 0) scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

/* ---------------- 玻璃表面 ----------------
   注意：绝对不能改 .block / #sidebar / #page-header 的 position 与 overflow，
   模板靠 fixed 定位侧边栏与页头，且表格内的下拉菜单不能被裁剪。
   顶部高光用 inset box-shadow 实现，避免引入伪元素与裁剪。 */
.block,
.card,
.modal-content,
.dropdown-menu,
.xhg-auth-card,
#sidebar,
#page-header,
.hero-static .block {
    background: var(--xhg-glass) !important;
    -webkit-backdrop-filter: var(--xhg-blur);
    backdrop-filter: var(--xhg-blur);
    border: 1px solid var(--xhg-glass-line) !important;
    border-radius: var(--xhg-r) !important;
    box-shadow: var(--xhg-shadow),
    inset 0 1px 0 var(--xhg-glass-edge),
    inset 0 18px 26px -22px rgba(255, 255, 255, .95) !important;
}

/* 卡片头部贴合圆角 */
.block-header {
    border-top-left-radius: calc(var(--xhg-r) - 1px);
    border-top-right-radius: calc(var(--xhg-r) - 1px);
}

.block-content,
.block-header {
    background: transparent !important;
}

.block-header.block-header-default {
    border-bottom: 1px solid rgba(255, 255, 255, .5) !important;
    background: rgba(255, 255, 255, .22) !important;
}

.block-title {
    color: var(--xhg-ink) !important;
    font-weight: 600;
    letter-spacing: .2px;
}

.block-title small {
    color: var(--xhg-ink-3) !important;
    font-weight: 400;
}

/* 取消卡片悬浮抖动，改为轻抬起 */
.block-link-pop {
    transition: transform .34s var(--xhg-spring), box-shadow .3s ease;
}

.block-link-pop:hover {
    transform: translateY(-3px);
    box-shadow: var(--xhg-shadow-lg), inset 0 1px 0 var(--xhg-glass-edge) !important;
}

/* ---------------- 布局：铺满视口 ---------------- */
/* 侧边栏与页头定位交给模板，这里只放开宽度限制 */
#page-container.main-content-boxed #main-container > .content {
    max-width: none !important;
    width: auto;
    margin: 0 !important;
    padding: 20px 24px 0 !important;
}

#page-header {
    border-radius: 0 0 var(--xhg-r) var(--xhg-r) !important;
    border-top: 0 !important;
}

/*
 * 页头内容与主内容左右对齐
 * 原模板给 .content-header 设了 max-width:1260px + 自动外边距（居中留白），
 * 二开把主内容改成铺满视口后页头没跟着改，
 * 结果 Logo 比下方面板多缩进 90 多像素，看上去就是「排版错位」。
 */
#page-header .content-header {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

#sidebar {
    border-radius: 0 !important;
    border-left: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    border-right: 1px solid var(--xhg-glass-line) !important;
}

#page-footer .content,
#page-footer .content .col-sm-6 {
    max-width: none !important;
    margin: 0 !important;
    padding: 12px 24px !important;
    color: var(--xhg-ink-2);
}

#page-footer .content .col-sm-6 {
    padding: 6px 0 !important;
}

#page-footer a {
    color: var(--xhg-ink-3) !important;
}

/* ---------------- 侧边导航 ---------------- */
.nav-main-link {
    border-radius: 12px;
    transition: background .25s, color .25s, transform .3s var(--xhg-spring);
}

.nav-main-link:hover {
    background: rgba(255, 255, 255, .5);
    transform: translateX(2px);
}

.nav-main-link.active {
    background: rgba(47, 94, 136, .12);
    color: var(--xhg-brand);
    box-shadow: inset 0 0 0 1px rgba(47, 94, 136, .22);
}

.nav-main-heading {
    color: var(--xhg-ink-3) !important;
    letter-spacing: 1.4px;
    font-size: 11px;
}

.content-side-user .img-avatar {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .75), 0 8px 20px rgba(16, 24, 40, .18);
    border-radius: 18px;
}

/* ---------------- 按钮：微反馈 + 弹性 ---------------- */
.btn,
.btn-block-option,
.page-link {
    border-radius: var(--xhg-r-sm) !important;
    position: relative;
    overflow: hidden;
    transition: transform .3s var(--xhg-spring), box-shadow .28s ease, background .28s ease, color .2s;
    will-change: transform;
}

.btn:active,
.page-link:active {
    transform: scale(.99);
}

.btn-primary,
.btn-alt-primary {
    background: linear-gradient(180deg, rgba(54, 168, 224, .96), rgba(47, 94, 136, .96)) !important;
    border-color: rgba(47, 94, 136, .10) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(47, 94, 136, .28), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
}

.btn-primary:hover,
.btn-alt-primary:hover {
    box-shadow: 0 10px 26px rgba(47, 94, 136, .36), inset 0 1px 0 rgba(255, 255, 255, .4) !important;
}

.btn-alt-secondary,
.btn-secondary {
    background: rgba(255, 255, 255, .55) !important;
    border-color: var(--xhg-glass-line) !important;
    color: var(--xhg-ink-2) !important;
    box-shadow: inset 0 1px 0 var(--xhg-glass-edge) !important;
}

.btn-alt-danger,
.btn-danger {
    background: rgba(220, 38, 38, .10) !important;
    border-color: rgba(220, 38, 38, .28) !important;
    color: #dc2626 !important;
}

.btn-alt-info,
.btn-info {
    background: rgba(8, 145, 178, .10) !important;
    border-color: rgba(8, 145, 178, .28) !important;
    color: #0891b2 !important;
}

/* 波纹 */
.xhg-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, .26);
    pointer-events: none;
    animation: xhgRipple .46s cubic-bezier(.2, .6, .3, 1) forwards;
}

.btn-alt-secondary .xhg-ripple,
.btn-secondary .xhg-ripple,
.btn-alt-info .xhg-ripple,
.btn-alt-danger .xhg-ripple {
    background: rgba(47, 94, 136, .14);
}

@keyframes xhgRipple {
    from {
        transform: scale(0);
        opacity: .85;
    }
    to {
        transform: scale(1);
        opacity: 0;
    }
}

/* ---------------- 表单 ---------------- */
.form-control,
.form-select,
.form-control-alt,
textarea.form-control {
    background: #ffffff !important;
    border: 1px solid rgba(120, 134, 152, .34) !important;
    border-radius: var(--xhg-r-sm) !important;
    color: var(--xhg-ink) !important;
    font-size: 14px;
    min-height: 42px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04) !important;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

textarea.form-control {
    min-height: 96px;
    line-height: 1.6;
    resize: vertical;
}

.form-control:hover,
.form-select:hover,
.form-control-alt:hover,
textarea.form-control:hover {
    border-color: rgba(47, 94, 136, .45) !important;
}

.form-control::placeholder,
.form-control-alt::placeholder,
textarea.form-control::placeholder {
    color: #9aa7b6;
    opacity: 1;
}

.form-control:focus,
.form-select:focus,
.form-control-alt:focus,
textarea.form-control:focus {
    border-color: var(--xhg-brand) !important;
    box-shadow: 0 0 0 4px rgba(47, 94, 136, .14), 0 1px 2px rgba(16, 24, 40, .05) !important;
    background: #ffffff !important;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background: #f3f5f8 !important;
    color: #98a4b2 !important;
    cursor: not-allowed;
}

/* select 下拉：给原生下箭头留出空间并统一高度 */
.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='%236b7684' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px 12px !important;
    padding-right: 38px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.form-select option {
    color: var(--xhg-ink);
    background: #ffffff;
}

.form-label {
    color: var(--xhg-ink-2);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: .2px;
}

/* form-floating 的浮动标签在玻璃底色下要改色 */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--xhg-brand);
}

.form-floating > label {
    color: var(--xhg-ink-3);
}

/* 输入框组合：按钮与输入框贴合，不要各自圆角 */
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > .btn:not(:first-child),
.input-group > .btn:not(:last-child) {
    border-radius: 0 !important;
    box-shadow: none !important;
}

.input-group > .btn:last-child {
    border-top-right-radius: var(--xhg-r-sm) !important;
    border-bottom-right-radius: var(--xhg-r-sm) !important;
}

.input-group > .btn:first-child {
    border-top-left-radius: var(--xhg-r-sm) !important;
    border-bottom-left-radius: var(--xhg-r-sm) !important;
}

/* ---------------- 表格 ---------------- */
.table {
    color: var(--xhg-ink);
    --bs-table-color: var(--xhg-ink);
    --bs-table-bg: transparent;
    --bs-table-striped-color: var(--xhg-ink);
    --bs-table-striped-bg: rgba(255, 255, 255, .34);
    --bs-table-hover-color: var(--xhg-ink);
    --bs-table-hover-bg: rgba(47, 94, 136, .07);
    border-color: rgba(255, 255, 255, .55);
}

.table > :not(caption) > * > * {
    border-color: rgba(255, 255, 255, .5);
    background: transparent;
}

.table > thead {
    background: rgba(255, 255, 255, .36);
}

.table > thead th {
    color: var(--xhg-ink-2);
    font-weight: 600;
    font-size: 13px;
}

.table tbody tr {
    transition: background .2s;
}

/* 表格里的图标按钮 */
.table .btn {
    transform-origin: center;
}

/* ---------------- 自定义勾选框 ---------------- */
.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid rgba(120, 134, 152, .5) !important;
    background-color: #ffffff !important;
    border-radius: 5px !important;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.form-check-input:hover {
    border-color: var(--xhg-brand) !important;
}

.form-check-input:focus {
    border-color: var(--xhg-brand) !important;
    box-shadow: 0 0 0 3px rgba(47, 94, 136, .16) !important;
}

.custom-control-input:checked ~ .custom-control-label::before,
.form-check-input:checked {
    background: linear-gradient(180deg, #36a8e0, #2f5e88) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(47, 94, 136, .35);
}

.form-check-input:checked[type="radio"],
.form-radio .form-check-input:checked {
    background-image: none;
}

.custom-control-label::before {
    border-radius: 6px !important;
    border-color: rgba(140, 155, 172, .5) !important;
}

.form-check-label {
    color: var(--xhg-ink-2);
    font-size: 13.5px;
    cursor: pointer;
}

/* input-group 前置/后置图标块与输入框等高、白底 */
.input-group-text {
    background: rgba(255, 255, 255, .85) !important;
    border: 1px solid rgba(120, 134, 152, .34) !important;
    color: var(--xhg-ink-3) !important;
    border-radius: var(--xhg-r-sm) !important;
}

.input-group > .input-group-text:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .input-group-text:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* ---------------- 分页 ---------------- */
.page-link {
    background: rgba(255, 255, 255, .5) !important;
    border-color: var(--xhg-glass-line) !important;
    color: var(--xhg-ink-2) !important;
}

.page-item.active .page-link {
    background: linear-gradient(180deg, #36a8e0, #2f5e88) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(47, 94, 136, .3);
}

/* ---------------- 下箭头 / 下拉菜单 ---------------- */
.dropdown-menu {
    padding: 8px !important;
    border-radius: 16px !important;
}

.dropdown-item {
    border-radius: 10px;
    color: var(--xhg-ink-2);
    transition: background .2s, transform .25s var(--xhg-spring);
}

.dropdown-item:hover {
    background: rgba(47, 94, 136, .1);
    color: var(--xhg-brand);
    transform: translateX(2px);
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, .5);
}

/* ---------------- 统计卡（后台首页） ---------------- */
.block-link-pop .block-content-full {
    border-bottom: 0 !important;
}

.block-link-pop .fs-3 {
    letter-spacing: -.5px;
}

/* ---------------- 顶部页头横幅（后台首页） ---------------- */
.bg-primary-light {
    background: linear-gradient(120deg, rgba(47, 94, 136, .88), rgba(77, 128, 170, .82) 55%, rgba(37, 78, 116, .78)) !important;
    box-shadow: 0 16px 40px rgba(47, 94, 136, .26);
}

.bg-primary-light h1,
.bg-primary-light h2 {
    text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

/* ---------------- 接口详情页顶部横幅 ---------------- */
.bg-primary-op {
    background: linear-gradient(120deg, rgba(47, 94, 136, .9), rgba(37, 78, 116, .8)) !important;
    border-radius: var(--xhg-r);
    box-shadow: 0 16px 40px rgba(47, 94, 136, .26);
}

/* 代码块 */
pre {
    background: rgba(16, 24, 40, .05);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--xhg-ink);
    font-size: 12.5px;
    line-height: 1.7;
    overflow: auto;
}

.block-content.bg-gray-light {
    background: rgba(16, 24, 40, .05) !important;
    border-radius: 14px;
}

/* =========================================================
   二开组件：自研开关 / 方块选择器 / 模态框 / 提示条
   ========================================================= */

/* iOS 风格滑动开关 */
.xhg-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.xhg-switch .track {
    width: 58px;
    height: 32px;
    border-radius: 16px;
    background: rgba(120, 132, 148, .3);
    position: relative;
    transition: background .32s ease, box-shadow .32s ease;
    box-shadow: inset 0 1px 3px rgba(16, 24, 40, .18);
    flex: 0 0 auto;
}

.xhg-switch .dot {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 7px rgba(16, 24, 40, .28);
    transition: transform .38s var(--xhg-spring);
}

.xhg-switch.on .track {
    background: linear-gradient(180deg, #3f9c62, #2f8050);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .16), 0 0 0 4px rgba(63, 156, 98, .14);
}

.xhg-switch.on .dot {
    transform: translateX(26px);
}

.xhg-switch .label {
    font-size: 13px;
    font-weight: 500;
    color: var(--xhg-ink-2);
}

/* 方块网格选择器（替代原生 select） */
.xhg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.xhg-grid .opt {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid var(--xhg-glass-line);
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--xhg-ink-2);
    transition: transform .3s var(--xhg-spring), box-shadow .28s, background .28s, color .2s;
    position: relative;
    overflow: hidden;
}

.xhg-grid .opt:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .10);
}

.xhg-grid .opt.active {
    background: rgba(47, 94, 136, .12);
    border-color: rgba(47, 94, 136, .5);
    color: var(--xhg-brand);
    box-shadow: 0 0 0 3px rgba(47, 94, 136, .13);
}

.xhg-grid .opt .sub {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--xhg-ink-3);
    margin-top: 2px;
}

/* 自研模态框 */
.xhg-mask {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 18, 26, .36);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.xhg-mask.show {
    opacity: 1;
    visibility: visible;
}

.xhg-dialog {
    width: min(900px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: var(--xhg-glass-strong);
    -webkit-backdrop-filter: var(--xhg-blur);
    backdrop-filter: var(--xhg-blur);
    border: 1px solid var(--xhg-glass-line);
    border-radius: 22px;
    box-shadow: var(--xhg-shadow-lg), inset 0 1px 0 var(--xhg-glass-edge);
    transform: translateY(20px) scale(.97);
    transition: transform .42s var(--xhg-spring);
    overflow: hidden;
}

.xhg-mask.show .xhg-dialog {
    transform: none;
}

.xhg-dialog.sm {
    width: min(460px, 96vw);
}

.xhg-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .2);
}

.xhg-dialog-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--xhg-ink);
}

.xhg-dialog-body {
    padding: 20px;
    overflow: auto;
    flex: 1 1 auto;
}

.xhg-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .18);
}

.xhg-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .5);
    color: var(--xhg-ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .3s var(--xhg-spring), background .25s;
}

.xhg-close:hover {
    background: rgba(220, 38, 38, .12);
    color: #dc2626;
}

.xhg-close:active {
    transform: scale(.98);
}

/* 自研提示条 */
.xhg-toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.xhg-toast {
    min-width: 200px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--xhg-glass-strong);
    -webkit-backdrop-filter: var(--xhg-blur);
    backdrop-filter: var(--xhg-blur);
    border: 1px solid var(--xhg-glass-line);
    box-shadow: var(--xhg-shadow), inset 0 1px 0 var(--xhg-glass-edge);
    color: var(--xhg-ink);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(24px) scale(.96);
    opacity: 0;
    animation: xhgToastIn .46s var(--xhg-spring) forwards;
}

.xhg-toast.out {
    animation: xhgToastOut .3s ease forwards;
}

.xhg-toast .bar {
    width: 3px;
    align-self: stretch;
    border-radius: 2px;
    background: var(--xhg-brand);
    flex: 0 0 auto;
}

.xhg-toast.success .bar {
    background: #22a24a;
}

.xhg-toast.warning .bar {
    background: #d97706;
}

.xhg-toast.danger .bar {
    background: #dc2626;
}

@keyframes xhgToastIn {
    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes xhgToastOut {
    to {
        transform: translateX(24px) scale(.96);
        opacity: 0;
    }
}

/* 主题开关放进页头 */
.xhg-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .45);
    color: var(--xhg-ink-2);
    font-size: 12px;
    cursor: pointer;
    transition: background .25s, transform .3s var(--xhg-spring);
}

.xhg-theme-toggle:active {
    transform: scale(.99);
}

.xhg-theme-toggle .xhg-switch .track {
    width: 42px;
    height: 24px;
    border-radius: 12px;
}

.xhg-theme-toggle .xhg-switch .dot {
    width: 18px;
    height: 18px;
}

.xhg-theme-toggle .xhg-switch.on .dot {
    transform: translateX(18px);
}

/* 接口卡片（前台） */
#list .block-content.pt-5 {
    padding-top: 1.9rem !important;
}

#list .block-options-item {
    font-variant-numeric: tabular-nums;
}

/* 细微滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(140, 155, 172, .45) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(140, 155, 172, .42);
    border-radius: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* 小屏适配 */
@media (max-width: 991.98px) {
    #page-container.main-content-boxed #main-container > .content {
        padding: 16px 14px 0 !important;
    }

    .xhg-dialog {
        width: min(900px, 94vw);
        max-height: 90vh;
    }
}

/* =========================================================
   登录页：整屏左右分栏（左侧品牌 / 右侧玻璃表单）
   铺满视口，不使用居中窄列
   ========================================================= */
.xhg-auth {
    min-height: calc(100vh - 196px);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 26px;
    padding: 6px 0 18px;
}

.xhg-auth-brand {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(140deg, rgba(47, 94, 136, .94), rgba(77, 128, 170, .76) 46%, rgba(37, 78, 116, .82));
    box-shadow: 0 26px 64px rgba(47, 94, 136, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
    color: #fff;
}

.xhg-auth-brand::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -180px;
    bottom: -220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 66%);
    pointer-events: none;
}

.xhg-auth-brand .brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .5px;
}

.xhg-auth-brand h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.28;
    margin: 34px 0 14px;
}

.xhg-auth-brand .lead {
    font-size: 14.5px;
    line-height: 1.85;
    color: rgba(255, 255, 255, .88);
    max-width: 460px;
    margin: 0;
}

.xhg-auth-points {
    display: grid;
    gap: 14px;
    margin-top: 34px;
}

.xhg-auth-points span {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .95);
}

.xhg-auth-points i {
    margin-top: 3px;
    opacity: .78;
}

.xhg-auth-foot {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .72);
}

.xhg-auth-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.xhg-auth-card {
    width: 100%;
    max-width: 452px;
    padding: 34px 32px 30px;
}

.xhg-auth-card .card-head {
    margin-bottom: 26px;
}

.xhg-auth-card .card-head h2 {
    font-size: 23px;
    font-weight: 700;
    color: var(--xhg-ink);
    margin: 0 0 6px;
}

.xhg-auth-card .card-head p {
    font-size: 13px;
    color: var(--xhg-ink-3);
    margin: 0;
}

.xhg-auth-hint {
    font-size: 12.5px;
    color: var(--xhg-ink-3);
    text-align: center;
}

@media (max-width: 991.98px) {
    .xhg-auth {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }

    .xhg-auth-brand {
        padding: 32px 26px;
        border-radius: 22px;
    }

    .xhg-auth-brand h1 {
        font-size: 27px;
        margin-top: 22px;
    }

    .xhg-auth-points {
        display: none;
    }
}

/* =========================================================
   会员中心
   ========================================================= */
.xhg-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    margin-bottom: 22px;
    border-radius: 14px;
    background: rgba(120, 140, 160, .12);
    border: 1px solid var(--xhg-glass-line);
}

.xhg-tabs .tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 9px 0;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--xhg-ink-3);
    cursor: pointer;
    transition: background .28s, color .28s, transform .32s var(--xhg-spring);
}

.xhg-tabs .tab:active {
    transform: scale(.99);
}

.xhg-tabs .tab.active {
    background: rgba(255, 255, 255, .82);
    color: var(--xhg-brand);
    box-shadow: 0 4px 14px rgba(16, 24, 40, .10);
}

/* 余额大卡 */
.xhg-balance-card {
    background: linear-gradient(135deg, rgba(47, 94, 136, .92), rgba(77, 128, 170, .8) 52%, rgba(37, 78, 116, .84)) !important;
    border-color: rgba(255, 255, 255, .3) !important;
    box-shadow: 0 20px 46px rgba(47, 94, 136, .3), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
    color: #fff;
}

.xhg-balance-label {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .82);
    letter-spacing: .4px;
}

.xhg-balance-num {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.25;
    margin: 8px 0 4px;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    transition: transform .4s var(--xhg-spring);
}

.xhg-balance-num .pop {
    display: inline-block;
    animation: xhgPop .6s var(--xhg-spring);
}

@keyframes xhgPop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.xhg-balance-num.pop {
    display: inline-block;
    animation: xhgPop .6s var(--xhg-spring);
}

.xhg-balance-num::before {
    content: "￥";
    font-size: 22px;
    font-weight: 600;
    margin-right: 4px;
    opacity: .85;
}

.xhg-balance-meta {
    display: flex;
    gap: 10px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .82);
    margin-bottom: 18px;
}

.xhg-balance-actions .btn {
    background: rgba(255, 255, 255, .9) !important;
    border-color: transparent !important;
    color: #16202c !important;
    box-shadow: none !important;
}

/* 提示盒子 */
.xhg-tip-box {
    margin-top: 18px;
    padding: 15px 16px;
    border-radius: 14px;
    background: rgba(47, 94, 136, .08);
    border: 1px dashed rgba(47, 94, 136, .35);
}

.xhg-tip-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--xhg-brand);
    margin-bottom: 6px;
}

.xhg-tip-text {
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--xhg-ink-2);
    word-break: break-all;
}

/* =========================================================
   接口列表改版 + 分类
   ========================================================= */
.xhg-cate-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.xhg-cate-bar button {
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .55);
    color: var(--xhg-ink-2);
    padding: 7px 15px;
    border-radius: 11px;
    font-size: 13px;
    cursor: pointer;
    transition: background .26s, color .26s, transform .3s var(--xhg-spring), box-shadow .26s;
}

.xhg-cate-bar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(16, 24, 40, .09);
}

.xhg-cate-bar button.active {
    background: rgba(47, 94, 136, .13);
    border-color: rgba(47, 94, 136, .48);
    color: var(--xhg-brand);
    font-weight: 600;
}

/* 分类后面的接口数量：弱化，避免抢过分类名 */
.xhg-cate-bar button b {
    font-weight: 600;
    font-size: 11.5px;
    opacity: .55;
    margin-left: 2px;
}

.xhg-cate-bar button.active b {
    opacity: .8;
}

/* 接口卡片 */
.xhg-api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 16px;
}

.xhg-api-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 18px 16px;
    border-radius: var(--xhg-r);
    background: var(--xhg-glass);
    -webkit-backdrop-filter: var(--xhg-blur);
    backdrop-filter: var(--xhg-blur);
    border: 1px solid var(--xhg-glass-line);
    box-shadow: var(--xhg-shadow), inset 0 1px 0 var(--xhg-glass-edge);
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    color: inherit;
    transition: transform .36s var(--xhg-spring), box-shadow .3s ease, border-color .3s;
    animation: xhgCardIn .5s var(--xhg-spring) both;
}

.xhg-api-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--xhg-shadow-lg), inset 0 1px 0 var(--xhg-glass-edge);
    border-color: rgba(47, 94, 136, .4);
}

.xhg-api-card:active {
    transform: scale(.995);
}

@keyframes xhgCardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.xhg-api-card .card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.xhg-api-card .api-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--xhg-ink);
    line-height: 1.4;
}

.xhg-api-card .api-desc {
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--xhg-ink-3);
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xhg-api-card .card-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .5);
    font-size: 12px;
    color: var(--xhg-ink-3);
}

.xhg-api-card .card-foot .fa,
.xhg-api-card .card-foot .si {
    margin-right: 4px;
}

.xhg-chip {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.xhg-chip.ok {
    background: rgba(34, 162, 74, .14);
    color: #1c8a3d;
}

.xhg-chip.off {
    background: rgba(217, 119, 6, .16);
    color: #b45309;
}

.xhg-chip.free {
    background: rgba(100, 116, 139, .14);
    color: #475569;
}

.xhg-chip.paid {
    background: rgba(47, 94, 136, .14);
    color: var(--xhg-brand);
}

.xhg-price {
    margin-left: auto;
    font-weight: 600;
    color: var(--xhg-brand);
}

.xhg-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--xhg-ink-3);
}

.xhg-empty .fa {
    font-size: 34px;
    opacity: .35;
    display: block;
    margin-bottom: 12px;
}

/* 首屏搜索框 */
.xhg-search .form-control {
    height: 46px;
    font-size: 14px;
}

.xhg-search .btn {
    min-width: 96px;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .xhg-search {
        margin-top: 4px;
    }
}

/* 页面淡入 */
.xhg-fade-in {
    animation: xhgFadeIn .42s ease both;
}

@keyframes xhgFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* =========================================================
   接口详情页：多语言示例 / 在线调试
   ========================================================= */
.xhg-code-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.xhg-code-tabs button {
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .55);
    color: var(--xhg-ink-2);
    padding: 6px 12px;
    border-radius: 9px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background .24s, color .24s, transform .3s var(--xhg-spring);
}

.xhg-code-tabs button:active {
    transform: scale(.985);
}

.xhg-code-tabs button.active {
    background: rgba(47, 94, 136, .14);
    border-color: rgba(47, 94, 136, .5);
    color: var(--xhg-brand);
    font-weight: 600;
}

.xhg-code-box {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(16, 24, 40, .05);
    border: 1px solid var(--xhg-glass-line);
}

.xhg-code-box pre {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    max-height: 420px;
    overflow: auto;
    padding: 16px 18px;
    font-size: 12.5px;
    line-height: 1.75;
    white-space: pre;
    tab-size: 4;
}

.xhg-code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .72);
    color: var(--xhg-ink-2);
    cursor: pointer;
    z-index: 2;
    transition: transform .3s var(--xhg-spring), background .24s, color .24s;
}

.xhg-code-copy:hover {
    background: rgba(47, 94, 136, .16);
    color: var(--xhg-brand);
}

.xhg-code-copy:active {
    transform: scale(.98);
}

.xhg-code-preview {
    padding: 11px 14px;
    border-radius: 11px;
    background: rgba(16, 24, 40, .05);
    border: 1px solid var(--xhg-glass-line);
    font-family: var(--bs-font-monospace);
    font-size: 12px;
    color: var(--xhg-ink-2);
    word-break: break-all;
    line-height: 1.7;
}

.xhg-debug-result {
    margin-top: 16px;
    border-radius: 14px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(16, 24, 40, .04);
    overflow: hidden;
    animation: xhgFadeIn .35s ease both;
}

.xhg-debug-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--xhg-glass-line);
    flex-wrap: wrap;
}

.xhg-debug-result pre {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    max-height: 460px;
    overflow: auto;
    padding: 14px 16px;
    font-size: 12.5px;
    line-height: 1.75;
}

/* 数字滚动计数 */
.xhg-count-up {
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   主题开关 / 入场动画
   ========================================================= */
.xhg-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 12px;
    border-radius: 13px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .48);
    color: var(--xhg-ink-2);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: background .26s, transform .3s var(--xhg-spring), border-color .26s;
}

.xhg-theme-toggle:active {
    transform: scale(.99);
}

.xhg-theme-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(47, 94, 136, .28);
}

.xhg-theme-toggle .xhg-theme-label {
    min-width: 26px;
    text-align: center;
}

@keyframes xhgFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* 尊重系统的「减少动效」设置 */
@media (prefers-reduced-motion: reduce) {
    .xhg-api-card,
    .xhg-fade-in,
    .block,
    .xhg-theme-toggle,
    .xhg-switch .dot {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================
   会员中心：资料头图 / 头像 / 签到 / 我的评论
   ========================================================= */
.xhg-profile {
    overflow: hidden;
}

.xhg-profile-cover {
    position: relative;
    height: 132px;
    background: linear-gradient(120deg, rgba(47, 94, 136, .88), rgba(77, 128, 170, .72) 46%, rgba(37, 78, 116, .84));
    background-size: cover;
    background-position: center;
}

.xhg-cover-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .26);
    color: #fff;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: transform .3s var(--xhg-spring), background .25s;
}

.xhg-cover-btn:active {
    transform: scale(.98);
}

.xhg-profile-row {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: -40px;
}

.xhg-avatar {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    flex: 0 0 auto;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, .92);
    background: linear-gradient(140deg, #2f5e88, #4d80aa);
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(16, 24, 40, .18);
    transition: transform .3s var(--xhg-spring);
}

.xhg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.xhg-avatar:active {
    transform: scale(.98);
}

.xhg-profile-main {
    flex: 1 1 200px;
    min-width: 160px;
    padding-bottom: 4px;
}

.xhg-profile-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 19px;
    font-weight: 700;
    color: var(--xhg-ink);
}

.xhg-profile-intro {
    font-size: 12.5px;
    color: var(--xhg-ink-3);
    margin-top: 4px;
}

.xhg-profile-stats {
    display: flex;
    gap: 22px;
    padding-bottom: 4px;
}

.xhg-profile-stats .stat {
    text-align: center;
}

.xhg-profile-stats .stat b {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--xhg-ink);
    font-variant-numeric: tabular-nums;
}

.xhg-profile-stats .stat span {
    font-size: 11.5px;
    color: var(--xhg-ink-3);
}

.xhg-profile-actions {
    padding-bottom: 4px;
}

/* 签到 7 天格子 */
.xhg-sign-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.xhg-sign-cell {
    border-radius: 12px;
    padding: 9px 4px;
    text-align: center;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .5);
    transition: background .25s, border-color .25s, box-shadow .25s;
}

.xhg-sign-cell em {
    display: block;
    font-style: normal;
    font-size: 10.5px;
    color: var(--xhg-ink-3);
}

.xhg-sign-cell b {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--xhg-ink);
}

.xhg-sign-cell span {
    font-size: 10px;
    color: var(--xhg-ink-3);
}

.xhg-sign-cell.done {
    background: rgba(34, 162, 74, .12);
    border-color: rgba(34, 162, 74, .4);
}

.xhg-sign-cell.done b {
    color: #1c8a3d;
}

.xhg-sign-cell.next {
    border-color: rgba(47, 94, 136, .5);
    box-shadow: 0 0 0 3px rgba(47, 94, 136, .12);
}

/* 我的评论 */
.xhg-my-comment {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .5);
}

.xhg-my-comment .cm-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

.xhg-my-comment .cm-body {
    font-size: 13px;
    line-height: 1.75;
    color: var(--xhg-ink-2);
    margin: 6px 0 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.xhg-my-comment .cm-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================================
   接口详情页：点赞收藏 + 评论区
   ========================================================= */
.xhg-act-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.xhg-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 11px;
    cursor: pointer;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .5);
    color: var(--xhg-ink-2);
    font-size: 13px;
    transition: transform .3s var(--xhg-spring), background .24s, color .24s, border-color .24s;
}

.xhg-act-btn:active {
    transform: scale(.985);
}

.xhg-act-btn.on {
    background: rgba(47, 94, 136, .14);
    border-color: rgba(47, 94, 136, .45);
    color: var(--xhg-brand);
    font-weight: 600;
}

.xhg-cmt {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--xhg-glass-line);
}

.xhg-cmt:first-child {
    border-top: 0;
}

.xhg-cmt-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex: 0 0 auto;
    overflow: hidden;
    background: linear-gradient(140deg, #2f5e88, #4d80aa);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xhg-cmt-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xhg-cmt-main {
    flex: 1 1 auto;
    min-width: 0;
}

.xhg-cmt-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--xhg-ink);
}

.xhg-cmt-head .fs-sm {
    font-weight: 400;
}

.xhg-cmt-body {
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--xhg-ink-2);
    margin: 5px 0 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.xhg-cmt-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    color: var(--xhg-ink-3);
}

.xhg-cmt-foot button {
    border: 0;
    background: transparent;
    color: var(--xhg-ink-3);
    cursor: pointer;
    font-size: 12.5px;
    padding: 2px 6px;
    border-radius: 7px;
    transition: color .22s, background .22s;
}

.xhg-cmt-foot button:hover {
    color: var(--xhg-brand);
    background: rgba(47, 94, 136, .1);
}

.xhg-cmt-foot button.on {
    color: var(--xhg-brand);
    font-weight: 600;
}

.xhg-cmt-empty {
    padding: 34px 0;
    text-align: center;
    color: var(--xhg-ink-3);
    font-size: 13px;
}

/* 仪表盘折线图 */
.xhg-chart-wrap {
    position: relative;
    height: 290px;
    padding: 4px 2px 0;
}

.xhg-chart-foot {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--xhg-glass-line);
    font-size: 12.5px;
    color: var(--xhg-ink-3);
    text-align: right;
}

.xhg-chart-foot b {
    color: var(--xhg-brand);
    font-size: 14px;
    margin: 0 2px;
}

/* =========================================================
   协议勾选 / 绑定提醒 / 绑定卡片 / 等级卡片 / 更新日志
   ========================================================= */
.xhg-agree-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
}

.xhg-check {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    cursor: pointer;
}

.xhg-check input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.xhg-check span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--xhg-field-line);
    background: rgba(255, 255, 255, .7);
    transition: background .22s, border-color .22s, transform .3s var(--xhg-spring);
}

.xhg-check input:checked + span {
    background: var(--xhg-brand);
    border-color: var(--xhg-brand);
}

.xhg-check input:checked + span::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2.5px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.xhg-check input:active + span {
    transform: scale(.94);
}

.xhg-agree-text {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--xhg-ink-2);
}

.xhg-agree-text a {
    color: var(--xhg-brand);
    font-weight: 600;
}

/* 绑定提醒条 */
.xhg-bind-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    color: #92400e;
    background: rgba(251, 191, 36, .16);
    border: 1px solid rgba(251, 191, 36, .38);
}

.xhg-bind-tip .fa {
    font-size: 16px;
}

/* 绑定卡片 */
.xhg-bind-box {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .5);
    margin-bottom: 12px;
}

.xhg-bind-box .bb-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.xhg-bind-box .bb-head .fa {
    color: var(--xhg-brand);
    font-size: 15px;
}

/* 协议正文 */
.xhg-agreement {
    font-size: 13.5px;
    line-height: 1.95;
    color: var(--xhg-ink-2);
}

.xhg-agreement .ag-h {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--xhg-ink);
    margin: 20px 0 6px;
}

.xhg-agreement .ag-h:first-child {
    margin-top: 0;
}

.xhg-agreement .ag-p {
    margin: 0 0 6px;
}

/* 等级卡片 */
.xhg-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.xhg-level-card {
    padding: 16px 18px;
    border-radius: var(--xhg-r);
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .55);
    transition: transform .34s var(--xhg-spring), box-shadow .3s;
}

.xhg-level-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--xhg-shadow);
}

.xhg-level-card .lv-head {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

.xhg-level-card ul {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--xhg-ink-2);
}

.xhg-level-card .lv-mine {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--xhg-brand);
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid var(--xhg-glass-line);
}

.xhg-level-card .lv-mine.muted {
    color: var(--xhg-ink-3);
    font-weight: 400;
}

.xhg-level-card.mine {
    background: rgba(47, 94, 136, .06);
}

/* 更新日志 */
.xhg-log-item {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .5);
    margin-bottom: 10px;
}

.xhg-log-item .lg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.xhg-log-item .lg-body {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.85;
    color: var(--xhg-ink-2);
    word-break: break-word;
}

/* 个人主页资料行 */
.xhg-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--xhg-glass-line);
    font-size: 13px;
}

.xhg-info-row:last-child {
    border-bottom: 0;
}

.xhg-info-row span {
    color: var(--xhg-ink-3);
}

.xhg-info-row b {
    color: var(--xhg-ink);
    text-align: right;
    word-break: break-all;
}

/* =========================================================
   第 7 轮 · 设计统一层
   目标：
     1. 按钮尺寸全部对齐（不再有大有小）
     2. 开关统一为 44×26，滑块行程一致
     3. 深色模式覆盖到模板自带组件（不再「有的变有的不变」）
     4. 收敛多余的发光与渐变
   本段追加在文件末尾，同优先级下优先生效。
   ========================================================= */

/* ---------------- 1. 按钮：统一尺寸与质感 ---------------- */
.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: var(--xhg-r-sm);
    border-width: 1px;
    border-style: solid;
    vertical-align: middle;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease,
    box-shadow .22s ease, transform .22s var(--xhg-spring);
}

.btn:active {
    transform: scale(.985);
}

.btn .fa,
.btn .far,
.btn .fas,
.btn .fab,
.btn .si {
    font-size: 1em;
    line-height: 1;
    margin: 0 !important;
}

/* 纯图标按钮做成正方形，避免又扁又长
   注意：类名由 glass.js 的 markIconButtons() 打上。
   不能用 :has(> i:only-child) —— 它不看文本节点，
   带文字的按钮（<i></i>后台管理）会被误判成图标按钮。 */
.btn.xhg-icon-btn {
    width: 38px;
    min-width: 38px;
    padding: 0;
}

.btn-sm {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 9px;
    gap: 5px;
}

.btn-sm.xhg-icon-btn {
    width: 32px;
    min-width: 32px;
    padding: 0;
}

.btn-lg {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 14.5px;
    border-radius: 11px;
}

/* input-group 里的按钮跟输入框等高，不能各按自己的 min-height 撑 */
.input-group > .btn {
    min-height: 0;
    align-self: stretch;
    border-radius: 0 var(--xhg-r-sm) var(--xhg-r-sm) 0;
}

.input-group > .btn:first-child {
    border-radius: var(--xhg-r-sm) 0 0 var(--xhg-r-sm);
}

.input-group > .form-control:first-child,
.input-group > .form-select:first-child {
    border-radius: var(--xhg-r-sm) 0 0 var(--xhg-r-sm);
}

.input-group > .form-control:last-child,
.input-group > .form-select:last-child {
    border-radius: 0 var(--xhg-r-sm) var(--xhg-r-sm) 0;
}

/* 主色按钮：实心钢蓝 */
.btn-alt-primary,
.btn-primary,
.btn-alt-info,
.btn-info {
    background: var(--xhg-brand) !important;
    border-color: var(--xhg-brand) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(47, 94, 136, .2) !important;
}

.btn-alt-primary:hover,
.btn-primary:hover,
.btn-alt-info:hover,
.btn-info:hover {
    background: #356a99 !important;
    border-color: #356a99 !important;
    box-shadow: 0 4px 14px rgba(47, 94, 136, .28) !important;
}

/* 中性按钮：半透明玻璃底 */
.btn-alt-secondary,
.btn-secondary {
    background: rgba(255, 255, 255, .68) !important;
    border-color: var(--xhg-field-line) !important;
    color: var(--xhg-ink-2) !important;
    box-shadow: none !important;
}

.btn-alt-secondary:hover,
.btn-secondary:hover {
    background: rgba(255, 255, 255, .96) !important;
    border-color: rgba(47, 94, 136, .36) !important;
    color: var(--xhg-ink) !important;
}

/* 语义按钮：浅底软色，比满色实心更贴玻璃面板 */
.btn-alt-danger {
    background: rgba(198, 68, 68, .1) !important;
    border-color: rgba(198, 68, 68, .3) !important;
    color: #b23c3c !important;
    box-shadow: none !important;
}

.btn-alt-danger:hover {
    background: rgba(198, 68, 68, .18) !important;
    border-color: rgba(198, 68, 68, .46) !important;
    color: #9c2f2f !important;
}

.btn-alt-success,
.btn-success {
    background: rgba(47, 128, 80, .12) !important;
    border-color: rgba(47, 128, 80, .3) !important;
    color: #2b7a4b !important;
    box-shadow: none !important;
}

.btn-alt-warning,
.btn-warning {
    background: rgba(178, 124, 30, .13) !important;
    border-color: rgba(178, 124, 30, .32) !important;
    color: #97671a !important;
    box-shadow: none !important;
}

/* ---------------- 2. 开关：统一 44×26 ---------------- */
.xhg-switch .track,
.xhg-theme-toggle .xhg-switch .track {
    width: 44px !important;
    height: 26px !important;
    border-radius: 13px !important;
    background: rgba(122, 132, 146, .34) !important;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, .16) !important;
}

.xhg-switch .dot {
    top: 3px !important;
    left: 3px !important;
    width: 20px !important;
    height: 20px !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .3) !important;
    transition: transform .3s cubic-bezier(.3, 1.1, .4, 1) !important;
}

.xhg-switch.on .dot {
    transform: translateX(18px) !important;
}

.xhg-switch.on .track {
    background: var(--xhg-brand) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .14) !important;
}

.xhg-switch .label {
    font-size: 12.5px;
}

/* 主题开关本体 */
.xhg-theme-toggle {
    min-height: 32px;
    height: 32px;
    padding: 0 10px 0 12px;
    gap: 8px;
    border-radius: 9px;
    font-size: 12.5px;
    background: rgba(255, 255, 255, .68);
    border: 1px solid var(--xhg-field-line);
    color: var(--xhg-ink-2);
}

/* ---------------- 3. 波纹：小一圈，淡一点 ---------------- */
.xhg-ripple {
    background: rgba(255, 255, 255, .2) !important;
    animation-duration: .5s !important;
}

.btn-alt-secondary .xhg-ripple,
.btn-secondary .xhg-ripple,
.btn-alt-primary .xhg-ripple,
.btn-primary .xhg-ripple,
.btn-alt-info .xhg-ripple,
.btn-alt-danger .xhg-ripple,
.btn-alt-success .xhg-ripple,
.btn-alt-warning .xhg-ripple {
    background: rgba(47, 94, 136, .1) !important;
}

/* ---------------- 4. 收敛多余的发光 ---------------- */
.xhg-balance-card {
    background: linear-gradient(140deg, #2b5578, #37688f 60%, #40739c) !important;
    border-color: rgba(255, 255, 255, .22) !important;
    box-shadow: 0 14px 32px rgba(43, 85, 120, .24) !important;
}

.xhg-auth-brand {
    background: linear-gradient(155deg, #2b5578, #37688f 55%, #42749d) !important;
    box-shadow: 0 16px 40px rgba(43, 85, 120, .22) !important;
}

.xhg-api-card:hover {
    border-color: rgba(47, 94, 136, .34) !important;
}

.xhg-chip.paid {
    background: rgba(47, 94, 136, .12) !important;
}

/* =========================================================
   友情链接条
   ========================================================= */
.xhg-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.xhg-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9px;
    border: 1px solid var(--xhg-glass-line);
    background: rgba(255, 255, 255, .5);
    color: var(--xhg-ink-2);
    font-size: 12.5px;
    text-decoration: none;
    transition: background .22s, border-color .22s, color .22s, transform .24s var(--xhg-spring);
}

.xhg-link-item:hover {
    background: rgba(255, 255, 255, .92);
    border-color: rgba(47, 94, 136, .34);
    color: var(--xhg-ink);
    transform: translateY(-1px);
}

.xhg-links .xhg-link-empty {
    font-size: 12.5px;
    color: var(--xhg-ink-3);
}

/* 标签栏：之前底色和面板太接近，选中的那个不够明显 */
.xhg-tabs {
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(120, 132, 148, .16);
    border: 1px solid rgba(120, 132, 148, .14);
}

.xhg-tabs .tab {
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13px;
    color: var(--xhg-ink-3);
    white-space: nowrap;
}

.xhg-tabs .tab:hover {
    color: var(--xhg-ink-2);
}

.xhg-tabs .tab.active {
    background: #fff;
    color: var(--xhg-brand);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(24, 35, 48, .12);
}

/* 标签多的时候（会员中心现在有 8 个）允许换行，不要挤成一条 */
.xhg-tabs {
    flex-wrap: wrap;
}

.xhg-tabs .tab {
    flex: 1 1 auto;
    min-width: 88px;
}

/* =========================================================
   加载遮罩（替代 layui layer.load）
   ========================================================= */
.xhg-loading {
    position: fixed;
    left: 50%;
    top: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 0 0 12px 12px;
    background: var(--xhg-glass-strong);
    -webkit-backdrop-filter: var(--xhg-blur);
    backdrop-filter: var(--xhg-blur);
    border: 1px solid var(--xhg-glass-line);
    border-top: 0;
    box-shadow: var(--xhg-shadow-lg);
    font-size: 13px;
    color: var(--xhg-ink-2);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -110%);
    transition: opacity .24s ease, transform .32s var(--xhg-spring), visibility .24s;
    pointer-events: none;
}

.xhg-loading.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.xhg-loading-spin {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(47, 94, 136, .25);
    border-top-color: var(--xhg-brand);
    animation: xhgSpin .7s linear infinite;
}

@keyframes xhgSpin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   请求失败详情弹窗
   ========================================================= */
.xhg-err-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--xhg-glass-line);
    font-size: 12.5px;
}

.xhg-err-row span {
    color: var(--xhg-ink-3);
    flex: 0 0 auto;
}

.xhg-err-row b {
    color: var(--xhg-ink);
    text-align: right;
    word-break: break-all;
    font-weight: 600;
}

.xhg-err-hint {
    margin-top: 10px;
    padding: 10px 13px;
    border-radius: 10px;
    background: rgba(198, 68, 68, .08);
    border: 1px solid rgba(198, 68, 68, .22);
    font-size: 12.5px;
    line-height: 1.7;
    color: #b23c3c;
}

/* =========================================================
   第 8 轮 · Logo / 按钮统一 / 深色补偿
   ========================================================= */

/* ---------------- 1. Logo ---------------- */
.xhg-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
}

.xhg-logo-img {
    height: 30px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

/* 后台侧边栏收起时的小图标 */
.xhg-logo-img.xhg-logo-inline {
    height: 22px;
    width: 22px;
    max-width: 22px;
    object-fit: cover;
    border-radius: 6px;
    vertical-align: middle;
}

/* 会员中心登录页左侧品牌行里的图标 */
.brand-mark .xhg-logo-img.xhg-logo-inline {
    margin-right: 8px;
}

/* 后台侧边栏收起 / 展开两态 */
.smini-visible.xhg-logo-img {
    height: 26px;
    width: 26px;
    max-width: 26px;
    object-fit: cover;
    border-radius: 7px;
}

@media (max-width: 575.98px) {
    .xhg-logo-img {
        height: 24px;
        max-width: 150px;
    }
}

/* ---------------- 2. 按钮统一美化 ---------------- */
.btn {
    letter-spacing: .2px;
}

/* 键盘聚焦要看得见（鼠标点击不出现白框） */
.btn:focus {
    box-shadow: none;
    outline: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 94, 136, .28) !important;
}

/* 禁用态统一：变淡 + 不允许悬停位移 */
.btn:disabled,
.btn.disabled {
    opacity: .5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    filter: grayscale(.25);
}

.btn.w-100,
.btn-block {
    width: 100%;
    justify-content: center;
}

/* 弹窗底部的按钮：统一最小宽度，避免一个宽一个窄 */
.xhg-dialog-foot .btn {
    min-width: 88px;
}

/* 表格里的操作按钮排布一致 */
.table .btn + .btn {
    margin-left: 6px !important;
}

/* link 型按钮 */
.btn-link {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--xhg-brand) !important;
    padding-left: 6px;
    padding-right: 6px;
}

.btn-link:hover {
    text-decoration: underline;
    background: transparent !important;
}

/* ---------------- 3. 深色模式补偿 ---------------- */

/*
 * color-scheme 是最省事也最彻底的一招：
 * 它让浏览器用深色渲染「原生控件」—— select 弹出的选项列表、
 * 滚动条、日期选择器、自动填充背景。之前 select 的选项在深色下
 * 依旧是白底黑字，怎么用 CSS 覆盖都不稳，就是因为缺这个。
 */
html {
    color-scheme: light;
}

/* 顶部进度条换成品牌色 */
#nprogress .bar {
    background: var(--xhg-brand) !important;
}

#nprogress .peg {
    box-shadow: 0 0 10px var(--xhg-brand), 0 0 5px var(--xhg-brand) !important;
}

#nprogress .spinner-icon {
    border-top-color: var(--xhg-brand) !important;
    border-left-color: var(--xhg-brand) !important;
}
