@charset "UTF-8";
/**
 * APP 运营后台样式（Bootstrap 5 定制皮肤）
 * - 基础组件（btn / card / table / badge / alert / form / pagination / dropdown）全部使用 Bootstrap 5
 * - 本文件只负责：品牌色、后台骨架布局（侧边栏 / 顶栏 / 内容区）、统计卡片、图表容器、登录页、响应式细节
 */

/* ============ 品牌色（覆盖 Bootstrap CSS 变量，全局生效） ============ */
:root {
    --bs-primary: #2979ff;
    --bs-primary-rgb: 41, 121, 255;
    --bs-link-color: #2979ff;
    --bs-link-color-rgb: 41, 121, 255;
    --bs-link-hover-color: #1c60d8;
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --admin-sidebar-width: 232px;
    --admin-topbar-height: 56px;
}

body {
    background-color: #f2f4f8;
    font-size: 14px;
}

.btn-primary {
    --bs-btn-bg: #2979ff;
    --bs-btn-border-color: #2979ff;
    --bs-btn-hover-bg: #1c66e0;
    --bs-btn-hover-border-color: #1c66e0;
    --bs-btn-active-bg: #195bc9;
    --bs-btn-active-border-color: #195bc9;
    --bs-btn-disabled-bg: #2979ff;
    --bs-btn-disabled-border-color: #2979ff;
    --bs-btn-focus-shadow-rgb: 41, 121, 255;
}

.btn-outline-primary {
    --bs-btn-color: #2979ff;
    --bs-btn-border-color: #2979ff;
    --bs-btn-hover-bg: #2979ff;
    --bs-btn-hover-border-color: #2979ff;
    --bs-btn-active-bg: #1c66e0;
    --bs-btn-active-border-color: #1c66e0;
    --bs-btn-focus-shadow-rgb: 41, 121, 255;
}

/* 卡片统一轻量化 */
.card {
    --bs-card-border-color: #e6e9f0;
    --bs-card-border-radius: 10px;
    --bs-card-cap-bg: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 0;
}

/* ============ 骨架布局 ============ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 侧边栏 */
.admin-side {
    --bs-offcanvas-width: 240px;
    background: #fff;
    border-right: 1px solid #e6e9f0;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--admin-topbar-height);
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2d3d;
    border-bottom: 1px solid #eef1f6;
    white-space: nowrap;
}

.admin-logo i {
    color: #2979ff;
    font-size: 18px;
}

.admin-menu {
    padding: 8px 0 16px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.menu-group {
    padding: 12px 16px 6px;
    font-size: 12px;
    color: #98a2b3;
    letter-spacing: .5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 8px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #475467;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.menu-item i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    color: #98a2b3;
    transition: color .15s ease;
}

.menu-item:hover {
    background: #f2f6ff;
    color: #2979ff;
}

.menu-item:hover i {
    color: #2979ff;
}

.menu-item.active {
    background: #2979ff;
    color: #fff;
    font-weight: 500;
}

.menu-item.active i {
    color: #fff;
}

/* 顶栏 */
.admin-top {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--admin-topbar-height);
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e6e9f0;
}

.top-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2d3d;
}

.min-w-0 {
    min-width: 0;
}

/* 内容区 */
.admin-body {
    flex: 1 1 auto;
    padding: 16px;
    min-width: 0;
}

/* ============ 统计卡片 ============ */
.stat-card .stat-label {
    font-size: 13px;
    color: #667085;
    margin-bottom: 6px;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    color: #1f2d3d;
    word-break: break-all;
}

.stat-card .stat-value small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #98a2b3;
    margin-top: 4px;
}

.stat-card .stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 18px;
    flex: 0 0 auto;
}

/* ============ 图表容器 ============ */
.chart-box {
    width: 100%;
    height: 320px;
}

.chart-box-sm {
    width: 100%;
    height: 240px;
}

/* ============ 表格辅助 ============ */
.table td,
.table th {
    vertical-align: middle;
    white-space: nowrap;
}

.table .cell-truncate {
    display: inline-block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.table .empty-row {
    text-align: center;
    color: #98a2b3;
    padding: 28px 0;
}

.table-responsive {
    border-radius: 0 0 10px 10px;
}

/* ============ 键值对（详情页） ============ */
.kv-row {
    display: flex;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed #eef1f6;
    font-size: 14px;
}

.kv-row:last-child {
    border-bottom: 0;
}

.kv-row .kv-k {
    flex: 0 0 130px;
    color: #667085;
}

.kv-row .kv-v {
    flex: 1 1 auto;
    min-width: 0;
    color: #1f2d3d;
    word-break: break-all;
}

/* ============ 加载遮罩（admin.js 动态创建） ============ */
.admin-loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .45);
}

/* ============ 登录页 ============ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #eef4ff 0%, #f7f9fc 55%, #eef7f4 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #1f2d3d;
}

.login-brand i {
    color: #2979ff;
    font-size: 24px;
}

.login-sub {
    text-align: center;
    color: #98a2b3;
    font-size: 13px;
    margin-top: 6px;
}

.login-foot {
    text-align: center;
    color: #98a2b3;
    font-size: 12px;
    margin-top: 16px;
}

/* ============ 响应式 ============ */
@media (min-width: 992px) {
    .admin-side {
        position: sticky;
        top: 0;
        height: 100vh;
        width: var(--admin-sidebar-width);
        flex: 0 0 var(--admin-sidebar-width);
        display: flex;
        flex-direction: column;
    }

    .admin-body {
        padding: 20px 24px;
    }
}

@media (max-width: 991.98px) {
    .admin-side {
        display: flex;
        flex-direction: column;
    }

    .admin-body {
        padding: 12px;
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .chart-box,
    .chart-box-sm {
        height: 240px;
    }

    /* 移动端表格紧凑化，仍保留横向滚动 */
    .table > :not(caption) > * > * {
        padding: 6px 8px;
        font-size: 13px;
    }

    .kv-row {
        flex-direction: column;
        gap: 2px;
    }

    .kv-row .kv-k {
        flex: 0 0 auto;
    }
}
