:root {
    /* 国风配色 */
    --app-primary: #9F2222;
    --app-primary-dark: #7a1a1a;
    --app-primary-light: #b93a3a;
    --app-bg: #F8F5F0;
    --app-sidebar: #222222;
    --app-sidebar-hover: #333333;
    --app-surface: #FFFFFF;
    --app-text: #222222;
    --app-muted: #6b5e5e;

    /* 覆盖 Bootstrap 默认主题 */
    --bs-primary: #9F2222;
    --bs-primary-rgb: 159, 34, 34;
    --bs-primary-bg-subtle: #f5e6e6;
    --bs-primary-border-subtle: #e0b8b8;
    --bs-primary-text-emphasis: #7a1a1a;

    --bs-body-color: #222222;
    --bs-body-bg: #F8F5F0;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

/* ===== 导航栏 ===== */
.app-navbar {
    background: linear-gradient(90deg, var(--app-primary), var(--app-primary-dark));
}

/* ===== 侧边栏 ===== */
.app-sidebar {
    width: 230px;
    min-height: calc(100vh - 56px);
    background: var(--app-sidebar);
    padding: 1rem 0;
    flex-shrink: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1.3rem;
    color: #a89a8a;
    text-decoration: none;
    transition: all .15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--app-sidebar-hover);
    color: #F8F5F0;
}

.sidebar-link.active {
    background: rgba(159, 34, 34, .25);
    color: #F8F5F0;
    border-left-color: var(--app-primary);
}

.sidebar-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }

/* ===== 主内容区 ===== */
.app-main { padding: 1.5rem; min-height: calc(100vh - 56px); }

/* ===== 统计卡片 ===== */
.card-stat {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: transform .15s;
    background: var(--app-surface);
}
.card-stat:hover { transform: translateY(-2px); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}

/* ===== 按钮 ===== */
.btn-primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
}
.btn-primary:hover {
    background: var(--app-primary-dark);
    border-color: var(--app-primary-dark);
}
.btn-primary:active, .btn-primary:focus-visible {
    background: var(--app-primary-dark) !important;
    border-color: var(--app-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--app-primary);
    border-color: var(--app-primary);
}
.btn-outline-primary:hover {
    background: var(--app-primary);
    border-color: var(--app-primary);
}
.btn-outline-light {
    color: #F8F5F0;
    border-color: rgba(248, 245, 240, .5);
}
.btn-outline-light:hover {
    background: rgba(248, 245, 240, .15);
    color: #F8F5F0;
    border-color: #F8F5F0;
}

/* ===== 背景/文字工具类 ===== */
.bg-primary {
    background-color: var(--app-primary) !important;
}
.bg-primary.bg-opacity-10 {
    background-color: rgba(159, 34, 34, .1) !important;
}
.bg-primary.bg-opacity-25 {
    background-color: rgba(159, 34, 34, .25) !important;
}
.text-primary {
    color: var(--app-primary) !important;
}
.text-muted {
    color: var(--app-muted) !important;
}

/* ===== 认证页 ===== */
.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #9F2222, #222222);
}
.auth-card {
    width: 100%; max-width: 420px;
    border: none; border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    background: var(--app-surface);
}

/* ===== 表格 ===== */
.table thead th {
    background: #F8F5F0;
    font-weight: 600;
    color: var(--app-primary-dark);
    border-bottom: 2px solid rgba(159, 34, 34, .2);
}
.table tbody td { vertical-align: middle; }

/* ===== 卡片 ===== */
.card {
    background: var(--app-surface);
    border-color: rgba(159, 34, 34, .1);
}
.card-header {
    background: #F8F5F0;
    border-bottom-color: rgba(159, 34, 34, .1);
}
.card-footer {
    background: #F8F5F0;
    border-top-color: rgba(159, 34, 34, .1);
}

/* ===== 表单 ===== */
.form-control:focus, .form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 .2rem rgba(159, 34, 34, .15);
}

/* ===== 链接 ===== */
a {
    color: var(--app-primary);
    text-decoration: none;
}
a:hover {
    color: var(--app-primary-dark);
}

/* ===== Badge ===== */
.badge.bg-light {
    background: rgba(248, 245, 240, .15) !important;
    color: #0095F0 !important;
}

/* ===== 分页 ===== */
.page-link {
    color: var(--app-primary);
}
.page-link:hover {
    color: var(--app-primary-dark);
}
.page-item.active .page-link {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

/* ===== 状态/徽章扩展 ===== */
.badge.bg-warning {
    background-color: #e8b84b !important;
    color: #222222 !important;
}
.badge.bg-success {
    background-color: #3b8258 !important;
}

/* ===== Alert ===== */
.alert-success {
    border-left: 4px solid #3b8258;
}
.alert-warning {
    border-left: 4px solid #e8b84b;
}
.alert-danger {
    border-left: 4px solid var(--app-primary);
}
