/* =========================================
   1. 全局重置与基础变量
   ========================================= */
* { -webkit-tap-highlight-color: transparent !important; }
button, .student-card, .pet-area, .action-btn, .new-action-btn, .htab, .ptab, .custom-checkbox, .nav-btn, .exchange-btn { user-select: none; outline: none; }

:root {
    --primary: #4a8bf5;
    --secondary: #ff9d42;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-color: #f4f7fa;
    --card-bg: #ffffff;
    --accent: #4a8bf5;
    --progress-bg: #e2e8f0;
    --progress-fill: #4a8bf5;
}

body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background-color: var(--bg-color); margin: 0; padding: 20px 20px 100px 20px; color: var(--text-main); }

/* =========================================
   2. 顶部导航与操作栏
   ========================================= */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.class-selector .title { font-size: 24px; font-weight: bold; margin-right: 10px; color: var(--accent); }
.class-selector .subtitle { color: var(--text-muted); font-size: 14px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.nav-btn { background: #fff; border: 1px solid #ddd; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: bold; color: var(--text-main); transition: 0.2s; }
.nav-btn:hover { background: #eff6ff; border-color: var(--accent); color: var(--accent); }
.store-btn { background: #fff0f6; color: #e074b1; border-color: #ffc9c9; }
.store-btn:hover { background: #fce7f3; color: #db2777; border-color: #f472b6; }
.custom-select { padding: 8px 15px; border-radius: 20px; border: 1px solid #ddd; outline: none; background: #fff; font-weight: bold; cursor: pointer; }

/* =========================================
   3. 全新现代风格神兽卡片
   ========================================= */
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; }
.student-card { background: var(--card-bg); border-radius: 28px; padding: 25px 20px; box-shadow: 0 12px 35px rgba(0, 0, 0, 0.04); border: none; display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s; position: relative; box-sizing: border-box; max-width: 100%; overflow: hidden; }
.student-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(74, 139, 245, 0.1); }
.student-card.selected { box-shadow: 0 0 0 3px var(--primary), 0 12px 35px rgba(74, 139, 245, 0.15); }
.class-divider { grid-column: 1 / -1; font-size: 22px; font-weight: bold; color: var(--accent); margin-top: 15px; margin-bottom: 5px; padding-bottom: 8px; border-bottom: 2px dashed #bfdbfe; display: flex; align-items: center; }
.class-divider span { font-size: 14px; color: var(--text-muted); font-weight: normal; margin-left: 10px; }

.profile-header-new { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; }
.custom-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
.profile-avatar-new { width: 44px; height: 44px; background: #eff6ff; color: #4a8bf5; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; flex-shrink: 0; }
.profile-info-new { flex: 1; min-width: 0; overflow: hidden; }

.badge-btn { border: 1px solid #e2e8f0; transition: all 0.2s ease; cursor: pointer; flex-shrink: 0 !important; white-space: nowrap !important; }
.badge-btn:hover { background-color: #e2e8f0; border-color: #cbd5e1; }
.profile-label-new { font-size: 11px; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.profile-name-new { font-size: 18px; font-weight: 900; color: var(--text-main); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.class-tag { background: #eff6ff; color: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: bold; margin-left: 5px; white-space: nowrap; flex-shrink: 0; }

.pet-area { background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%); border-radius: 20px; padding: 25px 0; margin-bottom: 15px; position: relative; cursor: pointer; display: flex; justify-content: center; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); }
.pet-visual { display: flex; justify-content: center; align-items: center; min-height: 180px; width: 100%; padding: 10px 0; position: relative; }
.egg-svg { width: 100%; max-width: 150px; height: auto; max-height: 160px; filter: drop-shadow(0 6px 10px rgba(230, 212, 250, 0.6)); transform-origin: bottom center; animation: livingEgg 3.5s ease-in-out infinite; }
.beast-img { width: 100%; max-width: 190px; height: auto; max-height: 180px; object-fit: contain; filter: drop-shadow(0 15px 20px rgba(0,0,0,0.15)); transition: transform 0.3s; transform-origin: bottom center; animation: livingBeast 4s ease-in-out infinite; }
.pet-area:hover .beast-img { transform: scale(1.05); animation: livingBeast 1.5s ease-in-out infinite; }
.temp-beast { width: 100px; height: 100px; background: linear-gradient(135deg, #eff6ff, #dbeafe); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--accent); font-size: 22px; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2); }

.hungry-tag { position: absolute; top: -12px; right: 15px; background: #f59e0b; color: white; font-size: 12px; font-weight: 900; padding: 5px 12px; border-radius: 12px; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4); z-index: 20; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.hungry-tag:hover { transform: scale(1.15) rotate(-5deg); }

.pet-info-new { text-align: center; margin-bottom: 25px; }
.pet-name-title { font-size: 24px; font-weight: 900; color: #0f172a; margin-bottom: 4px; }
.pet-level-desc { font-size: 14px; color: #64748b; font-weight: 600; }

.progress-section { background: #f8fafc; border: 1px solid #f1f5f9; padding: 18px 20px; border-radius: 20px; cursor: pointer; transition: all 0.2s ease; margin-top: 5px; }
.progress-section:hover { background: #eff6ff; border-color: #bfdbfe; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(59, 130, 246, 0.15); }
.progress-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.next-evo-label { font-size: 11px; color: var(--primary); font-weight: 900; text-transform: uppercase; margin-bottom: 2px; }
.next-evo-name { font-size: 16px; font-weight: 900; color: #1e293b; }
.progress-numbers { font-size: 13px; color: #64748b; font-weight: 700; }
.progress-bar-new { height: 12px; background: #e2e8f0; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.progress-fill-new { height: 100%; background: linear-gradient(90deg, #60a5fa, #fbbf24); border-radius: 6px; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-hint { font-size: 12px; color: #94a3b8; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }

/* =========================================
   4. 底部悬浮控制台 (批量操作栏)
   ========================================= */
.batch-bar { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #fff; padding: 12px 25px; border-radius: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); display: flex; justify-content: space-between; align-items: center; width: 80%; max-width: 550px; z-index: 90; }
.batch-actions { display: flex; gap: 12px; align-items: center; }
.btn-pill { border-radius: 20px; padding: 8px 18px; font-weight: bold; font-size: 14px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.btn-clear { background: #fff; border-color: #e5e7eb; color: #4b5563; }
.btn-clear:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-batch-score { background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); color: white; padding: 8px 25px; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4); }
.btn-batch-score:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(59, 130, 246, 0.6); }

/* =========================================
   5. 通用弹窗与表单样式
   ========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); display: none; justify-content: center; align-items: center; z-index: 100; backdrop-filter: blur(4px); }
.modal { background: #fff; width: 90%; max-width: 400px; border-radius: 24px; padding: 25px; box-shadow: 0 15px 40px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; position: relative; }
.modal-lg { max-width: 650px; }
.modal-header { font-size: 20px; font-weight: bold; margin-bottom: 20px; text-align: center; color: #0f172a; }
.close-btn { width: 100%; padding: 12px; margin-top: 15px; background: #f1f5f9; color: #475569; border: none; border-radius: 12px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.close-btn:hover { background: #e2e8f0; }
.save-btn { width: 100%; padding: 12px; margin-top: 15px; background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); color: white; border: none; border-radius: 12px; cursor: pointer; font-weight: bold; font-size: 16px; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.save-btn:hover { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.custom-input { width: 100%; box-sizing: border-box; padding: 12px; border: 2px solid #e2e8f0; border-radius: 12px; margin-bottom: 15px; outline: none; transition: 0.2s; }
.custom-input:focus { border-color: var(--primary); }
.close-icon-floating { position: sticky; top: -10px; float: right; margin-right: -10px; width: 32px; height: 32px; border: none; background: #f1f5f9; border-radius: 50%; color: #64748b; font-size: 22px; cursor: pointer; z-index: 100; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.close-icon-floating:hover { background: #fee2e2; color: #ef4444; transform: scale(1.1); }

/* =========================================
   6. 学生档案与打分弹窗
   ========================================= */
.profile-modal { width: 850px; max-width: 95vw; display: flex; flex-direction: column; padding: 0; overflow: hidden; background: #f8fafc; }
.profile-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 30px; background: #fff; border-bottom: 1px solid #edf2f7; }
.profile-title-area { display: flex; align-items: center; gap: 15px; }
.profile-icon { background: #eff6ff; color: #3b82f6; width: 45px; height: 45px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.profile-title { margin: 0; font-size: 22px; color: #1e293b; font-weight: 800; }
.profile-subtitle { margin: 4px 0 0 0; font-size: 13px; color: #94a3b8; }
.profile-body { display: flex; height: 65vh; min-height: 400px; overflow: hidden; }

.profile-sidebar { width: 240px; background: #fff; padding: 30px 20px 20px; display: flex; flex-direction: column; align-items: center; border-right: 1px solid #edf2f7; overflow-y: auto; }
.profile-sidebar::-webkit-scrollbar { width: 4px; }
.profile-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.profile-avatar-wrap { position: relative; margin-bottom: 20px; }
.profile-avatar { width: 110px; height: 110px; border-radius: 50%; background: #eff6ff; color: #3b82f6; display: flex; align-items: center; justify-content: center; font-size: 45px; font-weight: bold; border: 5px solid #fff; box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15); }
.profile-level-badge { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: #fff; border: 2px solid #eff6ff; color: #10b981; font-weight: 900; font-size: 13px; padding: 4px 12px; border-radius: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); white-space: nowrap; }
.profile-name { font-size: 24px; font-weight: bold; color: #0f172a; margin-bottom: 30px; letter-spacing: 1px; }
.profile-stat-card { width: 100%; box-sizing: border-box; background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 16px; padding: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 15px; transition: transform 0.2s; }
.profile-stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.stat-icon { font-size: 24px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-info .stat-label { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.stat-info .stat-value { font-size: 22px; font-weight: 800; color: #0f172a; }

.profile-main { flex: 1; display: flex; flex-direction: column; background: #fff; }
.profile-tabs { display: flex; gap: 30px; padding: 0 30px; border-bottom: 1px solid #edf2f7; }
.ptab { padding: 20px 10px; font-size: 16px; font-weight: bold; color: #64748b; cursor: pointer; position: relative; transition: color 0.2s; }
.ptab.active { color: #3b82f6; }
.ptab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 3px; background: #3b82f6; border-radius: 3px 3px 0 0; }
.profile-content { flex: 1; padding: 25px 30px; overflow-y: auto; background: #fdfdfd; }
.score-section-title { font-size: 15px; font-weight: 800; color: #475569; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.score-section-title::before { content: ''; display: block; width: 5px; height: 16px; background: #10b981; border-radius: 3px; }
.score-section-title.negative::before { background: #f43f5e; }

.new-action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; margin-bottom: 35px; }
.new-action-btn { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 18px 10px; text-align: center; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.02); }
.new-action-btn:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.06); }
.new-action-btn.positive:hover { border-color: #a7f3d0; }
.new-action-btn.negative:hover { border-color: #fecdd3; }
.action-icon-wrap { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.action-name { font-size: 15px; font-weight: 800; color: #334155; margin-bottom: 8px; }
.action-points { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; }

.new-action-btn.positive .action-icon-wrap, .new-action-btn.positive .action-points { background: #ecfdf5; color: #10b981; }
.new-action-btn.negative .action-icon-wrap, .new-action-btn.negative .action-points { background: #fff1f2; color: #f43f5e; }

/* =========================================
   7. 各类游戏面板 (图鉴/小卖部/历史/魔王等)
   ========================================= */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
.store-item { border: 2px solid; border-radius: 16px; padding: 20px 10px; text-align: center; transition: 0.2s; }
.store-item:hover { transform: translateY(-5px); }
.store-icon { font-size: 40px; margin-bottom: 10px; }
.store-name { font-weight: bold; font-size: 15px; margin-bottom: 15px; color: #444; }
.exchange-btn { background: #fff; border: 1px solid rgba(0,0,0,0.1); border-radius: 20px; padding: 6px 15px; font-size: 12px; font-weight: bold; cursor: pointer; width: 100%; transition: 0.2s; }
.exchange-btn:hover { transform: scale(1.05); }

.history-tabs { display: inline-flex; background: #f1f5f9; padding: 5px; border-radius: 14px; gap: 4px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.htab { font-size: 13px; color: #64748b; cursor: pointer; padding: 6px 16px; font-weight: 800; border-radius: 10px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: none; margin: 0; }
.htab:hover { color: var(--primary); background: #e2e8f0; }
.htab.active { color: var(--primary); background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.history-list { display: flex; flex-direction: column; gap: 12px; padding: 5px 0; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: #fff; border-radius: 20px; border-left: 6px solid #10b981; border: 1px solid #f8fafc; border-left-width: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: transform 0.2s, box-shadow 0.2s; }
.history-item:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); }
.history-item.negative { border-left-color: #f43f5e; }
.history-item.undone { opacity: 0.6; border-left-color: #cbd5e1; background: #f8fafc; filter: grayscale(40%); }
.history-time { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 65px; border-right: 2px dashed #f1f5f9; padding-right: 15px; margin-right: 15px; }
.history-time-date { font-size: 11px; color: #94a3b8; font-weight: 800; margin-bottom: 2px; text-transform: uppercase; }
.history-time-clock { font-size: 16px; color: #334155; font-weight: 900; }
.history-content { flex: 1; font-size: 14px; color: #475569; }
.history-student-name { font-size: 16px; font-weight: 900; color: #1e293b; margin-right: 6px; }
.history-class-tag { font-size: 11px; color: var(--primary); background: #eff6ff; padding: 2px 8px; border-radius: 10px; font-weight: bold; }
.history-reason { margin-top: 8px; font-weight: 700; font-size: 14px; color: #475569; }
.history-points { font-size: 16px; font-weight: 900; margin-left: 10px; padding: 5px 12px; border-radius: 12px; white-space: nowrap; }
.history-points.pos { background: #ecfdf5; color: #10b981; }
.history-points.neg { background: #fff1f2; color: #f43f5e; }
.undo-btn { background: #f1f5f9; border: none; color: #64748b; border-radius: 12px; padding: 8px 16px; font-size: 12px; font-weight: 800; cursor: pointer; transition: all 0.2s ease; margin-left: 10px; white-space: nowrap; }
.undo-btn:hover { background: #fee2e2; color: #ef4444; box-shadow: 0 4px 10px rgba(239,68,68,0.2); transform: scale(1.05); }

.pet-selector-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-height: 480px; overflow-y: auto; padding: 10px; perspective: 1000px; }
.pet-option { text-align: center; padding: 30px 15px; border-radius: 20px; cursor: pointer; border: 3px solid transparent; background: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.pet-option img { width: 130px !important; height: 130px !important; object-fit: contain; margin-bottom: 12px; filter: drop-shadow(0 8px 10px rgba(0,0,0,0.1)); transition: transform 0.3s; }
.pet-option div { font-size: 18px !important; font-weight: bold; color: #1e293b; }
.pet-option:hover { border-color: #cbd5e1; box-shadow: 0 15px 35px rgba(0,0,0,0.1); transform: translateY(-8px) rotateX(3deg); }
.pet-option:hover img { transform: scale(1.15); }
.pet-option.selected { border-color: var(--primary); background: #eff6ff; box-shadow: 0 10px 25px rgba(74, 139, 245, 0.3); transform: translateY(-8px) rotateX(3deg); }

.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.badge-item { background: linear-gradient(135deg, #fffcf0 0%, #fff2e0 100%); border: 1px solid #ffe0b2; padding: 15px; border-radius: 16px; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

.welcome-container { display: flex; justify-content: center; align-items: center; min-height: 70vh; }
.welcome-card { background: #fff; border-radius: 30px; padding: 50px 40px; text-align: center; box-shadow: 0 15px 35px rgba(59, 130, 246, 0.1); max-width: 600px; border: 3px solid #eff6ff; }
.welcome-egg { margin-bottom: 20px; animation: float 3s ease-in-out infinite; }
.welcome-title { font-size: 32px; color: var(--primary); margin-bottom: 15px; font-weight: 900; }
.welcome-desc { color: #475569; font-size: 16px; line-height: 1.6; margin-bottom: 35px; }

.lb-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 15px; font-size: 16px; font-weight: bold; color: #94a3b8; cursor: pointer; transition: 0.3s; }
.lb-tab.active { background: #38bdf8; color: white; box-shadow: 0 4px 10px rgba(56, 189, 248, 0.4); }
.lb-item { display: flex; align-items: center; background: white; padding: 12px 20px; border-radius: 16px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); border: 2px solid #f1f5f9; transition: transform 0.2s; }
.lb-item:hover { transform: scale(1.02); }
.lb-rank { width: 40px; font-size: 20px; font-weight: 900; color: #cbd5e1; }
.lb-item.rank-1 { border-color: #fde047; background: #fefce8; }
.lb-item.rank-1 .lb-rank { color: #eab308; font-size: 24px; }
.lb-item.rank-2 { border-color: #cbd5e1; background: #f8fafc; }
.lb-item.rank-2 .lb-rank { color: #94a3b8; font-size: 22px; }
.lb-item.rank-3 { border-color: #fdba74; background: #fff7ed; }
.lb-item.rank-3 .lb-rank { color: #f97316; font-size: 22px; }
.lb-avatar { font-size: 30px; margin-right: 15px; }
.lb-info { flex: 1; }
.lb-name { font-size: 18px; font-weight: 900; color: #334155; margin-bottom: 4px; }
.lb-sub { font-size: 12px; color: #94a3b8; }
.lb-score { font-size: 20px; font-weight: 900; color: #f59e0b; }

.boss-btn { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }
.boss-btn:hover { background: #fca5a5; color: white; }
.boss-modal-body { text-align: center; padding: 10px; }
.boss-image { font-size: 80px; margin: 20px 0; display: inline-block; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3)); }
#boss-image img { animation: breathe 3s ease-in-out infinite; transform-origin: center bottom; }
.boss-hp-bg { background: #3f3f46; height: 26px; border-radius: 13px; margin: 15px 0; overflow: hidden; position: relative; border: 2px solid #18181b; }
.boss-hp-fill { background: linear-gradient(90deg, #ef4444, #f87171); height: 100%; width: 100%; transition: width 0.5s ease-out; }
.boss-hp-text { position: absolute; width: 100%; text-align: center; line-height: 26px; color: white; font-weight: bold; font-size: 14px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); top: 0; left: 0; }
.damage-list { margin-top: 20px; text-align: left; background: #27272a; border-radius: 12px; padding: 15px; max-height: 220px; overflow-y: auto; border: 1px solid #3f3f46; }
.damage-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #3f3f46; font-size: 14px; color: #d4d4d8; }
.damage-item:last-child { border-bottom: none; }
.boss-speech-bubble { position: absolute; bottom: 80%; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, 0.9); color: #333; padding: 10px 15px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); font-size: 13px; line-height: 1.4; max-width: 180px; text-align: center; animation: bubbleUpAndFade 6s linear forwards; pointer-events: none; opacity: 0; }
.boss-speech-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -8px; border-width: 8px; border-style: solid; border-color: rgba(255, 255, 255, 0.9) transparent transparent transparent; }

/* =========================================
   8. 动画与全屏特效 (Animations & FX)
   ========================================= */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes bossShake { 10%, 90% { transform: translate3d(-4px, 0, 0) rotate(-2deg); } 20%, 80% { transform: translate3d(6px, 0, 0) rotate(2deg); } 30%, 50%, 70% { transform: translate3d(-8px, 0, 0) rotate(-4deg); } 40%, 60% { transform: translate3d(8px, 0, 0) rotate(4deg); } }
@keyframes floatDamage { 0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); } 20% { transform: translate(-50%, -30px) scale(1.3); } 100% { opacity: 0; transform: translate(-50%, -80px) scale(1); } }
@keyframes floatHeart { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -120%) scale(1); } }
@keyframes bubbleUpAndFade { 0% { transform: translateX(-50%) translateY(20px); opacity: 0; } 10% { transform: translateX(-50%) translateY(0); opacity: 1; } 80% { transform: translateX(-50%) translateY(-60px); opacity: 1; } 100% { transform: translateX(-50%) translateY(-100px); opacity: 0; } }
@keyframes floatUp { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1.2); } }
@keyframes fadeInOut { 0% { opacity: 0; transform: translate(-50%, -20px); } 15% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -20px); } }

.pet-happy-anim { animation: petHappy 0.4s cubic-bezier(0.28, 0.84, 0.42, 1) !important; }
@keyframes petHappy { 0% { transform: scale(1) translateY(0); } 25% { transform: scale(1.1, 0.9) translateY(5px); } 50% { transform: scale(0.9, 1.1) translateY(-15px); } 75% { transform: scale(1.05, 0.95) translateY(0); } 100% { transform: scale(1) translateY(0); } }

.floating-heart { position: fixed; font-size: 28px; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); animation: floatHeart 1s ease-out forwards; filter: drop-shadow(0 2px 4px rgba(255,105,180,0.3)); }
.floating-feedback { position: fixed; font-size: 22px; font-weight: bold; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); animation: floatUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; text-shadow: 0 2px 5px rgba(0,0,0,0.15); }
.toast-message { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.7); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: bold; z-index: 10000; pointer-events: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2); animation: fadeInOut 2s forwards; }
.damage-number { position: fixed; color: #ffeb3b; font-weight: 900; font-size: 32px; text-shadow: 0 3px 0 #b45309, 0 -1px 10px #ef4444; pointer-events: none; z-index: 10000; animation: floatDamage 1s ease-out forwards; }
.boss-shake { animation: bossShake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes livingBeast { 0% { transform: scale(1, 1) translateY(0) rotate(0deg); } 25% { transform: scale(0.97, 1.03) translateY(-4px) rotate(-1.5deg); } 50% { transform: scale(1, 1) translateY(-8px) rotate(0deg); } 75% { transform: scale(1.03, 0.97) translateY(-3px) rotate(1.5deg); } 100% { transform: scale(1, 1) translateY(0) rotate(0deg); } }
@keyframes shadowBreathe { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; } 50% { transform: translateX(-50%) scale(0.4); opacity: 0.15; } }
@keyframes livingEgg { 0%, 100% { transform: translateY(0) rotate(0deg); } 40% { transform: translateY(-8px) rotate(0deg); } 45% { transform: translateY(-8px) rotate(8deg); } 50% { transform: translateY(-8px) rotate(-8deg); } 55% { transform: translateY(-8px) rotate(0deg); } }

.pet-visual::after { content: ''; position: absolute; bottom: 5px; left: 50%; width: 80px; height: 12px; background: radial-gradient(ellipse at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0) 70%); border-radius: 50%; pointer-events: none; animation: shadowBreathe 4s ease-in-out infinite; z-index: -1; }
.student-card:has(.egg-svg) .pet-visual::after { animation: shadowBreathe 3.5s ease-in-out infinite; }

.crit-screen-shake { animation: critShake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes critShake { 0%, 100% { transform: translate(0, 0) rotate(0); } 10% { transform: translate(-12px, -12px) rotate(-3deg); } 20% { transform: translate(12px, 12px) rotate(3deg); } 30% { transform: translate(-15px, 8px) rotate(-4deg); } 40% { transform: translate(15px, -8px) rotate(4deg); } 50% { transform: translate(-10px, 10px) rotate(-2deg); } 60% { transform: translate(10px, -10px) rotate(2deg); } 70% { transform: translate(-5px, -5px) rotate(-1deg); } 80% { transform: translate(5px, 5px) rotate(1deg); } 90% { transform: translate(-2px, 2px) rotate(0); } }
.crit-flash-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, rgba(153, 27, 27, 0.8) 100%); z-index: 100000; pointer-events: none; mix-blend-mode: multiply; animation: flashRed 0.5s ease-out forwards; }
@keyframes flashRed { 0%, 100% { opacity: 0; } 10% { opacity: 1; } }
.damage-number.crit-text { font-size: 60px !important; color: #ff1744 !important; text-shadow: 0 0 20px rgba(255,0,0,0.8), 0 6px 0 #900000, 0 15px 15px rgba(0,0,0,0.5) !important; animation: critDamageFloat 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important; }
@keyframes critDamageFloat { 0% { opacity: 1; transform: translate(-50%, 0) scale(0.3); } 20% { transform: translate(-50%, -40px) scale(1.3) rotate(-5deg); } 40% { transform: translate(-50%, -40px) scale(1.1) rotate(3deg); } 100% { opacity: 0; transform: translate(-50%, -120px) scale(1) rotate(0deg); } }

.level-up-overlay, .celeb-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 100000; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.level-up-overlay { background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(8px); }
.celeb-overlay { background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(12px); animation: fadeIn 0.4s ease-out forwards; }

.magic-aura { position: absolute; width: 60vw; height: 60vw; max-width: 600px; max-height: 600px; background: radial-gradient(circle, rgba(251,191,36,0.4) 0%, rgba(251,191,36,0) 70%); animation: pulseAura 2s ease-in-out infinite; z-index: 1; }
.magic-rays, .celeb-rays { position: absolute; width: 150vw; height: 150vw; background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255, 255, 255, 0.3) 10deg, transparent 20deg, transparent 40deg, rgba(255, 255, 255, 0.3) 50deg, transparent 60deg, transparent 80deg, rgba(255, 255, 255, 0.3) 90deg, transparent 100deg, transparent 120deg, rgba(255, 255, 255, 0.3) 130deg, transparent 140deg, transparent 160deg, rgba(255, 255, 255, 0.3) 170deg, transparent 180deg, transparent 200deg, rgba(255, 255, 255, 0.3) 210deg, transparent 220deg, transparent 240deg, rgba(255, 255, 255, 0.3) 250deg, transparent 260deg, transparent 280deg, rgba(255, 255, 255, 0.3) 290deg, transparent 300deg, transparent 320deg, rgba(255, 255, 255, 0.3) 330deg, transparent 340deg, transparent 360deg, rgba(255, 255, 255, 0.3) 370deg, transparent 380deg); z-index: 1; mask-image: radial-gradient(circle, #fff 10%, transparent 60%); -webkit-mask-image: radial-gradient(circle, #fff 10%, transparent 60%); }
.magic-rays { animation: spinRays 15s linear infinite; }
.celeb-rays { background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(251, 191, 36, 0.6) 10deg, transparent 20deg, transparent 40deg, rgba(251, 191, 36, 0.6) 50deg, transparent 60deg, transparent 80deg, rgba(251, 191, 36, 0.6) 90deg, transparent 100deg, transparent 120deg, rgba(251, 191, 36, 0.6) 130deg, transparent 140deg, transparent 160deg, rgba(251, 191, 36, 0.6) 170deg, transparent 180deg, transparent 200deg, rgba(251, 191, 36, 0.6) 210deg, transparent 220deg, transparent 240deg, rgba(251, 191, 36, 0.6) 250deg, transparent 260deg, transparent 280deg, rgba(251, 191, 36, 0.6) 290deg, transparent 300deg, transparent 320deg, rgba(251, 191, 36, 0.6) 330deg, transparent 340deg, transparent 360deg, rgba(251, 191, 36, 0.6) 370deg, transparent 380deg); animation: spinRays 25s linear infinite; mask-image: radial-gradient(circle, #fff 15%, transparent 65%); -webkit-mask-image: radial-gradient(circle, #fff 15%, transparent 65%); }

.level-up-pet { width: 300px; height: 300px; object-fit: contain; z-index: 3; animation: popInPet 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; filter: drop-shadow(0 0 30px rgba(251,191,36,0.9)); }
.celeb-pet { width: 320px; height: 320px; object-fit: contain; z-index: 3; animation: popInPet 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, celebPetFloat 3s ease-in-out infinite 0.8s; filter: drop-shadow(0 0 50px rgba(251,191,36,0.9)); }

.level-up-title { font-size: 80px; font-weight: 900; color: #fff; z-index: 3; margin-top: 30px; text-shadow: 0 6px 0 #d97706, 0 15px 30px rgba(0,0,0,0.6); animation: popInText 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards; opacity: 0; transform: scale(0); font-style: italic; }
.level-up-subtitle { font-size: 32px; font-weight: bold; color: #fde047; z-index: 3; margin-top: 10px; animation: popInText 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards; opacity: 0; transform: scale(0); letter-spacing: 4px; }
.celeb-title { font-size: 75px; font-weight: 900; z-index: 3; margin-top: 25px; background: linear-gradient(to bottom, #fef08a, #f59e0b); -webkit-background-clip: text; color: transparent; text-shadow: 0 10px 30px rgba(245, 158, 11, 0.6); animation: popInText 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards; opacity: 0; transform: scale(0); letter-spacing: 6px; }
.celeb-subtitle { font-size: 24px; color: #fff; z-index: 3; margin-top: 15px; animation: popInText 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s forwards; opacity: 0; transform: scale(0); font-weight: bold; text-shadow: 0 4px 10px rgba(0,0,0,0.8); }

.celeb-collect-btn { z-index: 3; margin-top: 50px; background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; border: 3px solid #34d399; padding: 18px 50px; font-size: 26px; font-weight: 900; border-radius: 50px; cursor: pointer; box-shadow: 0 10px 30px rgba(16, 185, 129, 0.6), inset 0 4px 10px rgba(255,255,255,0.4); animation: popInText 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.7s forwards, pulseBtn 2s infinite 1.3s; opacity: 0; transform: scale(0); transition: all 0.2s; }
.celeb-collect-btn:hover { transform: scale(1.1) !important; filter: brightness(1.1); box-shadow: 0 15px 40px rgba(16, 185, 129, 0.8), inset 0 4px 10px rgba(255,255,255,0.4); }

@keyframes pulseAura { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.2); opacity: 1; } }
@keyframes spinRays { 100% { transform: rotate(360deg); } }
@keyframes popInPet { 0% { transform: scale(0) translateY(150px); opacity: 0; } 100% { transform: scale(1.2) translateY(0); opacity: 1; } }
@keyframes popInText { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.fade-out-anim { animation: fadeOutOverlay 0.5s ease-out forwards; }
@keyframes fadeOutOverlay { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pulseBtn { 0%, 100% { box-shadow: 0 10px 30px rgba(16, 185, 129, 0.6); } 50% { box-shadow: 0 10px 45px rgba(16, 185, 129, 0.9), 0 0 25px #34d399; } }
@keyframes celebPetFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-25px); } }

.hatch-rays { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 150vw; height: 150vw; background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 40%); animation: pulseRays 2s infinite; z-index: 1; }
.egg-crack-anim { animation: eggShake 1.2s cubic-bezier(.36,.07,.19,.97) both; transform-origin: bottom center; }
.hatch-flash { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; background: #fff; z-index: 100; pointer-events: none; animation: flashFade 0.8s ease-out forwards; }
@keyframes eggShake { 0%, 100% { transform: rotate(0); filter: drop-shadow(0 0 10px rgba(255,255,255,0)); } 10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg) scale(1.05); filter: drop-shadow(0 0 30px rgba(255,255,255,0.8)); } 20%, 40%, 60%, 80% { transform: rotate(10deg) scale(1.05); filter: drop-shadow(0 0 30px rgba(255,255,255,0.8)); } 95% { transform: scale(1.2); filter: drop-shadow(0 0 60px #fff); } }
@keyframes flashFade { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pulseRays { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; } 50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } }

.btn-blind-box { padding: 12px 24px; font-size: 16px; font-weight: bold; border-radius: 12px; cursor: pointer; transition: all 0.2s; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.btn-blind-box-single { background: #e2e8f0; color: #475569; }
.btn-blind-box-single:hover { background: #cbd5e1; transform: translateY(-1px); }
.btn-blind-box-ten { background: #fbbf24; color: #1e293b; border: 2px solid #f59e0b; }
.btn-blind-box-ten:hover:not(:disabled) { background: #f59e0b; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4); }
.btn-blind-box-ten:disabled { background: #e2e8f0; color: #94a3b8; border-color: #cbd5e1; cursor: not-allowed; box-shadow: none; opacity: 0.7; }
@keyframes shakeBlindBox { 0% { transform: translate(1px, 1px) rotate(0deg); } 10% { transform: translate(-1px, -2px) rotate(-1deg); } 20% { transform: translate(-3px, 0px) rotate(1deg); } 30% { transform: translate(3px, 2px) rotate(0deg); } 40% { transform: translate(1px, -1px) rotate(1deg); } 50% { transform: translate(-1px, 2px) rotate(-1deg); } 60% { transform: translate(-3px, 1px) rotate(0deg); } 70% { transform: translate(3px, 1px) rotate(-1deg); } 80% { transform: translate(-1px, -1px) rotate(1deg); } 90% { transform: translate(1px, 2px) rotate(0deg); } 100% { transform: translate(1px, -2px) rotate(-1deg); } }
@keyframes flashParticle { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(0.5); opacity: 0; } }
.shake-anim { animation: shakeBlindBox 0.15s ease-in-out infinite; }
.box-flash { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; background: #fff; border-radius: 50%; pointer-events: none; z-index: 100001; box-shadow: 0 0 50px 30px #fff, 0 0 100px 60px #fbbf24; animation: flashParticle 0.6s ease-out forwards; }

/* =========================================
   9. 版权信息
   ========================================= */
.copyright-footer { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 40px; margin-bottom: 5px; letter-spacing: 1px; font-weight: 500; user-select: none; }
.copyright-footer span { font-weight: 800; color: #cbd5e1; margin: 0 8px; }
.copyright-footer .version { background: #e2e8f0; color: #64748b; padding: 2px 6px; border-radius: 6px; font-weight: bold; font-family: monospace; }

/* =========================================
   10. 弹窗悬浮胶囊按钮栏
   ========================================= */
.sticky-bottom-bar-wrapper { position: sticky; bottom: -15px; display: flex; justify-content: center; width: 100%; z-index: 100; pointer-events: none; padding-bottom: 10px; margin-top: 15px; padding-left: 5px; padding-right: 5px; box-sizing: border-box; }
.sticky-bottom-bar { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 8px 10px; border-radius: 30px; box-shadow: 0 8px 25px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255,255,255,0.6); display: flex; justify-content: center; gap: 10px; pointer-events: auto; width: 100%; box-sizing: border-box; }
.sticky-bottom-bar button { margin: 0 !important; border-radius: 20px !important; padding: 10px 0 !important; font-size: 14px !important; white-space: nowrap; flex: 1; display: flex; justify-content: center; align-items: center; }


/* ==========================================
   👤 头像选择器 (Avatar Selector) - 紧凑型
   ========================================== */

/* 1. 头像选择器容器：实现多行网格，垂直滚动 */
.avatar-grid {
    display: flex; /* 使用 Flexbox 进行布局 */
    flex-wrap: wrap; /* 允许换行 */
    gap: 12px; /* 选项之间的紧凑间距 */
    padding: 15px; /* 减少内边距 */
    background: #f8fafc; /* 淡淡的背景色 */
    border-radius: 12px; /* 圆角 */
    border: 1px solid #e2e8f0; /* 细边框 */
    margin-bottom: 20px; /* 下方间距 */
    justify-content: center; /* 使项目居中对齐 */
    max-height: 250px; /* 限制容器最大高度，防止弹窗过高 */
    overflow-y: auto; /* 允许垂直滚动 */
    /* 自定义垂直滚动条 */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* 兼容 Webkit (Chrome, Safari) 的垂直滚动条样式 */
.avatar-grid::-webkit-scrollbar {
    width: 5px; /* 垂直滚动条宽度 */
}
.avatar-grid::-webkit-scrollbar-thumb {
    background-color: #cbd5e1; /* 滚动条滑块颜色 */
    border-radius: 2.5px;
}
.avatar-grid::-webkit-scrollbar-track {
    background: transparent;
}

/* 2. 头像选项 (紧凑型小圆格) */
.avatar-option {
    /* 使用灵活的宽度，确保每行大约 5-6 个，并利用 gap */
    flex: 0 0 calc(20% - 10px); 
    aspect-ratio: 1 / 1; /* 保持正方形，用于 padding:0 的容器 */
    max-width: 50px; /* 限制最大宽度，使其保持“小”个的感觉 */
    border-radius: 50%; /* 强制圆形 */
    background: white;
    border: 2px solid transparent; /* 细边框，预留给选中状态 */
    cursor: pointer;
    transition: all 0.2s; /* 过渡动画 */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box; /* 边框包含在尺寸内 */
    padding: 0; /* 移除内边距，使内容填充整个圆 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* 轻微阴影 */
}

/* 悬停效果 */
.avatar-option:hover {
    border-color: #e2e8f0; /* 悬停时显示淡淡边框 */
    transform: translateY(-2px); /* 微微上移 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 选中状态 */
.avatar-option.selected {
    border-color: var(--accent); /* 使用主题色 */
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4); /* 发光阴影 */
}

/* 3. 头像选项内部图片 */
.avatar-option img {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* 也是圆形 */
    object-fit: contain; /* 图片完整显示在圆形内 */
}

/* 4. 默认文字头像选项 */
.avatar-option.default {
    font-size: 20px; /* 减小字号以适应更小的圆 */
    font-weight: bold;
    color: #3b82f6; /* 默认颜色 */
    background: #eff6ff; /* 默认背景色 */
}

/* 5. 选中状态的勾选图标 (紧凑型) */
.avatar-option.selected::after {
    content: '\2713'; /* 勾选符号 */
    position: absolute;
    bottom: -4px; /* 减小偏移 */
    right: -4px; /* 减小偏移 */
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 18px; /* 减小勾选图标容器大小 */
    height: 18px; /* 减小勾选图标容器大小 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px; /* 减小勾选符号大小 */
    border: 1.5px solid white; /* 更细的白色描边 */
}

/* =========================================
   11. 响应式布局
   ========================================= */
@media (max-width: 850px) {
    .profile-modal .profile-body { display: block !important; height: auto !important; max-height: 70vh !important; overflow-y: auto !important; }
    .profile-modal .profile-sidebar { width: 100%; display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: flex-start !important; justify-content: space-between !important; height: auto !important; padding: 20px 15px !important; border-right: none; border-bottom: 5px solid #f1f5f9 !important; box-sizing: border-box; overflow: visible !important; }
    
    .profile-modal .profile-avatar-wrap { width: 100% !important; margin-bottom: 10px !important; }
    .profile-modal .profile-avatar { margin: 0 auto !important; }
    .profile-modal .profile-name { width: 100% !important; text-align: center !important; margin-bottom: 20px !important; }
    
    .profile-modal .profile-stat-card { width: calc(50% - 6px) !important; margin: 0 0 12px 0 !important; flex: none !important; box-sizing: border-box !important; padding: 12px 10px !important; gap: 8px !important; }
    .profile-modal .profile-stat-card .stat-icon { width: 36px !important; height: 36px !important; font-size: 20px !important; border-radius: 10px; }
    .profile-modal .profile-stat-card .stat-value { font-size: 18px !important; }
    
    .profile-tabs { justify-content: center; gap: 15px; padding: 0 15px; flex-wrap: wrap; }
    .settings-wrapper { flex-direction: column !important; overflow-y: visible !important; overflow-x: hidden !important; }
    .settings-wrapper > div { border-right: none !important; padding-right: 0 !important; margin-bottom: 20px; flex: none !important; width: 100% !important; box-sizing: border-box; }
    
    .profile-header, .modal-header { flex-shrink: 0 !important; }
}

@media (max-width: 550px) {
    body { padding-bottom: 140px; }
    .header { flex-direction: column; align-items: stretch; gap: 15px; margin-bottom: 15px; }
    .class-selector { width: 100%; display: flex; justify-content: space-between; align-items: center; }
    .class-selector select { flex: 1; font-size: 16px !important; padding: 6px 10px !important; }
    .class-selector .subtitle { display: none !important; } 
    .top-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px !important; justify-content: space-between; }
    
    #quick-search, #sort-select { flex: 1; min-width: 45%; margin-bottom: 0 !important; font-size: 13px; padding: 6px !important; }
    .nav-btn { flex: 1; min-width: 30% !important; padding: 8px 4px !important; font-size: 12px !important; text-align: center; }
    .student-grid { grid-template-columns: 1fr; gap: 15px; }
    .student-card { padding: 20px 15px; } 
    .action-buttons { gap: 10px; }
    .btn-outline, .btn-solid { padding: 10px; font-size: 14px; }
    .stat-pill { padding: 10px; }
    .stat-value { font-size: 16px; }
    
    .modal { padding: 15px; }
    .modal.profile-modal { padding: 0 !important; }
    .profile-modal .profile-stat-card { padding: 10px 8px !important; }
    
    .pet-selector-grid, .badge-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 5px; }
    .pet-option { padding: 15px 5px; border-radius: 15px; }
    .pet-option img { width: 65px !important; height: 65px !important; margin-bottom: 8px; }
    .pet-option div { font-size: 13px !important; }
    
    .new-action-grid, .store-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    .batch-bar { width: 90%; padding: 12px; flex-direction: column; gap: 10px; border-radius: 15px; }
    .batch-actions { width: 100%; justify-content: space-between; }
	/* 限制分类标签的最大宽度，改为 flex 并允许内容滑动，防止撑破弹窗 */
    #pet-category-tabs { 
        display: flex !important; 
        max-width: 100%; 
        box-sizing: border-box; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; /* 保证苹果设备的滑动流畅 */
    }
    
    /* 隐藏横向滚动条，让UI更清爽 */
    #pet-category-tabs::-webkit-scrollbar { 
        display: none; 
    }

    /* 确保弹窗在移动端绝对不会超过屏幕宽度 */
    .modal { 
        width: 92%; 
        box-sizing: border-box; 
        overflow-x: hidden; 
    }

    /* 修复设置页面输入框和按钮在极小屏幕下挤在一起的问题 */
    .settings-input-group { 
        flex-wrap: wrap; 
    }
}

@media (max-width: 360px) {
    .sticky-bottom-bar { gap: 6px; padding: 6px 8px; }
    .sticky-bottom-bar button { font-size: 13px !important; padding: 8px 0 !important; }
	.pet-selector-grid, .badge-grid { gap: 6px; }
    .pet-option { padding: 10px 2px; }
    .pet-option img { width: 55px !important; height: 55px !important; }
    .pet-option div { font-size: 12px !important; }
}