* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #F5F5F5;
    color: #2E2E2E;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 40px 0;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #8a9c95;
    margin-bottom: 20px;
}

.nickname {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2E2E2E;
}

/* 个人介绍 */
.intro {
    background-color: #ECECEC;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 40px;
    text-align: center;
}

/* 作业模块 */
.assignments {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.subject-cards {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.subject-card {
    /* 新增渐变背景 */
    background: linear-gradient(135deg, #3b054b 0%, #02f376 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-weight: bold;
    /* 新增：确保渐变不重复 */
    background-size: 100% 100%;
}

.subject-card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(141, 34, 34, 0.2);
    /* 新增：悬浮时渐变颜色变化 */
    background: linear-gradient(135deg, #1cd18c 0%, #c2212e 100%);
}

/* 新增类：激活状态的渐变 */
.subject-card.active {
    background: linear-gradient(135deg, #026444 0%, #083c9c 100%);
    /* 可选：增加边框强化激活态 */
    border: 2px solid #d0c8e8;
}


.content-cards {
    display: none;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-cards.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.contents-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* 作业项之间的间距 */
}

/* 新增：单个作业项的样式 */
.content-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    /* 分隔线 */
}

.content-item:last-child {
    border-bottom: none;
    /* 最后一项去掉分隔线 */
}

.content-item h3 {
    margin-bottom: 8px;
    color: #2E2E2E;
    font-size: 1.2rem;
}

.content-item p {
    color: #666;
    line-height: 1.7;
}

.content-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.content-item.item-active p {
    max-height: 200px;
    /* 展开后最大高度，可根据内容调整 */
    opacity: 1;
    /* 显示文字 */
}

.content-item p {
    max-height: 0;
    /* 默认高度为0，隐藏 */
    opacity: 0;
    /* 默认透明 */
    overflow: hidden;
    transition: all 0.2s ease;
    /* 过渡动画 */
}

/* 给作业项标题加折叠/展开图标 */
.content-item h3::after {
    content: '点击展开';
    /* 默认折叠图标 */
    font-size: 0.8rem;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.content-item.item-active h3::after {
    content: '↑';
    /* 展开后图标 */
    transform: rotate(0deg);
}

/* 底部版权区域样式 */
.footer {
    margin-top: 60px;
    /* 与上方内容拉开间距 */
    padding: 30px 20px;
    background-color: #2E2E2E;
    /* 深色背景 */
    color: #FFFFFF;
    /* 白色文字 */
    border-top: 3px solid #7bbad8;
    /* 顶部装饰线，呼应主题色 */
}

.copyright {
    max-width: 1200px;
    margin: 0 auto;
    /* 居中对齐 */
    text-align: center;
}

.copyright p {
    margin: 8px 0;
    font-size: 0.9rem;
    opacity: 0.9;
    /* 轻微透明增加质感 */
}

.copyright p:hover {
    opacity: 1;
    color: #077a3f;
    transition: all 0.3s ease;
}


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .subject-cards {
        flex-direction: column;
        gap: 10px;
        /* 原gap: 0 → 修改为10px（可根据需求调整），增加科目按钮之间的垂直间距 */
    }

    .subject-card {
        width: 100%;
        margin-bottom: 0;
        /* 保留此属性，间距由subject-cards的gap控制更统一 */
        /* 可选：增加内边距让按钮更饱满 */
        padding: 18px 25px;
    }

    /* 内容卡片样式保留不变（如需微调间距可按需改） */
    .content-cards {
        margin-top: 10px;
        margin-bottom: 15px;
    }

    .footer {
        margin-top: 40px;
        padding: 20px 15px;
    }

    .copyright p {
        font-size: 0.8rem;
    }
}

.subject-card.with-password::after {
    content: '🔒';
    margin-left: 8px;
    font-size: 0.9rem;
}

/* 激活后（密码验证通过）隐藏锁图标 */
.subject-card.with-password.active::after {
    content: '✅';
}