/* ========== 学生卡片基础样式 ========== */
/* 从 cards.css 拆分 v3.5 */

/* 学生卡片主体样式 */
.student-card {
    width: 230px;
    height: 270px;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--theme-color) 7%, #fff) 0%,
        color-mix(in srgb, var(--theme-color) 7%, #fff) 57%,
        color-mix(in srgb, var(--theme-color) 5%, #fff) 57%,
        color-mix(in srgb, var(--theme-color) 5%, #fff) 100%
    );
    border-radius: 20px;
    border: 2px solid var(--theme-color);
    box-shadow: 
        -8px 8px 15px -5px color-mix(in srgb, var(--theme-color) 25%, transparent),
        8px 8px 15px -5px color-mix(in srgb, var(--theme-color) 25%, transparent),
        0 4px 8px -2px color-mix(in srgb, var(--theme-color) 40%, transparent),
        0 12px 20px -6px color-mix(in srgb, var(--theme-color) 30%, transparent),
        0 25px 35px -12px color-mix(in srgb, var(--theme-color) 20%, transparent),
        0 40px 50px -20px color-mix(in srgb, var(--theme-color) 10%, transparent);
    position: relative;
    overflow: visible;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.student-card:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 
        -12px 12px 20px -5px color-mix(in srgb, var(--theme-color) 35%, transparent),
        12px 12px 20px -5px color-mix(in srgb, var(--theme-color) 35%, transparent),
        0 6px 10px -2px color-mix(in srgb, var(--theme-color) 50%, transparent),
        0 16px 25px -6px color-mix(in srgb, var(--theme-color) 40%, transparent),
        0 32px 45px -12px color-mix(in srgb, var(--theme-color) 28%, transparent),
        0 50px 65px -20px color-mix(in srgb, var(--theme-color) 15%, transparent);
}

/* 等级标签样式 */
.card-level {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 32.4px;
    height: 32.4px;
    background-color: var(--theme-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* 分配宠物按钮样式 */
.btn-assign-pet {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 32.4px;
    height: 32.4px;
    background-color: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14.4px;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-assign-pet:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 宠物图片区域样式 */
.card-pet-image {
    width: 145px;
    height: 121px;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
}

.card-pet-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: breatheStrong 3s ease-in-out infinite;
}

/* 宠物名称样式 */
.card-pet-name {
    position: absolute;
    left: -32px;
    bottom: 0;
    font-size: 11.55px;
    font-weight: 600;
    color: color-mix(in srgb, var(--theme-color) 90%, #000);
    white-space: nowrap;
    z-index: 20;
    text-align: center;
    width: 36px;
}

/* 宠物蛋图标样式（未分配宠物时） */
.card-pet-egg {
    width: 87px;
    height: 109px;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #999;
    animation: breatheStrong 3s ease-in-out infinite;
    box-shadow: 0 3px 13px rgba(0, 0, 0, 0.1);
}

/* 学生姓名样式 */
.card-name {
    font-size: 16.8px;
    font-weight: 700;
    color: color-mix(in srgb, var(--theme-color) 90%, #000);
    text-align: center;
    margin-top: 8px;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 进度条容器样式 */
.card-progress {
    width: 88%;
    margin-top: 8px;
    position: relative;
}

/* 进度条标签行 */
.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 11px;
}

.progress-label-left {
    color: #666;
    font-weight: 500;
    font-size: 11.55px;
}

.progress-label-right {
    color: color-mix(in srgb, var(--theme-color) 90%, #000);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.progress-label-right .food-icon {
    width: 13px;
    height: 13px;
    object-fit: contain;
}

/* 点击分配文字样式 */
.click-to-assign {
    color: #999;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 11.55px;
}

.student-card.no-pet-assigned:hover .click-to-assign {
    color: color-mix(in srgb, var(--theme-color) 90%, #000);
    font-weight: 600;
}

/* 进度条背景 */
.progress-bg {
    width: 100%;
    height: 9px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

/* 进度条填充 */
.progress-fill {
    height: 100%;
    background-color: var(--theme-color);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

/* 信息行样式 */
.card-info {
    width: 88%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #eee;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 18px;
}

/* 信息项样式 */
.info-item {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

.info-item .info-label {
    font-size: 12.6px;
}

.info-item .info-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.info-item span {
    font-weight: 500;
}

/* 徽章信息项 */
.info-item.info-badges {
    margin-left: 0;
    margin-right: 0;
}

/* 礼物信息项 */
.info-item.info-gifts {
    margin-left: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    background: rgba(211, 91, 126, 0.1);
    padding: 2px 4px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.info-item.info-gifts:hover {
    transform: scale(1.1);
}

.info-item.info-gifts .gift-emoji {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

.info-item.info-gifts span {
    font-weight: 600;
    font-size: 12px;
    color: color-mix(in srgb, var(--theme-color) 85%, #000);
}


/* ========== 宠物选择弹窗样式 ========== */
#petSelectModal .pet-select-modal-content {
    width: 950px;
    max-width: 95%;
}

.pet-select-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14.5px;
    padding: 14.5px;
}

.pet-select-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #f9f9f9;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pet-select-item:hover {
    border-color: var(--theme-color);
    background: rgba(211, 91, 126, 0.08);
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 8px 20px rgba(211, 91, 126, 0.25);
    z-index: 10;
}

.pet-select-item.selected {
    border-color: var(--theme-color);
    background: rgba(211, 91, 126, 0.1);
}

.pet-select-item img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 8px;
    /* 添加呼吸特效 */
    animation: breatheStrong 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

/* 鼠标悬停时宠物图片额外放大 */
.pet-select-item:hover img {
    transform: scale(1.1);
    animation: breatheStrong 2s ease-in-out infinite;
}

.pet-select-item .pet-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-align: center;
}


/* ========== 加减分弹窗样式 ========== */
#scoreModal .score-modal-content {
    width: 680px;
    max-width: 95%;
}

/* 学生信息展示区 */
.score-student-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    margin-bottom: 20px;
}

.score-pet-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.score-pet-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.score-student-details {
    flex: 1;
}

.score-student-details p {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

.score-student-details p:last-child {
    margin-bottom: 0;
}

.score-student-details span {
    font-weight: 600;
    color: var(--theme-color);
}

/* 评价按钮区 */
.score-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.score-section {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
}

.score-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.score-btn-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.score-btn {
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 奖励按钮样式 */
.reward-btn {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.reward-btn:hover {
    background-color: #c8e6c9;
    transform: translateY(-2px);
}

/* 惩罚按钮样式 */
.punish-btn {
    background-color: #ffebee;
    color: #c62828;
}

.punish-btn:hover {
    background-color: #ffcdd2;
    transform: translateY(-2px);
}

.punish-grid {
    grid-template-columns: repeat(6, 1fr);
}


/* ========== 卡片响应式 ========== */
@media (max-width: 768px) {
    #cardContainer {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .student-card {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .pet-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .score-btn-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .punish-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #cardContainer {
        grid-template-columns: 1fr;
    }
    
    .student-card {
        width: 100%;
        max-width: none;
    }
}
