/* ========== 食物管理弹窗样式 ========== */
/* 已拆分：礼物相关样式移至 modals-gift.css v3.5 */

/* 食物管理弹窗 */
#foodMgmtModal .food-mgmt-modal-content {
    width: 800px;
    max-width: 95%;
}

/* 食物管理区块样式 */
.food-mgmt-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.food-mgmt-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 添加加减分项行样式 */
.add-score-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.add-score-item-row .form-control {
    flex: 1;
    min-width: 80px;
}

.add-score-item-row .score-value-input {
    width: 80px;
    flex: 0 0 80px;
}

.add-score-item-row .btn {
    flex-shrink: 0;
}

/* 选择图标按钮 */
.btn-select-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 2px dashed #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 3px;
}

.btn-select-icon:hover {
    border-color: var(--theme-color);
    background: #f5f5f5;
}

.btn-select-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 已配置的加减分项容器 */
.score-config-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.score-config-group {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.score-config-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* 加减分项卡片网格 */
.score-config-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    justify-items: center;
}

/* 加减分项卡片样式 */
.score-config-card {
    width: 100%;
    max-width: 100px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    padding-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.score-config-card:hover {
    border-color: var(--theme-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-config-card .card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-config-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.score-config-card .card-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.score-config-card .card-value {
    font-size: 14px;
    font-weight: 600;
    color: #e53935;
    white-space: nowrap;
}

.score-config-card .card-value.negative {
    color: #4caf50;
}

/* 修改按钮 - 左上角 */
.score-config-card .btn-edit-item {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: rgba(25, 118, 210, 0.1);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #1976d2;
    z-index: 2;
}

.score-config-card .btn-edit-item:hover {
    background: #e3f2fd;
    transform: scale(1.1);
}

/* 删除按钮 - 右上角 */
.score-config-card .btn-delete-item {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: rgba(229, 57, 53, 0.1);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #e53935;
    z-index: 2;
}

.score-config-card .btn-delete-item:hover {
    background: #ffebee;
    transform: scale(1.1);
}

/* 食物管理操作区域 */
.food-mgmt-actions {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* 空状态提示 */
.score-config-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}


/* ========== 图标选择弹窗样式 ========== */

#iconSelectModal {
    z-index: 1100;
}

#iconSelectModal .icon-select-modal-content {
    width: 352px;
    max-width: 95%;
    overflow: hidden;
}

.icon-select-section {
    margin-bottom: 20px;
}

.icon-select-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.icon-select-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.icon-select-item {
    width: 65px;
    height: 65px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 5px;
    background: #fff;
}

.icon-select-item:hover {
    border-color: var(--theme-color);
    transform: scale(1.05);
}

.icon-select-item.selected {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px var(--theme-color);
}

.icon-select-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-select-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}


/* ========== 批量操作弹窗样式 ========== */

#batchOpModal .batch-op-modal-content {
    width: 900px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.batch-op-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.batch-op-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 全选行 */
.batch-select-all-row {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 学生勾选列表 */
.batch-student-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.batch-student-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
}

.batch-student-item:hover {
    border-color: var(--theme-color);
}

.batch-student-item.selected {
    border-color: var(--theme-color);
    background: rgba(211, 91, 126, 0.1);
}

.batch-student-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.batch-student-name {
    font-size: 14px;
    color: #333;
    flex: 1;
}

.batch-student-level {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

.batch-student-food {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #666;
}

.batch-student-food img {
    width: 16px;
    height: 16px;
}

/* 批量操作加减分项容器 */
.batch-score-items-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.batch-score-group {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.batch-score-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* 批量操作加减分项卡片 */
.batch-score-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.batch-score-card {
    width: 90px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.batch-score-card:hover {
    border-color: var(--theme-color);
}

.batch-score-card.selected {
    border-color: var(--theme-color);
    background: rgba(211, 91, 126, 0.1);
    box-shadow: 0 0 0 2px var(--theme-color);
}

.batch-score-card .card-icon {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-score-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.batch-score-card .card-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.batch-score-card .card-value {
    font-size: 14px;
    font-weight: 600;
    color: #e53935;
}

.batch-score-card .card-value.negative {
    color: #4caf50;
}

/* 批量操作执行按钮区域 */
.batch-op-actions {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}


/* ========== 修改加减分项弹窗样式 ========== */

.edit-score-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.edit-score-item-row .form-control {
    flex: 1;
    min-width: 80px;
}

.edit-score-item-row .score-value-input {
    width: 80px;
    flex: 0 0 80px;
}


/* ========== 加减分弹窗卡片样式 ========== */

.score-item-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.score-item-card {
    width: auto;
    min-width: 80px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.score-item-card:hover {
    border-color: var(--theme-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.score-item-card:active {
    transform: scale(0.98);
}

.score-item-card .card-icon {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-item-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.score-item-card .card-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.score-item-card .card-value {
    font-size: 14px;
    font-weight: 600;
    color: #e53935;
}

.score-item-card .card-value.negative {
    color: #4caf50;
}


/* ========== 食物管理响应式 ========== */

@media (max-width: 480px) {
    #foodMgmtModal .food-mgmt-modal-content {
        width: 95%;
    }
    
    .add-score-item-row {
        flex-wrap: wrap;
    }
    
    .add-score-item-row .btn-select-icon {
        width: 50px;
        height: 50px;
    }
    
    .add-score-item-row .form-control {
        width: 100%;
        flex: none;
    }
    
    .add-score-item-row .score-value-input {
        width: 100%;
        flex: none;
    }
    
    .add-score-item-row .btn {
        width: 100%;
    }
    
    .score-config-card {
        width: 80px;
    }
    
    .score-config-card .card-icon {
        width: 50px;
        height: 50px;
    }
    
    #iconSelectModal .icon-select-modal-content {
        width: 95%;
    }
    
    .icon-select-item {
        width: 50px;
        height: 50px;
    }
    
    #batchOpModal .batch-op-modal-content {
        width: 95%;
    }
    
    .batch-student-item {
        width: 100%;
    }
    
    .batch-score-card {
        width: 80px;
    }
    
    .batch-score-card .card-icon {
        width: 50px;
        height: 50px;
    }
    
    .score-item-card {
        width: 80px;
    }
    
    .score-item-card .card-icon {
        width: 50px;
        height: 50px;
    }
}

/* ========== 图标选择弹窗样式（新版） ========== */

.icon-select-modal-content {
    width: 352px;
    max-width: 95vw;
    overflow: hidden;
    border-radius: 12px;
}

/* 修复图标选择弹窗左右上角圆弧问题 */
/* 问题原因：modal-content 白色背景在圆角处与 modal-header 主题色背景产生视觉差异 */
/* 解决方案：将 modal-content 背景色设为主题色，这样圆角处不会有颜色差异 */
#iconSelectModal .modal-content {
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--theme-color);
}

/* modal-body 需要设置白色背景来覆盖主题色 */
#iconSelectModal .modal-body {
    background-color: #fff;
}

.icon-select-modal-content .modal-body {
    padding: 20px 25px;
}

.icon-category-tabs {
    display: flex;
    gap: 6px;
    padding: 0;
    justify-content: space-between;
    background: transparent;
    border-radius: 0;
    margin-bottom: 15px;
    flex-wrap: nowrap;
    width: 302px;
}

.icon-category-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    flex: 1;
}

.icon-category-tab:hover {
    background: #fff;
    border-color: #ccc;
}

.icon-category-tab.active {
    background: var(--theme-color);
    color: white;
    border-color: transparent;
}

.icon-category-tab img {
    width: 18px;
    height: 18px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(7, 38px);
    gap: 6px;
    padding: 0;
    justify-content: flex-start;
    width: 302px;
}

.icon-item {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-item:hover {
    background: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1;
}

.icon-item:hover img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(316deg) brightness(104%) contrast(97%);
}

.icon-item img {
    width: 30px;
    height: 30px;
    transition: filter 0.2s ease;
}

/* ========== 加分/减分图标颜色样式 ========== */

/* 加分项图标 - 浅粉色背景 + 玫红色线条 */
.score-item-icon.positive,
.card-icon.positive {
    background: #FFF0F5;
    border-radius: 8px;
    padding: 4px;
}

.score-item-icon.positive img,
.card-icon.positive img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(316deg) brightness(104%) contrast(97%);
}

/* 减分项图标 - 浅绿色背景 + 绿色线条 */
.score-item-icon.negative,
.card-icon.negative {
    background: #F0FFF0;
    border-radius: 8px;
    padding: 4px;
}

.score-item-icon.negative img,
.card-icon.negative img {
    filter: brightness(0) saturate(100%) invert(58%) sepia(69%) saturate(456%) hue-rotate(73deg) brightness(92%) contrast(88%);
}
