/* 后台左侧菜单布局 */
body.admin-layout {
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    overflow-x: hidden;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 左侧边栏 */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand a {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand a:hover {
    color: #fff;
    text-decoration: none;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-nav li a .glyphicon {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav li.active a {
    background: rgba(52, 152, 219, 0.15);
    color: #fff;
    border-left-color: #3498db;
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer a {
    color: #95a5a6;
    font-size: 13px;
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: #e74c3c;
    text-decoration: none;
}

.sidebar-footer a .glyphicon {
    margin-right: 6px;
}

/* 右侧主区域 */
.main-wrapper {
    flex: 1;
    margin-left: 220px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: #fff;
    padding: 10px 16px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-content {
    padding: 24px;
    flex: 1;
}

.main-content .page-header {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

.sidebar-toggle {
    padding: 6px 10px;
}

/* 登录页 */
.login-page {
    background: #2c3e50;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    width: 360px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
}

.page-header h1 {
    margin-top: 0;
    font-size: 22px;
}

.toolbar-panel {
    background: #fff;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.sync-readonly {
    margin-bottom: 0;
    font-size: 13px;
}

.sync-readonly dt {
    width: 70px;
    text-align: left;
    color: #888;
}

.sync-readonly dd {
    margin-left: 80px;
    margin-bottom: 8px;
}

code.small {
    font-size: 11px;
    word-break: break-all;
}

.page-header h1 small {
    font-size: 13px;
}

/* 手机端：侧边栏可折叠 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 16px;
    }

    .top-bar .page-title {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }
}
