/* 全局自定义样式 */

body {
    background-color: #f5f6fa;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* 数字等宽(价格/属性等列上下对齐) */
.num, .text-end, .price {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}
/* 藏宝阁风格:价格红色加粗 */
.price { color: #f5222d; font-weight: 600; }

/* 交易表格:数据默认居中,装备列左对齐 */
#tradeBody td { text-align: center; vertical-align: middle; }
#tradeBody td.equip-cell { text-align: left; }

/* 防闪屏：主内容在侧边栏渲染前隐藏(独立页如登录/改密页除外,它们没有侧边栏) */
body:not(.has-sidebar):not(.standalone-page) > .container-fluid,
body:not(.has-sidebar):not(.standalone-page) > .container,
body:not(.has-sidebar):not(.standalone-page) > main {
    visibility: hidden;
}
/* 侧边栏渲染完成后恢复显示，加过渡更平滑 */
body.has-sidebar > .container-fluid,
body.has-sidebar > .container,
body.has-sidebar > main {
    visibility: visible;
}

/* 首页模块卡片 */
.module-card {
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.module-card.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.module-card.disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 首页统计迷你卡片 */
.stat-mini {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 8px;
}
.stat-mini-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 2px;
}
.stat-mini-val {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.2;
}

/* 首页待办提醒 */
.todo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.todo-item:hover { background: #f0f4ff; }
.todo-item:last-child { margin-bottom: 0; }
.todo-info { border-left: 3px solid #3b82f6; background: #eff6ff; }
.todo-warning { border-left: 3px solid #f59e0b; background: #fffbeb; }
.todo-danger { border-left: 3px solid #ef4444; background: #fef2f2; }
.todo-action { color: #3b82f6; font-size: 0.78rem; white-space: nowrap; }

/* 对比表格分数徽标 */
.score-badge {
    font-size: 1rem;
    min-width: 3rem;
}

/* 表格操作按钮 */
.table .btn-sm {
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
}

/* ==================== 经典后台布局：左侧边栏 + 白色顶部栏 ==================== */

.admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 195px;
    background: #16181e;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}
.side-brand {
    color: #fff;
    font-size: 0.95rem;
    font-weight: bold;
    padding: 14px 12px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.side-badge {
    font-size: 0.62rem;
    font-weight: normal;
    color: #7ee0a3;
    border: 1px solid #2c4a3b;
    background: rgba(46, 160, 67, 0.15);
    border-radius: 3px;
    padding: 1px 4px;
}
.side-action {
    padding: 2px 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.side-menu {
    padding: 6px 0;
}
.side-link {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 9px 10px;
    font-size: 0.86rem;
    transition: all 0.15s;
}
.side-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.side-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.35);
}

/* 可展开主菜单（含子菜单） */
.side-group {
    margin: 0;
}
.side-link-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}
.side-link-parent .side-caret {
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.side-group.submenu-collapsed .side-caret {
    transform: rotate(-90deg);
}
.side-submenu {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
}
.side-group.submenu-collapsed .side-submenu {
    max-height: 0;
}
.side-link-sub {
    text-align: center;
    font-size: 0.8rem;
    padding: 7px 10px 7px 22px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
}
.side-link-sub::before {
    content: '└';
    position: absolute;
    left: 10px;
    opacity: 0.4;
}
.side-group.parent-active > .side-link-parent {
    color: #fff;
}
.side-group.parent-active > .side-link-parent .side-caret {
    color: #60a5fa;
}

/* 侧边栏工具区 */
.side-tools {
    flex: 1;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.side-sec-title {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    text-align: center;
    padding: 8px 0 4px;
}
.side-widget {
    margin: 6px 10px;
    padding: 8px 10px;
    background: #1c2230;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.65);
}
.wg-head2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    margin-bottom: 8px;
}
.wg-link { color: #6ea8fe; text-decoration: none; font-size: 0.72rem; }
.wg-link:hover { color: #9ec5fe; }
.wg-clear { color: #7ee0a3; text-decoration: none; font-size: 0.74rem; }
.wg-clear:hover { color: #a5ebc0; }
.wg-date { color: rgba(255, 255, 255, 0.45); font-size: 0.7rem; }

/* 日/月数据的日期选择器：显示文字+图标，透明input覆盖，点击任意处弹日历 */
.wg-date-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
}
.wg-date-wrap:hover { border-color: #3b82f6; }
.wg-date-text {
    color: #fff;
    font-size: 0.72rem;
}
.wg-date-icon { font-size: 0.7rem; opacity: 0.7; }
.wg-date-input {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    color-scheme: dark;
}
/* 隐藏input自带的日历图标，用我们自己的 */
.wg-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    margin: 0;
    cursor: pointer;
}
.wg-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 4px;
}
.wg-label { flex-shrink: 0; }
.wg-row b { color: #fff; font-size: 0.74rem; }
.wg-input {
    width: 70px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    color: #fff;
    font-size: 0.74rem;
    padding: 2px 5px;
    outline: none;
}
.wg-input:focus { border-color: #3b82f6; }
.wg-server-select { width: 100%; padding: 3px 5px; cursor: pointer; }
.wg-server-select option { color: #000; }

/* 交易计算器：标签行 + 数值行 */
.wg-grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3px;
    margin-bottom: 2px;
}
.wg-labels span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    text-align: center;
    display: block;
}
.wg-val {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.82rem;
    font-weight: bold;
    text-align: center;
    padding: 2px 0;
    outline: none;
}
.wg-val:focus { border-bottom-color: #3b82f6; }
.wg-total {
    text-align: center;
    color: #7ee0a3;
    font-size: 0.85rem;
    margin-top: 6px;
}
.wg-total b { font-size: 1rem; }

/* 日/月数据：大数字小单位 */
.wg-stats2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 4px;
}
.wg-stat { text-align: center; overflow: hidden; min-width: 0; }
.wg-stat-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wg-stat-val b {
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    word-break: break-all;
}
.wg-stat-val span {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.68rem;
}

/* 白色顶部栏 */
.admin-topbar {
    position: fixed;
    top: 0; left: 195px; right: 0;
    height: 54px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1030;
}
.topbar-notice {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 桌面端：内容区给侧边栏和顶部栏让位 */
@media (min-width: 768px) {
    body.has-sidebar {
        padding-left: 195px;
        padding-top: 54px;
    }
}

/* 移动端：侧边栏默认隐藏，汉堡按钮展开 */
.mobile-topbar, .side-backdrop { display: none; }

@media (max-width: 767.98px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #16181e;
        color: #fff;
        padding: 10px 14px;
    }
    .admin-topbar {
        display: none;
    }
    .admin-sidebar {
        left: -195px;
        transition: left 0.2s;
    }
    .admin-sidebar.show {
        left: 0;
    }
    .side-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
    }
}
