/* ============================================================
 * skin-shadcn v15 = v14 + bk 实际 aside 类名 + header 对齐 main
 *
 * v14 的错误: CSS 用了 v9 源码的 .user-center-aside / .aside-logo / .nav-item
 *   但 bk 的实际类是 .ba-user-layouts / .userinfo / .user-menu-item
 *   所以 v14 的 aside CSS 完全没有生效
 *
 * v15 修正:
 *   1. aside 改用 bk 实际类名 (CSS 选择器覆盖)
 *   2. aside 改 fixed top-left, 260px, full height
 *   3. header 推到右边对齐 main
 *   4. aside 内容样式完全照 v9 aside-logo / aside-nav
 * ============================================================ */

/* ============ :root --secu-* 变量定义 ============ */
:root {
    --secu-bg: #ffffff;
    --secu-bg-page: #fff;
    --secu-bg-overlay: #ffffff;
    --secu-bg-subtle: #f6f6f6;
    --secu-bg-muted: #eeeeee;
    --secu-fg: #303133;
    --secu-fg-muted: #606266;
    --secu-fg-subtle: #909399;
    --secu-fg-disabled: #c0c4cc;
    --secu-border: #ebeef5;
    --secu-border-strong: #dcdfe6;
    --secu-input: #dcdfe6;
    --secu-ring: #3f6ad8;
    --secu-primary: #3f6ad8;
    --secu-primary-hover: #3458b8;
    --secu-primary-active: #2a4a9c;
    --secu-primary-fg: #ffffff;
    --secu-primary-soft: #ecf1fb;
    --secu-primary-softer: #f3f6fc;
    --secu-success: #67c23a;
    --secu-success-soft: #f0f9eb;
    --secu-warning: #e6a23c;
    --secu-warning-soft: #fdf6ec;
    --secu-danger: #f56c6c;
    --secu-danger-soft: #fef0f0;
    --secu-info: #909399;
    --secu-info-soft: #f4f4f5;
    --secu-radius-sm: 6px;
    --secu-radius: 8px;
    --secu-radius-lg: 10px;
    --ba-bg-color: #fff;
    --el-fill-color-blank: #fff;
}

/* ============ v12 的 7 项 CSS (字符级保留) ============ */

/* 1. 取消所有 user-avatar / header-user-avatar */
img.header-user-avatar,
img.icon-header-user-avatar,
.user-avatar img,
img.new-user-avatar {
    display: none !important;
}
.user-avatar,
.user-avatar-icons {
    display: none !important;
}

/* 2. .el-col-23 全屏 */
.el-col-23 {
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* 3. footer 恢复 - 仅隐藏两个特定 selector (恢复其他位置 footer) */
section.el-container > footer.el-footer {
    display: none !important;
}
div.el-scrollbar__view > footer.el-footer {
    display: none !important;
}

/* 4. .bubble 背景图 */
.bubble[data-v-d2a5dd0b] {
    background: none !important;
    background-image: none !important;
    background-repeat: no-repeat !important;
}

/* 5. aside height: 100% */
aside.el-aside,
.el-aside {
    height: 100% !important;
}

/* 6. el-divider margin */
.el-divider--horizontal {
    margin: 6px 0 !important;
}

/* 7. /user 排版按 v9 - 见下方 */

/* ============ v9 源码 default.vue layout CSS (v14 保留) ============ */
.is-user-center {
    min-height: 100vh !important;
}
.frontend-footer-brother {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}
.user-layouts {
    display: flex !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}
@media screen and (max-width: 768px) {
    .user-layouts {
        flex-direction: column !important;
    }
}

/* ============ v15 新增: header 对齐 main + aside 顶到顶部 ============
 *
 * bk 的真实结构:
 *   el-container.is-vertical (flex column)
 *   ├── el-header.header            ← 顶栏 (full-width)
 *   ├── el-scrollbar
 *   │   └── el-row.frontend-footer-brother
 *   │       └── el-col.user-layouts (flex row, span:23)
 *   │           ├── el-aside.ba-user-layouts ← aside
 *   │           └── el-main.layout-main      ← main
 *   └── el-footer (removed)
 *
 * 目标布局:
 *   ┌──────────┬──────────────────────────┐
 *   │          │   el-header.header       │ ← 对齐 main
 *   │   ASIDE  ├──────────────────────────┤
 *   │  260px   │                          │
 *   │  fixed   │   main.layout-main       │
 *   │  left:0  │   (router-view)          │
 *   │  top:0   │                          │
 *   │  full-h  │                          │
 *   └──────────┴──────────────────────────┘
 */

/* aside: fixed top-left, 260px wide, full height */
.ba-user-layouts {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--secu-bg-overlay) !important;
    border-right: 1px solid var(--secu-border) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 100 !important;
    flex-shrink: 0 !important;
}

/* header: 推到右边对齐 main */
.el-container.is-vertical > .header.el-header,
.el-container.is-vertical > header.el-header.header,
header.el-header.header {
    margin-left: 275px !important;
    padding-left: 0 !important;
    margin-bottom: 13px !important;
    border-bottom: 1px solid var(--secu-border) !important;
}

/* main 内容区: 推到右边对齐 header */
.el-container.is-vertical > .el-scrollbar {
    margin-left: 260px !important;
}

/* row.user-layouts: 不要 center, 撑满 */
.el-row.frontend-footer-brother {
    justify-content: flex-start !important;
}
.el-col.user-layouts.el-col-23 {
    max-width: 100% !important;
    flex: 1 1 auto !important;
}


/* ============ v16 新增: header-logo 移到 aside 顶部 ============ */
/* bk 的 .header-logo 是 header 内的 logo (在 el-header.header 里)
 * 用户要求: div.header-logo 视觉上放到 <aside> 的最顶部
 * 做法: header-logo 用 absolute 定位到 aside 顶部, aside 顶部留 padding 让出空间 */

.ba-user-layouts {
    padding-top: 60px !important;  /* 给 .header-logo 在 aside 顶部留 60px 空间 */
}

/* 把 header-logo 定位到 aside 顶部 (与 main 顶部的 header 并排) */
.header-logo {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 260px !important;
    height: 60px !important;
    margin: 0 !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    background-color: var(--secu-bg-overlay) !important;
    border-bottom: 1px solid var(--secu-border) !important;
    border-right: 1px solid var(--secu-border) !important;
    z-index: 101 !important;
    cursor: pointer !important;
}

/* ============ v15 aside 内容: 严格按 v9 源码 aside.vue 样式 ============ */

/* .userinfo: 仿 v9 .aside-logo (顶部品牌区) */
.userinfo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 20px 20px 18px !important;
    cursor: pointer !important;
    border-bottom: 1px solid var(--secu-border) !important;
    flex-shrink: 0 !important;
    transition: background-color 0.15s ease !important;
    margin: 0 !important;
}
.userinfo:hover {
    background-color: var(--secu-bg-subtle) !important;
}

/* 隐藏 user-avatar-box (item 1 已隐藏, 这里再次确保) */
.user-avatar-box,
.user-avatar-box .icon {
    display: none !important;
}

/* .username: 仿 v9 .logo-title */
.username {
    flex: 1 !important;
    min-width: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--secu-fg) !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* .user-menus: 仿 v9 .aside-nav */
.user-menus {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 14px 12px 20px !important;
    margin: 0 !important;
}

/* .user-menu-max-title: 仿 v9 .nav-group-title */
.user-menu-max-title {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--secu-fg-subtle) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 14px 12px 6px !important;
    margin: 0 !important;
}

/* .user-menu-item: 仿 v9 .nav-item */
.user-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 12px !important;
    margin: 1px 0 !important;
    border-radius: var(--secu-radius-sm) !important;
    color: var(--secu-fg-muted) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    line-height: 1.2 !important;
}
.user-menu-item > span {
    flex: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.user-menu-item:hover {
    background-color: var(--secu-bg-subtle) !important;
    color: var(--secu-fg) !important;
}
.user-menu-item.active {
    background-color: var(--secu-primary-soft) !important;
    color: var(--secu-primary) !important;
    font-weight: 600 !important;
}
.user-menu-item.active .icon {
    color: var(--secu-primary) !important;
}

/* aside 内的滚动条样式 (shadcn 风格) */
.user-menus::-webkit-scrollbar {
    width: 6px !important;
}
.user-menus::-webkit-scrollbar-thumb {
    background: var(--secu-border-strong) !important;
    border-radius: 3px !important;
}

/* 移动端响应式 */
@media screen and (max-width: 991px) {
    .ba-user-layouts {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-height: 50vh !important;
        border-right: none !important;
        border-bottom: 1px solid var(--secu-border) !important;
    }
    header.el-header.header {
        margin-left: 0 !important;
    }
    .el-container.is-vertical > .el-scrollbar {
        margin-left: 0 !important;
    }
}

/* ============ v18 新增: dark mode 变量覆盖 ============
 * 同步源 SCSS 的 html.dark 设计 tokens,
 * 让 v18 新加元素 (.ba-user-layouts / .userinfo / .user-menus /
 *  .user-menu-item / .header-logo / header.el-header.header 等)
 * 在 div.switch 切换 dark mode 时正确反色
 */
html.dark {
    --secu-bg: #1d1e1f;
    --secu-bg-page: #141414;
    --secu-bg-overlay: #1d1e1f;
    --secu-bg-subtle: #262727;
    --secu-bg-muted: #2a2b2c;

    --secu-fg: #e5eaf3;
    --secu-fg-muted: #a3a6ad;
    --secu-fg-subtle: #82848a;
    --secu-fg-disabled: #58585b;

    --secu-border: #3d3e3f;
    --secu-border-strong: #58585b;
    --secu-input: #3d3e3f;
    --secu-ring: #6c8ce6;

    --secu-primary: #5a82e0;
    --secu-primary-hover: #6c8ce6;
    --secu-primary-active: #3f6ad8;
    --secu-primary-fg: #ffffff;
    --secu-primary-soft: rgba(63, 106, 216, 0.2);
    --secu-primary-softer: rgba(63, 106, 216, 0.1);

    --secu-success: #67c23a;
    --secu-success-soft: rgba(103, 194, 58, 0.15);
    --secu-warning: #e6a23c;
    --secu-warning-soft: rgba(230, 162, 60, 0.15);
    --secu-danger: #f78989;
    --secu-danger-soft: rgba(245, 108, 108, 0.15);
    --secu-info: #a6a9ad;
    --secu-info-soft: rgba(144, 147, 153, 0.15);

    --secu-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --secu-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
    --secu-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
    --secu-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --secu-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --ba-bg-color: #141414;
    --el-fill-color-blank: #141414;
}

/* ============ v18 新增: header 在 dark mode 下补背景 ============
 * v17 header 没有显式 bg, light mode 下默认是白色透明, 看不出来;
 * dark mode 下 el-header 默认仍是浅色, 会突兀.
 * 显式补一个 bg, 与 aside 颜色一致 */
header.el-header.header {
    background-color: var(--secu-bg-overlay) !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}
.ba-user-layouts {
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}
.userinfo,
.header-logo {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}
.user-menu-item {
    transition: background-color 0.15s ease, color 0.15s ease !important;
}



/* ============ v20 新增: /user/login 方框全屏水平+垂直居中 ============
 * 源 .login-box 默认 margin: 100px auto 只水平居中, 垂直写死 100px
 * 不同屏幕高度会贴顶/留白过多. 改为 flex 容器双向居中.
 */
.login {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
}
.login > .el-container.is-vertical {
    min-height: 100vh !important;
    width: 100% !important;
}
.login > .el-container.is-vertical > .el-main.frontend-footer-brother {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 0 !important;
}
.login .login-box {
    width: 460px !important;
    max-width: 100% !important;
    margin: auto !important;
    padding: 10px 60px 20px 60px !important;
    background-color: var(--secu-bg-overlay) !important;
    border-radius: var(--secu-radius-lg) !important;
    border: 1px solid var(--secu-border) !important;
    box-shadow: var(--secu-shadow-sm) !important;
}
@media screen and (max-width: 768px) {
    .login .login-box {
        width: calc(100vw - 32px) !important;
        margin: 0 auto !important;
        padding: 10px 24px 20px 24px !important;
    }
}



/* ============ v21 新增: .login-box 的上一级 DIV 全宽 (max-width:100%; flex:100%) ============
 * 源模板结构: <el-row><el-col :span="16" :xs="24"><div class="login-box">
 * 编译后 el-col 默认 max-width 16/24=66.7%, 限制 .login-box 居中范围.
 * 改为 max-width:100%; flex:100%, 让 el-col 占满父容器, 不再限制 .login-box.
 */
.login > .el-container.is-vertical > .el-main.frontend-footer-brother > .el-row > .el-col,
.login .el-col {
    max-width: 100% !important;
    flex: 0 0 100% !important;
    width: 100% !important;
}



/* ============ v22 新增: /user/login 全屏背景图 + 登录框毛玻璃 ============
 * 1. .login 加全屏背景图 (https://imgcdn.secupay.pro/logo.webp)
 *    background-size: cover 自适应所有屏, center 居中
 * 2. .login-box 加半透明毛玻璃效果
 *    backdrop-filter: blur(10px) 模糊背景图
 *    半透明 bg 让背景图透过来
 *    dark mode 用深色半透明
 */
.login {
    background-image: url('https://imgcdn.secupay.pro/logo.webp') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}
.login .login-box {
    background-color: rgba(255, 255, 255, 0.01) !important;
    backdrop-filter: blur(6px) saturate(500%) !important;
    transition: box-shadow 0.5s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06), 0 2px 100px rgba(0, 0, 0, 0.01) !important;
}
html.dark .login .login-box {
    background-color: rgba(20, 20, 20, 0.55) !important;
    backdrop-filter: blur(12px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}




/* ============ v28 新增: header/aside 边框改为 #f6f6f6 (v27 el-card 不动) ============
 * v27 基础上: header.el-header 和 aside.ba-user-layouts 的 border 颜色从 var(--el-card-border-color) 改为 #f6f6f6
 * 其余 (el-card 边框 + :hover 阴影) 完全保留
 */
.el-col > .el-card {
    border: 1px solid var(--el-card-border-color) !important;
}

/* ============ v36 新增: 同一行两个 el-col > el-card 顶/底对齐 ============
 * 屏幕截图显示 /user 端首页, 账户信息 (账户信息 + 通知) 两个卡片
 *   因为内容不同, 高度不同, 顶部和底部不对齐
 * v32 SCSS .is-user-center .el-row { display: flex; flex-wrap: wrap; }
 *   让 el-row 变 flex 容器, el-col 默认 align-items: stretch 会拉伸到最高
 *   但 el-card 在 el-col 里默认 height: auto, 不会填满 el-col
 * 修复: 给 el-col 内的 el-card 加 height: 100%, 让卡片填满 el-col 高度
 *   配合 flex row 的 stretch 行为, 两个卡片自动同高, 顶/底对齐
 */
div.el-col > div.el-card {
    height: 100% !important;
}
header.el-header:hover {
    box-shadow: var(--el-box-shadow-light);
}
aside.ba-user-layouts:hover {
    box-shadow: var(--el-box-shadow-light);
}



/* ============ v32 新增: /user 端所有 font-size 统一改为 11.5px (除 span.site-name) ============
 * 关键修复: v31 用 .is-user-center 作 scope 失败 — 因为 .is-user-center 只在 default layout (登录后),
 *          disable 布局 + login 页都没有这个类, 所以 v31 没生效.
 *
 * v32 改用 .frontend-footer-brother 作 scope:
 *   - 这个类只在 /user 端使用 (default.vue + disable.vue + login.vue)
 *   - /admin 完全不用这个类 (admin 用 .layout-container / .content-wrapper)
 *   - 3 个 /user 端场景全覆盖:
 *     1. default.vue (登录后, 居中 layout)
 *     2. disable.vue (登录前 / 禁用状态, 居中)
 *     3. login.vue (登录页, el-main 上有 .frontend-footer-brother)
 *
 * 效果: 整个 /user 端所有文字 11.5px, 包括 Element Plus 组件 / 表格 / 按钮 / 表单等
 * 例外: span.site-name 内的文字保持原样 (项目级默认, Element Plus 14px)
 */
.frontend-footer-brother,
.frontend-footer-brother * {
    font-size: 11.5px !important;
}

/* 例外: span.site-name 内的文字保持原样 (项目级默认值) */
.frontend-footer-brother span.site-name,
.frontend-footer-brother span.site-name * {
    font-size: revert !important;
}


/* ============ v35 新增: !important 强制 body/html/#app 底色 ============
 * v34 失败原因: 主 CSS chunk style-ewW5PYAM.css 在加载顺序中位于
 *   skin-shadcn.css 之后 (index.html 第 3 个 link), 并在 :root 里硬编码:
 *     :root { --ba-bg-color: #f5f5f5; ... }
 *     html.dark { --ba-bg-color: #141414; ... }
 *   v34 改的 --ba-bg-color: #fff 完全被主 chunk 覆盖, light mode 仍 #f5f5f5
 * 
 * v35 修复: 
 *   1. :root 块里同时覆盖 --el-fill-color-blank (Element Plus body 变量)
 *   2. html.dark 块里覆盖 --el-fill-color-blank 为 #141414
 *   3. 末尾追加 !important 规则, 直接强制 body/html/#app 底色
 *      !important 永远赢主 chunk 的非 !important 规则
 *      不管加载顺序, 也不管 :root 变量级联
 */
body, html, #app {
    background-color: #fff !important;
}
html.dark body, html.dark html, html.dark #app {
    background-color: #141414 !important;
}


/* ============ v37 fix: 给 div.el-card__body 增加滚动条 ============
 * 用户反馈: 当通知太多的时候 div.el-card__body 通知显示不全
 * 修复: 给 .el-card__body 加 overflow-y: auto, 内容超出时自动出现滚动条
 * 不影响内容不大时的外观, 不影响其它功能/皮肤/细节
 */
.el-card__body {
    overflow-y: auto;
}


/* ============ v37-fix4: 给 div.el-card__body 增加滚动条 (强约束版) ============
 * 用户反馈 (v3 未生效): 当通知太多的时候 div.el-card__body 通知显示不全
 * 
 * 根因分析:
 *   - v3 只加了 overflow-y: auto, 但 .el-card__body 默认没有高度约束
 *   - 通知卡片实际是 src/views/frontend/user/account/overview.vue 里:
 *       <el-card class="box-card card-height">  -- Notice 通知卡
 *       .card-height { height: 260px; }        -- 固定高度, 内容超出时无滚动条
 *   - 只加 overflow-y 无法触发滚动条, 因为父级 el-card 没有溢出, 只有 body 内溢出
 *
 * v4 修复 (强约束版, 使用 !important):
 *   1. .el-card__body 强制 max-height: 70vh + overflow-y: auto (有 !important)
 *      - 内容小 (< 70vh) 时不影响外观, 自然展开
 *      - 内容大 (> 70vh) 时出现滚动条
 *   2. .card-height (通知卡固定高度) 的 body 也确保有滚动条
 *      - 高度 260px 不够放下所有通知时, body 内出现滚动条
 *      - 不会破坏卡片外壳 260px 高度
 *
 * 不影响其它外观/皮肤/细节, 不影响 /user/login 登录窗口
 */
.el-card__body {
    max-height: 70vh !important;
    overflow-y: auto !important;
}


/* ============ v37-url-feature: 通知超链接样式 (fix9) ============
 * 通知标题超链接: 去掉下划线, 跟随系统字体颜色, 圆角边框
 * 通知日期列: flex 右对齐
 * (双选择器确保命中: 带/不带 el-card__body 前缀都生效)
 */
div.el-card__body > div.notice-item > a.notice-link,
div.notice-item > a.notice-link {
    text-decoration: none !important;
    color: currentColor !important;
    border: 1px solid currentColor;
    padding: 10px;
    border-radius: 15px;
}
div.el-card__body > div.notice-item > div,
div.notice-item > div {
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
}
