/* ========== 模态框 - 宝可梦风格 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 90, 142, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 0 #c7a008, 0 12px 24px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideIn 0.3s ease;
    border: 4px solid #ffcb05;
    overflow: hidden;
}

.modal-content::before {
    display: none;
}

/* 模态框标题 - 宝可梦风格 */
.modal-content h2 {
    color: #2a75bb;
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

/* 关闭按钮 */
.close {
    color: #1e5a8e;
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    right: 16px;
    top: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #ffcb05;
    border: 2px solid #c7a008;
}

.close:hover,
.close:focus {
    background: #ffd43b;
    transform: scale(1.05);
}

/* 表单输入框 - 宝可梦风格 */
.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #fff;
    color: #2a75bb;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #ffcb05;
    box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.3);
}

/* 模态框按钮 - 宝可梦风格 */
.modal .btn {
    margin-top: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: none;
    border: 3px solid transparent;
}

.modal .btn-primary {
    background: #ffcb05;
    color: #1e5a8e;
    border-color: #c7a008;
    box-shadow: 0 4px 0 #c7a008;
}

.modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #c7a008;
}

.modal .btn-secondary {
    background: #2a75bb;
    color: #fff;
    border-color: #1e5a8e;
    box-shadow: 0 4px 0 #1e5a8e;
}

.modal .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1e5a8e;
}

/* 修改用户信息模态框 */
#update-user-modal .avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #ffcb05;
    margin: 10px auto;
    display: block;
}

/* 编辑商品模态框 */
#edit-items-modal .modal-content {
    max-width: 480px;
}

.edit-items-hint {
    color: #64748b;
    margin-bottom: 16px;
    font-size: 14px;
}

.edit-items-list {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.edit-items-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.edit-item-row:hover {
    background: #f1f5f9;
}

.edit-item-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.edit-item-name {
    flex: 1;
    font-weight: 600;
    color: #1e5a8e;
}

.edit-item-meta {
    font-size: 13px;
    color: #64748b;
}

.edit-items-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 创建商品模态框 */
#create-item-modal .modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* 创建宠物模态框 */
#create-pet-modal .modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    animation: none;
    transform: translateZ(0);
    will-change: transform;
}

/* 创建首领模态框（表单较长，内容区可滚动） */
#create-boss-modal .modal-content {
    max-width: 520px;
    width: 95%;
    max-height: min(90vh, 720px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    animation: none;
    transform: translateZ(0);
    will-change: transform;
}

/* 极巨首领配置（表单较长，与创建首领一致：内容区可滚动） */
#create-gigantamax-modal .modal-content {
    max-width: 520px;
    width: 95%;
    max-height: min(90vh, 720px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    animation: none;
    transform: translateZ(0);
    will-change: transform;
}

/* 对战过程模态框 */
#battle-process-modal .modal-content {
    max-width: 900px;
    background: linear-gradient(180deg, #3d7dca 0%, #2a75bb 100%) !important;
    border: 4px solid #ffcb05;
}

#battle-process-modal .modal-content h2 {
    color: #ffcb05;
    text-shadow: 2px 2px 0 #1e5a8e;
}

.battle-arena {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    border: 3px solid #ffcb05;
}

.battle-pet {
    flex: 0 0 200px;
    text-align: center;
    position: relative;
}

.battle-pet img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 4px solid #ffcb05;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 0 #c7a008;
}

.battle-pet-img-wrap {
    position: relative;
    display: inline-block;
}

.battle-winner-badge {
    display: none;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 44px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    font-size: 24px;
    font-weight: 900;
    color: #ffcb05;
    background: linear-gradient(135deg, #e3350d 0%, #ff6b35 100%);
    border: 3px solid #ffcb05;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255,203,5,0.8), 0 4px 0 #c7a008, inset 0 1px 0 rgba(255,255,255,0.4);
    text-shadow: 2px 2px 0 #1e5a8e;
    z-index: 10;
    animation: winnerBadgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.battle-winner-badge.show {
    display: block;
}

@keyframes winnerBadgePop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.battle-pet-name {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 0 #1e5a8e;
}

.battle-effect-zone {
    flex: 1;
    min-height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 攻击特效容器 - 深色光球 */
.battle-attack-effect {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

/* 普通攻击 - 光晕与核心（动画通过 effect-active 每次触发时重启） */
.battle-attack-effect::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,120,0.65) 0%, rgba(255,200,50,0.4) 50%, transparent 70%);
    opacity: 0;
}

.battle-attack-effect::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(255,255,255,0.99) 0%,
        rgba(255,255,150,0.98) 25%,
        rgba(255,235,80,0.95) 50%,
        rgba(255,150,50,0.9) 75%,
        rgba(227,80,80,0.85) 100%);
    box-shadow: 0 0 15px rgba(255,255,100,0.9),
                0 0 25px rgba(255,200,50,0.6),
                inset 0 0 22px rgba(255,255,255,0.5);
    opacity: 0;
}

/* 每次攻击时添加 effect-active，动画从头播放，结束后移除以重置 */
.battle-attack-effect.effect-active::before {
    animation: attackGlowPulse 0.6s ease-out forwards;
}

.battle-attack-effect.effect-active::after {
    animation: attackCorePulse 0.6s ease-out forwards;
}

/* 暴击时光晕额外闪烁 */
.battle-attack-effect.effect-crit.effect-active::before {
    animation: attackGlowPulse 0.6s ease-out forwards, critGlowFlash 0.15s ease-out 2;
}

.battle-crit-lightning {
    position: absolute;
    inset: -15px;
    width: 130px;
    height: 130px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 2;
}

.battle-attack-effect.effect-crit .battle-crit-lightning {
    opacity: 1;
}

.battle-crit-lightning .lightning-bolt {
    fill: none;
    stroke: #ff4444;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(255,60,60,0.95));
    animation: lightningFlicker 0.06s ease-in-out infinite;
}

.battle-crit-lightning .lightning-bolt:nth-child(2) { animation-delay: 0.01s; }
.battle-crit-lightning .lightning-bolt:nth-child(3) { animation-delay: 0.02s; }
.battle-crit-lightning .lightning-bolt:nth-child(4) { animation-delay: 0.03s; }
.battle-crit-lightning .lightning-bolt:nth-child(5) { animation-delay: 0.04s; }
.battle-crit-lightning .lightning-bolt:nth-child(6) { animation-delay: 0.02s; }

@keyframes lightningFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes critGlowFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

/* MISS 闪避特效 */
.battle-miss-effect {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 900;
    color: #94a3b8;
    text-shadow: 2px 2px 0 #64748b, 0 0 20px rgba(148,163,184,0.6);
    letter-spacing: 0.2em;
    pointer-events: none;
    z-index: 5;
}

.battle-miss-effect.show {
    display: block;
    animation: missPop 0.6s ease-out forwards;
}

@keyframes missPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
    60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}

.battle-attack-effect.attack-from-left {
    left: 0;
    animation: attackLeftToRight 0.7s ease-out forwards;
}

.battle-attack-effect.attack-from-right {
    right: 0;
    animation: attackRightToLeft 0.7s ease-out forwards;
}

@keyframes attackGlowPulse {
    0% { opacity: 0; transform: scale(0.5); }
    40% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes attackCorePulse {
    0% { opacity: 0; transform: scale(0.4); }
    30% { opacity: 1; transform: scale(1.1); }
    70% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 0; transform: scale(0.9); }
}

@keyframes attackLeftToRight {
    0% { opacity: 0; transform: scale(0.5) translateX(0); left: 0; }
    25% { opacity: 1; transform: scale(1.1) translateX(5%); left: 25%; }
    50% { opacity: 1; transform: scale(1.2) translateX(0); left: 50%; }
    75% { opacity: 0.9; transform: scale(1.1) translateX(-5%); left: 75%; }
    100% { opacity: 0; transform: scale(0.8) translateX(0); left: 100%; }
}

@keyframes attackRightToLeft {
    0% { opacity: 0; transform: scale(0.5) translateX(0); right: 0; }
    25% { opacity: 1; transform: scale(1.1) translateX(-5%); right: 25%; }
    50% { opacity: 1; transform: scale(1.2) translateX(0); right: 50%; }
    75% { opacity: 0.9; transform: scale(1.1) translateX(5%); right: 75%; }
    100% { opacity: 0; transform: scale(0.8) translateX(0); right: 100%; }
}

/* 被攻击方受击反馈 */
.battle-pet.pet-hit img {
    animation: petHitShake 0.4s ease-out;
}

@keyframes petHitShake {
    0%, 100% { transform: translateX(0); filter: brightness(1); }
    25% { transform: translateX(-4px); filter: brightness(1.5); }
    50% { transform: translateX(4px); filter: brightness(1.2); }
    75% { transform: translateX(-2px); filter: brightness(1.3); }
}

.battle-log-container {
    max-height: 220px;
    overflow-y: auto;
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.7;
    border: 2px solid #ffcb05;
}

.battle-result-summary {
    font-weight: bold;
    font-size: 18px;
    color: #ffcb05;
    text-shadow: 1px 1px 0 #1e5a8e;
}

/* 购买商品选择学生模态框 */
#purchase-dialog .modal-content {
    max-width: 420px;
}
.battle-log-line {
    padding: 6px 0;
    border-bottom: 1px solid #e8e6e3;
    color: #2a75bb;
}
.battle-log-line:last-child {
    border-bottom: none;
    font-weight: bold;
    color: #1e5a8e;
}

/* 创建宠物表单的阶段上传容器样式 */
.stage-upload-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.stage-upload-item {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e8e6e3;
}

.stage-upload-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2a75bb;
}

.stage-upload-item input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e8e6e3;
    border-radius: 10px;
    background: #fff;
}
#create-item-modal .form-group input,
#create-item-modal .form-group textarea,
#create-item-modal .form-group select {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

#create-item-modal .form-group textarea {
    min-height: 100px;
}

.modal .form-group label {
    color: #2a75bb;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content form {
    display: flex;
    flex-direction: column;
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 16px;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e1e5eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #ffcb05;
    box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.3);
}

.modal .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* 注册模态框 */
#register-modal .modal-content {
    max-width: 550px;
}

#reg-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid #ffcb05;
    margin-top: 10px;
    display: none;
}

/* 响应式模态框 */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    /* 移动端创建宠物模态框调整 */
    #create-pet-modal .modal-content {
        max-width: 95%;
        max-height: 85vh;
        padding: 15px;
    }
    #create-boss-modal .modal-content {
        max-width: 95%;
        max-height: 85vh;
        padding: 15px;
    }
    /* 移动端创建商品模态框调整 */
    #create-item-modal .modal-content {
        max-height: 85vh;
        padding: 15px;
    }
    
    .stage-upload-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stage-upload-item {
        padding: 12px;
    }
    .modal-content h2 {
        font-size: 24px;
    }
    
    .close {
        right: 15px;
        top: 10px;
        font-size: 24px;
    }
    
    .modal .form-group input,
    .modal .form-group select,
    .modal .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }
    
    .modal .btn {
        padding: 12px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 5% auto;
        padding: 15px;
    }
    
    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .close {
        font-size: 20px;
        width: 25px;
        height: 25px;
    }
}



@keyframes modalShow {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 成功/错误消息样式 */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.message.success {
    background: #ffcb05;
    color: #1e5a8e;
    border: 2px solid #c7a008;
    box-shadow: 0 4px 0 #c7a008;
}

.message.error {
    background: #e3350d;
    color: white;
    border: 2px solid #b32b0a;
    box-shadow: 0 4px 0 #b32b0a;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 文件上传样式 */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 14px;
    background: #f8f9fa;
    border: 2px dashed #2a75bb;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2a75bb;
    font-weight: 600;
}

.file-upload-label:hover {
    background: #e8f4ff;
    border-color: #ffcb05;
}

.file-upload-label.has-file {
    background: #fffbeb;
    border-color: #ffcb05;
    color: #1e5a8e;
}

/* 登录/注册/修改信息 - 宝可梦风格 */
.auth-modal-content {
    border: 4px solid #ffcb05;
    box-shadow: 0 8px 0 #c7a008, 0 12px 24px rgba(0, 0, 0, 0.25);
}

.auth-modal-content h2 {
    color: #2a75bb;
}

/* 学生端登录：矮屏高度下可滚动，避免登录按钮被裁切 */
#student-login-modal.modal.show {
    align-items: flex-start;
    justify-content: center;
    padding: 16px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

#student-login-modal .modal-content.auth-modal-content {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    margin: auto 0;
    flex-shrink: 0;
}

@supports (height: 100dvh) {
    #student-login-modal .modal-content.auth-modal-content {
        max-height: calc(100dvh - 32px);
    }
}

@media (max-height: 720px) {
    #student-login-modal .modal-content.auth-modal-content {
        padding: 20px 24px;
    }
    #student-login-modal .modal-content h2 {
        margin-bottom: 14px;
        font-size: 20px;
    }
    #student-login-modal .modal .form-group {
        margin-bottom: 10px;
    }
    #student-login-modal .modal .form-group input {
        padding: 10px 12px;
        font-size: 15px;
    }
    #student-login-modal .modal .btn {
        margin-top: 8px;
        padding: 12px 20px;
    }
}

@media (max-height: 560px) {
    #student-login-modal .modal-content.auth-modal-content {
        padding: 16px 20px;
    }
    #student-login-modal .modal-content h2 {
        margin-bottom: 10px;
        font-size: 18px;
    }
    #student-login-modal .modal .form-group {
        margin-bottom: 8px;
    }
    #student-login-modal .modal .form-group label {
        margin-bottom: 4px;
        font-size: 13px;
    }
}

/* 一键加分/减分 - 宝可梦风格（加宽 + 每行 5 名学生网格） */
.batch-exp-modal-content,
.batch-reduce-modal-content {
    border: 4px solid #ffcb05;
    box-shadow: 0 8px 0 #c7a008, 0 12px 24px rgba(0, 0, 0, 0.25);
    max-width: min(1400px, 98vw);
    width: 98%;
    max-height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.batch-exp-modal-content h2 {
    flex-shrink: 0;
}

/* 学生列表：5 列网格，减少纵向滚动 */
.batch-exp-modal-content .batch-students-scroll {
    flex: 1 1 auto;
    min-height: min(52vh, 420px);
    max-height: min(62vh, 560px);
    overflow-y: auto;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 16px 18px;
    -webkit-overflow-scrolling: touch;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px 12px;
    align-content: start;
}

.batch-exp-modal-content .student-item {
    padding: 12px 10px;
    margin-bottom: 0;
    font-size: 15px;
    min-width: 0;
}

.batch-exp-modal-content .student-item strong,
.batch-exp-modal-content .batch-student-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
}

.batch-exp-modal-content .batch-student-number {
    color: #1e5a8e;
    font-weight: 600;
    margin-left: 0;
    font-size: 13px;
    line-height: 1.2;
}

.batch-exp-modal-content .student-item label,
.batch-exp-modal-content .batch-student-label {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    cursor: pointer;
    min-width: 0;
}

.batch-exp-modal-content .batch-student-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.batch-exp-modal-content .student-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

@media (max-width: 1200px) {
    .batch-exp-modal-content .batch-students-scroll {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .batch-exp-modal-content .batch-students-scroll {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .batch-exp-modal-content .batch-students-scroll {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .batch-exp-modal-content .batch-students-scroll {
        grid-template-columns: 1fr;
    }
}

.batch-amount-row {
    margin-top: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.batch-amount-row label {
    color: #1e5a8e;
    font-weight: 600;
}

.batch-amount-input {
    width: 120px;
    padding: 8px 12px;
    border: 2px solid #ffcb05;
    border-radius: 8px;
    font-size: 16px;
}

/* 宠物兑换选择模态框 */
.pet-exchange-modal-content {
    max-width: 520px;
}

.pet-exchange-hint {
    margin-bottom: 16px;
    color: #2a75bb;
    font-weight: 600;
}

.pet-exchange-list {
    max-height: 360px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.pet-exchange-table {
    width: 100%;
    border-collapse: collapse;
}

.pet-exchange-table th,
.pet-exchange-table td {
    padding: 12px;
    border: 2px solid #ffcb05;
    text-align: center;
}

.pet-exchange-table th {
    background: #2a75bb;
    color: #fff;
}

.pet-exchange-table tbody tr:hover {
    background: rgba(255, 203, 5, 0.15);
}

.pet-exchange-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #ffcb05;
}

/* 段位表模态框 - 宝可梦风格 */
.rank-tier-modal-content {
    max-width: 420px;
}

.rank-tier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.rank-tier-table th,
.rank-tier-table td {
    padding: 12px 16px;
    border: 2px solid #ffcb05;
    text-align: center;
}

.rank-tier-table th {
    background: #2a75bb;
    color: #fff;
    font-weight: 700;
}

.rank-tier-table tbody tr:nth-child(even) {
    background: rgba(255, 203, 5, 0.1);
}

.rank-tier-table tbody tr:nth-child(odd) {
    background: #fff;
}

.rank-tier-table td:first-child {
    font-weight: 600;
    color: #2a75bb;
}

.rank-tier-table td:last-child {
    color: #1e5a8e;
}

/* 设置加减分规则 - 宝可梦风格 */
.add-rule-modal-content {
    background: #fff !important;
    border: 4px solid #ffcb05;
    box-shadow: 0 8px 0 #c7a008, 0 12px 24px rgba(0, 0, 0, 0.25);
}

.add-rule-modal-content::before {
    display: none;
}

.add-rule-modal-content h2 {
    color: #2a75bb;
}

.add-rule-modal-content .form-group input,
.add-rule-modal-content .form-group select {
    border-color: #e8e6e3;
}

/* 宠物状态卡详情 - 宝可梦风格，左右布局 */
.pet-detail-modal-content {
    max-width: 1080px;
    width: 95%;
    background: #fff;
    border: 4px solid #ffcb05;
    box-shadow: 0 8px 0 #c7a008, 0 12px 24px rgba(0, 0, 0, 0.25);
}

.pet-detail-modal-content::before {
    display: none;
}

.pet-detail-modal-content h2 {
    color: #2a75bb;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

/* 左右布局：左侧宠物信息，右侧规则 */
.pet-detail-layout {
    display: flex;
    gap: 32px;
    align-items: stretch;
}

.pet-detail-left-panel {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #fffbeb;
    border-radius: 16px;
    border: 2px solid #ffcb05;
}

.pet-detail-pet-img {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: 16px;
    border: 4px solid #ffcb05;
    background: #fff;
    box-shadow: 0 4px 0 #c7a008;
    margin-bottom: 16px;
}

.pet-detail-name {
    font-size: 18px;
    font-weight: bold;
    color: #2a75bb;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ffcb05;
    text-align: center;
}

.pet-detail-info {
    width: 100%;
    margin-bottom: 16px;
}

.pet-detail-info p {
    margin: 6px 0;
    font-size: 14px;
    color: #1e5a8e;
}

.pet-detail-info span {
    font-weight: 600;
    color: #2a75bb;
}

.pet-detail-left-panel .pet-radar-chart {
    margin-top: 8px;
}

.pet-radar-chart {
    position: relative;
    width: 180px;
    height: 180px;
}

.pet-radar-chart canvas {
    display: block;
}

.pet-radar-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.radar-label {
    position: absolute;
    font-size: 11px;
    font-weight: 600;
    color: #2a75bb;
}

.radar-label.attack { top: 2px; left: 50%; transform: translateX(-50%); }
.radar-label.health { bottom: 2px; left: 50%; transform: translateX(-50%); }
.radar-label.crit { top: 50%; right: 2px; transform: translateY(-50%); }
.radar-label.evasion { top: 50%; left: 2px; transform: translateY(-50%); }

.pet-detail-right-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.pet-detail-rules-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pet-detail-rules-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

#pet-detail-grade-select {
    border: 2px solid #ffcb05;
    font-size: 14px;
    border-radius: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.pet-detail-rules-list {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}


.pet-detail-rules-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    min-height: 0;
}

.pet-detail-rules-column.add-column {
    background: rgba(255, 203, 5, 0.15);
    border: 2px solid #ffcb05;
}

.pet-detail-rules-column.reduce-column {
    background: rgba(42, 117, 187, 0.15);
    border: 2px solid #2a75bb;
}

.rules-column-title {
    padding: 8px 12px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}

.add-column .rules-column-title {
    color: #1e5a8e;
    background: rgba(255, 203, 5, 0.4);
}

.reduce-column .rules-column-title {
    color: #fff;
    background: rgba(42, 117, 187, 0.5);
}

.rules-column-content {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.pet-detail-rule-item-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rule-delete-btn {
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rule-delete-btn:hover {
    background: rgba(255, 59, 48, 0.9);
    color: #fff;
}

.pet-detail-rule-item {
    padding: 10px 16px;
    background: #ffcb05;
    color: #1e5a8e;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid #c7a008;
    box-shadow: 0 2px 0 #c7a008;
}

.pet-detail-rule-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #c7a008;
}

.pet-detail-rule-item .rule-points {
    margin-left: 6px;
    opacity: 0.9;
}

.pet-detail-rule-item.rule-reduce {
    background: #2a75bb;
    color: #fff;
    border-color: #1e5a8e;
    box-shadow: 0 2px 0 #1e5a8e;
}

.pet-detail-rule-item.rule-reduce:hover {
    box-shadow: 0 4px 0 #1e5a8e;
}

.no-rules-hint {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* 宠物图片可点击 */
.student-card .pet-image {
    cursor: pointer;
}

/* 宠物状态卡 - 移动端响应式 */
@media (max-width: 768px) {
    #student-record-modal .modal-content {
        min-width: 95% !important;
        max-width: 95% !important;
    }
    
    #pet-detail-modal.show {
        align-items: flex-start;
        padding: 20px 0;
        overflow-y: auto;
    }
    
    .pet-detail-modal-content {
        max-width: 100%;
        width: 95%;
        max-height: none;
        margin: 0 auto 20px;
    }
    
    .pet-detail-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .pet-detail-left-panel {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        padding: 12px;
    }
    
    .pet-detail-pet-img {
        width: 160px;
        height: 160px;
    }
    
    .pet-detail-left-panel .pet-radar-chart {
        transform: scale(0.8);
        transform-origin: center;
    }
    
    .pet-detail-right-panel {
        min-height: 200px;
    }
    
    .pet-detail-rules-list {
        flex-direction: column;
        min-height: 150px;
    }
    
    .pet-detail-rules-column {
        min-height: 120px;
    }
    
    .pet-detail-rules-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pet-detail-rules-header .btn-sm {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pet-detail-modal-content {
        width: 98%;
        padding: 12px;
    }
    
    .pet-detail-modal-content h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .pet-detail-pet-img {
        width: 140px;
        height: 140px;
    }
    
    .pet-detail-left-panel .pet-radar-chart {
        transform: scale(0.65);
        transform-origin: center;
    }
    
    .pet-detail-info p {
        font-size: 13px;
    }
    
    .pet-detail-rule-item {
        padding: 8px 12px;
        font-size: 13px;
    }
}