/* 侧边栏基础 */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 999;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 文字在左，按钮在右 */
    padding: 0.5rem 1rem; /* 根据设计调整内边距 */
}

    /* 折叠状态 */
    #sidebar.collapsed {
        min-width: 60px;
        max-width: 60px;
    }


        #sidebar.collapsed .sidebar-header {
            justify-content: center;
        }

        /* 折叠时隐藏文字 */
        #sidebar.collapsed .nav-link span,
        #sidebar.collapsed .sidebar-header .brand-text {
            display: none;
        }

        /* 折叠时让图标居中 */
        #sidebar.collapsed .nav-link {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0.5rem 0;
            width: 100%;
        }

    /* 展开时的菜单项样式（防止换行） */
    #sidebar:not(.collapsed) .nav-link {
        display: flex;
        align-items: center;
        gap: 8px; /* 图标与文字间距 */
        padding: 0.5rem 1rem; /* 适当内边距 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 让文字部分占据剩余宽度 */
    #sidebar:not(.collapsed) .nav-link span {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* 折叠按钮样式 */
#sidebarCollapse {
    background: transparent;
    border: none;
    color: #808080;
    font-size: 1.5rem;
    padding-right: 0 0.5rem;
}

/* 主内容区调整 */
#content {
    margin-left: 250px;
    transition: margin-left 0.3s;
    width: calc(100% - 250px);
}

#sidebar.collapsed + #content {
    margin-left: 60px;
    width: calc(100% - 60px);
}

#sidebar:not(.collapsed) .user-info {
    color: #8d8383;
}
/* 折叠时让图标居中 */
#sidebar.collapsed .user-info .d-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
    width: 100%;
    color: #8d8383;
}

/* 用户信息区域在折叠时的样式 */
#sidebar.collapsed .user-info .flex-grow-1,
#sidebar.collapsed .user-info small,
#sidebar.collapsed .user-info .btn-sm { /* 如果按钮文字在 span 内 */
    display: none;
}

/* 当前活动菜单项高亮 */
.nav-item.active > .nav-link {
    background-color: #cdc6c6;
    border-radius: 0.25rem;
}


/* 可选：折叠状态下的高亮依然可见 */
#sidebar.collapsed .nav-item.active > .nav-link {
    background-color: #cdc6c6;
    justify-content: center; /* 保持图标居中 */
}

/* 个人中心卡片内的行分隔线 */
.profile-card .row:not(:last-child) {
    border-bottom: 1px dashed #dee2e6;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

/* 退休卡片信息行分隔 */
.retirement-card .row:not(:last-child) {
    border-bottom: 1px dashed #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.life-grid div {
    transition: transform 0.2s;
    cursor: default;
}

.life-grid div:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}


/* 小清新风格页面 */
.account-page {
    min-height: 100vh;
    background: url('https://images.unsplash.com/photo-1499002238440-d264edd844ec?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

    .account-page::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.6); /* 半透明白色遮罩，让背景更柔和 */
        z-index: 1;
    }

.account-card {
    position: relative;
    z-index: 2;
    max-width: 400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

    .account-card .card-header {
        background: transparent;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        text-align: center;
        padding: 0 0 1.5rem 0;
        margin-bottom: 1.5rem;
    }

        .account-card .card-header h2 {
            font-weight: 300;
            color: #5a7c6c;
            letter-spacing: 1px;
            margin: 0;
            font-size: 2rem;
        }

    .account-card .form-label {
        color: #6b7b8e;
        font-weight: 400;
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .account-card .form-control {
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
        padding: 0.75rem 1.2rem;
        background: rgba(255, 255, 255, 0.9);
        transition: all 0.2s;
    }

        .account-card .form-control:focus {
            border-color: #a3d8c9;
            box-shadow: 0 0 0 0.2rem rgba(163, 216, 201, 0.25);
            outline: none;
        }

    .account-card .btn-primary {
        background: #a3d8c9;
        border: none;
        border-radius: 2rem;
        padding: 0.75rem 1.5rem;
        font-weight: 500;
        color: #fff;
        width: 100%;
        transition: background 0.2s;
        box-shadow: 0 4px 10px rgba(163, 216, 201, 0.3);
    }

        .account-card .btn-primary:hover {
            background: #8bc9b8;
        }

        .account-card .btn-primary:focus {
            box-shadow: 0 0 0 0.2rem rgba(163, 216, 201, 0.5);
        }

    .account-card .text-muted {
        color: #8f9eb0 !important;
    }

    .account-card a {
        color: #8bc9b8;
        text-decoration: none;
        transition: color 0.2s;
    }

        .account-card a:hover {
            color: #5a7c6c;
            text-decoration: underline;
        }

    /* 验证消息样式 */
    .account-card .text-danger {
        color: #e76f51;
        font-size: 0.85rem;
        margin-top: 0.2rem;
        display: block;
    }

    .account-card .alert-danger {
        background: #fceae8;
        border-color: #f5c6b6;
        color: #e76f51;
        border-radius: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .account-card .validation-summary-errors ul {
        margin: 0;
        padding-left: 1.5rem;
    }

/* 生命日历网格容器 */
.life-grid {
    display: grid;
    gap:5px;
    grid-template-columns: repeat(auto-fill, minmax(15px, 75px));
    justify-content: center;
}

/* 每个格子的样式 */
.life-grid-item {
    aspect-ratio: 1 / 1; /* 保持正方形 */
    border-radius: 4px;
    display:flex;
    justify-content:center;
}

/* 移动端（小屏幕）格子可以更小 */
@media (max-width: 576px) {
    .life-grid {
        grid-template-columns: repeat(auto-fill, minmax(15px, 20px));
    }
}

/* 平板 */
@media (min-width: 577px) and (max-width: 992px) {
    .life-grid {
        grid-template-columns: repeat(auto-fill, minmax(30px, 55px));
    }
}

/* 桌面 */
@media (min-width: 993px) {
    .life-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 75px));
    }
}