/* ===== 数字商品中控系统 后台样式 ===== */
:root {
    --sidebar-width: 220px;
    --sidebar-collapsed: 64px;
    --topbar-height: 50px;
    --brand: #2c6cf6;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; font-size: 14px; }

.app { min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 1030;
    transition: width .2s;
    overflow-y: auto;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-header span,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-parent .arrow,
.sidebar.collapsed .nav-children { display: none; }
.sidebar.collapsed .nav-link { text-align: center; }

.sidebar-header {
    height: var(--topbar-height);
    display: flex; align-items: center; gap: 8px;
    padding: 0 16px;
    font-weight: 600; font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap; overflow: hidden;
}
.sidebar-header i { font-size: 20px; color: #6ea8fe; }

.sidebar-nav { padding: 8px 0; }
.sidebar-nav .nav-link {
    color: #c8d3e6;
    padding: 9px 16px;
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--brand); color: #fff; }
.sidebar-nav .nav-link i { font-size: 16px; width: 18px; text-align: center; }
.sidebar-nav .nav-parent .arrow { margin-left: auto; transition: transform .2s; font-size: 12px; }
.sidebar-nav .nav-group.open .arrow { transform: rotate(180deg); }
.nav-children {
    overflow: hidden; max-height: 0; transition: max-height .2s;
    background: rgba(0,0,0,.2);
}
.sidebar-nav .nav-group.open .nav-children { max-height: 400px; }
.nav-children .nav-link { padding-left: 44px; font-size: 13px; }

/* 主区域 */
.main { margin-left: var(--sidebar-width); transition: margin-left .2s; }
.main.expanded { margin-left: var(--sidebar-collapsed); }

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e8eaef;
    position: sticky; top: 0; z-index: 1020;
}
.content { min-height: calc(100vh - var(--topbar-height)); }

/* 卡片 */
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-radius: 6px; }
.card-header { background: #fff; border-bottom: 1px solid #f0f2f5; font-weight: 600; }

.stat-card { border-left: 3px solid var(--brand); transition: box-shadow .2s; }
.stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.stat-card .stat-value { font-size: 22px; font-weight: 600; color: #1f2937; }
.stat-card .stat-label { color: #6b7280; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.stat-card .stat-value-big { font-size: 26px; font-weight: 700; color: #1f2937; margin: 8px 0 4px; letter-spacing: -0.5px; }
.stat-card .stat-sub { font-size: 12px; color: #9ca3af; }
.stat-card .stat-tag { font-size: 11px; color: #9ca3af; background: #f3f4f6; padding: 1px 6px; border-radius: 3px; }
.stat-card .stat-pct { font-size: 13px; font-weight: 600; color: #6b7280; }
.stat-card .stat-sep { color: #d1d5db; margin: 0 2px; font-weight: 400; }

/* 卡片左边框配色 */
.stat-balance { border-left-color: #2c6cf6; }
.stat-recharge { border-left-color: #f59e0b; }
.stat-consume { border-left-color: #8b5cf6; }
.stat-orders { border-left-color: #2c6cf6; }
.stat-charging { border-left-color: #f59e0b; }
.stat-success { border-left-color: #28c76f; }
.stat-fail { border-left-color: #ea5455; }
.stat-rate { border-left-color: #28c76f; }

/* 业务指标监控卡片(正常绿,超阈值红) */
.stat-metric-ok { border-left-color: #28c76f; }
.stat-metric-over { border-left-color: #ea5455; background: #fff5f5; }
.stat-metric-over .stat-value-big { color: #ea5455; }

.table th { background: #fafbfc; font-weight: 600; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f7f9fc; }

/* 搜索表单 */
.search-bar { background: #fff; padding: 12px; border-radius: 6px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.search-bar .form-control, .search-bar .form-select { max-width: 200px; display: inline-block; }

.badge { font-weight: 500; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2c6cf6 0%, #1e3a8a 100%); }
.login-card { width: 380px; background: #fff; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.2); padding: 32px; }
.login-card h4 { text-align: center; margin-bottom: 24px; color: #1f2937; }

.required::before { content: "*"; color: #dc3545; margin-right: 2px; }

.view-detail { background: #f7f9fc; padding: 10px; border-radius: 4px; }
.view-detail dt { color: #6b7280; font-weight: 500; }
