/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
}

/* ===== 顶部导航栏 ===== */
.navbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 0 0 1px rgba(15, 23, 42, 0.02);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

/* 品牌区 */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-right: 14px;
    margin-right: 4px;
    border-right: 1px solid rgba(226, 232, 240, 0.7);
}

.nav-brand-logo {
    display: block;
    width: 108px;
    height: 70px;
    object-fit: contain;
}

.nav-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4a6cf7 0%, #7c5bfc 50%, #a855f7 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(74, 108, 247, 0.3), 0 1px 2px rgba(74, 108, 247, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-brand-icon:hover {
    transform: scale(1.06) rotate(-2deg);
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.4);
}

.nav-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1;
}

/* 主导航 */
.nav-left {
    display: flex;
    align-items: center;
    gap: 1px;
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
}

.nav-left::-webkit-scrollbar { display: none; }
.nav-left { scrollbar-width: none; }

/* 分隔条 */
.nav-divider {
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, #cbd5e1, transparent);
    margin: 0 8px;
    flex-shrink: 0;
}

/* 导航按钮 - 精致 ghost 风格 */
.nav-btn {
    background: transparent;
    color: #64748b;
    border: none;
    height: 42px;
    padding: 0 16px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    letter-spacing: 0.01em;
}

.nav-btn svg {
    color: #94a3b8;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.nav-btn:hover {
    background: rgba(74, 108, 247, 0.06);
    color: #1e293b;
}

.nav-btn:hover svg {
    color: #4a6cf7;
    transform: scale(1.08);
}

.nav-btn:active {
    transform: scale(0.96);
    background: rgba(74, 108, 247, 0.1);
}

/* 强调按钮（批量加分）- 与普通按钮统一 */
.nav-btn-accent {
    font-weight: 500;
}

.nav-btn-accent svg {
    color: #94a3b8;
}

.nav-btn-accent:hover {
    background: rgba(74, 108, 247, 0.06);
}

/* 班级筛选下拉 */
.nav-class-filter {
    height: 38px;
    padding: 0 30px 0 12px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #475569;
    cursor: pointer;
    outline: none;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid #e2e8f0;
    min-width: 110px;
    text-align-last: left;
    text-align: left;
    -moz-text-align-last: left;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.nav-class-filter:hover {
    border-color: #cbd5e1;
    background-color: #fff;
}

.nav-class-filter:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
    background-color: #fff;
}

.nav-class-filter option {
    background: #fff;
    color: #1e293b;
}

/* 搜索区 */
.nav-center {
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 36px;
}

.search-box:focus-within {
    background: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08), 0 2px 8px rgba(74, 108, 247, 0.06);
}

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.2s ease;
}

.search-box:focus-within .search-icon {
    color: #4a6cf7;
}

#searchInput {
    padding: 0 8px 0 33px;
    border: none;
    border-radius: 10px;
    width: 170px;
    height: 34px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    outline: none;
    background: transparent;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#searchInput::placeholder {
    color: #b0b8c4;
    font-weight: 400;
}

#searchInput:focus {
    width: 200px;
}

.search-btn {
    background: transparent;
    color: #94a3b8;
    border: none;
    height: 30px;
    width: 30px;
    margin-right: 3px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-btn:hover {
    background: rgba(74, 108, 247, 0.08);
    color: #4a6cf7;
}

/* 用户区 */
.nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.auth-buttons {
    display: flex;
    gap: 6px;
}

.auth-btn {
    border: none;
    height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
}

.auth-btn-login {
    background: linear-gradient(135deg, #4a6cf7, #5b7cff);
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

.auth-btn-login:hover {
    background: linear-gradient(135deg, #3b5de7, #4a6cf7);
    box-shadow: 0 4px 14px rgba(74, 108, 247, 0.4);
    transform: translateY(-1px);
}

.auth-btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 108, 247, 0.25);
}

.auth-btn-register {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.auth-btn-register:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.auth-btn-account {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.auth-btn-account:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    transform: translateY(-1px);
}

.auth-btn-account svg {
    flex: none;
    transition: color 0.2s ease;
}

.auth-btn-account:hover svg {
    color: #2563eb;
}

.user-info-bar {
    display: none;
    align-items: center;
    gap: 8px;
}

.user-name-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #475569;
    height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 170px;
}

.user-name-tag svg {
    flex: none;
    color: #64748b;
}

.user-name-tag span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 小屏适配 */
@media (max-width: 1024px) {
    .nav-brand-text { display: none; }
    .nav-brand { padding-right: 8px; }
    .nav-brand-logo { width: 84px; height: 54px; }
    #searchInput { width: 120px; }
    #searchInput:focus { width: 150px; }
}

@media (max-width: 640px) {
    .auth-btn-account span { display: inline !important; }
    .auth-btn-account { padding: 0 8px; }
    .auth-btn-login span { display: none; }
    .auth-btn-login { padding: 0 10px; }
}

/* 主内容区域 */
.main-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 操作栏样式 */
.action-bar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.action-bar-right {
    display: flex;
    align-items: center;
}

.btn-add-student {
    background: linear-gradient(45deg, #06D6A0, #118AB2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(6, 214, 160, 0.3);
}

.btn-add-student:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 214, 160, 0.4);
}

.class-filter {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.class-filter:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

.student-count {
    font-size: 14px;
    color: #718096;
    font-weight: 600;
}

.student-count span {
    color: #5a67d8;
    font-weight: bold;
}

/* 学生网格布局 */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 学生卡片 */
.student-card {
    background: white;
    border-radius: 15px;
    padding: 15px 10px 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: visible;
    min-height: 220px;
}

.student-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.student-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
}

/* 饥饿状态卡片 */
.student-card-hungry {
    filter: grayscale(80%);
    opacity: 0.7;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.student-card-hungry:hover {
    filter: grayscale(35%);
    opacity: 0.88;
}
.student-card-hungry::before {
    background: linear-gradient(45deg, #9ca3af, #6b7280) !important;
}

.hunger-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 13px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
    white-space: nowrap;
    z-index: 5;
    animation: hungerPulse 2s ease-in-out infinite;
    letter-spacing: 1px;
}

.student-card .pet-image-section > .hunger-badge {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    min-width: max-content !important;
    pointer-events: none !important;
    z-index: 8 !important;
}

@keyframes hungerPulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.75; transform: translate(-50%, -50%) scale(0.95); }
}

.student-info {
    text-align: center;
    margin-bottom: 10px;
}

.student-name {
    font-size: 15px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 4px;
}

.student-class {
    display: inline-block;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 3px;
}

.student-id {
    font-size: 10px;
    color: #718096;
}

.pet-image-section {
    position: relative;
    height: 180px;
    overflow: visible;
    animation: breathe 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
    pointer-events: none;
}

.pet-image-section:hover {
    transform: translateY(-5px);
}

.student-card-unhatched::before {
    background: linear-gradient(45deg, #fbbf24, #38bdf8, #f472b6);
}

.student-card-hatching {
    pointer-events: none;
    box-shadow: 0 18px 44px rgba(251, 191, 36, 0.28);
}

.student-card-hatching .pet-image-section {
    animation: hatch-shake 0.16s ease-in-out infinite;
    filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.7));
}

.student-card-hatching .pet-image-section::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.75), rgba(251,191,36,0.28) 45%, rgba(56,189,248,0) 70%);
    animation: hatch-glow 1.1s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.student-card-hatching .pet-image-section > img,
.student-card-hatching .pet-image-section > div:not(.hunger-badge):not(.hatch-sparkles):not(.hatch-badge) {
    position: relative;
    z-index: 1;
}

.hatch-badge {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.3);
    white-space: nowrap;
    z-index: 3;
}

.hatch-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.hatch-sparkles span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: hatch-spark 1s ease-in-out infinite;
}

.hatch-sparkles span:nth-child(1) { left: 18%; top: 24%; background: #38bdf8; animation-delay: 0s; }
.hatch-sparkles span:nth-child(2) { left: 78%; top: 22%; background: #f472b6; animation-delay: 0.12s; }
.hatch-sparkles span:nth-child(3) { left: 16%; top: 68%; background: #a78bfa; animation-delay: 0.24s; }
.hatch-sparkles span:nth-child(4) { left: 82%; top: 66%; background: #34d399; animation-delay: 0.36s; }
.hatch-sparkles span:nth-child(5) { left: 48%; top: 14%; background: #facc15; animation-delay: 0.48s; }
.hatch-sparkles span:nth-child(6) { left: 52%; top: 82%; background: #fb7185; animation-delay: 0.6s; }

@keyframes hatch-shake {
    0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
    25% { transform: translateX(-3px) rotate(-4deg) scale(1.02); }
    75% { transform: translateX(3px) rotate(4deg) scale(1.02); }
}

@keyframes hatch-glow {
    0%, 100% { opacity: 0.55; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes hatch-spark {
    0%, 100% { opacity: 0; transform: translateY(8px) scale(0.5); }
    50% { opacity: 1; transform: translateY(-8px) scale(1.2); }
}

/* ===== 当天加分金色光环（3 种形态） ===== */
.pet-image-section.has-halo > img,
.pet-image-section.has-halo > div:not(.hunger-badge) {
    position: relative;
    z-index: 1;
}

/* —— 形态 1：金圈（默认） —— */
.pet-image-section.has-halo.halo-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 108%;
    height: 108%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgba(255, 215, 0, 0)    0deg,
        rgba(255, 215, 0, 0.7)  90deg,
        rgba(255, 245, 180, 0.95) 180deg,
        rgba(255, 215, 0, 0.7)  270deg,
        rgba(255, 215, 0, 0)    360deg
    );
    -webkit-mask: radial-gradient(circle, transparent 46%, #000 50%, #000 56%, transparent 60%);
            mask: radial-gradient(circle, transparent 46%, #000 50%, #000 56%, transparent 60%);
    filter: drop-shadow(0 0 4px rgba(255, 200, 50, 0.55));
    animation: halo-rotate 4s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* —— 形态 2：柔光（呼吸脉动） —— */
.pet-image-section.has-halo.halo-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 105%;
    height: 105%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 230, 130, 0.55) 0%,
        rgba(255, 200, 60, 0.35)  40%,
        rgba(255, 180, 30, 0.15)  65%,
        rgba(255, 180, 30, 0)     80%
    );
    filter: blur(3px);
    animation: halo-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* —— 形态 3：星光（4 颗星旋转） —— */
.pet-image-section.has-halo.halo-sparkle::before,
.pet-image-section.has-halo.halo-sparkle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110%;
    height: 110%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle 4px at 50% 5%,  rgba(255, 240, 150, 1) 0%, rgba(255, 215, 0, 0.6) 40%, transparent 70%),
        radial-gradient(circle 3px at 95% 50%, rgba(255, 240, 150, 1) 0%, rgba(255, 215, 0, 0.6) 40%, transparent 70%),
        radial-gradient(circle 4px at 50% 95%, rgba(255, 240, 150, 1) 0%, rgba(255, 215, 0, 0.6) 40%, transparent 70%),
        radial-gradient(circle 3px at 5% 50%,  rgba(255, 240, 150, 1) 0%, rgba(255, 215, 0, 0.6) 40%, transparent 70%);
    filter: drop-shadow(0 0 3px rgba(255, 200, 50, 0.7));
    animation: halo-rotate 5s linear infinite;
}

.pet-image-section.has-halo.halo-sparkle::after {
    width: 90%;
    height: 90%;
    background:
        radial-gradient(circle 2px at 75% 25%, rgba(255, 240, 150, 0.95) 0%, rgba(255, 215, 0, 0.5) 40%, transparent 70%),
        radial-gradient(circle 2px at 75% 75%, rgba(255, 240, 150, 0.95) 0%, rgba(255, 215, 0, 0.5) 40%, transparent 70%),
        radial-gradient(circle 2px at 25% 75%, rgba(255, 240, 150, 0.95) 0%, rgba(255, 215, 0, 0.5) 40%, transparent 70%),
        radial-gradient(circle 2px at 25% 25%, rgba(255, 240, 150, 0.95) 0%, rgba(255, 215, 0, 0.5) 40%, transparent 70%);
    animation: halo-rotate-rev 4s linear infinite;
}

@keyframes halo-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes halo-rotate-rev {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to   { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes halo-pulse {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.96); }
    50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    .pet-image-section.has-halo::before,
    .pet-image-section.has-halo::after {
        animation: none;
    }
}

/* Idle cards stay still; explicit score and hatching feedback can still animate. */
.student-card:not(.student-card-hatching) .pet-image-section,
.student-card .hunger-badge,
.student-card:not(.student-card-hatching) .pet-image-section.has-halo::before,
.student-card:not(.student-card-hatching) .pet-image-section.has-halo::after {
    animation: none;
}

.student-card .level-light {
    /* Override the legacy inline blink without changing score rendering. */
    animation: none !important;
}

/* 光环样式选择按钮 */
.halo-style-btn {
    flex: 1 1 auto;
    min-width: 56px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.halo-style-btn:hover {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.halo-style-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #d97706;
    color: #fff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

/* 音量等级选择按钮 */
.sound-volume-btn {
    flex: 1 1 auto;
    min-width: 38px;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sound-volume-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.sound-volume-btn.active {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.student-name {
    transition: all 0.3s ease;
}

.student-name:hover {
    transform: scale(1.02);
}

.pet-breed {
    transition: all 0.3s ease;
}

.pet-breed:hover {
    transform: scale(1.05);
}

.level-badge-inline {
    transition: all 0.3s ease;
}

.level-badge-inline:hover {
    transform: scale(1.05);
}

.exp-section {
    transition: all 0.3s ease;
}

/* exp-section 内各元素默认字号（桌面端） */
.exp-section .exp-label {
    font-size: 10px;
}

.exp-section .exp-remain {
    font-size: 10px;
}

.exp-section .exp-score {
    font-size: 11px;
}

.exp-section .level-badge-inline {
    font-size: 10px;
}

.exp-section .group-badge {
    font-size: 9px;
}

.exp-section:hover {
    background: rgba(255, 255, 255, 0.85) !important;
}

.pet-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pet-image div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 呼吸动画 - 持续放大缩小 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 等级指示器 - 发光动画 */
@keyframes level-blink {
    0% {
        opacity: 0.6;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 小等级指示器 - 发光动画 */
@keyframes level-blink-small {
    0% {
        opacity: 0.5;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 白底等级指示器 - 发光动画 */
@keyframes level-blink-white {
    0% {
        opacity: 0.7;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 加分动画 - 向上飘 */
@keyframes score-up {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -120%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(0.8);
    }
}

/* emoji爆炸动画 */
@keyframes emoji-burst {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(0);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) rotate(var(--rotation)) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(-50% + var(--end-x)),
            calc(-50% + var(--end-y))
        ) rotate(var(--end-rotation)) scale(0.5);
        opacity: 0;
    }
}

/* 升级动画 - 缩放抖动 */
@keyframes level-up {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    30% {
        transform: translate(-50%, -50%) scale(0.9);
    }
    45% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    60% {
        transform: translate(-50%, -50%) scale(0.95);
    }
    75% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -30%) scale(0.8);
    }
}

/* ===== 升级弹窗 ===== */
.levelup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: levelup-bg-in 0.4s ease;
    cursor: pointer;
    overflow: hidden;
}
.levelup-overlay.levelup-out {
    animation: levelup-bg-out 0.5s ease forwards;
}
.levelup-card {
    position: relative;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 28px;
    padding: 36px 32px 28px;
    width: 340px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.2), 0 20px 60px rgba(0,0,0,0.5);
    animation: levelup-card-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    overflow: hidden;
}
.levelup-out .levelup-card {
    animation: levelup-card-out 0.4s ease forwards;
}
.levelup-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    background-size: 200% 100%;
    animation: levelup-glow-flow 1.5s linear infinite;
}
.levelup-pet-wrap {
    margin: 0 auto 16px;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: levelup-pet-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
    filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.35));
}
.levelup-pet-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.levelup-pet-emoji {
    font-size: 100px;
    line-height: 1;
}
.levelup-name {
    font-size: 20px;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 12px;
    letter-spacing: 1px;
    animation: levelup-fade-up 0.5s ease 0.35s both;
}
.levelup-levels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    animation: levelup-fade-up 0.5s ease 0.5s both;
}
.levelup-lv-old {
    font-size: 26px;
    font-weight: 900;
    color: #64748b;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.levelup-arrow {
    font-size: 28px;
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
    animation: levelup-arrow-pulse 0.8s ease-in-out infinite alternate;
}
.levelup-lv-new {
    font-size: 34px;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5), 0 0 40px rgba(251, 191, 36, 0.2);
}
.levelup-title {
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, #f59e0b, #fbbf24, #f59e0b);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: levelup-glow-flow 2s linear infinite, levelup-fade-up 0.5s ease 0.65s both;
    letter-spacing: 2px;
}
.levelup-star {
    position: absolute;
    pointer-events: none;
    animation: levelup-star-float 2s ease-in-out infinite alternate;
    opacity: 0;
    z-index: 0;
}

@keyframes levelup-bg-in {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes levelup-bg-out {
    from { opacity: 1; } to { opacity: 0; }
}
@keyframes levelup-card-in {
    0% { opacity: 0; transform: scale(0.3) rotateZ(-3deg); }
    100% { opacity: 1; transform: scale(1) rotateZ(0); }
}
@keyframes levelup-card-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.7) translateY(30px); }
}
@keyframes levelup-pet-in {
    0% { opacity: 0; transform: scale(0) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes levelup-fade-up {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes levelup-arrow-pulse {
    0% { transform: translateX(-3px); opacity: 0.7; }
    100% { transform: translateX(3px); opacity: 1; }
}
@keyframes levelup-glow-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
@keyframes levelup-star-float {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 0.9; }
    100% { opacity: 0; transform: translateY(-30px) scale(1.1); }
}

/* ===== 加分公告全屏弹窗 ===== */
.score-announce-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: sa-bg-in 0.35s ease;
    cursor: pointer;
    overflow: hidden;
}
.score-announce-overlay.sa-out {
    animation: sa-bg-out 0.5s ease forwards;
}

.sa-card {
    position: relative;
    border-radius: 28px;
    padding: 36px 40px 30px;
    width: 360px;
    max-width: 90vw;
    text-align: center;
    animation: sa-card-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    overflow: hidden;
}
.sa-out .sa-card {
    animation: sa-card-out 0.4s ease forwards;
}

/* 加分：绿色系 */
.sa-positive .sa-card {
    background: linear-gradient(160deg, #064e3b 0%, #065f46 50%, #047857 100%);
    border: 2px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.2), 0 20px 60px rgba(0,0,0,0.5);
}

/* 扣分：红色系 */
.sa-negative .sa-card {
    background: linear-gradient(160deg, #450a0a 0%, #7f1d1d 50%, #991b1b 100%);
    border: 2px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.2), 0 20px 60px rgba(0,0,0,0.5);
}

.sa-glow {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background-size: 200% 100%;
    animation: levelup-glow-flow 1.5s linear infinite;
}
.sa-positive .sa-glow {
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
    background-size: 200% 100%;
}
.sa-negative .sa-glow {
    background: linear-gradient(90deg, #ef4444, #f87171, #ef4444);
    background-size: 200% 100%;
}

.sa-pet-wrap {
    margin: 0 auto 14px;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: levelup-pet-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
.sa-positive .sa-pet-wrap {
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.35));
}
.sa-negative .sa-pet-wrap {
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.35));
}

.sa-pet-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sa-pet-emoji {
    font-size: 80px;
    line-height: 1;
}

.sa-name {
    font-size: 22px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 6px;
    letter-spacing: 1px;
    animation: levelup-fade-up 0.4s ease 0.25s both;
}

.sa-operation {
    font-size: 15px;
    color: rgba(241, 245, 249, 0.7);
    margin-bottom: 14px;
    animation: levelup-fade-up 0.4s ease 0.35s both;
}

.sa-score-change {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 6px;
    animation: levelup-fade-up 0.5s ease 0.4s both;
}
.sa-positive .sa-score-change {
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.4));
}
.sa-negative .sa-score-change {
    background: linear-gradient(135deg, #ef4444, #f87171);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.4));
}

.sa-score-detail {
    font-size: 14px;
    color: rgba(241, 245, 249, 0.5);
    font-weight: 600;
    animation: levelup-fade-up 0.4s ease 0.5s both;
}

.sa-particle {
    position: absolute;
    pointer-events: none;
    animation: levelup-star-float 2s ease-in-out infinite alternate;
    opacity: 0;
    z-index: 0;
}

@keyframes sa-bg-in {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes sa-bg-out {
    from { opacity: 1; } to { opacity: 0; }
}
@keyframes sa-card-in {
    0% { opacity: 0; transform: scale(0.3); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes sa-card-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.7) translateY(30px); }
}

/* 分数中心放大动画 - 向上 */
@keyframes score-center-up {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(0.8);
    }
}

/* 分数中心放大动画 - 向下 */
@keyframes score-center-down {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -20%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 30%) scale(0.8);
    }
}

/* Keep idle bars static; score changes retain their width transition. */
.exp-fill {
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: none;
}

/* 宠物加分动画 - 快乐的弹跳 */
@keyframes pet-happy-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-15px) scale(1.1);
    }
    50% {
        transform: translateY(-25px) scale(1.05);
    }
    75% {
        transform: translateY(-10px) scale(1.08);
    }
}

/* 宠物扣分动画 - 悲伤的摇晃 */
@keyframes pet-sad-shake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10% {
        transform: translateX(-5px) rotate(-2deg);
    }
    20% {
        transform: translateX(5px) rotate(2deg);
    }
    30% {
        transform: translateX(-5px) rotate(-2deg);
    }
    40% {
        transform: translateX(5px) rotate(2deg);
    }
    50% {
        transform: translateX(-3px) rotate(-1deg);
    }
    60% {
        transform: translateX(3px) rotate(1deg);
    }
    70% {
        transform: translateX(-2px) rotate(0deg);
    }
    80% {
        transform: translateX(2px) rotate(0deg);
    }
    90% {
        transform: translateX(-1px) rotate(0deg);
    }
}

.pet-mood {
    position: absolute;
    top: -5px;
    right: 20px;
    font-size: 30px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 宠物状态栏 */
.pet-status {
    margin-top: 15px;
}

.status-bar {
    margin-bottom: 10px;
}

.status-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.status-label span:first-child {
    color: #4a5568;
    font-weight: 600;
}

.status-label span:last-child {
    color: #718096;
}

.status-progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.status-fill {
    height: 100%;
    transition: all 0.5s ease;
    border-radius: 10px;
}

.happiness-fill {
    background: linear-gradient(90deg, #FF6B6B, #FFD166);
}

.hunger-fill {
    background: linear-gradient(90deg, #06D6A0, #118AB2);
}

.health-fill {
    background: linear-gradient(90deg, #EF476F, #FF9A9E);
}

/* 操作按钮 */
.pet-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.feed-btn {
    background: linear-gradient(45deg, #06D6A0, #118AB2);
    color: white;
}

.play-btn {
    background: linear-gradient(45deg, #FF6B6B, #FFD166);
    color: white;
}

.heal-btn {
    background: linear-gradient(45deg, #EF476F, #FF9A9E);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== 未登录遮罩层 ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fafaf9;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    overflow: hidden;
}

/* 极简纹理：等距网格 + 一点品牌色光晕，远胜紫粉蓝渐变 */
.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(244, 114, 182, 0.06), transparent 45%),
        linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    pointer-events: none;
}

.login-overlay.hidden { display: none; }

.login-overlay-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 48px 44px 40px;
    text-align: center;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 24px 48px -16px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.06);
    max-width: 380px;
    width: 90%;
    animation: overlay-fade-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes overlay-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-overlay-icon {
    font-size: 48px;
    margin-bottom: 24px;
    line-height: 1;
    /* 单色调：让 emoji 不那么"AI" */
    filter: grayscale(0.1);
}

.login-overlay-title {
    font-size: 26px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 6px;
    letter-spacing: -0.4px;
}

.login-overlay-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 32px;
    line-height: 1.6;
}

.login-overlay-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.login-overlay-btn {
    flex: 1;
    padding: 12px 0;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    letter-spacing: 0;
}

.login-overlay-btn-primary {
    background: #0f172a;
    color: #ffffff;
}

.login-overlay-btn-primary:hover {
    background: #1e293b;
}

.login-overlay-btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #e2e8f0;
}

.login-overlay-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.login-overlay-recover {
    margin-top: 4px;
}

.login-overlay-recover a {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.login-overlay-recover a:hover {
    color: #475569;
}

/* ===== 登录/注册/找回 弹窗 - 扁平化 ===== */
.modal-content.auth-modal {
    max-width: 380px;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 24px 48px -16px rgba(15, 23, 42, 0.18) !important;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    background: #ffffff;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
}

.auth-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.2px;
}

.auth-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.auth-close:hover {
    background: #f1f5f9;
    color: #475569;
    transform: none;
}

.auth-body {
    padding: 20px 24px 24px;
}

.auth-form-group {
    margin-bottom: 14px;
}

.auth-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.auth-required {
    color: #ef4444;
    font-weight: 500;
    font-size: 12px;
}

.auth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: #ffffff;
}

.auth-input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.auth-tip-card {
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.auth-tip-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 2px;
}

.auth-tip-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.auth-error-card {
    padding: 10px 12px;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
    color: #b91c1c;
    line-height: 1.5;
    animation: authErrorShake 0.35s ease;
}

@keyframes authErrorShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.auth-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    margin-top: 4px;
}

.auth-btn-submit {
    flex: 1;
    padding: 10px 0;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #0f172a;
    cursor: pointer;
    transition: background 0.15s ease;
}

.auth-btn-submit:hover {
    background: #1e293b;
    transform: none;
    box-shadow: none;
}

.auth-btn-cancel {
    flex: 1;
    padding: 10px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    background: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.auth-footer-link {
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.auth-footer-link a {
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.auth-footer-link a:hover {
    color: #0f172a;
}

.auth-recover-link {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

.auth-recover-link:hover {
    color: #475569 !important;
}

.auth-buy-link {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.auth-buy-link a {
    color: #d97706;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-buy-link a:hover {
    color: #b45309;
}

.modal-content.auth-modal.personal-center-modal {
    width: min(400px, 100%);
    max-width: 400px;
    border-radius: 12px !important;
}

.personal-center-body {
    padding-top: 18px;
}

#personalCenterModal .personal-center-modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
}

#personalCenterModal .auth-header {
    flex-shrink: 0;
}

#personalCenterModal .personal-center-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.personal-account-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.personal-account-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #2563eb;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
}

.personal-account-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.personal-account-copy small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
}

.personal-account-copy strong {
    overflow: hidden;
    color: #172033;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.personal-access-badge {
    min-width: 54px;
    padding: 5px 8px;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    color: #64748b;
    background: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.personal-access-badge.is-active {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.personal-access-badge.is-permanent {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.personal-access-badge.is-expired {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.personal-mini-program {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 172px;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
}

.personal-mini-program figcaption {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.personal-mini-program img {
    display: block;
    width: 172px;
    height: 172px;
    object-fit: contain;
    background: #fff;
}

.personal-account-details {
    margin: 16px 0 18px;
    border-top: 1px solid #e8edf2;
}

.personal-account-details > div {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px 2px;
    border-bottom: 1px solid #e8edf2;
}

.personal-account-details dt,
.personal-account-details dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.personal-account-details dt {
    color: #64748b;
}

.personal-account-details dd {
    color: #1e293b;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.personal-center-feedback {
    margin: -4px 0 14px;
    padding: 9px 10px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #9a3412;
    background: #fff7ed;
    font-size: 12px;
    line-height: 1.5;
}

.personal-username-section {
    margin: 0 0 14px;
    padding: 0 0 14px;
    border-bottom: 1px solid #e8edf2;
}

.personal-username-toggle {
    width: 100%;
    min-height: 42px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1d4ed8;
    background: #eff6ff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.personal-username-toggle:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #dbeafe;
}

.personal-username-toggle:disabled {
    color: #94a3b8;
    border-color: #e2e8f0;
    background: #f8fafc;
    cursor: wait;
}

.personal-username-hint {
    margin: 7px 2px 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.personal-username-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8edf2;
}

.personal-username-form[hidden] {
    display: none;
}

.personal-username-form label {
    display: block;
    margin: 0 0 6px;
    color: #475569;
    font-size: 12px;
    font-weight: 650;
}

.personal-username-form .auth-input {
    width: 100%;
    height: 42px;
    margin: 0 0 11px;
    font-size: 14px;
}

.personal-username-error {
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-radius: 7px;
    color: #b91c1c;
    background: #fef2f2;
    font-size: 12px;
    line-height: 1.5;
}

.personal-username-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.personal-username-actions .auth-btn-cancel,
.personal-username-actions .auth-btn-submit {
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    font-size: 13px;
}

.personal-shortcut-section {
    margin-bottom: 12px;
}

.personal-shortcut-button {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #a7d8c4;
    border-radius: 8px;
    color: #16634b;
    background: #f3faf6;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
}

.personal-shortcut-button:hover {
    border-color: #67b699;
    background: #e7f5ed;
}

.personal-shortcut-button:focus-visible {
    outline: 2px solid #16805d;
    outline-offset: 2px;
}

.personal-shortcut-hint {
    margin: 8px 2px 0;
    color: #52665c;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.personal-shortcut-hint[hidden] {
    display: none;
}

.personal-center-logout {
    width: 100%;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.personal-center-logout:hover {
    border-color: #fca5a5;
    background: #fef2f2;
}

.personal-center-logout:focus-visible {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .modal-content.auth-modal.personal-center-modal {
        margin: 24px auto;
    }

    .personal-center-body {
        padding: 16px;
    }

    .personal-account-head {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 11px;
    }

    .personal-account-avatar {
        width: 40px;
        height: 40px;
    }
}

.logout-confirm-modal {
    max-width: 360px;
}

.logout-confirm-icon {
    width: 44px;
    height: 44px;
    margin: 2px auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    color: #ea580c;
    font-size: 24px;
    font-weight: 700;
}

.logout-confirm-title {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.logout-confirm-text {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.logout-confirm-actions {
    margin-bottom: 0;
}

.logout-confirm-submit {
    background: #dc2626;
}

.logout-confirm-submit:hover {
    background: #b91c1c;
}

.app-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
}

.app-dialog {
    width: min(380px, 100%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
    padding: 20px;
    animation: authModalIn 0.18s ease;
}

.app-dialog-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.app-dialog-message {
    color: #64748b;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    max-height: 42vh;
    overflow: auto;
}

.app-dialog-input {
    width: 100%;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
}

.app-dialog-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.app-dialog-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.app-dialog-btn {
    flex: 1;
    min-height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.app-dialog-cancel {
    background: #ffffff;
    color: #64748b;
}

.app-dialog-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.app-dialog-confirm {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.app-dialog-confirm:hover {
    background: #1e293b;
    border-color: #1e293b;
}

.app-dialog-danger .app-dialog-confirm {
    background: #dc2626;
    border-color: #dc2626;
}

.app-dialog-danger .app-dialog-confirm:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* 找回成功结果卡片 */
.auth-result-card {
    background: #f0fdf4;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
    padding: 18px;
    margin-bottom: 16px;
    text-align: center;
}

.auth-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 14px;
}

.auth-result-info {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dcfce7;
    padding: 12px;
    margin-bottom: 10px;
}

.auth-result-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 0;
}

.auth-result-row + .auth-result-row {
    border-top: 1px solid #f1f5f9;
}

.auth-result-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.auth-result-value {
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

.auth-result-username {
    color: #0f172a;
}

.auth-result-password {
    color: #b91c1c;
}

.auth-result-hint {
    font-size: 12px;
    color: #64748b;
}

.modal-content.login-auth-modal {
    max-width: 440px;
    margin: max(24px, 7vh) auto;
    border-radius: 12px !important;
}

.login-auth-modal .auth-header {
    padding: 18px 20px 14px;
    background: #ffffff !important;
}

.login-auth-modal .auth-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.login-modal-subtitle {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.4;
}

.login-method-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 14px 20px 0;
    padding: 4px;
    border-radius: 8px;
    background: #f1f5f9;
}

.login-method-tabs.single {
    grid-template-columns: 1fr;
}

.login-method-tab {
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.login-method-tab:hover {
    color: #0f172a;
}

.login-method-tab.active {
    background: #ffffff;
    color: #15803d;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.login-method-tab:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.login-auth-body {
    padding: 18px 20px 20px;
}

.login-method-panel[hidden] {
    display: none !important;
}

.wechat-login-heading {
    margin-bottom: 10px;
    text-align: center;
}

.wechat-login-title {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
}

.wechat-login-subtitle {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.wechat-test-status {
    min-height: 20px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.wechat-test-qr-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 196px;
    height: 196px;
    margin: 10px auto 2px;
    padding: 7px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.wechat-test-qr-wrap::before {
    content: "正在准备二维码";
    grid-area: 1 / 1;
    color: #94a3b8;
    font-size: 12px;
}

.wechat-test-qr-wrap.is-error::before {
    content: "请重新获取二维码";
}

.wechat-test-qr-wrap.is-ready::before {
    display: none;
}

.wechat-test-qr {
    grid-area: 1 / 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.wechat-test-qr-wrap.is-ready .wechat-test-qr {
    opacity: 1;
}

.wechat-bind-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.wechat-bind-title {
    margin-bottom: 12px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.wechat-test-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.wechat-test-actions .auth-btn-submit,
.wechat-test-actions .auth-btn-cancel {
    min-height: 40px;
}

.wechat-refresh-btn {
    padding: 5px 8px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.wechat-refresh-btn:hover {
    color: #15803d;
}

.wechat-refresh-btn:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
    border-radius: 4px;
}

.wechat-test-note {
    margin-top: 7px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.login-password-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.login-password-label .auth-label {
    margin-bottom: 0;
}

.login-password-label .auth-recover-link {
    color: #64748b !important;
    font-size: 12px;
    text-decoration: none;
}

.login-account-actions {
    margin: 18px 0 12px;
}

.login-auth-modal .auth-btn-submit {
    min-height: 42px;
    background: #16a34a !important;
    box-shadow: none !important;
}

.login-auth-modal .auth-btn-submit:hover {
    background: #15803d !important;
    box-shadow: none !important;
}

.login-register-link {
    margin: 0;
}

.login-help-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    padding: 10px 20px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
}

.login-help-footer button {
    padding: 3px 1px;
    border: 0;
    background: transparent;
    color: #15803d;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.login-help-footer button:hover {
    color: #166534;
    text-decoration: underline;
}

.login-help-footer button:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 3px;
    border-radius: 2px;
}

.login-auth-modal[data-mode="bind"] .login-help-footer {
    display: none;
}

@media (max-width: 640px) {
    .modal-content.login-auth-modal {
        width: calc(100% - 24px);
        margin: 16px auto;
    }

    .login-auth-modal .auth-header {
        padding: 16px 16px 12px;
    }

    .login-method-tabs {
        margin: 12px 16px 0;
    }

    .login-auth-body {
        padding: 16px;
    }

    .wechat-test-qr-wrap {
        width: 184px;
        height: 184px;
    }
}

/* ===== 激活码找回密码 ===== */
#recoverModal {
    padding: 16px;
    background: rgba(15, 23, 42, 0.52);
}

.modal-content.auth-modal.recover-auth-modal {
    display: flex;
    flex-direction: column;
    width: min(420px, 100%);
    max-width: 420px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: clamp(32px, 9vh, 84px) auto !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

.recover-auth-modal .auth-header {
    flex: 0 0 auto;
    min-height: 56px;
    padding: 14px 18px;
    border-bottom-color: #e8edf2;
    background: #ffffff !important;
}

.recover-auth-modal .auth-header h2 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0;
}

.recover-auth-modal .auth-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 18px 20px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.recover-auth-modal .recover-tip-card {
    margin-bottom: 15px;
    border-color: #dbe7df !important;
    background: #f5faf7 !important;
}

.recover-auth-modal .recover-tip-card .auth-tip-title {
    color: #166534 !important;
}

.recover-auth-modal .auth-input:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12) !important;
}

.recover-password-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.recover-password-grid > div {
    min-width: 0;
}

.recover-actions {
    margin: 18px 0 0;
}

.recover-actions .auth-btn-submit {
    min-height: 44px;
    background: #16a34a !important;
}

.recover-actions .auth-btn-submit:hover {
    background: #15803d !important;
}

.recover-actions .auth-btn-submit:disabled {
    cursor: wait;
    opacity: 0.66;
}

.recover-actions .auth-btn-cancel {
    min-height: 44px;
}

@media (max-width: 640px) {
    #recoverModal {
        padding: max(8px, env(safe-area-inset-top)) 8px 0;
        overflow: hidden;
    }

    .modal-content.auth-modal.recover-auth-modal {
        position: absolute;
        right: 8px;
        bottom: 0;
        left: 8px;
        width: auto;
        max-height: calc(100vh - 8px);
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
        margin: 0 auto !important;
        border-bottom: 0;
        border-radius: 14px 14px 0 0 !important;
    }

    .recover-auth-modal .auth-header {
        min-height: 52px;
        padding: 12px 14px 11px 16px;
    }

    .recover-auth-modal .auth-body {
        padding: 14px 16px max(14px, env(safe-area-inset-bottom));
        scroll-padding: 12px 0 max(72px, env(safe-area-inset-bottom));
    }

    .recover-auth-modal .auth-input {
        min-height: 46px;
        font-size: 16px;
        scroll-margin: 12px 0 76px;
    }
}

@media (max-width: 340px) {
    .recover-password-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 850px;
    width: 90%;
    margin: 40px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    color: #2d3748;
    font-size: 24px;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #718096;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #e53e3e;
    transform: scale(1.1);
}

/* 小卖部样式 */
.store-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 25px;
}

.store-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.store-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.store-item:active {
    transform: scale(0.95);
}

.item-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.item-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.item-price {
    font-size: 14px;
    opacity: 0.9;
}

/* ===== 班级管理弹窗 ===== */
.cls-mgmt-modal {
    max-width: 520px;
    padding: 0 !important;
    border-radius: 18px !important;
    overflow: hidden;
}

.cls-mgmt-header {
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    padding: 18px 24px;
}

.cls-mgmt-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
}

.cls-mgmt-header-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.cls-mgmt-header .close-btn {
    color: #94a3b8;
    font-size: 22px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
}

.cls-mgmt-header .close-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
    transform: none;
}

.cls-mgmt-body {
    padding: 20px 24px 24px;
    background: #f5f7fa;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* 添加栏 */
.cls-mgmt-add-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.cls-mgmt-add-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1.5px solid #e0e5ee;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a2e;
    transition: all 0.2s;
    outline: none;
}

.cls-mgmt-add-input:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

.cls-mgmt-add-input::placeholder { color: #b8c0cc; }

.cls-mgmt-add-btn {
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    border: none;
    background: #4a6cf7;
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.cls-mgmt-add-btn:hover {
    background: #3b5de7;
    box-shadow: 0 3px 10px rgba(74,108,247,0.3);
}

.cls-mgmt-add-btn:active { transform: scale(0.97); }

/* 班级列表 */
.cls-mgmt-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 班级行 */
.cls-mgmt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #edf0f5;
    transition: all 0.15s;
}

.cls-mgmt-row:hover {
    border-color: #dce1ea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 色条 */
.cls-mgmt-bar {
    width: 4px;
    height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* 信息区 */
.cls-mgmt-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cls-mgmt-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cls-mgmt-badge {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 8px;
    flex-shrink: 0;
    line-height: 20px;
}

/* 删除按钮 — hover 淡入 */
.cls-mgmt-del {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #c8cfd8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    opacity: 0;
}

.cls-mgmt-del svg { display: block; }
.cls-mgmt-row:hover .cls-mgmt-del { opacity: 1; }

.cls-mgmt-del:hover {
    background: #fef2f2;
    color: #ef4444;
}

.cls-mgmt-del:active { transform: scale(0.9); }

.cls-mgmt-del.is-locked { opacity: 0 !important; pointer-events: none; }
.cls-mgmt-row:hover .cls-mgmt-del.is-locked { opacity: 0.3 !important; pointer-events: none; }

/* 重命名是常用管理动作，保持可见，避免触屏和无 hover 设备找不到入口。 */
.cls-mgmt-rename {
    width: auto;
    min-width: 58px;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: none;
    background: #eff6ff;
    color: #3b82f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s;
    flex-shrink: 0;
    opacity: 1;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

.cls-mgmt-rename svg { display: block; }

.cls-mgmt-rename:hover {
    background: #dbeafe;
    color: #2563eb;
}

.cls-mgmt-rename:active { transform: scale(0.9); }

.cls-mgmt-rename-label { line-height: 1; }

/* 空态 */
.cls-mgmt-empty {
    text-align: center;
    padding: 40px 0 28px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.8;
}

.cls-mgmt-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: #edf0f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c4d0;
}

.cls-mgmt-empty-icon svg { display: block; }

/* 底部统计 */
.cls-mgmt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 14px 16px 0;
    border-top: 1px solid #e8ecf1;
}

.cls-mgmt-stat {
    font-size: 12px;
    color: #94a3b8;
}

.cls-mgmt-stat b {
    color: #64748b;
    font-weight: 600;
}

@media (max-width: 480px) {
    .cls-mgmt-modal { max-width: 100%; border-radius: 14px !important; }
    .cls-mgmt-body { padding: 16px; }
}

/* ===== 分组管理弹窗 ===== */
.grp-mgmt-modal {
    max-width: 680px;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    margin: 20px auto !important;
}

.grp-mgmt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    flex-shrink: 0;
}

.grp-mgmt-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grp-mgmt-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #4a6cf7;
}

.grp-mgmt-header h2 {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.grp-mgmt-header-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1px;
}

.grp-mgmt-header .grp-mgmt-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.grp-mgmt-header .grp-mgmt-close:hover {
    background: #e2e8f0;
    color: #64748b;
    transform: none;
}

.grp-mgmt-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 16px 20px;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 顶部添加表单：不可压缩，永远可见，包括「添加分组」按钮 */
.grp-mgmt-add-card {
    flex: 0 0 auto;
}

/* 现有分组：自适应剩余空间，列表区单独滚动 */
.grp-mgmt-list-card {
    flex: 1 1 auto;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.grp-mgmt-list-card .grp-mgmt-section-head {
    flex: 0 0 auto;
}
.grp-mgmt-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.grp-mgmt-list-scroll::-webkit-scrollbar { width: 5px; }
.grp-mgmt-list-scroll::-webkit-scrollbar-track { background: transparent; }
.grp-mgmt-list-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

/* 区块卡片 */
.grp-mgmt-section-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.grp-mgmt-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.grp-mgmt-section-head svg {
    color: #64748b;
    flex-shrink: 0;
}

.grp-mgmt-section-body {
    padding: 14px 18px;
}

/* 添加表单：横向收紧，避免纵向占用过多空间 */
.grp-mgmt-add-card .grp-mgmt-section-body {
    padding: 14px 18px 12px;
}

/* 表单 */
.grp-mgmt-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.grp-mgmt-form-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grp-mgmt-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.grp-mgmt-form-full {
    margin-bottom: 10px;
}

.grp-mgmt-form-full .grp-mgmt-label {
    display: block;
    margin-bottom: 6px;
}

.grp-mgmt-input,
.grp-mgmt-select {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: all 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.grp-mgmt-input::placeholder { color: #b0b8c4; }

.grp-mgmt-input:focus,
.grp-mgmt-select:focus {
    background: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.08);
}

.grp-mgmt-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

/* 颜色选择器 */
.grp-mgmt-colors {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
}

.grp-mgmt-colors .color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
    outline: none;
}

.grp-mgmt-colors .color-option:hover {
    transform: scale(1.15);
}

.grp-mgmt-colors .color-option.selected {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor;
    transform: scale(1.1);
}

.grp-mgmt-colors .color-option:focus-visible {
    outline: 3px solid rgba(74, 108, 247, 0.2);
    outline-offset: 2px;
}

/* 添加按钮 */
.grp-mgmt-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.grp-mgmt-btn-add {
    height: 36px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #fff;
    background: #4a6cf7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.grp-mgmt-btn-add:hover {
    background: #3b5de7;
    box-shadow: 0 2px 8px rgba(74,108,247,0.25);
}

.grp-mgmt-btn-add:active {
    transform: scale(0.97);
}

/* 分组列表 */
.grp-mgmt-class-section + .grp-mgmt-class-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f5;
}

.grp-mgmt-class-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}

.grp-mgmt-class-title svg {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.grp-mgmt-class-count {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.grp-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    align-items: start;
}

.grp-mgmt-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #eef1f5;
    border-radius: 8px;
    transition: all 0.15s;
    position: relative;
}

.grp-mgmt-card:hover {
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.grp-mgmt-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.grp-mgmt-card-info {
    flex: 1;
    min-width: 0;
}

.grp-mgmt-card-name {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grp-mgmt-card-count {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}

.grp-mgmt-card-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}

.grp-mgmt-card:hover .grp-mgmt-card-btn {
    opacity: 1;
}

.grp-mgmt-card-btn svg {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.grp-mgmt-card-rename:hover {
    background: #eff6ff;
}

.grp-mgmt-card-rename:hover svg {
    color: #3b82f6;
}

.grp-mgmt-card-del:hover {
    background: #fef2f2;
}

.grp-mgmt-card-del:hover svg {
    color: #ef4444;
}

/* 空状态 */
.grp-mgmt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
}

.grp-mgmt-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: #b0b8c4;
}

/* 底部 */
.grp-mgmt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 24px;
    background: #fff;
    border-top: 1px solid #e8ecf1;
    flex-shrink: 0;
    font-size: 12px;
    color: #94a3b8;
}

.grp-mgmt-footer strong {
    color: #64748b;
    font-weight: 600;
}

@media (max-width: 640px) {
    .grp-mgmt-form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== 班级与分组统一管理 ===== */
.class-group-modal {
    width: min(720px, calc(100vw - 40px));
    max-width: 720px;
    height: min(700px, calc(100dvh - 40px));
    max-height: calc(100dvh - 40px) !important;
    margin: 20px auto !important;
    padding: 0 0 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

.class-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    flex: 0 0 auto;
}

.class-group-header-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.class-group-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eef3ff;
    color: #4a6cf7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.class-group-header h2 {
    margin: 0;
    color: #1e293b;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
}

.class-group-header-sub {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.4;
}

.class-group-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.class-group-close:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
    transform: none;
}

.class-group-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    flex: 0 0 auto;
}

.class-group-tab {
    min-width: 0;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f4f6f9;
    color: #64748b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.class-group-tab:hover {
    background: #edf1f7;
    color: #334155;
}

.class-group-tab.is-active {
    background: #eef3ff;
    border-color: #cdd8ff;
    color: #3658d4;
    box-shadow: inset 0 -2px 0 #4a6cf7;
}

.class-group-tab:focus-visible {
    outline: 3px solid rgba(74, 108, 247, 0.18);
    outline-offset: 1px;
}

.class-group-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.class-group-panel.is-active {
    display: flex;
}

.class-group-panel[hidden] {
    display: none !important;
}

.class-group-panel .cls-mgmt-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 20px 22px 24px;
    overflow-y: auto;
}

.class-group-panel .grp-mgmt-body {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 640px) {
    #classGroupManagementModal {
        padding: 8px;
    }

    .class-group-modal {
        width: 100%;
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px) !important;
        margin: 0 auto !important;
        border-radius: 12px !important;
    }

    .class-group-header {
        padding: 14px 16px;
    }

    .class-group-header-icon {
        width: 34px;
        height: 34px;
    }

    .class-group-header h2 {
        font-size: 17px;
    }

    .class-group-tabs {
        padding: 8px 12px;
    }

    .class-group-tab {
        min-height: 40px;
        padding: 0 10px;
        font-size: 13px;
    }

    .class-group-panel .cls-mgmt-body {
        padding: 14px 12px 18px;
    }

    .class-group-panel .grp-mgmt-body {
        padding: 12px;
        gap: 10px;
    }

    .class-group-panel .grp-mgmt-footer {
        padding: 11px 14px;
    }
}

@media (hover: none), (pointer: coarse) {
    .class-group-panel .cls-mgmt-del,
    .class-group-panel .cls-mgmt-rename,
    .class-group-panel .grp-mgmt-card-btn {
        opacity: 1;
    }
}

/* ===== 账号绑定弹窗 ===== */
.pb-modal {
    max-width: 420px;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
    margin: auto;
    padding-bottom: 0 !important;
}

.pb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    flex-shrink: 0;
}

.pb-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pb-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f4ff;
    color: #4a6cf7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pb-header h2 {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.pb-header-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1px;
}

.pb-header .pb-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.pb-header .pb-close:hover {
    background: #e2e8f0;
    color: #64748b;
    transform: none;
}

.pb-body {
    padding: 20px 22px 22px;
    background: #f5f7fa;
    overflow-y: auto;
}

.pb-body::-webkit-scrollbar { width: 5px; }
.pb-body::-webkit-scrollbar-track { background: transparent; }
.pb-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.account-binding-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex-shrink: 0;
    gap: 4px;
    margin: 14px 22px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f1f5f9;
}

.account-binding-tabs [role="tab"] {
    min-width: 0;
    min-height: 40px;
    padding: 8px;
    border: 0;
    border-radius: 5px;
    color: #64748b;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    touch-action: manipulation;
}

.account-binding-tabs [role="tab"][aria-selected="true"] {
    color: #1d4ed8;
    background: #fff;
}

.account-binding-tabs [role="tab"]:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.account-binding-panel {
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.account-binding-panel[hidden] {
    display: none;
}

.teacher-binding-panel {
    padding: 18px 22px 24px;
    background: #fff;
}

#parentBindModal.is-teacher-binding .pb-modal {
    height: fit-content;
    align-self: center;
    margin: auto;
}

.teacher-binding-code {
    display: block;
    width: min(100%, 260px);
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
    object-fit: contain;
}

/* 二维码卡片 */
.pb-qr-card {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.pb-qr-img {
    max-width: 220px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.pb-qr-empty {
    text-align: center;
    color: #b0b8c4;
    font-size: 13px;
    line-height: 1.6;
    padding: 20px;
}

.pb-qr-empty svg {
    color: #cbd5e1;
    margin-bottom: 10px;
}

.pb-poster-card {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}

.pb-poster-img {
    width: 100%;
    max-width: 330px;
    max-height: min(58vh, 520px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    background: #fff;
}

.pb-poster-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.pb-poster-actions .pb-copy-btn {
    width: 100%;
    justify-content: center;
}

.pb-copy-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.pb-poster-note {
    color: #64748b;
    font-size: 13px;
    line-height: 1.65;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    padding: 12px 14px;
}

/* 绑定码卡片 */
.pb-code-card {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.pb-code-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a6cf7 0%, #6b8aff 100%);
}

.pb-code-label {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pb-code-label svg { color: #cbd5e1; }

.pb-code-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pb-code-value {
    flex: 1;
    font-size: 28px;
    font-weight: 800;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: #1e293b;
    letter-spacing: 0.12em;
    user-select: all;
    line-height: 1;
}

.pb-copy-btn {
    padding: 9px 14px;
    background: #4a6cf7;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(74,108,247,0.25);
}

.pb-copy-btn:hover {
    background: #3b5de7;
    box-shadow: 0 4px 12px rgba(74,108,247,0.35);
    transform: translateY(-1px);
}

.pb-copy-btn:active { transform: translateY(0); }

.pb-copy-btn.copied {
    background: #10b981;
    box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

/* 步骤 */
.pb-steps {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    padding: 14px 16px;
}

.pb-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.pb-step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.pb-step-text strong {
    color: #1e293b;
    font-weight: 600;
}

.pb-or {
    display: inline-block;
    margin: 0 4px;
    padding: 0 6px;
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== 等级设置弹窗 ===== */
.lvl-modal {
    max-width: 620px;
    padding: 0 !important;
    border-radius: 22px !important;
    overflow: hidden;
}

.lvl-header {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-bottom: none;
    padding: 14px 22px;
}

.lvl-header h2 {
    color: white;
    font-size: 17px;
}

.lvl-header .close-btn {
    color: rgba(255,255,255,0.85);
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.2s;
}

.lvl-header .close-btn:hover {
    background: rgba(255,255,255,0.35);
    color: white;
    transform: none;
}

.lvl-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

.lvl-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lvl-toolbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.lvl-btn {
    height: 34px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lvl-btn-reset {
    color: white;
    background: linear-gradient(135deg, #f97316, #fb923c);
}

.lvl-btn-reset:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(249,115,34,0.35);
}

.lvl-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lvl-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fafbff;
    border: 1.5px solid #e8ecf2;
    transition: all 0.2s;
}

.lvl-item:hover {
    border-color: #fde68a;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

.lvl-item-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    flex-shrink: 0;
}

.lvl-item-info {
    flex: 1;
    min-width: 0;
}

.lvl-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.lvl-item-range {
    font-size: 11px;
    color: #94a3af;
    margin-top: 2px;
}

.lvl-item-edit {
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lvl-item-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,158,11,0.35);
}

.lvl-tip-card {
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #fde68a;
}

.lvl-tip-title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 6px;
}

.lvl-tip-text {
    font-size: 12px;
    color: #a16207;
    line-height: 1.8;
}

/* ===== 点名弹窗 ===== */
.rc-modal {
    max-width: 480px;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
}

.rc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 22px 24px 18px;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
}

.rc-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rc-header-icon {
    color: #4a6cf7;
    margin-top: 2px;
    flex-shrink: 0;
}

.rc-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.rc-header-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.rc-header .rc-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.rc-header .rc-close:hover {
    background: #e2e8f0;
    color: #64748b;
    transform: none;
}

.rc-body {
    padding: 22px 24px 24px;
    background: #f5f7fa;
}

/* 班级选择行 */
.rc-filter-row {
    margin-bottom: 18px;
}

.rc-filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 7px;
}

.rc-select-wrap {
    position: relative;
}

.rc-filter-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.rc-filter-select:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

/* 展示区 */
.rc-display {
    text-align: center;
    padding: 32px 20px;
    background: #fff;
    border: 2px dashed #e2e8f0;
    border-radius: 14px;
    margin-bottom: 18px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.rc-display.is-active {
    border-color: #4a6cf7;
    border-style: solid;
    box-shadow: 0 4px 20px rgba(74,108,247,0.08);
}

.rc-display.is-rolling {
    border-color: #4a6cf7;
    border-style: solid;
}

/* 占位态 */
.rc-placeholder {
    text-align: center;
}

.rc-placeholder-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #f1f5f9;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.rc-placeholder-text {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

/* 宠物图片 */
.rc-pet-wrap {
    margin-bottom: 14px;
}

.rc-pet-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    transition: transform 0.3s;
}

.rc-pet-wrap.is-rolling .rc-pet-img {
    animation: rcPetRollShake 0.1s ease infinite alternate;
}

.rc-pet-wrap.is-result .rc-pet-img {
    width: 140px;
    height: 140px;
    animation: rcPetBounce 0.5s ease;
}

@keyframes rcPetRollShake {
    from { transform: rotate(-4deg) scale(0.92); }
    to   { transform: rotate(4deg) scale(1.08); }
}

@keyframes rcPetBounce {
    0%   { transform: scale(0.3) rotate(-10deg); opacity: 0.5; }
    50%  { transform: scale(1.12) rotate(4deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}

/* 学生姓名 */
.rc-student-name {
    font-size: 30px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.rc-student-name.is-rolling {
    color: #4a6cf7;
    animation: rcNamePulse 0.12s ease infinite;
}

@keyframes rcNamePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.rc-student-info {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.rc-student-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 6px;
}

/* 按钮 */
.rc-actions {
    margin-bottom: 14px;
}

.rc-btn-start {
    width: 100%;
    padding: 13px 20px;
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(74,108,247,0.25);
}

.rc-btn-start:hover {
    background: #3b5de7;
    box-shadow: 0 6px 20px rgba(74,108,247,0.35);
    transform: translateY(-1px);
}

.rc-btn-start:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(74,108,247,0.2);
}

.rc-btn-start:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* 提示卡片 */
.rc-tip-card {
    padding: 11px 14px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.5;
}

.rc-tip-icon {
    flex-shrink: 0;
    color: #cbd5e1;
}

/* 抽取人数选择器 */
.rc-count-row {
    margin-bottom: 18px;
}

.rc-count-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
}

.rc-count-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}

.rc-count-btn:first-child {
    border-radius: 10px 0 0 10px;
    border-right: none;
}

.rc-count-btn:last-child {
    border-radius: 0 10px 10px 0;
    border-left: none;
}

.rc-count-btn:hover {
    background: #f0f4ff;
    color: #4a6cf7;
}

.rc-count-btn:active {
    background: #e0e7ff;
}

.rc-count-input {
    width: 52px;
    height: 36px;
    border: 1.5px solid #e2e8f0;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #1e293b;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.rc-count-input::-webkit-inner-spin-button,
.rc-count-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rc-count-input:focus {
    border-color: #4a6cf7;
}

/* 多人结果展示 */
.rc-multi-result {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
    padding: 6px 0;
}

.rc-multi-rolling {
    font-size: 18px;
    font-weight: 600;
    color: #94a3b8;
    padding: 30px 0;
    animation: rcPulse 0.6s ease infinite alternate;
}

@keyframes rcPulse {
    from { opacity: 0.5; }
    to   { opacity: 1; }
}

.rc-multi-card {
    background: #fff;
    border: 1.5px solid #e8ecf3;
    border-radius: 12px;
    padding: 12px 10px 10px;
    width: 90px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.rc-multi-card-enter {
    opacity: 0;
    transform: scale(0.6) translateY(10px);
}

.rc-multi-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 4px 14px rgba(74,108,247,0.15);
    transform: translateY(-2px);
}

.rc-multi-pet {
    width: 52px;
    height: 52px;
    margin: 0 auto 6px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-multi-pet img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rc-multi-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-multi-info {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* 彩色纸屑 */
.rc-confetti-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

@keyframes rcConfettiFall {
    0%   { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
    100% { opacity: 0; transform: translateY(80px) rotate(360deg) scale(0); }
}

/* ===== 转盘设置弹窗 ===== */
.wheel-modal {
    max-width: 620px;
    padding: 0 !important;
    border-radius: 22px !important;
    overflow: hidden;
}

.wheel-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-bottom: none;
    padding: 14px 22px;
}

.wheel-header h2 {
    color: white;
    font-size: 17px;
}

.wheel-header .close-btn {
    color: rgba(255,255,255,0.85);
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.2s;
}

.wheel-header .close-btn:hover {
    background: rgba(255,255,255,0.35);
    color: white;
    transform: none;
}

.wheel-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

.wheel-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.wheel-section-title span {
    font-size: 16px;
}

.wheel-cost-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1.5px solid #a7f3d0;
}

.wheel-cost-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1.5px solid #a7f3d0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    outline: none;
    background: white;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wheel-cost-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

.wheel-prize-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: white;
    border: 1.5px solid #e0e5f6;
}

.wheel-prize-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.wheel-prize-grid input {
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid #d1d5e8;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    background: #fafbff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wheel-prize-grid input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

.wheel-actions {
    display: flex;
    gap: 10px;
}

.wheel-btn {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wheel-btn-save {
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
}

.wheel-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16,185,129,0.35);
}

.wheel-btn-reset {
    color: #475569;
    background: #e2e8f0;
}

.wheel-btn-reset:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}

/* ===== 积分排名弹窗 ===== */
.ranking-modal {
    max-width: 720px;
    padding: 0 !important;
    border-radius: 22px !important;
    overflow: hidden;
}

.ranking-header {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-bottom: none;
    padding: 14px 22px;
}

.ranking-header h2 {
    color: white;
    font-size: 17px;
}

.ranking-header .close-btn {
    color: rgba(255,255,255,0.85);
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.2s;
}

.ranking-header .close-btn:hover {
    background: rgba(255,255,255,0.35);
    color: white;
    transform: none;
}

.ranking-body {
    padding: 16px 20px 20px;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

.ranking-toolbar-card {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #fde68a;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-toolbar-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px 18px;
}

.ranking-toolbar-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 58px;
    justify-content: flex-end;
}

.ranking-toolbar-label {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}

.ranking-type-switch {
    display: flex;
    gap: 6px;
    background: rgba(255,255,255,0.6);
    padding: 3px;
    border-radius: 10px;
}

.ranking-switch-btn {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    background: transparent;
    color: #92400e;
    white-space: nowrap;
}

.ranking-switch-btn.active {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}

.ranking-filter-block { /* 兼容旧结构，无样式 */ }

.ranking-toolbar-row-right {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    align-items: flex-start;
    margin-left: auto;
}

.ranking-toolbar-push-right { margin-left: auto; }

.ranking-export-block { /* 兼容旧结构，无样式 */ }

.ranking-period-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ranking-custom-day-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.6);
    padding: 3px 10px;
    border-radius: 10px;
    height: 38px;
    box-sizing: border-box;
    border: 1.5px solid #fde68a;
}

.ranking-custom-prefix,
.ranking-custom-suffix {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    user-select: none;
}

.ranking-custom-day-input {
    width: 56px;
    height: 26px;
    border: none;
    border-bottom: 1.5px solid #fde68a;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #b45309;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.ranking-custom-day-input::-webkit-outer-spin-button,
.ranking-custom-day-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ranking-custom-day-input:focus {
    border-bottom-color: #f59e0b;
}

.ranking-filter-select {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    outline: none;
    min-width: 130px;
    transition: border-color 0.2s;
}

.ranking-filter-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

.ranking-export-btn {
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ranking-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.premium-ranking-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    background: white;
    border: 1.5px solid #f0f0f5;
    transition: all 0.25s;
}

.rank-card:hover {
    border-color: #e0e5f6;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateX(4px);
}

.rank-card.rank-gold {
    background: linear-gradient(135deg, #fffdf0 0%, #fef9e7 100%);
    border-color: #fcd34d;
    box-shadow: 0 3px 12px rgba(252,211,77,0.25);
}

.rank-card.rank-silver {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-color: #d1d5db;
    box-shadow: 0 3px 12px rgba(209,213,219,0.3);
}

.rank-card.rank-bronze {
    background: linear-gradient(135deg, #fdf8f0 0%, #fef5eb 100%);
    border-color: #fdba74;
    box-shadow: 0 3px 12px rgba(253,186,116,0.25);
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
}

.rank-badge-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.rank-badge-silver { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: white; }
.rank-badge-bronze { background: linear-gradient(135deg, #fdba74, #f97316); color: white; }
.rank-badge-normal { background: #f1f5f9; color: #64748b; font-size: 15px; }

.rank-pet-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f8fafc;
    padding: 2px;
}

.rank-card-info {
    flex: 1;
    min-width: 0;
}

.rank-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.rank-card-class {
    font-size: 11px;
    color: #94a3af;
    margin-top: 2px;
}

.rank-group-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid;
}

.rank-card-score {
    text-align: right;
    flex-shrink: 0;
}

.rank-card-score-value {
    font-size: 18px;
    font-weight: 800;
    color: #f59e0b;
}

.rank-card-score-label {
    font-size: 10px;
    color: #94a3af;
    margin-top: 1px;
}

.rank-group-card {
    border-radius: 14px;
    padding: 14px 16px;
    background: white;
    border: 1.5px solid #f0f0f5;
    transition: all 0.25s;
}

.rank-group-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.rank-group-card.rank-gold { background: linear-gradient(135deg, #fffdf0, #fef9e7); border-color: #fcd34d; box-shadow: 0 3px 12px rgba(252,211,77,0.2); }
.rank-group-card.rank-silver { background: linear-gradient(135deg, #fafafa, #f5f5f5); border-color: #d1d5db; }
.rank-group-card.rank-bronze { background: linear-gradient(135deg, #fdf8f0, #fef5eb); border-color: #fdba74; }

.rank-group-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-group-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-group-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rank-group-class {
    font-size: 11px;
    color: #94a3af;
    margin-left: auto;
}

.rank-group-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
    font-size: 12px;
    color: #64748b;
}

.rank-group-stats strong {
    color: #f59e0b;
}

.rank-group-members {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rank-group-member-tag {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.ranking-empty {
    text-align: center;
    padding: 50px 20px;
    color: #94a3af;
}

.ranking-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.ranking-empty-text {
    font-size: 14px;
}

/* 设置样式 */
.settings-content {
    padding: 25px;
}

/* ===== 设置弹窗 - 高级版 ===== */
.settings-modal {
    max-width: 780px;
    padding: 0 !important;
    border-radius: 22px !important;
    overflow: hidden;
}

.settings-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 10px 20px;
}

.settings-header h2 {
    color: white;
    font-size: 17px;
}

.settings-header .close-btn {
    color: rgba(255,255,255,0.85);
    font-size: 22px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.2s;
}

.settings-header .close-btn:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: none;
}

.premium-settings-content {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(90vh - 50px);
    overflow-y: auto;
}

/* 设置卡片 */
.settings-card {
    border-radius: 12px;
    padding: 10px 14px;
    border: 1.5px solid #e0e5f6;
    background: white;
    transition: box-shadow 0.25s;
}

.settings-card:hover {
    box-shadow: 0 4px 16px rgba(102,126,234,0.1);
}

.settings-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.settings-card-title span {
    font-size: 15px;
}

.settings-subtitle {
    font-size: 11px;
    color: #94a3af;
    margin-bottom: 8px;
}

/* 色彩区分 */
.settings-card-students { border-left: 4px solid #818cf8; }
.settings-card-score { border-left: 4px solid #f59e0b; }
.settings-card-level { border-left: 4px solid #f472b6; }
.settings-card-wheel { border-left: 4px solid #34d399; }
.settings-card-sound { border-left: 4px solid #60a5fa; }
.settings-card-class { border-left: 4px solid #a78bfa; }
.settings-card-theme { border-left: 4px solid #fb923c; }
.settings-card-grid { border-left: 4px solid #6366f1; }

/* 每行数量滑块 */
.settings-grid-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.settings-grid-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3af;
    flex-shrink: 0;
}

#gridColumnsRange {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    accent-color: #6366f1;
}

#gridColumnsRange::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99,102,241,0.4);
}

#gridColumnsRange::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(99,102,241,0.4);
}

.settings-grid-badge {
    min-width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 学生排序按钮组 */
.sort-options-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sort-option-btn {
    height: 34px;
    padding: 0 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    background: #fff;
    color: #6b7280;
    white-space: nowrap;
}

.sort-option-btn:hover {
    border-color: #a78bfa;
    color: #7c3aed;
    background: #f5f3ff;
}

.sort-option-btn.active {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}

/* 饥饿设置 */
.settings-hunger-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.settings-hunger-text {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}
.settings-hunger-input {
    width: 56px;
    padding: 5px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    color: #374151;
    outline: none;
    transition: border-color 0.2s;
}
.settings-hunger-input:focus {
    border-color: #667eea;
}

/* 两列网格 */
.settings-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* 行内布局 */
.settings-inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.settings-inline-row:last-child {
    margin-bottom: 0;
}

.settings-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.settings-action-row:last-child {
    margin-bottom: 0;
}

.settings-flex-1 { flex: 1; min-width: 0; }

/* 设置用下拉框 */
.settings-select {
    height: 32px;
    padding: 0 10px;
    border: 1.5px solid #d1d5e8;
    border-radius: 8px;
    font-size: 12px;
    background: #fafbff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.settings-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* 设置用输入框 */
.settings-input {
    height: 32px;
    padding: 0 10px;
    border: 1.5px solid #d1d5e8;
    border-radius: 8px;
    font-size: 12px;
    outline: none;
    background: #fafbff;
    transition: border-color 0.2s;
}

.settings-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* 设置操作按钮 */
.settings-action-btn {
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.settings-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.settings-btn-primary {
    color: white;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.settings-btn-green {
    color: white;
    background: linear-gradient(135deg, #10b981, #34d399);
}

.settings-btn-indigo {
    color: white;
    background: linear-gradient(135deg, #818cf8, #6366f1);
}

.settings-btn-slate {
    color: #475569;
    background: #e2e8f0;
}

.settings-btn-slate:hover {
    background: #cbd5e1;
}

.settings-btn-red {
    color: white;
    background: linear-gradient(135deg, #ef4444, #f87171);
}

/* 危险区域行 */
.settings-danger-row {
    padding: 8px 10px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1.5px dashed #fecaca;
}

/* 内嵌面板 */
.settings-inner-panel {
    padding: 8px 12px;
    background: #fafbff;
    border-radius: 8px;
    border: 1.5px solid #e8ecf7;
}

.settings-panel-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

/* 音效行 */
.settings-sound-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.settings-sound-label {
    font-size: 12px;
    color: #4a5568;
}

/* 班级列表 */
.settings-class-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 6px;
}

/* 主题选择网格 */
.settings-theme-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 2px;
}

/* 响应式 */
@media (max-width: 640px) {
    .settings-grid-two {
        grid-template-columns: 1fr;
    }
    .settings-theme-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   新版设置页面样式 (stg- 前缀)
   ============================================ */

/* 设置页面 CSS 变量 */
.settings-modal {
    --stg-bg: #f0f2f5;
    --stg-card-bg: #ffffff;
    --stg-text-primary: #1a1a2e;
    --stg-text-secondary: #64748b;
    --stg-text-tertiary: #94a3b8;
    --stg-border: #e8ecf1;
    --stg-border-hover: #cbd5e1;
    --stg-accent: #4a6cf7;
    --stg-accent-soft: #eef1fe;
    --stg-accent-hover: #3b5de7;
    --stg-green: #10b981;
    --stg-green-soft: #ecfdf5;
    --stg-red: #ef4444;
    --stg-red-soft: #fef2f2;
    --stg-orange: #f59e0b;
    --stg-orange-soft: #fffbeb;
    --stg-purple: #8b5cf6;
    --stg-purple-soft: #f5f3ff;
    --stg-radius-sm: 8px;
    --stg-radius-md: 12px;
    --stg-radius-lg: 16px;
    --stg-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --stg-shadow-md: 0 4px 12px rgba(0,0,0,0.06);
}

/* 设置头部副标题 */
.settings-header-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
    font-weight: 400;
}

/* 分区标签 */
.stg-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--stg-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 4px;
    margin-bottom: 10px;
    margin-top: 16px;
}

.stg-section-label:first-child {
    margin-top: 4px;
}

/* 卡片 */
.stg-card {
    background: var(--stg-card-bg);
    border: 1px solid var(--stg-border);
    border-radius: var(--stg-radius-lg);
    padding: 20px;
    margin-bottom: 10px;
    transition: all 0.2s;
    box-shadow: var(--stg-shadow-sm);
}

.stg-card:hover {
    box-shadow: var(--stg-shadow-md);
    border-color: var(--stg-border-hover);
}

/* 卡片头部 */
.stg-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.stg-card-head-with-metric {
    align-items: center;
}

.stg-log-usage {
    min-width: 126px;
    margin-left: auto;
    padding-left: 14px;
    border-left: 1px solid var(--stg-border);
    text-align: right;
    flex: 0 0 auto;
}

.stg-log-usage > span {
    display: block;
    font-size: 11px;
    color: var(--stg-text-tertiary);
    white-space: nowrap;
}

.stg-log-usage > div {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    min-height: 27px;
}

.stg-log-usage strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 21px;
    line-height: 1.25;
    color: var(--stg-orange);
    font-variant-numeric: tabular-nums;
}

.stg-log-usage em {
    font-size: 11px;
    color: var(--stg-text-secondary);
    font-style: normal;
}

@media (max-width: 420px) {
    .stg-card-head-with-metric {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .stg-log-usage {
        width: 100%;
        margin-left: 54px;
        padding: 10px 0 0;
        border-left: 0;
        border-top: 1px solid var(--stg-border);
        text-align: left;
    }

    .stg-log-usage > div {
        justify-content: flex-start;
    }
}

.stg-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--stg-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stg-icon-blue { background: var(--stg-accent-soft); }
.stg-icon-green { background: var(--stg-green-soft); }
.stg-icon-orange { background: var(--stg-orange-soft); }
.stg-icon-red { background: var(--stg-red-soft); }
.stg-icon-purple { background: var(--stg-purple-soft); }

.stg-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--stg-text-primary);
}

.stg-card-desc {
    font-size: 12px;
    color: var(--stg-text-tertiary);
    margin-top: 2px;
}

/* 两列网格 */
.stg-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .stg-grid-2 { grid-template-columns: 1fr; }
}

/* 通用按钮 */
.stg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--stg-radius-sm);
    border: 1px solid var(--stg-border);
    background: var(--stg-card-bg);
    font-size: 13px;
    font-weight: 500;
    color: var(--stg-text-primary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.stg-btn:hover {
    border-color: var(--stg-border-hover);
    box-shadow: var(--stg-shadow-sm);
}

.stg-btn:active {
    transform: scale(0.98);
}

.stg-btn-primary {
    background: var(--stg-accent);
    color: white;
    border-color: var(--stg-accent);
}

.stg-btn-primary:hover {
    background: var(--stg-accent-hover);
    border-color: var(--stg-accent-hover);
}

.stg-btn-green {
    background: var(--stg-green);
    color: white;
    border-color: var(--stg-green);
}

.stg-btn-green:hover {
    opacity: 0.9;
}

.stg-btn-danger {
    color: var(--stg-red);
    border-color: #fca5a5;
    background: var(--stg-red-soft);
}

.stg-btn-danger:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* 按钮行 */
.stg-btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 行内排列 */
.stg-inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 下拉框 */
.stg-select {
    flex: 1;
    min-width: 0;
    padding: 8px 30px 8px 12px;
    border-radius: var(--stg-radius-sm);
    border: 1px solid var(--stg-border);
    background: var(--stg-card-bg);
    font-size: 13px;
    font-family: inherit;
    color: var(--stg-text-primary);
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.stg-select:focus {
    outline: none;
    border-color: var(--stg-accent);
    box-shadow: 0 0 0 3px var(--stg-accent-soft);
}

/* 输入框 */
.stg-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border-radius: var(--stg-radius-sm);
    border: 1px solid var(--stg-border);
    background: var(--stg-card-bg);
    font-size: 13px;
    font-family: inherit;
    color: var(--stg-text-primary);
    transition: border-color 0.15s;
}

.stg-input:focus {
    outline: none;
    border-color: var(--stg-accent);
    box-shadow: 0 0 0 3px var(--stg-accent-soft);
}

/* 开关行 */
.stg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.stg-toggle-row + .stg-toggle-row {
    border-top: 1px solid var(--stg-border);
    margin-top: 6px;
    padding-top: 12px;
}

.stg-toggle-label {
    font-size: 13px;
    color: var(--stg-text-primary);
}

.stg-toggle-desc {
    font-size: 11px;
    color: var(--stg-text-tertiary);
    margin-top: 1px;
}

/* 开关本体 */
.stg-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.stg-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.stg-toggle-track {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s;
}

.stg-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.25s;
}

.stg-toggle input:checked + .stg-toggle-track {
    background: var(--stg-accent);
}

.stg-toggle input:checked + .stg-toggle-track::after {
    transform: translateX(20px);
}

/* 用户编号展示 */
.stg-code-box {
    background: linear-gradient(135deg, #f8faff, #f0f4ff);
    border: 1px solid #dbe4ff;
    border-radius: var(--stg-radius-md);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.stg-code-label {
    font-size: 12px;
    color: var(--stg-text-tertiary);
    margin-bottom: 8px;
}

.stg-code-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--stg-accent);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    margin-bottom: 4px;
}

.stg-code-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.stg-code-copy-btn {
    padding: 6px 20px;
    border-radius: 20px;
    border: 1px solid var(--stg-accent);
    background: white;
    color: var(--stg-accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.stg-code-copy-btn:hover {
    background: var(--stg-accent);
    color: white;
}

.stg-code-hint {
    font-size: 11px;
    color: var(--stg-text-tertiary);
    margin-top: 10px;
}

/* 参数行 */
.stg-param-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--stg-text-secondary);
}

.stg-param-row + .stg-param-row {
    border-top: 1px solid var(--stg-border);
}

/* 数字输入 */
.stg-num-input {
    width: 60px;
    padding: 6px 8px;
    border-radius: var(--stg-radius-sm);
    border: 1px solid var(--stg-border);
    font-size: 14px;
    font-family: inherit;
    text-align: center;
    color: var(--stg-text-primary);
}

.stg-num-input:focus {
    outline: none;
    border-color: var(--stg-accent);
    box-shadow: 0 0 0 3px var(--stg-accent-soft);
}

/* 危险区域 */
.stg-danger-zone {
    border: 1px dashed #fca5a5;
    border-radius: var(--stg-radius-md);
    padding: 14px;
    background: #fffbfb;
}

.stg-danger-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--stg-red);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stg-danger-desc {
    font-size: 11px;
    color: #b91c1c;
    margin-bottom: 10px;
    opacity: 0.7;
}

/* 新版设置背景色 */
.premium-settings-content {
    background: var(--stg-bg, #f0f2f5);
}

/* 家长端 hero 区域（左 QR + 右编号） */
.stg-parent-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f8faff, #f0f4ff);
    border: 1px solid #dbe4ff;
    border-radius: var(--stg-radius-md);
}

.stg-parent-qr {
    flex-shrink: 0;
    text-align: center;
}

.stg-parent-qr img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 1px solid #dbe4ff;
    background: white;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.stg-parent-qr img:hover {
    transform: scale(1.04);
}

.stg-qr-tip {
    font-size: 11px;
    color: var(--stg-text-tertiary);
    margin-top: 6px;
}

.stg-parent-code {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.stg-parent-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--stg-text-primary);
    margin-bottom: 2px;
}

.stg-parent-subtitle {
    font-size: 12px;
    color: var(--stg-text-tertiary);
    margin-bottom: 14px;
}

.stg-parent-poster {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(34, 184, 167, 0.22);
    border-radius: 10px;
    background: rgba(34, 184, 167, 0.06);
}

.stg-parent-poster .stg-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.stg-code-clickable {
    cursor: pointer;
    user-select: all;
    padding: 8px 20px;
    border-radius: 12px;
    display: inline-block;
    transition: all 0.2s;
    position: relative;
}

.stg-code-clickable:hover {
    background: rgba(74, 108, 247, 0.08);
    transform: scale(1.03);
}

.stg-code-clickable:active {
    transform: scale(0.97);
}

.stg-code-copy-hint {
    font-size: 11px;
    color: var(--stg-text-tertiary);
    margin-top: 6px;
}

@media (max-width: 500px) {
    .stg-parent-hero {
        flex-direction: column;
        gap: 16px;
    }
    .stg-parent-poster {
        align-items: stretch;
        flex-direction: column;
    }
    .stg-parent-qr img {
        width: 100px;
        height: 100px;
    }
}

/* ============================================
   / 新版设置页面样式结束
   ============================================ */

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #5a67d8, #667eea);
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 表单样式 - 优化间距 */
.form-group {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.form-group:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

/* 表单选择器样式 */
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

/* 宠物选择器 - 5列图片版优化 */
.pet-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 15px 0;
    border: 2px solid #e2e8f0;
}

.pet-option {
    background: white;
    border-radius: 10px;
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pet-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.pet-option.selected {
    border-color: #5a67d8;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 25px rgba(90, 102, 216, 0.4);
    transform: translateY(-3px);
}

.pet-option.selected .pet-name {
    color: white;
    font-weight: bold;
}

.pet-image-preview {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pet-option:hover .pet-image-preview img {
    transform: scale(1.1);
}

.pet-name {
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.pet-option.selected .pet-name {
    color: white;
}

/* Fallback emoji for image loading error */
.pet-emoji-fallback {
    font-size: 60px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 分类标题 */
.pet-category-title {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #2d3748;
    margin: 25px 0 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 宠物选择器标题 */
.pet-selector-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

/* 宠物详情样式 */
.pet-detail-content {
    max-width: 500px;
}

/* Avoid a full-viewport blur surface on the frequently opened scoring panel. */
#scoreModal {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* 快速评分模态框 */
.score-modal-content {
    max-width: 920px;
    max-height: 88vh;
    overflow: hidden;
    padding: 0 !important;
    border-radius: 24px !important;
    display: flex;
    flex-direction: column;
}

.score-modal-content .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 14px 22px;
}

.score-modal-content .modal-header h2 {
    color: white;
    font-size: 17px;
    letter-spacing: 0.5px;
}

.score-modal-content .modal-header .close-btn {
    color: rgba(255, 255, 255, 0.85);
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.score-modal-content .modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: rotate(90deg);
}

.score-content {
    padding: 16px 20px 20px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 评分面板 - 左右分栏布局 */
.score-layout {
    display: flex;
    gap: 18px;
    height: 100%;
    min-height: 0;
}

.score-layout-left {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.score-layout-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 左栏 - 最近记录区 */
.score-left-logs {
    background: #fafbff;
    border-radius: 14px;
    border: 1.5px solid #e8ecf7;
    padding: 12px 14px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.score-left-logs-title {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8ecf7;
}

.score-left-logs .score-recent-list {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
}

/* 评分面板 - 学生信息卡片 */
.score-student-card {
    border-radius: 18px;
    overflow: hidden;
    margin: 0;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.score-student-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow: hidden;
}

.score-student-info::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.score-student-info::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -10%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.score-pet-image {
    width: 68px;
    height: 68px;
    min-width: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.score-student-details {
    flex: 1;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.score-student-name {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-name-medal-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.35);
    text-shadow: none;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}
.score-name-medal-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

.score-student-class {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    margin-bottom: 6px;
}

.score-current-score {
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 4px;
}

.score-current-score strong {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #ffe58a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 2px;
}

.score-pet-score {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}
.score-pet-score strong {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 2px;
}

/* 评分面板 - 加分记录面板 */
.score-logs-panel {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef0ff 100%);
    padding: 10px 14px;
    border-top: 1px solid rgba(102, 126, 234, 0.08);
}

.score-recent-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 320px;
    overflow-y: auto;
}

.score-recent-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 6px 10px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.score-recent-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.score-recent-op {
    color: #333;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-recent-time {
    color: #aaa;
    font-size: 10px;
}

.score-recent-val {
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
}

.score-undo-btn {
    flex-shrink: 0;
    padding: 3px 10px;
    font-size: 11px;
    border: 1px solid #e74c3c;
    background: #fff;
    color: #e74c3c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.score-undo-btn:hover {
    background: #e74c3c;
    color: #fff;
}

.score-undo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.score-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef0ff 100%);
    border-top: 1px solid rgba(102, 126, 234, 0.12);
}

.score-header-btn {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    color: #4b5563;
    border: none;
    border-right: 1px solid rgba(102, 126, 234, 0.1);
    padding: 10px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-header-btn:last-child {
    border-right: none;
}

.score-header-btn:hover {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
    transform: none;
    box-shadow: none;
}

.score-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 14px;
    flex: 1;
    min-height: 0;
}

.score-section {
    background: #fafbff;
    border-radius: 14px;
    padding: 14px;
    border: 1.5px solid #e8ecf7;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.score-section:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.08);
}

.score-section-title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
    text-align: center;
    padding: 5px 0;
    border-radius: 10px;
    letter-spacing: 0.5px;
    position: relative;
    flex-shrink: 0;
}

.score-quick-add-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.7);
    color: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.score-quick-add-btn:hover {
    background: rgba(255,255,255,1);
}

.score-section:first-child .score-section-title {
    color: #0d9f6e;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-bottom: none;
}

.score-section:last-child .score-section-title {
    color: #dc2626;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-bottom: none;
}

.score-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 4px;
}

/* 加分/扣分项小滚动条样式 */
.score-items::-webkit-scrollbar {
    width: 4px;
}
.score-items::-webkit-scrollbar-track {
    background: transparent;
}
.score-items::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}
.score-items::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.score-item-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    font-size: 14px;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.score-item-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    transition: all 0.25s ease;
}

.score-item-btn.positive::before {
    background: linear-gradient(to bottom, #10b981, #059669);
}

.score-item-btn.negative::before {
    background: linear-gradient(to bottom, #ef4444, #dc2626);
}

.score-item-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.score-item-btn:hover::before {
    width: 5px;
}

.score-item-btn.positive:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.score-item-btn.negative:hover {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}

.score-item-icon {
    font-size: 18px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.score-item-btn.positive .score-item-icon {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.score-item-btn.negative .score-item-icon {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.score-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.score-item-name {
    text-align: left;
    font-weight: 700;
    color: #1f2937;
    font-size: 13px;
}

.score-item-effect {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}

.score-item-value {
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    min-width: 46px;
    text-align: center;
    flex-shrink: 0;
}

.score-item-value.positive {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.score-item-value.negative {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

@media (max-width: 640px) {
    .score-item-list-element {
        flex-wrap: wrap;
    }

    .score-item-position-tools {
        order: 3;
        width: 100%;
    }

    .score-item-position-tools button {
        flex: 1;
    }
}

.score-note-section {
    margin-bottom: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
    border-radius: 14px;
    border: 1.5px solid #e8ecf7;
    flex-shrink: 0;
}

.score-note-section label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #4b5563;
    font-size: 12px;
}

.score-note-section label::before {
    content: '📝';
    font-size: 14px;
}

.score-note-section textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    resize: vertical;
    min-height: 56px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.score-note-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .score-modal-content {
        max-width: 100%;
        overflow-y: auto;
    }

    .score-content {
        overflow: visible;
    }

    .score-layout {
        flex-direction: column;
        gap: 12px;
        height: auto;
    }

    .score-layout-left {
        flex: none;
    }

    .score-left-logs .score-recent-list {
        max-height: 150px;
    }

    .score-items {
        max-height: none;
    }

    .score-sections {
        grid-template-columns: 1fr;
    }

    .score-student-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .score-header-actions {
        flex-direction: row;
    }

    .score-item-btn {
        padding: 10px 12px;
        gap: 10px;
    }

    .score-item-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .score-item-name {
        font-size: 13px;
    }

    .score-item-effect {
        font-size: 10px;
    }

    .score-item-value {
        font-size: 12px;
        min-width: 46px;
        padding: 5px 10px;
    }
}

/* 模态框表单内容区域 - 宽版优化 */
.modal-content > .form-group:first-of-type {
    margin-top: 25px;
}

.modal-content > .btn-primary:last-child {
    margin: 30px auto;
    width: calc(100% - 60px);
    display: block;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(90, 102, 216, 0.3);
}

/* 调整模态框内容内边距 */
.modal-content {
    padding-bottom: 30px;
    max-height: 90vh;
    overflow-y: auto;
}

/* 自定义输入框样式 - 宽版优化 */
#customScore {
    margin-top: 15px !important;
    border-radius: 12px;
    padding: 14px;
    border: 2px dashed #e2e8f0;
    background: #fff9db;
    font-size: 16px;
    font-weight: 500;
}

#customScore:focus {
    border-color: #5a67d8;
    border-style: solid;
    background: white;
    box-shadow: 0 0 0 4px rgba(90, 102, 216, 0.1);
}

/* 表单组 - 宽版布局 */
.modal-content .form-group {
    margin: 25px 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.modal-content .form-group:last-child {
    margin-bottom: 10px;
}

/* 下拉选择框宽版样式 */
.form-select#initialScore {
    padding: 14px;
    font-size: 16px;
    height: auto;
}

/* 学生姓名输入框特殊样式 */
#studentName {
    font-size: 18px;
    font-weight: 500;
    padding: 16px;
}

/* ===== 批量加分弹窗 ===== */
.bsc-modal {
    max-width: 960px;
    width: 96vw;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 60px);
}

.bsc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    flex-shrink: 0;
}

.bsc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bsc-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f4ff;
    color: #4a6cf7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bsc-header h2 {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bsc-header-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1px;
}

.bsc-header .bsc-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.bsc-header .bsc-close:hover {
    background: #e2e8f0;
    color: #64748b;
    transform: none;
}

.bsc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    background: #f5f7fa;
    min-height: 0;
}

.bsc-body::-webkit-scrollbar { width: 8px; }
.bsc-body::-webkit-scrollbar-track { background: transparent; }
.bsc-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.bsc-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 左右双栏容器 */
.bsc-columns {
    display: flex;
    gap: 14px;
    height: 100%;
    min-height: 280px;
}

.bsc-col-left {
    flex: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bsc-col-right {
    flex: 3;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bsc-col-left .bsc-section,
.bsc-col-right .bsc-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bsc-col-left .bsc-section-body,
.bsc-col-right .bsc-section-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 手机端恢复上下排列 */
@media (max-width: 768px) {
    .bsc-columns {
        flex-direction: column;
        min-height: auto;
    }
}

/* 区块卡片 */
.bsc-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.bsc-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    border-radius: 12px 12px 0 0;
}

.bsc-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a6cf7;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bsc-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.bsc-section-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
}

.bsc-section-body {
    padding: 14px 20px;
}

/* 筛选栏 */
.bsc-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.bsc-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bsc-filter-item label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.bsc-filter-item select {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    cursor: pointer;
    min-width: 120px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.15s;
}

.bsc-filter-item select:focus {
    background-color: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.08);
}

.bsc-filter-spacer {
    flex: 1;
    min-width: 8px;
}

.bsc-mini-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a6cf7;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
}

.bsc-mini-btn:hover {
    background: #f0f4ff;
    border-color: #c7d2fe;
}

.bsc-mini-btn-ghost {
    color: #64748b;
}

.bsc-mini-btn-ghost:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

/* 学生网格（纯名字 chip 风格） */
.bsc-student-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 2px;
    align-content: flex-start;
}

/* 学生 chip */
.bsc-student-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 calc(20% - 5px);
    padding: 9px 4px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.2;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .bsc-student-card {
        flex: 0 0 calc(25% - 5px);
    }
}

@media (max-width: 480px) {
    .bsc-student-card {
        flex: 0 0 calc(25% - 5px);
        font-size: 12px;
        padding: 8px 2px;
    }
}

.bsc-student-card:hover {
    border-color: #c7d2fe;
    background: #fafbff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(74,108,247,0.08);
}

.bsc-student-card.selected {
    border-color: #4a6cf7;
    background: #eef2ff;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(74,108,247,0.12);
    font-weight: 600;
}

.bsc-student-card.selected::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4a6cf7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/8px no-repeat;
    box-shadow: 0 1px 3px rgba(74,108,247,0.3);
}

.bsc-student-card .bsc-card-group-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: -2px;
}

.bsc-student-grid::-webkit-scrollbar { width: 5px; }
.bsc-student-grid::-webkit-scrollbar-track { background: transparent; }
.bsc-student-grid::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.bsc-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    color: #94a3b8;
    font-size: 13px;
}

/* 评分项区 */
.bsc-score-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.bsc-score-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.bsc-col-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
    padding-bottom: 6px;
    border-bottom: 1px dashed #eef0f4;
}

.bsc-col-title svg { flex-shrink: 0; }

.bsc-col-positive { color: #10b981; }
.bsc-col-positive svg { color: #10b981; }

.bsc-col-negative { color: #ef4444; }
.bsc-col-negative svg { color: #ef4444; }

.bsc-items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    min-height: 0;
    min-width: 0;
}

.bsc-items-list::-webkit-scrollbar { width: 6px; }
.bsc-items-list::-webkit-scrollbar-track { background: transparent; }
.bsc-items-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.bsc-items-list::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.bsc-item-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #eef1f5;
    border-radius: 9px;
    background: #f8fafc;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
}

.bsc-item-btn:hover {
    background: #fff;
    border-color: #e2e8f0;
}

.bsc-item-btn.positive:hover { border-color: #a7f3d0; }
.bsc-item-btn.negative:hover { border-color: #fecaca; }

.bsc-item-btn.active {
    background: #fff;
}

.bsc-item-btn.positive.active {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.08);
}

.bsc-item-btn.negative.active {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.08);
}

.bsc-item-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #eef1f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.bsc-item-btn.positive .bsc-item-icon {
    background: #ecfdf5;
    border-color: #d1fae5;
}

.bsc-item-btn.negative .bsc-item-icon {
    background: #fef2f2;
    border-color: #fecaca;
}

.bsc-item-name {
    flex: 1;
    font-size: 12.5px;
    font-weight: 500;
    color: #1e293b;
    min-width: 0;
    word-break: break-word;
}

.bsc-item-value {
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.bsc-item-btn.positive .bsc-item-value {
    background: #ecfdf5;
    color: #10b981;
}

.bsc-item-btn.negative .bsc-item-value {
    background: #fef2f2;
    color: #ef4444;
}

/* 底部操作栏 */
.bsc-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #e8ecf1;
    flex-shrink: 0;
}

.bsc-footer-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bsc-footer-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.bsc-footer-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.bsc-footer-value {
    font-size: 22px;
    font-weight: 800;
    color: #4a6cf7;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    line-height: 1;
}

.bsc-footer-input {
    display: flex;
    justify-content: flex-end;
}

.bsc-footer-reason {
    flex: 1;
    min-width: 140px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: all 0.15s;
}

.bsc-footer-reason::placeholder {
    color: #b0b8c4;
}

.bsc-footer-reason:focus {
    background: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.08);
}

.bsc-footer-input input {
    width: 110px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    text-align: center;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: all 0.15s;
}

.bsc-footer-input input::placeholder {
    font-family: inherit;
    font-weight: 400;
    color: #b0b8c4;
    font-size: 13px;
}

.bsc-footer-input input:focus {
    background: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.08);
}

.bsc-btn-cancel {
    height: 38px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s;
}

.bsc-btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.bsc-btn-confirm {
    height: 38px;
    padding: 0 18px;
    border: none;
    background: #4a6cf7;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(74,108,247,0.25);
}

.bsc-btn-confirm:hover {
    background: #3b5de7;
    box-shadow: 0 4px 12px rgba(74,108,247,0.35);
    transform: translateY(-1px);
}

.bsc-btn-confirm:active { transform: translateY(0); }

.bsc-btn-confirm:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .bsc-score-items {
        grid-template-columns: 1fr;
    }
    .bsc-student-grid {
        max-height: 180px;
    }
    .bsc-items-list {
        max-height: 200px;
    }
    .bsc-footer {
        flex-wrap: wrap;
        gap: 10px;
    }
    .bsc-footer-info {
        order: -1;
        width: 100%;
    }
    .bsc-footer-reason {
        order: -1;
        width: 100%;
        flex-basis: 100%;
    }
}

/* ===== 学生管理弹窗 ===== */
.sm-modal {
    max-width: 820px;
    width: 96vw;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 60px);
}

.sm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    flex-shrink: 0;
}

.sm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sm-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f4ff;
    color: #4a6cf7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sm-header h2 {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.sm-header-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1px;
}

.sm-header .sm-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.sm-header .sm-close:hover {
    background: #e2e8f0;
    color: #64748b;
    transform: none;
}

/* Tabs */
.sm-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px 0;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    flex-shrink: 0;
    overflow: hidden;
}

.sm-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: color 0.15s;
    white-space: nowrap;
}

.sm-tab svg { color: #94a3b8; flex-shrink: 0; transition: color 0.15s; }

.sm-tab:hover {
    color: #1e293b;
}

.sm-tab:hover svg { color: #64748b; }

.sm-tab.active {
    color: #4a6cf7;
    font-weight: 600;
}

.sm-tab.active svg { color: #4a6cf7; }

.sm-tab.active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 2px;
    background: #4a6cf7;
    border-radius: 2px;
}

.sm-tab.sm-tab-danger.active {
    color: #ef4444;
}

.sm-tab.sm-tab-danger.active svg { color: #ef4444; }

.sm-tab.sm-tab-danger.active::after {
    background: #ef4444;
}

/* Body */
.sm-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    background: #f5f7fa;
}

.sm-body::-webkit-scrollbar { width: 8px; }
.sm-body::-webkit-scrollbar-track { background: transparent; }
.sm-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.sm-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.sm-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 区块卡片 */
.sm-section-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: visible;
}

.sm-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.sm-section-head .sm-section-icon {
    color: #64748b;
    flex-shrink: 0;
    display: inline-flex;
}

.sm-section-tag {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 400;
    color: #94a3b8;
}

.sm-section-tag-danger { color: #ef4444; }

.sm-section-head-danger .sm-section-icon { color: #ef4444; }

.sm-section-body {
    padding: 16px;
    overflow: visible;
}

/* Forms */
.sm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.sm-form-row:last-child { margin-bottom: 0; }

.sm-form-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sm-form-full {
    margin-bottom: 12px;
}

.sm-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    display: block;
    margin-bottom: 6px;
}

.sm-label-hint {
    font-size: 11px;
    color: #b0b8c4;
    font-weight: 400;
    margin-left: 4px;
}

.sm-input,
.sm-select,
.sm-modal .form-select {
    height: 42px;
    padding: 0 13px;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #1e293b;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.sm-input::placeholder { color: #b0b8c4; }

.sm-input:focus,
.sm-select:focus,
.sm-modal .form-select:focus {
    background: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1), 0 8px 18px rgba(15, 23, 42, 0.06);
}

.sm-select,
.sm-modal .form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%234a6cf7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0 0, right 13px center;
    background-size: 100% 100%, 15px 15px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.sm-select:hover,
.sm-modal .form-select:hover {
    border-color: #b9c7f8;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.sm-select:disabled,
.sm-modal .form-select:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background: #f1f5f9;
    box-shadow: none;
}

.sm-native-select-hidden {
    display: none !important;
}

.sm-custom-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

.sm-custom-select.open {
    z-index: 30;
}

.sm-custom-select-trigger {
    width: 100%;
    height: 42px;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #1e293b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 0 38px 0 13px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.sm-custom-select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-custom-select-trigger i {
    position: absolute;
    right: 13px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    background: no-repeat center/15px 15px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%234a6cf7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    transition: transform 0.16s ease;
    pointer-events: none;
}

.sm-custom-select-trigger:hover {
    border-color: #b9c7f8;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.sm-custom-select.open .sm-custom-select-trigger {
    background: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1), 0 8px 18px rgba(15, 23, 42, 0.06);
}

.sm-custom-select.open .sm-custom-select-trigger i {
    transform: translateY(-50%) rotate(180deg);
}

.sm-custom-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 6px;
    border: 1px solid #dbe5f0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.sm-custom-select.open .sm-custom-select-menu {
    opacity: 0;
    visibility: hidden;
}

.sm-custom-select-menu.is-floating {
    position: fixed;
    right: auto;
    bottom: auto;
    z-index: 200000;
    opacity: 0;
    visibility: hidden;
}

.sm-custom-select-menu.is-floating.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.sm-custom-select-menu::-webkit-scrollbar {
    width: 7px;
}

.sm-custom-select-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sm-custom-select-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.sm-custom-select-option {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

.sm-custom-select-option:hover {
    background: #eef4ff;
    color: #3151d3;
}

.sm-custom-select-option.active {
    background: linear-gradient(135deg, #4a6cf7, #7c3aed);
    color: white;
}

.sm-custom-select-option:disabled {
    color: #aeb8c6;
    cursor: not-allowed;
    background: transparent;
}

.sm-custom-select.disabled .sm-custom-select-trigger {
    color: #94a3b8;
    cursor: not-allowed;
    background: #f1f5f9;
    box-shadow: none;
}

.select-id-navClassFilter {
    width: 132px;
    min-width: 110px;
    flex-shrink: 0;
}

.grp-mgmt-card-color {
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: pointer;
    position: relative;
    padding: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.grp-mgmt-card-color:hover,
.grp-mgmt-card-color:focus-within {
    border-color: #aab7c7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.grp-mgmt-card.is-color-editing {
    flex-wrap: wrap;
}

.grp-mgmt-card-palette {
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: repeat(5, 20px);
    justify-content: space-between;
    gap: 7px 5px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid #e8edf3;
}

.grp-mgmt-card-palette-option {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.grp-mgmt-card-palette-option:hover {
    transform: scale(1.12);
}

.grp-mgmt-card-palette-option.selected {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor;
}

/* 主菜单收紧后，“更多”紧邻个人中心；筛选和搜索仍靠右。 */
.nav-more-wrap + .nav-divider {
    margin-left: auto;
}

.select-id-navClassFilter .sm-custom-select-trigger {
    height: 36px;
    border-radius: 9px;
    font-weight: 600;
    color: #475569;
}

.select-id-classRankingFilter,
.select-id-exportClassFilter,
.select-id-exportScoreClassFilter,
.select-id-resetScoreClassFilter,
.select-id-clearDataClassFilter,
.select-id-batchClassFilter,
.select-id-batchGroupFilter,
.select-id-groupClassSelect,
.select-id-regEducationStage,
.select-id-rollCallClassFilter {
    width: 100%;
}

.settings-row .sm-custom-select,
.stg-danger-row .sm-custom-select,
.rc-select-wrap .sm-custom-select {
    flex: 1;
}

.bsc-filter-item .sm-custom-select-trigger,
.select-id-classRankingFilter .sm-custom-select-trigger,
.select-id-groupClassSelect .sm-custom-select-trigger,
.select-id-rollCallClassFilter .sm-custom-select-trigger {
    height: 40px;
}

.select-id-regEducationStage .sm-custom-select-trigger {
    height: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
}

.sm-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: all 0.15s;
    box-sizing: border-box;
    line-height: 1.6;
}

.sm-textarea::placeholder { color: #b0b8c4; }

.sm-textarea:focus {
    background: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.08);
}

/* 宠物选择器在学生管理内的覆盖 */
.sm-modal .pet-selector {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    gap: 10px;
    background: #f8fafc;
}

/* 提示条 */
.sm-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    line-height: 1.6;
}

.sm-tip svg { color: #cbd5e1; flex-shrink: 0; }

/* 列表头 */
.sm-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 8px;
}

/* 复选清单 */
.sm-checklist {
    max-height: 200px;
    overflow-y: auto;
    background: #f8fafc;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
}

.sm-checklist::-webkit-scrollbar { width: 5px; }
.sm-checklist::-webkit-scrollbar-track { background: transparent; }
.sm-checklist::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.sm-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #1e293b;
    transition: background 0.15s;
}

.sm-checklist label:hover {
    background: #fff;
}

.sm-checklist input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #4a6cf7;
    cursor: pointer;
}

.sm-selected-count {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}

.sm-selected-count strong {
    color: #4a6cf7;
    font-weight: 700;
    font-size: 14px;
    margin: 0 2px;
}

.sm-selected-count-danger strong {
    color: #ef4444;
}

/* Mini 按钮（全选） */
.sm-mini-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a6cf7;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.sm-mini-btn:hover {
    background: #f0f4ff;
    border-color: #c7d2fe;
}

.sm-mini-btn-primary {
    color: #4a6cf7;
}

.sm-mini-btn-danger {
    color: #ef4444;
}

.sm-mini-btn-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* Footer */
.sm-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    background: #fff;
    border-top: 1px solid #e8ecf1;
    flex-shrink: 0;
}

.sm-btn-cancel {
    height: 38px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s;
}

.sm-btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.sm-btn-confirm {
    height: 38px;
    padding: 0 18px;
    border: none;
    background: #4a6cf7;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(74,108,247,0.25);
}

.sm-btn-confirm:hover {
    background: #3b5de7;
    box-shadow: 0 4px 12px rgba(74,108,247,0.35);
    transform: translateY(-1px);
}

.sm-btn-confirm:active { transform: translateY(0); }

.sm-btn-danger {
    height: 38px;
    padding: 0 18px;
    border: none;
    background: #ef4444;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}

.sm-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239,68,68,0.35);
    transform: translateY(-1px);
}

.sm-btn-danger:active { transform: translateY(0); }

/* 学生管理弹窗内覆盖通用form样式 */
.sm-modal .form-group {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-left: none;
    box-shadow: none;
}

@media (max-width: 640px) {
    .sm-form-row {
        grid-template-columns: 1fr;
    }
    .sm-tabs {
        gap: 0;
    }
    .sm-tab {
        padding: 10px 10px;
        font-size: 12px;
    }
    .sm-tab span {
        display: none;
    }

    /* 手机端宠物选择器：横向滑动 */
    .sm-modal .pet-selector,
    .pet-selector {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 10px;
        padding: 12px;
        flex-wrap: nowrap;
    }
    .sm-modal .pet-selector .pet-option,
    .pet-selector .pet-option {
        flex: 0 0 80px;
        scroll-snap-align: start;
        padding: 8px 4px;
    }
    .sm-modal .pet-selector .pet-image-preview,
    .pet-selector .pet-image-preview {
        width: 60px;
        height: 60px;
    }
    .sm-modal .pet-selector .pet-name,
    .pet-selector .pet-name {
        font-size: 11px;
    }

    /* 隐藏横向滚动条（仍可触摸滑动） */
    .pet-selector::-webkit-scrollbar {
        display: none;
    }
    .pet-selector {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* petSwitcherSelector 同样适配 */
    #petSwitcherSelector {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 10px;
        flex-wrap: nowrap;
    }
    #petSwitcherSelector .pet-option {
        flex: 0 0 80px;
        scroll-snap-align: start;
        padding: 8px 4px;
    }
    #petSwitcherSelector .pet-image-preview {
        width: 60px;
        height: 60px;
    }
    #petSwitcherSelector .pet-name {
        font-size: 11px;
    }
    #petSwitcherSelector::-webkit-scrollbar {
        display: none;
    }
    #petSwitcherSelector {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* 图标选择器样式 */
.icon-option {
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 宠物切换器样式 - 与学生管理界面统一 */
.pet-category-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: calc(100% - 28px);
    padding: 3px;
    border: 1px solid #dfe5ef;
    border-radius: 8px;
    background: #eef2f7;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pet-category-tabs::-webkit-scrollbar {
    display: none;
}

.pet-category-tab {
    flex: 0 0 auto;
    min-width: 70px;
    height: 34px;
    padding: 0 11px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pet-category-tab:hover {
    color: #3f51b5;
    background: rgba(255, 255, 255, 0.72);
}

.pet-category-tab.active {
    color: #fff;
    background: #5a67d8;
    box-shadow: 0 2px 7px rgba(90, 103, 216, 0.25);
}

.pet-category-tab:focus-visible {
    outline: 2px solid #9aa5ff;
    outline-offset: 2px;
}

.pet-switcher-category-tabs {
    margin: 0 auto 10px;
    flex-shrink: 0;
}

.score-modal-content.pet-switcher-mode {
    height: min(820px, calc(100vh - 80px));
    height: min(820px, calc(100dvh - 80px));
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
}

.score-modal-content.pet-switcher-mode.pet-level-preview-mode {
    height: min(610px, calc(100vh - 80px));
    height: min(610px, calc(100dvh - 80px));
}

.score-modal-content.pet-switcher-mode .score-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pet-switcher-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.pet-switcher-heading {
    padding: 16px 25px 10px;
    text-align: center;
    flex-shrink: 0;
}

.pet-switcher-heading h3 {
    margin: 0;
    color: #2d3748;
    font-size: 18px;
    letter-spacing: 0;
}

.pet-switcher-scroll {
    position: relative;
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    padding: 0 25px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.pet-switcher-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 14px 25px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.pet-switcher-actions .btn-primary,
.pet-switcher-actions .btn-secondary {
    min-width: 122px;
    margin: 0;
    padding: 10px 24px;
    border-radius: 8px;
}

.pet-switcher-actions .btn-primary:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.pet-switcher-cancel-btn {
    min-width: 150px !important;
}

.pet-switcher-confirm-btn {
    min-width: 170px !important;
}

.claim-pet-category-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    margin: 0 auto 14px;
    overflow: visible;
}

.claim-pet-category-tabs .pet-category-tab {
    width: 100%;
    min-width: 0;
}

.pet-switcher-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 25px 4px;
    flex-shrink: 0;
}

.pet-switcher-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 520px;
    margin-left: auto;
}

.pet-switcher-search-icon {
    position: absolute;
    left: 13px;
    z-index: 1;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
}

.pet-switcher-search input {
    width: 100%;
    height: 42px;
    padding: 0 44px 0 40px;
    border: 1.5px solid #d7deea;
    border-radius: 8px;
    background: #fff;
    color: #263244;
    font-size: 14px;
    letter-spacing: 0;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.pet-switcher-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.pet-switcher-search input::placeholder {
    color: #98a3b3;
}

.pet-switcher-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

.pet-switcher-search-clear {
    position: absolute;
    right: 7px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #7b8797;
    font-size: 22px;
    line-height: 30px;
    cursor: pointer;
}

.pet-switcher-search-clear:hover,
.pet-switcher-search-clear:focus-visible {
    background: #eef1f7;
    color: #39475a;
    outline: none;
}

.pet-switcher-result-count {
    min-width: 48px;
    margin-right: auto;
    color: #718096;
    font-size: 13px;
    white-space: nowrap;
    text-align: right;
}

#petSwitcherSelector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    margin: 8px 0 12px;
    align-content: start;
    overflow: visible;
    touch-action: pan-y;
}

#petSwitcherSelector .pet-option[hidden] {
    display: none !important;
}

.pet-switcher-empty {
    grid-column: 1 / -1;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8491a3;
    font-size: 14px;
    text-align: center;
}

.pet-switcher-empty[hidden] {
    display: none !important;
}

#petSwitcherSelector .pet-option {
    background: white;
    border-radius: 10px;
    padding: 8px 5px 9px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    touch-action: pan-y;
}

#petSwitcherSelector .pet-egg-option {
    border-color: #c8d1ed;
    border-style: dashed;
    background: #f7f8ff;
}

#petSwitcherSelector .pet-egg-option .pet-egg-image-preview {
    background: #eef1ff;
}

#petSwitcherSelector .pet-egg-option .pet-egg-image-preview img {
    width: 82%;
    height: 82%;
}

#petSwitcherSelector .pet-egg-option:hover {
    border-color: #667eea;
    background: #f1f3ff;
}

#petSwitcherSelector .pet-egg-option.selected {
    border-style: solid;
}

#petSwitcherSelector .pet-egg-option.selected .pet-egg-image-preview {
    background: rgba(255, 255, 255, 0.16);
}

#petSwitcherSelector .pet-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

#petSwitcherSelector .pet-option:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
    border-color: #667eea;
}

#petSwitcherSelector .pet-option.selected {
    border-color: #5a67d8;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 25px rgba(90, 102, 216, 0.4);
    transform: translateY(-3px);
}

#petSwitcherSelector .pet-option.current:not(.selected) {
    border-color: #34b989;
}

#petSwitcherSelector .pet-option.current:not(.selected)::after {
    content: '当前';
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(5, 150, 105, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

#petSwitcherSelector .pet-option.selected .pet-name {
    color: white;
    font-weight: bold;
}

#petSwitcherSelector .pet-image-preview {
    width: min(136px, calc(100% - 8px));
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

#petSwitcherSelector .pet-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pet-card-preview-btn {
    display: none;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 5px;
    background: rgba(37, 48, 68, 0.82);
    color: #fff;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.22);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    touch-action: manipulation;
    transition: background 0.18s ease, transform 0.18s ease;
}

#petSwitcherSelector .pet-option.selected .pet-card-preview-btn {
    display: inline-flex;
}

.pet-card-preview-btn:hover,
.pet-card-preview-btn:focus-visible {
    background: rgba(79, 70, 229, 0.94);
    outline: 2px solid rgba(255, 255, 255, 0.88);
    outline-offset: 1px;
    transform: translateY(-1px) scale(1);
}

#petSwitcherSelector .pet-option:hover .pet-image-preview img {
    transform: scale(1.1);
}

#petSwitcherSelector .pet-name {
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

#petSwitcherSelector .pet-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-width: 0;
    min-height: 20px;
}

#petSwitcherSelector .pet-name-row .pet-name {
    width: auto;
    max-width: 100%;
}

#petSwitcherSelector .pet-option.selected .pet-name-row .pet-name {
    max-width: calc(100% - 23px);
}

#petSwitcherSelector .pet-option.selected .pet-name {
    color: white;
}

#petSwitcherSelector .pet-emoji-fallback {
    font-size: 40px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-level-preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.pet-level-preview-heading {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 16px 24px 12px;
    border-bottom: 1px solid #e8edf4;
    flex-shrink: 0;
}

.pet-level-preview-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    background: #fff;
    color: #42526a;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pet-level-preview-back:hover,
.pet-level-preview-back:focus-visible {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4f46e5;
    outline: none;
}

.pet-level-preview-title {
    min-width: 0;
}

.pet-level-preview-title h3 {
    margin: 0;
    color: #253044;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-level-preview-title span {
    display: block;
    margin-top: 3px;
    color: #7b8798;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: 0;
}

.pet-level-preview-status {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pet-level-preview-status.is-current {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #047857;
}

.pet-level-preview-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.pet-level-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    max-width: 830px;
    margin: 0 auto;
}

.pet-level-preview-item {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #f7fafc;
}

.pet-level-preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5px;
}

.pet-level-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pet-level-preview-image.pet-level-preview-balanced img {
    width: 88%;
    height: 88%;
}

.pet-level-preview-fallback {
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 42px;
}

.pet-level-preview-label {
    position: absolute;
    left: 7px;
    bottom: 7px;
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(37, 48, 68, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

@media (max-width: 640px) {
    .pet-switcher-category-tabs {
        display: flex;
        width: calc(100% - 28px);
    }

    .claim-pet-category-tabs {
        display: grid;
        width: 100%;
    }

    .pet-category-tab {
        min-width: 66px;
        flex: 0 0 auto;
        padding: 0 8px;
        font-size: 12px;
    }

    .pet-switcher-search-bar {
        gap: 8px;
        padding: 0 14px 4px;
    }

    .pet-switcher-search {
        max-width: none;
    }

    .pet-switcher-search input {
        height: 40px;
    }

    .pet-switcher-result-count {
        min-width: 42px;
        font-size: 12px;
    }

    #petSwitcherSelector {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 10px;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    #petSwitcherSelector::-webkit-scrollbar {
        display: none;
    }

    #petSwitcherSelector .pet-option {
        flex: 0 0 94px;
        scroll-snap-align: start;
        padding: 8px 4px;
    }

    #petSwitcherSelector .pet-image-preview {
        width: 72px;
        height: 72px;
        aspect-ratio: auto;
    }

    #petSwitcherSelector .pet-switcher-empty {
        flex: 1 0 100%;
        min-height: 150px;
    }

    .pet-level-preview-heading {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
        padding: 12px 14px 10px;
    }

    .pet-level-preview-status {
        grid-column: 2;
        justify-self: start;
        height: 24px;
        margin-top: -4px;
    }

    .pet-level-preview-scroll {
        padding: 12px;
    }

    .pet-level-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .pet-level-preview-actions .btn-primary,
    .pet-level-preview-actions .btn-secondary {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 12px;
    }

    .pet-switcher-actions .pet-switcher-cancel-btn,
    .pet-switcher-actions .pet-switcher-confirm-btn {
        flex: 1 1 0;
        min-width: 0 !important;
        padding: 10px 12px;
    }

}

/* iPad：充分利用弹窗高度，并避免 Safari 出现两个相互抢手势的滚动区。 */
@media (min-width: 641px) and (max-width: 1024px) {
    #scoreModal {
        padding: 12px;
    }

    .score-modal-content.pet-switcher-mode {
        width: 100%;
        height: calc(100vh - 24px);
        max-height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        max-height: calc(100dvh - 24px);
        margin: 0 auto;
        overflow: hidden;
    }

    .score-modal-content.pet-switcher-mode .score-content {
        min-height: 0;
        overflow: hidden;
        padding: 10px 12px 12px;
    }

    .pet-switcher-heading {
        padding: 10px 16px 8px;
    }

    .pet-switcher-heading h3 {
        font-size: 17px;
    }

    .pet-switcher-category-tabs {
        margin-bottom: 8px;
    }

    .pet-switcher-search-bar {
        padding: 0 16px 4px;
    }

    .pet-switcher-scroll {
        padding: 0 14px;
    }

    #petSwitcherSelector {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 8px;
        padding: 8px;
        margin: 6px 0 10px;
    }

    #petSwitcherSelector .pet-option {
        min-width: 0;
        padding: 6px 4px 7px;
    }

    #petSwitcherSelector .pet-image-preview {
        width: min(88px, calc(100% - 6px));
    }

    .pet-switcher-actions {
        padding: 10px 16px;
    }

    .pet-level-preview-heading {
        padding: 12px 18px 10px;
    }

    .pet-level-preview-scroll {
        padding: 14px 18px;
    }

    .pet-level-preview-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 9px;
    }
}

/* 手机继续使用单行横滑，弹窗按内容收起，不保留平板的剩余高度。 */
@media (max-width: 640px) {
    #scoreModal {
        padding: 8px;
    }

    .score-modal-content.pet-switcher-mode {
        height: auto;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        margin: 0 auto;
        overflow-y: auto;
    }

    .score-modal-content.pet-switcher-mode.pet-level-preview-mode {
        height: auto;
    }

    .score-modal-content.pet-switcher-mode .score-content {
        padding: 8px 10px 10px;
        overflow: visible;
    }

    .pet-switcher-panel {
        height: auto;
    }

    .pet-switcher-heading {
        padding: 8px 12px;
    }

    .pet-switcher-heading h3 {
        font-size: 16px;
    }

    .pet-switcher-scroll {
        flex: 0 0 auto;
        overflow: visible;
        padding: 0 10px;
    }

    #petSwitcherSelector {
        margin: 6px 0 10px;
    }

    .pet-switcher-actions {
        padding: 10px 12px;
    }
}

.icon-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: #a5b4fc !important;
}

/* 评分项列表样式 */
.score-item-list-element {
    transition: all 0.3s ease;
}

.score-item-list-element:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.pet-detail {
    padding: 25px;
    text-align: center;
}

.detail-pet-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin: 0 auto 20px;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.detail-stats {
    text-align: left;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-label {
    font-weight: 600;
    color: #4a5568;
}

.stat-value {
    font-weight: bold;
    color: #5a67d8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 手机禁止横向滚动，导航栏始终拉满 */
    html, body {
        overflow-x: hidden;
    }

    /* ===== 手机导航栏：省掉品牌行 ===== */
    .navbar {
        position: sticky;
        top: 0;
        width: 100%;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 0 5px;
        padding: 6px 10px;
    }

    /* 按钮行后换行 */
    .nav-container::before {
        content: '';
        width: 100%;
        order: 4;
    }
    .nav-container::after {
        content: none;
    }

    /* 品牌隐藏 */
    .nav-brand {
        display: none !important;
    }

    /* 退出/登录按钮 — 跟导航按钮同宽同行 */
    .nav-right {
        order: 3;
        width: calc(25% - 4px);
        margin-left: 0;
        margin-bottom: 5px;
        box-sizing: border-box;
    }

    .nav-right .auth-buttons,
    .nav-right .user-info-bar {
        width: 100%;
    }

    .nav-right .auth-btn {
        height: 30px !important;
        padding: 0 4px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        width: 100% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        gap: 3px;
    }

    /* nav-left 消失为容器，按钮直接参与排列 */
    .nav-left {
        display: contents !important;
    }

    .nav-left .nav-divider {
        display: none !important;
    }

    .nav-left .nav-btn {
        order: 3;
        width: calc(25% - 4px);
        height: 30px;
        padding: 0 4px;
        font-size: 11px;
        gap: 3px;
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #eef0f4;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        margin-bottom: 5px;
    }

    .nav-left .nav-btn svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    .nav-left .nav-btn span {
        display: inline;
    }

    /* 更多按钮 — 和其他按钮同一 order，紧跟点名后面 */
    .nav-more-wrap {
        order: 3;
        width: calc(25% - 4px);
        margin-bottom: 5px;
    }

    .nav-more-wrap .nav-btn {
        height: 30px;
        width: 100%;
        padding: 0 4px;
        font-size: 11px;
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #eef0f4;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-more-wrap .nav-btn span {
        display: inline;
    }

    .nav-more-dropdown {
        left: auto;
        right: 0;
        min-width: 210px;
    }

    .user-name-tag {
        display: none;
    }

    .nav-account-summary {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px 8px;
        color: #334155;
    }

    .nav-account-avatar {
        width: 30px;
        height: 30px;
        display: grid;
        place-items: center;
        flex: none;
        border: 1px solid #dbe4ee;
        border-radius: 50%;
        background: #f1f5f9;
        color: #4a6cf7;
    }

    .nav-account-copy {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
        line-height: 1.2;
    }

    .nav-account-copy small {
        color: #94a3b8;
        font-size: 10px;
        font-weight: 600;
    }

    .nav-account-copy strong {
        max-width: 145px;
        overflow: hidden;
        color: #1e293b;
        font-size: 13px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-account-divider {
        display: block;
    }

    /* 分隔线隐藏 */
    .nav-divider {
        display: none;
    }

    /* —— 最后一行：班级筛选 + 搜索 —— */
    .nav-class-filter {
        order: 5;
        flex: 1;
        min-width: 0;
        margin-top: 2px;
    }

    .nav-center {
        order: 6;
        flex: 1;
        min-width: 0;
        margin-top: 2px;
    }

    .search-box {
        width: 100%;
    }

    #searchInput {
        width: 100%;
    }

    #searchInput:focus {
        width: 100%;
    }

    .students-grid {
        gap: 10px;
        max-width: 100%;
    }

    /* 卡片内容自适应 - 覆盖内联样式 */
    .student-card {
        min-width: 0;
        overflow: visible;
    }

    .student-card .pet-image-section {
        height: 140px !important;
        margin-bottom: 8px !important;
    }

    .student-card .pet-image-section img {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: contain !important;
    }

    .student-card .pet-image-section > div:not(.hunger-badge):not(.hatch-sparkles):not(.hatch-badge) {
        font-size: 50px !important;
        padding: 10px 0 !important;
    }

    /* 饥饿徽章 - 中等手机适配（特异性必须 ≥ .pet-image-section > div） */
    .student-card .pet-image-section > .hunger-badge {
        top: 50% !important;
        left: 50% !important;
        font-size: 10px !important;
        padding: 3px 8px !important;
        letter-spacing: 0 !important;
        max-width: 90% !important;
    }

    .student-card .info-row {
        margin: 6px 0 !important;
        padding: 0 3px !important;
        flex-wrap: wrap !important;
        gap: 2px !important;
    }

    .student-card .student-name {
        font-size: 15px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .student-card .pet-breed {
        font-size: 11px !important;
    }

    /* 经验条区域缩小至60% */
    .student-card .exp-section {
        padding: 2px 4px !important;
    }

    .student-card .exp-section span {
        font-size: 7px !important;
    }

    .student-card .exp-section .level-badge-inline {
        padding: 0 3px !important;
        font-size: 7px !important;
        gap: 1px !important;
    }

    .student-card .exp-section .level-badge-inline .level-light {
        width: 3px !important;
        height: 3px !important;
    }

    .student-card .exp-section .group-badge {
        padding: 0 3px !important;
        font-size: 7px !important;
    }

    .student-card .exp-section .exp-progress {
        height: 2px !important;
    }

    .modal-content {
        margin: 20px auto;
    }

    .store-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .students-grid {
        gap: 6px;
    }

    /* === 卡片按比例缩放 === */
    .student-card {
        padding: 4px 2px;
        min-height: auto;
        min-width: 0;
        overflow: visible;
    }

    /* 宠物图片区 */
    .student-card .pet-image-section {
        height: 112px !important;
        margin-bottom: 2px !important;
    }

    .student-card .pet-image-section img {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: contain !important;
    }

    .student-card .pet-image-section > div:not(.hunger-badge):not(.hatch-sparkles):not(.hatch-badge) {
        font-size: 28px !important;
        padding: 2px 0 !important;
    }

    /* 信息行 - 上下排列 */
    .student-card .info-row {
        flex-direction: column !important;
        align-items: center !important;
        margin: 1px 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .student-card .student-name {
        font-size: 10px !important;
        flex-shrink: 1 !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
        text-align: center;
    }

    .student-card .pet-breed {
        font-size: 7px !important;
        color: #999 !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    /* 经验条区域 */
    .student-card .exp-section {
        padding: 2px 2px !important;
        overflow: hidden;
    }

    .student-card .exp-section > div {
        overflow: hidden !important;
        gap: 1px !important;
    }

    .student-card .exp-section span {
        font-size: 7px !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .student-card .exp-section .exp-progress {
        height: 2px !important;
        margin-bottom: 1px !important;
    }

    .student-card .exp-section .level-badge-inline {
        padding: 0px 3px !important;
        font-size: 7px !important;
        gap: 1px !important;
        box-shadow: none !important;
    }

    .student-card .exp-section .level-badge-inline .level-light {
        width: 3px !important;
        height: 3px !important;
    }

    .student-card .exp-section .group-badge {
        padding: 0 3px !important;
        font-size: 7px !important;
    }

    /* 饥饿徽章 */
    .student-card .pet-image-section > .hunger-badge {
        top: 50% !important;
        left: 50% !important;
        font-size: 8px !important;
        padding: 1px 4px !important;
    }

    .student-class {
        font-size: 7px;
        padding: 1px 4px;
    }

    .pet-emoji {
        font-size: 28px;
    }

    /* 缩小状态条 */
    .status-bar {
        height: 5px;
    }

    .status-bars {
        gap: 3px;
        margin-top: 8px;
    }

    .status-label {
        font-size: 9px;
    }

    /* 缩小积分显示 */
    .score-display {
        font-size: 11px;
        padding: 2px 6px;
    }

    .nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn .btn-text {
        display: none;
    }

    .nav-class-filter {
        font-size: 12px;
        height: 32px;
        padding: 0 26px 0 8px;
        min-width: 0;
    }

    .pet-actions {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    animation: slideInRight 0.3s ease;
    font-weight: bold;
}

.notification.success {
    border-left: 5px solid #06D6A0;
    color: #06D6A0;
}

.notification.error {
    border-left: 5px solid #EF476F;
    color: #EF476F;
}

.notification.info {
    border-left: 5px solid #5a67d8;
    color: #5a67d8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 撤回提示条 */
.undo-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #f1f5f9;
    padding: 12px 20px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.08) inset;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.4s ease;
    max-width: 520px;
    font-size: 13px;
}
.undo-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.undo-toast-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.undo-toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}
.undo-toast-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.undo-toast-text b {
    color: #93c5fd;
}
.undo-toast-btn {
    flex-shrink: 0;
    padding: 6px 16px;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}
.undo-toast-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(245,158,11,0.5);
}
.undo-toast-btn:active {
    transform: scale(0.97);
}

/* 批量导入区域样式 */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-info {
    background: #e6f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

/* 批量导入文本区域聚焦样式 */
#batchStudentNames:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* 转盘样式 */
.wheel-container {
    position: relative;
    margin: 30px auto;
}

.wheel-container canvas {
    transition: transform 4s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #667eea;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.wheel-spinning {
    animation: wheelPulse 0.1s infinite alternate;
}

@keyframes wheelPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* 转盘结果动画 */
#wheelResult {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 音效开关 */
.sound-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.sound-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.sound-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e0;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.3s;
}
.sound-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.sound-toggle input:checked + .sound-toggle-slider {
    background: linear-gradient(45deg, #667eea, #764ba2);
}
.sound-toggle input:checked + .sound-toggle-slider::before {
    transform: translateX(22px);
}

/* === 顶部更多下拉菜单 === */
.nav-more-wrap {
    position: relative;
    display: inline-block;
}
.nav-more-dropdown {
    display: none;
    position: absolute;
    top: 44px;
    left: 0;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.02);
    padding: 6px;
    z-index: 9999;
    overflow: hidden;
    animation: navMoreFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes navMoreFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.nav-more-dropdown.show {
    display: block;
}
.nav-account-summary,
.nav-account-divider {
    display: none;
}
.nav-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.nav-more-item svg {
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.nav-more-item:hover {
    background: rgba(74, 108, 247, 0.06);
    color: #1e293b;
}
.nav-more-item:hover svg {
    color: #4a6cf7;
    transform: scale(1.08);
}
.nav-more-item:active {
    background: rgba(74, 108, 247, 0.1);
    transform: scale(0.98);
}
.nav-more-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 4px 8px;
}

/* ========================
   隔空喊话 模块
   ======================== */
.shout-float-btn {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(238, 90, 82, 0.4);
    z-index: 9990;
    transition: transform 0.15s, box-shadow 0.15s;
}
.shout-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(238, 90, 82, 0.55);
}
.shout-float-btn:active { transform: scale(0.95); }

.shout-send-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.shout-send-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.shout-send-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}
.shout-send-hint {
    font-size: 13px;
    color: #888;
    margin-bottom: 14px;
}
#shoutSendInput {
    width: 100%;
    box-sizing: border-box;
    min-height: 100px;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    resize: none;
    outline: none;
    font-family: inherit;
}
#shoutSendInput:focus { border-color: #ee5a52; }
.shout-send-counter {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}
.shout-send-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}
.shout-btn-cancel, .shout-btn-send {
    padding: 9px 22px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    font-weight: 600;
}
.shout-btn-cancel { background: #f0f0f0; color: #555; }
.shout-btn-cancel:hover { background: #e4e4e4; }
.shout-btn-send {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #fff;
}
.shout-btn-send:hover { filter: brightness(1.05); }
.shout-btn-send:disabled { opacity: 0.6; cursor: not-allowed; }

/* 接收弹窗：全屏模糊 + 大字 */
.shout-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.25s;
}
.shout-popup-overlay.show { opacity: 1; }
.shout-popup-card {
    background: linear-gradient(135deg, #fff5f5, #ffeaea);
    border-radius: 24px;
    padding: 50px 40px;
    width: min(90%, 720px);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: shoutPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes shoutPopIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.shout-popup-title {
    font-size: 28px;
    font-weight: 700;
    color: #ee5a52;
    margin-bottom: 24px;
    letter-spacing: 2px;
}
.shout-popup-content {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 800;
    color: #2c2c3e;
    line-height: 1.4;
    margin: 20px 0 30px;
    word-break: break-all;
}
.shout-popup-time {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}
.shout-popup-close {
    padding: 12px 36px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(238, 90, 82, 0.35);
}
.shout-popup-close:hover { filter: brightness(1.05); }

/* TTS 解锁横幅 */
.shout-unlock-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: rgba(33, 33, 50, 0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    font-size: 14px;
}
.shout-unlock-banner button {
    padding: 6px 18px;
    border-radius: 20px;
    border: none;
    background: #ee5a52;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

/* ===== 宠物勋章 & 认领新宠物 ===== */

/* 学生卡片上的勋章（绝对定位，叠在宠物图片底部） */
.pet-medals-overlay {
    position: relative;
    z-index: 2;
    margin-top: -18px;
    margin-bottom: 2px;
    padding: 0 4px;
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    overflow: hidden;
}
.pet-medal {
    width: 15px;
    height: 15px;
    min-width: 15px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    cursor: default;
}
.pet-medal img {
    width: 11px;
    height: 11px;
    object-fit: contain;
}
.pet-medal span {
    font-size: 8px;
    line-height: 1;
}

/* 勋章弹窗 */
.medals-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px;
}
.medals-modal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    background: #fff;
    border: 1.5px solid #fde68a;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}
.medals-modal-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2.5px solid #f59e0b;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}
.medals-modal-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}
.medals-modal-name {
    font-size: 14px;
    font-weight: 700;
    color: #78350f;
    text-align: center;
}
.medals-modal-time {
    font-size: 11px;
    color: #b0a08a;
    text-align: center;
}

/* 认领新宠物按钮（评分面板特殊高亮，独占一行） */
.score-header-btn-grad {
    flex: 1 1 100% !important;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
    border: none !important;
    border-top: 1px solid rgba(245, 158, 11, 0.2) !important;
    animation: none;
    font-size: 13px !important;
    padding: 11px 8px !important;
}
.score-header-btn-grad:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    color: #fff !important;
}

/* 认领新宠物弹窗 */
.claim-pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
}
.claim-pet-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.claim-pet-option[hidden] {
    display: none !important;
}
.claim-pet-option:hover:not(.is-current) {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.claim-pet-option.is-current {
    border-color: #d1d5db;
    background: #f3f4f6;
    opacity: 0.6;
    cursor: not-allowed;
}
.claim-pet-option.is-selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}
.claim-pet-img {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.claim-pet-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 新生成图片透明边距较少，统一缩到普通萌宠的视觉尺寸。 */
.student-card .pet-image-section.pet-image-balanced img,
.pet-option.pet-thumbnail-balanced .pet-image-preview img,
#petSwitcherSelector .pet-option.pet-thumbnail-balanced .pet-image-preview img,
.score-pet-image.pet-image-balanced img,
.claim-pet-option.pet-thumbnail-balanced .claim-pet-img img {
    width: 80% !important;
    height: 80% !important;
}

/* 切换列表只约束最大尺寸，保留每张图片自身比例，避免横向灵宠被压扁。 */
#petSwitcherSelector .pet-image-preview img {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    flex: 0 0 auto;
}

#petSwitcherSelector .pet-option.pet-thumbnail-balanced .pet-image-preview img {
    max-width: 80%;
    max-height: 80%;
}

/* 宠物可能带长角、翅膀和尾巴，悬停放大时不能被预览框裁掉。 */
.pet-image-preview,
#petSwitcherSelector .pet-image-preview {
    overflow: visible;
}
.claim-pet-emoji {
    font-size: 40px;
    line-height: 1;
}
.claim-pet-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.claim-pet-current {
    font-size: 10px;
    color: #9ca3af;
    background: #e5e7eb;
    padding: 1px 8px;
    border-radius: 10px;
}

/* ===== 学生网格空状态（创建第一个班级 / 添加第一个学生）===== */
.empty-onboard {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 32px 64px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1.5px dashed #d8def0;
    border-radius: 24px;
    margin: 8px 0;
}

.empty-onboard__icon {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5edff 60%, #fef0f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 24px -10px rgba(74, 108, 247, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    position: relative;
    animation: emptyOnboardFloat 3.6s ease-in-out infinite;
}

.empty-onboard__icon svg {
    width: 44px;
    height: 44px;
    color: #6366f1;
    stroke: url(#emptyOnboardGradient);
}

.empty-onboard__icon::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 12px;
    background: radial-gradient(ellipse, rgba(124, 91, 252, 0.18), transparent 70%);
    filter: blur(2px);
    z-index: -1;
}

.empty-onboard__title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.empty-onboard__desc {
    font-size: 14.5px;
    color: #64748b;
    line-height: 1.6;
    max-width: 360px;
    margin-bottom: 28px;
    text-wrap: pretty;
}

.empty-onboard__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4a6cf7 0%, #7c5bfc 60%, #a855f7 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow:
        0 8px 22px -6px rgba(74, 108, 247, 0.45),
        0 2px 6px rgba(124, 91, 252, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.empty-onboard__cta:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 30px -8px rgba(74, 108, 247, 0.55),
        0 4px 10px rgba(124, 91, 252, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.05);
}

.empty-onboard__cta:active {
    transform: translateY(0);
}

.empty-onboard__cta svg {
    width: 18px;
    height: 18px;
}

.empty-onboard__hint {
    margin-top: 18px;
    font-size: 12.5px;
    color: #94a3b8;
}

.empty-onboard__hint kbd {
    display: inline-block;
    padding: 1px 7px;
    font-family: inherit;
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-radius: 5px;
    margin: 0 2px;
}

@keyframes emptyOnboardFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
    .empty-onboard__icon { animation: none; }
}

@media (max-width: 600px) {
    .empty-onboard { padding: 44px 20px 48px; }
    .empty-onboard__icon { width: 76px; height: 76px; border-radius: 20px; margin-bottom: 20px; }
    .empty-onboard__icon svg { width: 38px; height: 38px; }
    .empty-onboard__title { font-size: 19px; }
    .empty-onboard__desc { font-size: 13.5px; max-width: 300px; margin-bottom: 22px; }
    .empty-onboard__cta { padding: 11px 22px; font-size: 14px; }
}

/* 顶部菜单字号增强：适配放大 logo 后的视觉比例 */
.nav-btn {
    height: 42px;
    padding: 0 16px;
    font-size: 16px;
    font-weight: 700;
}

.nav-class-filter,
.auth-btn,
.user-name-tag {
    font-size: 14px;
}

.nav-class-filter,
.auth-btn {
    height: 38px;
}

.user-name-tag {
    height: 38px;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .nav-left .nav-btn,
    .nav-more-wrap .nav-btn {
        height: 34px;
        font-size: 12.5px;
    }

    .nav-right .auth-btn {
        height: 34px !important;
        font-size: 12.5px !important;
    }

    .nav-left .nav-btn svg {
        width: 13px;
        height: 13px;
    }

    .nav-class-filter {
        height: 34px;
        font-size: 13px;
    }
}

/* 手机端宠物切换：中间网格独立纵向滚动，避免横向列表抢占触摸手势。 */
@media (max-width: 640px) {
    #scoreModal {
        padding: 4px;
        overflow: hidden;
    }

    .score-modal-content.pet-switcher-mode {
        width: 100%;
        height: calc(100svh - 8px);
        max-height: calc(100svh - 8px);
        height: calc(100dvh - 8px);
        max-height: calc(100dvh - 8px);
        margin: 0 auto;
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    .score-modal-content.pet-switcher-mode .modal-header {
        flex: 0 0 auto;
        padding: 10px 14px;
    }

    .score-modal-content.pet-switcher-mode .score-content {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        padding: 6px 6px 8px;
        overflow: hidden !important;
    }

    .score-modal-content.pet-switcher-mode .pet-switcher-panel {
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .score-modal-content.pet-switcher-mode .pet-switcher-scroll {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0 6px;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-content: start;
        gap: 7px;
        margin: 5px 0 8px;
        padding: 7px;
        overflow: visible !important;
        scroll-snap-type: none;
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector .pet-option {
        flex: none;
        width: auto;
        min-width: 0;
        padding: 6px 3px 7px;
        scroll-snap-align: none;
        transform: none;
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector .pet-option.selected {
        transform: none;
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector .pet-image-preview {
        width: min(76px, calc(100% - 4px));
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector .pet-option:hover .pet-image-preview img {
        transform: none;
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector .pet-name {
        font-size: 10.5px;
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector .pet-switcher-empty {
        grid-column: 1 / -1;
        min-height: 150px;
    }

    .score-modal-content.pet-switcher-mode .pet-switcher-actions {
        flex: 0 0 auto;
        padding: 8px 10px;
    }
}

@media (max-width: 360px) {
    .score-modal-content.pet-switcher-mode #petSwitcherSelector {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .score-modal-content.pet-switcher-mode #petSwitcherSelector .pet-image-preview {
        width: min(84px, calc(100% - 6px));
    }
}

/* ============================================================
   班级排座
   ============================================================ */
body.seating-open {
    overflow: hidden;
}

.seating-modal,
.seating-modal * {
    box-sizing: border-box;
}

.seating-modal {
    position: fixed;
    inset: 0;
    z-index: 50000;
    display: none;
    color: #172033;
    background: #edf2f0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.seating-modal.active {
    display: block;
}

.seating-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.seating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 84px;
    padding: 14px 28px;
    border-bottom: 1px solid #dce4ea;
    background: #ffffff;
}

.seating-header,
.seating-toolbar,
.seating-workspace,
.seating-footer {
    width: 100%;
    min-width: 0;
}

.seating-heading,
.seating-header-controls,
.seating-heading-icon,
.seating-mode-switch,
.seating-class-field,
.seating-toolbar,
.seating-edit-tools,
.seating-view-tools,
.seating-tool-group,
.seating-front-field,
.seating-footer,
.seating-footer-actions {
    display: flex;
    align-items: center;
}

.seating-heading {
    gap: 13px;
    min-width: 190px;
}

.seating-heading-icon {
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 8px;
    color: #087f62;
    background: #e8f7f2;
}

.seating-heading h2 {
    margin: 0;
    color: #132238;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: 0;
}

.seating-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    margin-top: 3px;
    color: #768395;
    font-size: 12px;
    font-weight: 600;
}

.seating-dirty-state {
    display: none;
    color: #b45309;
    font-weight: 600;
}

.seating-header-controls {
    justify-content: flex-end;
    gap: 14px;
    min-width: 0;
}

.seating-class-field,
.seating-front-field {
    gap: 7px;
    color: #5e6b7d;
    font-size: 13px;
    white-space: nowrap;
}

.seating-class-field select,
.seating-front-field select {
    height: 44px;
    min-width: 154px;
    padding: 0 34px 0 11px;
    border: 1px solid #cfd9e3;
    border-radius: 7px;
    color: #243247;
    background: #ffffff;
    font: inherit;
    outline: none;
}

.seating-class-field select:focus,
.seating-front-field select:focus,
.seating-roster-search:focus-within {
    border-color: #1a9f7b;
    box-shadow: 0 0 0 3px rgba(26, 159, 123, 0.12);
}

.seating-mode-switch {
    height: 44px;
    padding: 4px;
    border: 1px solid #d6dee6;
    border-radius: 8px;
    background: #f2f5f7;
}

.seating-mode-switch button {
    height: 34px;
    min-width: 64px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    color: #687588;
    background: transparent;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.seating-mode-switch button.active {
    color: #ffffff;
    background: #168f70;
    box-shadow: 0 1px 4px rgba(8, 94, 71, 0.18);
}

.seating-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #d7e0e8;
    border-radius: 8px;
    color: #536174;
    background: #ffffff;
    cursor: pointer;
}

.seating-icon-btn:hover {
    color: #172033;
    border-color: #b8c5d0;
    background: #f7f9fa;
}

.seating-toolbar {
    justify-content: space-between;
    gap: 18px;
    min-height: 70px;
    padding: 12px 24px;
    border-bottom: 1px solid #dce4ea;
    background: #f9fbfc;
}

.seating-edit-tools,
.seating-view-tools {
    gap: 12px;
    min-width: 0;
}

.seating-edit-tools {
    flex: 1 1 auto;
}

.seating-view-tools {
    flex: 0 0 auto;
    margin-left: auto;
}

.seating-tool-group {
    height: 44px;
    padding: 4px;
    border: 1px solid #d7e0e8;
    border-radius: 8px;
    background: #ffffff;
    white-space: nowrap;
}

.seating-tool-group button,
.seating-export-btn,
.seating-roster-toggle {
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    color: #536174;
    background: transparent;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}

.seating-tool-group button:hover,
.seating-export-btn:hover,
.seating-roster-toggle:hover {
    color: #087f62;
    background: #eaf7f3;
}

.seating-tool-group button.active {
    color: #ffffff;
    background: #168f70;
}

.seating-arrange-tools button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.seating-arrange-tools .seating-random-btn {
    color: #ffffff;
    background: #168f70;
}

.seating-arrange-tools .seating-random-btn:hover {
    color: #ffffff;
    background: #0f7f63;
}

.seating-tool-group button:disabled {
    color: #b4bec9;
    cursor: not-allowed;
    background: transparent;
}

.seating-tool-label {
    padding: 0 5px;
    color: #6b7789;
    font-size: 12px;
}

.seating-column-label {
    margin-left: 5px;
    padding-left: 10px;
    border-left: 1px solid #e2e8ee;
}

.seating-dimension-group strong {
    min-width: 22px;
    color: #223047;
    font-size: 13px;
    text-align: center;
}

.seating-front-field select {
    min-width: 92px;
    height: 44px;
}

.seating-square-btn {
    width: 30px;
    padding: 0 !important;
}

.seating-export-btn,
.seating-roster-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d7e0e8;
    border-radius: 8px;
    background: #ffffff;
}

.seating-roster-toggle {
    display: none;
}

.seating-roster-toggle strong {
    min-width: 20px;
    padding: 1px 5px;
    border-radius: 10px;
    color: #ffffff;
    background: #168f70;
    font-size: 11px;
}

.seating-zoom-tools #seatingZoomValue {
    min-width: 54px;
}

.seating-workspace {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.seating-modal.mode-view .seating-workspace {
    grid-template-columns: minmax(0, 1fr);
}

.seating-modal.mode-view .seating-edit-tools,
.seating-modal.mode-view .seating-roster,
.seating-modal.mode-view .seating-roster-toggle {
    display: none;
}

.seating-modal.mode-edit .seating-edit-tools {
    display: flex;
}

.seating-roster {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid #dce4ea;
    background: #ffffff;
}

.seating-roster-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 18px 12px;
}

.seating-roster-head > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.seating-roster-head strong {
    color: #253248;
    font-size: 16px;
}

.seating-roster-head span {
    margin-top: 2px;
    color: #7c8999;
    font-size: 13px;
}

.seating-roster-close {
    display: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 7px;
    color: #69778a;
    background: #f0f3f5;
    font-size: 22px;
    cursor: pointer;
}

.seating-roster-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    margin: 0 16px 12px;
    padding: 0 12px;
    border: 1px solid #d7e0e8;
    border-radius: 7px;
    color: #8793a2;
    background: #ffffff;
}

.seating-roster-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #243247;
    background: transparent;
    font-size: 13px;
}

.seating-roster-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 2px 12px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.seating-roster-item {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 58px;
    margin: 0 0 8px;
    padding: 10px 12px 10px 18px;
    overflow: hidden;
    border: 1px solid #dce4ea;
    border-radius: 7px;
    color: #263349;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.seating-roster-item::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    content: "";
    background: var(--seat-group-color, #94a3b8);
}

.seating-roster-item strong,
.seating-roster-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seating-roster-item strong {
    font-size: 15px;
}

.seating-roster-item span {
    margin-top: 2px;
    color: #7d8998;
    font-size: 12px;
}

.seating-roster-item:hover,
.seating-roster-item.is-selected {
    border-color: #2ba889;
    background: #edf9f5;
}

.seating-roster-item.is-selected {
    box-shadow: 0 0 0 2px rgba(43, 168, 137, 0.15);
}

.seating-roster-item.is-dragging,
.seating-cell.is-dragging {
    opacity: 0.45;
}

.seating-roster-empty {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 18px;
    color: #8a96a6;
    font-size: 13px;
    text-align: center;
}

.seating-board-area {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #edf2f0;
}

.seating-empty {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    place-items: center;
    color: #788596;
    background: #f3f6f8;
}

.seating-board-scroll {
    width: 100%;
    height: 100%;
    padding: 30px 36px 44px;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.seating-board {
    --seat-width: 148px;
    --seat-height: 104px;
    --seat-gap: 14px;
    width: max-content;
    min-width: 100%;
    margin: 0 auto;
}

.seating-board-title {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    min-height: 58px;
    color: #263349;
}

.seating-board-title strong {
    font-size: 22px;
}

.seating-board-title span {
    color: #7a8797;
    font-size: 13px;
}

.seating-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    min-width: 100%;
}

.seating-front-marker {
    display: grid;
    place-items: center;
    width: min(460px, 72vw);
    height: 48px;
    margin: 0 auto 28px;
    border: 1px solid #b7c4ce;
    border-radius: 8px;
    color: #435166;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(40, 57, 70, 0.07);
    font-size: 15px;
    font-weight: 700;
}

.seating-stage.front-bottom .seating-front-marker {
    margin: 28px auto 0;
}

.seating-grid {
    display: grid;
    gap: var(--seat-gap);
    width: max-content;
}

.seating-cell {
    --seat-group-color: #94a3b8;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: var(--seat-width);
    height: var(--seat-height);
    min-width: 0;
    overflow: hidden;
    border: 1px solid #cfdbe3;
    border-radius: 8px;
    color: #273449;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(25, 43, 55, 0.07);
    cursor: default;
    user-select: none;
}

.seating-modal.mode-edit .seating-cell {
    cursor: pointer;
}

.seating-cell.has-student::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    content: "";
    background: var(--seat-group-color);
}

.seating-cell:hover {
    border-color: #aebcc8;
}

.seating-modal.mode-edit .seating-cell:hover {
    border-color: #2ba889;
}

.seating-cell.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.seating-cell.is-locked {
    background: #fffaf0;
    border-color: #efc66f;
}

.seating-seat-number {
    position: absolute;
    top: 8px;
    left: 12px;
    color: #93a0af;
    font-size: 11px;
    font-weight: 700;
}

.seating-seat-name {
    width: calc(100% - 18px);
    overflow: hidden;
    color: #1f2c41;
    font-size: 16px;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seating-seat-group,
.seating-empty-label {
    width: calc(100% - 18px);
    margin-top: 5px;
    overflow: hidden;
    color: #84909f;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seating-empty-label {
    margin-top: 0;
    color: #a5afbb;
}

.seating-cell-actions {
    position: absolute;
    right: 50%;
    bottom: 7px;
    display: flex;
    gap: 4px;
    transition: opacity 0.14s ease, transform 0.14s ease;
    transform: translate(50%, 2px);
}

.seating-cell.has-student .seating-cell-actions {
    opacity: 0;
    pointer-events: none;
    transform: translate(50%, 2px);
}

.seating-cell.has-student:hover .seating-cell-actions,
.seating-cell.has-student.is-selected .seating-cell-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translate(50%, 0);
}

.seating-cell.has-student .seating-seat-name,
.seating-cell.has-student .seating-seat-group {
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.seating-cell.has-student:hover .seating-seat-name,
.seating-cell.has-student.is-selected .seating-seat-name {
    transform: translateY(-8px);
}

.seating-cell.has-student:hover .seating-seat-group,
.seating-cell.has-student.is-selected .seating-seat-group {
    opacity: 0;
}

.seating-cell:not(.has-student) .seating-cell-actions {
    right: 7px;
    bottom: auto;
    top: 7px;
    transform: none;
}

.seating-cell-action {
    display: inline-grid;
    place-items: center;
    width: 25px;
    min-width: 25px;
    height: 24px;
    padding: 0;
    border: 1px solid #d8e0e6;
    border-radius: 6px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.96);
    cursor: pointer;
}

.seating-cell-action:hover {
    color: #087f62;
    background: #ddf4ec;
}

.seating-cell-action.is-active {
    color: #9a6700;
    border-color: #e9c36a;
    background: #fff5cf;
}

.seating-remove-action:hover {
    color: #b42318;
    background: #fee9e7;
}

.seating-delete-position-action:hover {
    color: #b42318;
    border-color: #f0b7b2;
    background: #fff0ee;
}

.seating-cell.is-removed-position {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.seating-modal.mode-edit .seating-cell.is-removed-position:hover {
    border-color: transparent;
}

.seating-position-restore {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px dashed #9eadaf;
    border-radius: 8px;
    color: #718081;
    background: rgba(255, 255, 255, 0.66);
    cursor: pointer;
}

.seating-position-restore:hover {
    color: #087f62;
    border-color: #37a98b;
    background: #ffffff;
}

.seating-footer {
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 12px 26px;
    border-top: 1px solid #dce4ea;
    background: #ffffff;
}

.seating-summary {
    min-width: 0;
    overflow: hidden;
    color: #687588;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seating-footer-actions {
    gap: 10px;
}

.seating-cancel-btn,
.seating-save-btn {
    min-width: 116px;
    height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.seating-cancel-btn {
    border: 1px solid #d2dce4;
    color: #5c697b;
    background: #ffffff;
}

.seating-save-btn {
    border: 1px solid #168f70;
    color: #ffffff;
    background: #168f70;
    box-shadow: 0 4px 10px rgba(22, 143, 112, 0.18);
}

.seating-save-btn:hover {
    background: #0f7f63;
}

.seating-save-btn:disabled {
    opacity: 0.58;
    cursor: wait;
}

@media (max-width: 1180px) {
    .seating-header {
        padding-inline: 16px;
    }

    .seating-toolbar {
        align-items: flex-start;
        overflow-x: auto;
    }

    .seating-edit-tools {
        width: max-content;
        flex: 0 0 auto;
    }

    .seating-workspace {
        grid-template-columns: 246px minmax(0, 1fr);
    }

    .seating-arrange-tools button {
        padding-inline: 8px;
    }
}

@media (min-width: 701px) and (max-width: 1180px) {
    .seating-toolbar {
        flex-wrap: wrap;
        gap: 6px;
        overflow: visible;
    }

    .seating-edit-tools {
        flex: 1 1 100%;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .seating-edit-tools::-webkit-scrollbar {
        display: none;
    }

    .seating-view-tools {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 700px) {
    .seating-shell {
        grid-template-rows: auto auto minmax(0, 1fr) auto;
    }

    .seating-header {
        min-height: 62px;
        padding: 8px 10px;
    }

    .seating-heading {
        min-width: 0;
        gap: 7px;
    }

    .seating-heading-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .seating-heading h2 {
        font-size: 16px;
    }

    .seating-status-line {
        font-size: 10px;
    }

    .seating-header-controls {
        gap: 6px;
    }

    .seating-class-field {
        width: min(31vw, 126px);
    }

    .seating-class-field > span {
        display: none;
    }

    .seating-class-field select {
        width: 100%;
        min-width: 0;
        height: 34px;
        padding-left: 8px;
        font-size: 12px;
    }

    .seating-mode-switch {
        height: 34px;
    }

    .seating-mode-switch button {
        min-width: 42px;
        height: 26px;
        padding-inline: 8px;
        font-size: 11px;
    }

    .seating-icon-btn {
        width: 34px;
        height: 34px;
    }

    .seating-toolbar {
        min-height: 50px;
        gap: 8px;
        padding: 6px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .seating-toolbar::-webkit-scrollbar {
        display: none;
    }

    .seating-edit-tools,
    .seating-view-tools {
        gap: 6px;
        width: max-content;
        flex: 0 0 auto;
    }

    .seating-front-field > span {
        display: none;
    }

    .seating-tool-group,
    .seating-front-field select,
    .seating-export-btn,
    .seating-roster-toggle {
        height: 36px;
    }

    .seating-tool-group button,
    .seating-export-btn,
    .seating-roster-toggle {
        font-size: 11px;
    }

    .seating-roster-toggle {
        display: inline-flex;
        position: fixed;
        bottom: 72px;
        left: 12px;
        z-index: 50020;
        box-shadow: 0 5px 16px rgba(23, 32, 51, 0.18);
    }

    .seating-workspace,
    .seating-modal.mode-view .seating-workspace {
        display: block;
        min-height: 0;
    }

    .seating-board-area {
        width: 100%;
        height: 100%;
    }

    .seating-board-scroll {
        padding: 14px 12px 24px;
    }

    .seating-board-title {
        justify-content: flex-start;
        min-height: 36px;
        padding-left: 4px;
    }

    .seating-board-title strong {
        font-size: 15px;
    }

    .seating-front-marker {
        height: 34px;
        margin-bottom: 16px;
    }

    .seating-stage.front-bottom .seating-front-marker {
        margin-top: 16px;
    }

    .seating-grid {
        gap: 10px;
    }

    .seating-cell-action {
        width: 22px;
        min-width: 22px;
        height: 22px;
    }

    .seating-position-restore {
        width: 36px;
        height: 36px;
    }

    .seating-roster {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 50030;
        display: flex !important;
        width: 100%;
        height: min(58dvh, 480px);
        border: 0;
        border-top: 1px solid #d5dee6;
        border-radius: 8px 8px 0 0;
        box-shadow: 0 -12px 32px rgba(23, 32, 51, 0.18);
        transform: translateY(105%);
        transition: transform 0.22s ease;
    }

    .seating-modal.mode-view .seating-roster {
        display: none !important;
    }

    .seating-roster.open {
        transform: translateY(0);
    }

    .seating-roster-close {
        display: inline-grid;
        place-items: center;
    }

    .seating-roster-list {
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    .seating-footer {
        min-height: 60px;
        padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    }

    .seating-summary {
        font-size: 11px;
    }

    .seating-cancel-btn,
    .seating-save-btn {
        min-width: 78px;
        height: 38px;
        padding-inline: 11px;
        font-size: 12px;
    }
}

@media (max-width: 390px) {
    .seating-heading-icon,
    .seating-status-line {
        display: none;
    }

    .seating-header {
        gap: 6px;
    }

    .seating-heading {
        min-width: 68px;
    }

    .seating-summary {
        max-width: 110px;
    }
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    body.seating-printing > *:not(#seatingModal) {
        display: none !important;
    }

    body.seating-printing,
    body.seating-printing #seatingModal {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    body.seating-printing #seatingModal {
        position: static !important;
        display: block !important;
    }

    body.seating-printing .seating-shell {
        display: block !important;
        height: auto !important;
    }

    body.seating-printing .seating-header,
    body.seating-printing .seating-toolbar,
    body.seating-printing .seating-roster,
    body.seating-printing .seating-footer,
    body.seating-printing .seating-cell-actions {
        display: none !important;
    }

    body.seating-printing .seating-workspace,
    body.seating-printing .seating-board-area,
    body.seating-printing .seating-board-scroll {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    body.seating-printing .seating-board {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.seating-printing .seating-board-title {
        min-height: 14mm;
    }

    body.seating-printing .seating-stage {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.seating-printing .seating-grid {
        grid-template-columns: repeat(var(--seat-columns), minmax(0, 1fr)) !important;
        width: 100% !important;
        gap: 2.4mm !important;
    }

    body.seating-printing .seating-cell {
        width: auto !important;
        height: 15mm !important;
        min-width: 0 !important;
        break-inside: avoid;
        box-shadow: none !important;
    }

    body.seating-printing .seating-cell.is-removed-position {
        visibility: hidden !important;
    }

    body.seating-printing .seating-front-marker {
        height: 9mm !important;
        margin-bottom: 4mm !important;
    }

    body.seating-printing .seating-stage.front-bottom .seating-front-marker {
        margin-top: 4mm !important;
        margin-bottom: 0 !important;
    }
}

/* ===== 注册弹窗：移动端可达性与紧凑布局 ===== */
#registerModal {
    padding: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content.auth-modal.register-auth-modal {
    display: flex;
    flex-direction: column;
    width: min(440px, 100%);
    max-width: 440px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: clamp(24px, 5vh, 44px) auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px !important;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24) !important;
}

.register-auth-modal .auth-header {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 15px 18px;
    background: #ffffff !important;
    border-bottom: 1px solid #e8edf2;
}

.register-auth-modal .auth-header h2 {
    color: #172033;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
}

.register-auth-modal .auth-close {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    color: #64748b;
    font-size: 24px;
}

.register-auth-modal .auth-close:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.register-auth-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 18px 20px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.register-auth-modal .auth-form-group {
    margin: 0 0 13px;
}

.register-auth-modal .auth-label {
    margin-bottom: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.register-auth-modal .auth-required {
    font-size: inherit;
}

.register-auth-modal .auth-input {
    min-height: 44px;
    padding: 10px 12px;
    border-color: #d7dee8;
    border-radius: 8px;
    color: #172033;
    font-size: 15px;
    font-weight: 500;
}

.register-auth-modal .auth-input:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12) !important;
}

.register-auth-modal .auth-input::placeholder {
    color: #a8b3c2;
}

.register-auth-modal .auth-buy-link {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.4;
}

.register-auth-modal .auth-buy-link a {
    color: #b45309;
}

.register-auth-modal .auth-tip-card {
    margin: 2px 0 10px;
    padding: 10px 12px;
    border-color: #dbe7df !important;
    background: #f5faf7 !important;
}

.register-auth-modal .auth-tip-title {
    color: #166534 !important;
}

.register-auth-modal .auth-tip-text {
    color: #5f6f65;
}

.register-auth-modal .auth-error-card {
    margin-bottom: 10px;
}

.register-auth-footer {
    flex: 0 0 auto;
    padding: 12px 20px 14px;
    border-top: 1px solid #e8edf2;
    background: #ffffff;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.035);
}

.register-auth-footer .auth-actions {
    margin: 0 0 10px;
    gap: 10px;
}

.register-auth-footer .auth-btn-submit,
.register-auth-footer .auth-btn-cancel {
    min-height: 44px;
    padding: 0 14px;
}

.register-auth-footer .auth-btn-submit {
    background: #16a34a !important;
    box-shadow: none !important;
}

.register-auth-footer .auth-btn-submit:hover {
    background: #15803d !important;
    box-shadow: none !important;
}

.register-auth-footer .auth-btn-cancel {
    flex: 0 0 96px;
}

.register-auth-footer .auth-footer-link {
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 640px) {
    #registerModal {
        padding: max(8px, env(safe-area-inset-top)) 8px 0;
    }

    .modal-content.auth-modal.register-auth-modal {
        position: absolute;
        right: 8px;
        bottom: 0;
        left: 8px;
        width: auto;
        max-width: 520px;
        max-height: calc(100vh - 8px);
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
        margin: 0 auto !important;
        border-bottom: 0;
        border-radius: 14px 14px 0 0 !important;
    }

    .register-auth-modal .auth-header {
        min-height: 54px;
        padding: 12px 14px 11px 16px;
    }

    .register-auth-modal .auth-header h2 {
        font-size: 19px;
    }

    .register-auth-body {
        padding: 14px 16px 6px;
        scrollbar-gutter: auto;
    }

    .register-auth-modal .auth-form-group {
        margin-bottom: 11px;
    }

    .register-auth-modal .auth-input {
        min-height: 46px;
        font-size: 16px;
    }

    .register-auth-modal .auth-tip-card {
        margin-bottom: 8px;
    }

    .register-auth-footer {
        padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    }

    .register-auth-footer .auth-btn-submit,
    .register-auth-footer .auth-btn-cancel {
        min-height: 46px;
        font-size: 15px;
    }

    .register-auth-footer .auth-btn-cancel {
        flex-basis: 84px;
    }
}

@media (max-height: 680px) and (max-width: 640px) {
    .register-auth-modal .auth-header {
        min-height: 48px;
        padding-block: 9px;
    }

    .register-auth-body {
        padding-top: 10px;
    }

    .register-auth-footer {
        padding-top: 8px;
    }

    .register-auth-footer .auth-footer-link {
        display: none;
    }
}
/* ===== 账号到期续费提醒 ===== */
body.account-access-locked { overflow: hidden; }
.renewal-offer-modal {
    z-index: 10055;
    padding: 18px;
    overflow-y: auto;
    background: rgba(15, 23, 42, .62);
}
.renewal-offer-dialog {
    width: min(100%, 720px);
    max-width: 720px;
    margin: 3vh auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dbe4df;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
}
.renewal-offer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px 20px;
    border-bottom: 1px solid #e5ebe7;
    background: #f7faf8;
}
.renewal-offer-kicker {
    margin-bottom: 5px;
    color: #047857;
    font-size: 12px;
    font-weight: 750;
}
.renewal-offer-header h2 {
    margin: 0;
    color: #17231d;
    font-size: 24px;
    letter-spacing: 0;
}
.renewal-offer-header p {
    max-width: 560px;
    margin: 8px 0 0;
    color: #5f6f66;
    font-size: 13px;
    line-height: 1.65;
}
.renewal-offer-close {
    flex: none;
    width: 36px;
    height: 36px;
    border: 1px solid #d8e2dc;
    border-radius: 50%;
    background: #fff;
    color: #64746b;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.renewal-offer-close:hover { border-color: #9db7a8; color: #174f36; }
.renewal-offer-body { padding: 20px 26px 22px; }
.renewal-account-status {
    padding: 9px 11px;
    border-left: 3px solid #f59e0b;
    background: #fffbeb;
    color: #71510a;
    font-size: 12px;
    line-height: 1.5;
}
.renewal-countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
}
.renewal-countdown[hidden] { display: none !important; }
.renewal-countdown-copy { display: grid; gap: 3px; }
.renewal-countdown-copy strong { color: #9a3412; font-size: 13px; }
.renewal-countdown-copy span { color: #9a5b39; font-size: 11px; }
.renewal-countdown-units { display: flex; flex: none; gap: 6px; }
.renewal-countdown-units > span {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 2px;
    min-width: 45px;
    padding: 6px 7px;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    background: #fff;
    text-align: center;
}
.renewal-countdown-units strong {
    color: #c2410c;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}
.renewal-countdown-units small { color: #9a5b39; font-size: 10px; }
.renewal-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.renewal-plan {
    min-width: 0;
    padding: 17px;
    border: 1px solid #dce6e0;
    border-radius: 8px;
    background: #fff;
}
.renewal-plan.is-featured { border-color: #6ee7b7; background: #f6fffb; }
.renewal-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.renewal-plan-label { display: block; margin-bottom: 4px; color: #718077; font-size: 10px; }
.renewal-plan h3 { margin: 0; color: #1f3027; font-size: 17px; letter-spacing: 0; }
.renewal-plan p { min-height: 40px; margin: 10px 0 14px; color: #66756c; font-size: 12px; line-height: 1.6; }
.renewal-recommend {
    flex: none;
    padding: 3px 7px;
    border-radius: 999px;
    background: #047857;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}
.renewal-price-row { display: flex; align-items: baseline; gap: 8px; min-height: 32px; }
.renewal-price-row del { color: #94a3a0; font-size: 12px; }
.renewal-price-row del[hidden] { display: none !important; }
.renewal-price-row strong { color: #b45309; font-size: 24px; font-variant-numeric: tabular-nums; }
.renewal-plan.is-featured .renewal-price-row strong { color: #047857; }
.renewal-plan button {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    border: 1px solid #a7c5b4;
    border-radius: 7px;
    background: #fff;
    color: #16613f;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.renewal-plan.is-featured button { border-color: #047857; background: #047857; color: #fff; }
.renewal-plan button:hover { filter: brightness(.97); }
.renewal-plan button:disabled { border-color: #d9e2dd; background: #f3f5f4; color: #98a39d; cursor: not-allowed; }
.renewal-offer-note { margin: 14px 0 0; color: #7a8980; font-size: 11px; line-height: 1.5; }
.renewal-offer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 13px 26px;
    border-top: 1px solid #e5ebe7;
    background: #fafcfb;
}
.renewal-offer-footer button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid #d8e2dc;
    border-radius: 7px;
    background: #fff;
    color: #5d6e64;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.renewal-offer-footer .renewal-recheck-button {
    border-color: #047857;
    background: #047857;
    color: #fff;
    font-weight: 700;
}
.renewal-offer-footer .renewal-recheck-button:hover { background: #036b4d; }
.renewal-offer-footer .renewal-recheck-button:disabled {
    border-color: #a7c5b4;
    background: #a7c5b4;
    cursor: wait;
}
.renewal-offer-footer .renewal-logout-button:hover {
    border-color: #b8c7bf;
    background: #f4f7f5;
    color: #33473c;
}
@media (max-width: 620px) {
    .renewal-offer-modal { padding: 10px; }
    .renewal-offer-dialog { width: 100%; margin: 10px auto; max-height: calc(100vh - 20px); overflow-y: auto; }
    .renewal-offer-header { padding: 18px 17px 16px; }
    .renewal-offer-header h2 { font-size: 21px; }
    .renewal-offer-body { padding: 15px 17px 17px; }
    .renewal-countdown { align-items: flex-start; flex-direction: column; }
    .renewal-countdown-units { width: 100%; }
    .renewal-countdown-units > span { flex: 1; min-width: 0; justify-content: center; }
    .renewal-plan-grid { grid-template-columns: 1fr; }
    .renewal-plan p { min-height: 0; }
    .renewal-offer-footer {
        display: grid;
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
        padding: 11px 17px max(11px, env(safe-area-inset-bottom));
    }
    .renewal-offer-footer button { width: 100%; min-width: 0; min-height: 44px; padding: 0 10px; }
}

/* ===== 积分日志容量灰度（仅服务端白名单账号解锁） ===== */
#capacityBetaSection[hidden] { display: none !important; }
.capacity-beta-card { border-color: #bfdbfe; background: linear-gradient(180deg, #f8fbff 0%, #fff 100%); }
.capacity-beta-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.capacity-beta-badge { flex: none; padding: 4px 9px; border: 1px solid #93c5fd; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 650; }
.capacity-usage-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 18px; }
.capacity-usage-row strong { color: #172554; font-size: 22px; font-variant-numeric: tabular-nums; }
.capacity-usage-row span { color: #64748b; font-size: 12px; }
.capacity-progress { height: 8px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #dbeafe; }
.capacity-progress > span { display: block; width: 0; height: 100%; border-radius: inherit; background: #2563eb; transition: width .2s ease; }
.capacity-expiry { margin-top: 8px; color: #64748b; font-size: 12px; }
.capacity-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.capacity-actions[hidden],
.capacity-usage-row span[hidden],
.capacity-expiry[hidden] { display: none !important; }
.capacity-actions .stg-btn { justify-content: center; min-height: 40px; }
.capacity-cleanup-open { border-color: #93c5fd; color: #1d4ed8; background: #fff; }
.capacity-cleanup-open:hover { border-color: #60a5fa; background: #eff6ff; }
.capacity-expansion-open { border-color: #c4b5fd; color: #6d28d9; background: #fff; }
.capacity-expansion-open:hover { border-color: #a78bfa; background: #f5f3ff; }
.capacity-cleanup-dialog,
.capacity-expansion-dialog {
    --stg-card-bg: #fff;
    --stg-text-primary: #1a1a2e;
    --stg-border: #e2e8f0;
    --stg-border-hover: #cbd5e1;
    --stg-accent: #4a6cf7;
    --stg-accent-hover: #3b5de7;
    --stg-red: #ef4444;
    --stg-red-soft: #fef2f2;
    --stg-radius-sm: 8px;
    --stg-shadow-sm: 0 1px 3px rgba(0, 0, 0, .04);
}
.capacity-cleanup-modal { z-index: 10040; }
.capacity-cleanup-dialog { width: min(92%, 560px); max-width: 560px; padding-bottom: 0; overflow: hidden; }
.capacity-cleanup-dialog-header { padding: 20px 22px; background: #fff; }
.capacity-cleanup-dialog-header h2 { margin: 0; color: #172554; font-size: 20px; }
.capacity-cleanup-dialog-header .close-btn { flex: none; }
.capacity-cleanup-dialog-sub { margin-top: 4px; color: #64748b; font-size: 12px; }
.capacity-cleanup-dialog-body { padding: 20px 22px 22px; }
.capacity-cleanup-notice { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid #bfdbfe; border-radius: 9px; background: #f8fbff; }
.capacity-cleanup-notice strong { color: #1e3a8a; font-size: 12px; }
.capacity-cleanup-notice span { color: #64748b; font-size: 11px; line-height: 1.5; }
.capacity-cleanup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.capacity-cleanup-field { display: grid; gap: 6px; min-width: 0; }
.capacity-cleanup-field > span { color: #475569; font-size: 11px; font-weight: 650; }
.capacity-cleanup-field select,
.capacity-cleanup-field input { width: 100%; min-height: 40px; box-sizing: border-box; padding: 8px 10px; border: 1px solid #bfdbfe; border-radius: 8px; outline: 0; background: #fff; color: #1e293b; font: inherit; font-size: 13px; }
.capacity-cleanup-field select:focus,
.capacity-cleanup-field input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.capacity-cleanup-custom-date { grid-column: 1 / -1; }
.capacity-cleanup-custom-date[hidden] { display: none !important; }
.capacity-cleanup-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.capacity-cleanup-actions .stg-btn { justify-content: center; min-height: 40px; }
.capacity-cleanup-actions .stg-btn:disabled { border-color: #e2e8f0; background: #f8fafc; color: #94a3b8; box-shadow: none; cursor: not-allowed; transform: none; }
.capacity-cleanup-result { display: grid; gap: 3px; margin-top: 12px; padding: 10px 12px; border: 1px solid #dbeafe; border-radius: 8px; background: rgba(255, 255, 255, .76); }
.capacity-cleanup-result strong { color: #334155; font-size: 12px; }
.capacity-cleanup-result span { color: #64748b; font-size: 11px; line-height: 1.5; }
.capacity-cleanup-result.is-loading { border-color: #bfdbfe; background: #eff6ff; }
.capacity-cleanup-result.is-ready { border-color: #a7f3d0; background: #ecfdf5; }
.capacity-cleanup-result.is-ready strong,
.capacity-cleanup-result.is-success strong { color: #047857; }
.capacity-cleanup-result.is-success { border-color: #86efac; background: #f0fdf4; }
.capacity-cleanup-result.is-error { border-color: #fecaca; background: #fef2f2; }
.capacity-cleanup-result.is-error strong { color: #b91c1c; }
.capacity-expansion-modal { z-index: 10040; }
.capacity-expansion-dialog { display: flex; flex-direction: column; width: min(92%, 640px); max-width: 640px; padding-bottom: 0; overflow: hidden; }
.capacity-expansion-dialog-header { padding: 20px 22px; background: #fff; }
.capacity-expansion-dialog-header h2 { margin: 0; color: #172554; font-size: 20px; }
.capacity-expansion-dialog-header .close-btn { flex: none; }
.capacity-expansion-dialog-sub { margin-top: 4px; color: #64748b; font-size: 12px; }
.capacity-expansion-dialog-body { flex: 1; min-height: 0; padding: 20px 22px 22px; overflow-y: auto; }
.capacity-expansion-notice { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid #ddd6fe; border-radius: 9px; background: #faf8ff; }
.capacity-expansion-notice strong { color: #5b21b6; font-size: 12px; }
.capacity-expansion-notice span { color: #64748b; font-size: 11px; line-height: 1.5; }
.capacity-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.capacity-plan { padding: 14px; border: 1px solid #dbeafe; border-radius: 10px; background: #fff; }
.capacity-plan h4 { margin: 0; color: #1e293b; font-size: 14px; }
.capacity-plan p { min-height: 34px; margin: 6px 0 12px; color: #64748b; font-size: 12px; line-height: 1.45; }
.capacity-plan-price { margin-bottom: 10px; color: #1d4ed8; font-size: 20px; font-weight: 750; }
.capacity-plan-price small { color: #64748b; font-size: 11px; font-weight: 500; }
.capacity-plan button { width: 100%; }
.capacity-payment-note { margin-top: 12px; color: #64748b; font-size: 12px; line-height: 1.6; }
.capacity-order-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
.capacity-order-heading strong { color: #172554; font-size: 13px; }
.capacity-order-heading span { color: #64748b; font-size: 11px; }
.capacity-order-list { display: grid; gap: 7px; margin-top: 14px; }
.capacity-order-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px dashed #dbeafe; color: #475569; font-size: 12px; }
.capacity-order-actions { display: flex; flex: none; flex-wrap: wrap; gap: 6px; }
.capacity-order-actions button { padding: 5px 8px; border: 1px solid #bfdbfe; border-radius: 6px; background: #fff; color: #1d4ed8; cursor: pointer; }
.capacity-order-empty { padding: 16px 12px; border: 1px dashed #cbd5e1; border-radius: 8px; color: #94a3b8; font-size: 12px; text-align: center; }
@media (max-width: 620px) {
    .capacity-beta-head, .capacity-usage-row, .capacity-order-row { align-items: flex-start; flex-direction: column; }
    .capacity-actions { grid-template-columns: 1fr; }
    .capacity-actions .stg-btn { width: 100%; min-height: 44px; }
    .capacity-cleanup-modal, .capacity-expansion-modal { padding: 12px; }
    .capacity-cleanup-dialog, .capacity-expansion-dialog { width: 100%; margin: 12px auto; max-height: calc(100vh - 24px); }
    .capacity-cleanup-dialog-header { padding: 16px; }
    .capacity-cleanup-dialog-header h2 { font-size: 18px; }
    .capacity-cleanup-dialog-body { padding: 16px; }
    .capacity-cleanup-grid { grid-template-columns: 1fr; }
    .capacity-cleanup-custom-date { grid-column: auto; }
    .capacity-cleanup-actions { grid-template-columns: 1fr; }
    .capacity-cleanup-actions .stg-btn { width: 100%; min-height: 44px; }
    .capacity-expansion-dialog-header { padding: 16px; }
    .capacity-expansion-dialog-header h2 { font-size: 18px; }
    .capacity-expansion-dialog-body { padding: 16px; }
    .capacity-plan-grid { grid-template-columns: 1fr; }
    .capacity-order-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
}
/* ===== 老师积分兑换 ===== */
.nav-more-count {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.reward-center-modal {
    padding: 18px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.55);
}

.reward-center-shell {
    --reward-green: #0f8b6d;
    --reward-green-dark: #08624e;
    --reward-green-soft: #eaf8f3;
    --reward-line: #dce7e3;
    --reward-ink: #18312b;
    --reward-muted: #6b7f79;
    width: min(1180px, 100%);
    max-width: 1180px;
    height: min(860px, calc(100vh - 36px));
    max-height: none;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    background: #f5f8f7;
    box-shadow: 0 22px 70px rgba(15, 45, 37, 0.26);
}

.reward-center-header,
.reward-editor-header {
    flex: 0 0 auto;
    min-height: 76px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #dce7e3;
    background: #fff;
}

.reward-center-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.reward-center-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #08735a;
    background: #e7f7f1;
}

.reward-center-heading h2,
.reward-editor-header h2 {
    margin: 0;
    color: #17332c;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: 0;
}

.reward-center-heading p,
.reward-editor-header p,
.reward-manage-toolbar p {
    margin: 4px 0 0;
    color: #6b7f79;
    font-size: 12px;
    line-height: 1.4;
}

.reward-icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe6e2;
    border-radius: 6px;
    background: #fff;
    color: #637770;
    cursor: pointer;
}

.reward-icon-button:hover {
    color: #b42318;
    border-color: #fecaca;
    background: #fff7f7;
}

.reward-tabs {
    flex: 0 0 auto;
    min-height: 52px;
    padding: 0 22px;
    display: flex;
    align-items: stretch;
    gap: 26px;
    border-bottom: 1px solid #dce7e3;
    background: #fff;
}

.reward-tab {
    position: relative;
    padding: 0 2px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: #6b7f79;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
}

.reward-tab::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
}

.reward-tab.active {
    color: #08735a;
}

.reward-tab.active::after {
    background: #0f8b6d;
}

.reward-tab-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eaf8f3;
    color: #08735a;
    font-size: 11px;
}

.reward-center-body {
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.reward-panel {
    width: 100%;
    height: 100%;
    display: none;
    min-height: 0;
}

.reward-panel.active {
    display: flex;
}

.reward-student-pane,
.reward-catalog-pane {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.reward-student-pane {
    width: 34%;
    max-width: 390px;
    padding: 20px;
    border-right: 1px solid #dce7e3;
    background: #fff;
}

.reward-catalog-pane {
    flex: 1;
    padding: 20px 22px;
    background: #f5f8f7;
}

.reward-pane-title-row,
.reward-manage-toolbar,
.reward-field-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reward-pane-title-row h3,
.reward-manage-toolbar h3 {
    margin: 2px 0 0;
    color: #18312b;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 0;
}

.reward-eyebrow {
    color: #0f8b6d;
    font-size: 11px;
    font-weight: 700;
}

.reward-result-count {
    color: #7c8e88;
    font-size: 12px;
}

.reward-student-filters,
.reward-record-filters {
    margin: 14px 0;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px;
}

.reward-student-filters select,
.reward-record-filters select,
.reward-search-field,
.reward-field input,
.reward-field textarea {
    min-width: 0;
    border: 1px solid #d6e2de;
    border-radius: 6px;
    background: #fff;
}

.reward-student-filters select,
.reward-record-filters select {
    width: 100%;
    height: 40px;
    padding: 0 30px 0 10px;
    color: #304943;
    font-size: 13px;
}

.reward-search-field {
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #7c8e88;
}

.reward-search-field:focus-within,
.reward-field input:focus,
.reward-field textarea:focus {
    border-color: #42a98e;
    box-shadow: 0 0 0 3px rgba(15, 139, 109, 0.1);
    outline: none;
}

.reward-search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #263d37;
    font: inherit;
    font-size: 13px;
}

.reward-student-list,
.reward-catalog-grid,
.reward-record-list,
.reward-manage-list {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.reward-student-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reward-student-option {
    width: 100%;
    min-height: 54px;
    padding: 9px 11px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #f7faf9;
    color: #253e37;
    text-align: left;
    cursor: pointer;
}

.reward-student-option:hover {
    border-color: #b9ded2;
    background: #f0faf6;
}

.reward-student-option.active {
    border-color: #31a886;
    background: #eaf8f3;
}

.reward-student-avatar {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #dcefe8;
    color: #08735a;
    font-size: 14px;
    font-weight: 750;
}

.reward-student-copy {
    min-width: 0;
}

.reward-student-copy strong,
.reward-student-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reward-student-copy strong {
    font-size: 14px;
}

.reward-student-copy small {
    margin-top: 3px;
    color: #71827d;
    font-size: 11px;
}

.reward-student-score {
    color: #08735a;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.reward-selected-student {
    min-height: 58px;
    margin: 14px 0;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #cce7de;
    border-radius: 7px;
    background: #fff;
}

.reward-selected-student.empty {
    justify-content: center;
    color: #7b8c87;
    border-style: dashed;
    background: #f8fbfa;
    font-size: 13px;
}

.reward-selected-name strong,
.reward-selected-name span {
    display: block;
}

.reward-selected-name strong {
    color: #18312b;
    font-size: 15px;
}

.reward-selected-name span {
    margin-top: 3px;
    color: #70817c;
    font-size: 11px;
}

.reward-selected-balance {
    text-align: right;
}

.reward-selected-balance strong {
    display: block;
    color: #08735a;
    font-size: 20px;
    line-height: 1;
}

.reward-selected-balance span {
    color: #71827d;
    font-size: 10px;
}

.reward-text-button,
.reward-secondary-button,
.reward-primary-button,
.reward-action-button {
    min-height: 36px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.reward-text-button {
    border: 0;
    background: transparent;
    color: #08735a;
}

.reward-text-button:hover {
    background: #eaf8f3;
}

.reward-primary-button,
.reward-action-primary {
    border: 1px solid #0f8b6d;
    background: #0f8b6d;
    color: #fff;
}

.reward-primary-button:hover,
.reward-action-primary:hover {
    border-color: #08735a;
    background: #08735a;
}

.reward-secondary-button,
.reward-action-secondary {
    border: 1px solid #ccd9d5;
    background: #fff;
    color: #425a53;
}

.reward-secondary-button:hover,
.reward-action-secondary:hover {
    border-color: #82bbaa;
    color: #08735a;
}

.reward-primary-button:disabled,
.reward-secondary-button:disabled,
.reward-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reward-catalog-grid {
    padding-right: 3px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 10px;
}

.reward-item-card {
    min-width: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid #dce7e3;
    border-radius: 7px;
    background: #fff;
}

.reward-item-card.unavailable {
    background: #f8faf9;
    opacity: 0.72;
}

.reward-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.reward-item-top h4 {
    margin: 0;
    min-width: 0;
    color: #18312b;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.reward-cost {
    flex: 0 0 auto;
    color: #08735a;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.reward-item-description {
    min-height: 34px;
    margin: 0;
    color: #687b75;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.reward-item-meta,
.reward-manage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.reward-meta-tag,
.reward-status-tag {
    min-height: 22px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    background: #f0f4f2;
    color: #60736d;
    font-size: 10px;
    line-height: 1.25;
}

.reward-item-card .reward-action-button {
    width: 100%;
    margin-top: auto;
}

.reward-empty-state,
.reward-loading-state {
    min-height: 180px;
    padding: 28px;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed #cbdad5;
    border-radius: 7px;
    color: #71827d;
    background: #fff;
    text-align: center;
    font-size: 13px;
}

.reward-empty-state strong {
    color: #304943;
    font-size: 14px;
}

#rewardRecordsPanel,
#rewardManagePanel {
    padding: 20px 22px;
    flex-direction: column;
    background: #f5f8f7;
}

.reward-record-toolbar {
    flex: 0 0 auto;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.reward-status-filter {
    min-height: 40px;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8e3df;
    border-radius: 7px;
    background: #fff;
}

.reward-status-filter button {
    min-height: 32px;
    padding: 0 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #667a74;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.reward-status-filter button.active {
    background: #e5f5ef;
    color: #08735a;
    font-weight: 700;
}

.reward-record-filters {
    margin: 0;
    grid-template-columns: 120px minmax(150px, 220px) auto;
}

.reward-record-list,
.reward-manage-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reward-record-row {
    min-width: 720px;
    padding: 13px 14px;
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) minmax(130px, 1fr) 90px 120px auto;
    align-items: center;
    gap: 14px;
    border: 1px solid #dce7e3;
    border-radius: 7px;
    background: #fff;
}

.reward-record-primary strong,
.reward-record-primary span,
.reward-record-item strong,
.reward-record-item span {
    display: block;
}

.reward-record-primary strong,
.reward-record-item strong {
    color: #213a33;
    font-size: 13px;
}

.reward-record-primary span,
.reward-record-item span,
.reward-record-time {
    margin-top: 3px;
    color: #71827d;
    font-size: 11px;
}

.reward-record-points {
    color: #b54708;
    font-size: 13px;
    font-weight: 750;
}

.reward-status-tag.pending {
    background: #fff3df;
    color: #a15c00;
}

.reward-status-tag.fulfilled {
    background: #e8f6f0;
    color: #08735a;
}

.reward-status-tag.cancelled {
    background: #f1f3f2;
    color: #6b7f79;
}

.reward-record-actions,
.reward-manage-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.reward-action-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
}

.reward-action-danger {
    border: 1px solid #f0c5c2;
    background: #fff;
    color: #b42318;
}

.reward-action-danger:hover {
    border-color: #e59a95;
    background: #fff7f7;
}

.reward-pagination {
    min-height: 42px;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #6b7f79;
    font-size: 12px;
}

.reward-manage-toolbar {
    flex: 0 0 auto;
    margin-bottom: 14px;
}

.reward-manage-row {
    min-width: 760px;
    padding: 13px 14px;
    display: grid;
    grid-template-columns: minmax(150px, 1.25fr) 90px 100px minmax(150px, 1fr) 92px auto;
    align-items: center;
    gap: 14px;
    border: 1px solid #dce7e3;
    border-radius: 7px;
    background: #fff;
}

.reward-manage-name strong,
.reward-manage-name small {
    display: block;
}

.reward-manage-name strong {
    color: #213a33;
    font-size: 13px;
}

.reward-manage-name small {
    margin-top: 3px;
    color: #71827d;
    font-size: 11px;
}

.reward-manage-number {
    color: #304943;
    font-size: 12px;
}

.reward-manage-number strong {
    display: block;
    color: #08735a;
    font-size: 15px;
}

.reward-editor-modal {
    z-index: 10030;
    padding: 18px;
    background: rgba(15, 23, 42, 0.62);
}

.reward-editor-shell {
    width: min(620px, 100%);
    max-width: 620px;
    max-height: calc(100vh - 36px);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background: #fff;
}

.reward-editor-body {
    min-height: 0;
    padding: 20px 22px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.reward-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #314a43;
    font-size: 12px;
    font-weight: 650;
}

.reward-field-wide {
    grid-column: 1 / -1;
}

.reward-field > span b,
.reward-field-line > span b {
    color: #c4322b;
}

.reward-field input,
.reward-field textarea {
    width: 100%;
    padding: 10px 11px;
    color: #213a33;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    box-sizing: border-box;
    resize: vertical;
}

.reward-field input {
    height: 42px;
}

.reward-field input:disabled {
    background: #f1f4f3;
    color: #8a9994;
}

.reward-field small {
    color: #7a8b86;
    font-size: 10px;
    font-weight: 400;
}

.reward-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #536963;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.reward-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #0f8b6d;
}

.reward-class-choices {
    min-height: 48px;
    max-height: 148px;
    padding: 10px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid #dce7e3;
    border-radius: 6px;
    background: #f8faf9;
}

.reward-class-choices.disabled {
    opacity: 0.55;
}

.reward-class-option {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #415952;
    font-size: 11px;
    font-weight: 500;
}

.reward-class-option input {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    accent-color: #0f8b6d;
}

.reward-class-option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reward-active-check {
    grid-column: 1 / -1;
    min-height: 30px;
}

.reward-editor-footer {
    flex: 0 0 auto;
    padding: 14px 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #dce7e3;
    background: #f8faf9;
}

@media (max-width: 920px) {
    .reward-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reward-record-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .reward-record-filters {
        grid-template-columns: 140px minmax(0, 1fr) auto;
    }
}

@media (max-width: 680px) {
    .reward-center-modal,
    .reward-editor-modal {
        padding: 0;
    }

    .reward-center-shell,
    .reward-editor-shell {
        width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .reward-editor-shell {
        height: 100vh;
        min-height: 100vh;
    }

    @supports (height: 100dvh) {
        .reward-editor-shell {
            height: 100dvh;
            min-height: 100dvh;
        }
    }

    .reward-center-header,
    .reward-editor-header {
        min-height: 66px;
        padding: 12px 14px;
    }

    .reward-center-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .reward-center-heading h2,
    .reward-editor-header h2 {
        font-size: 18px;
    }

    .reward-center-heading p,
    .reward-editor-header p {
        display: none;
    }

    .reward-tabs {
        min-height: 48px;
        padding: 0 14px;
        gap: 22px;
        overflow-x: auto;
    }

    .reward-tab {
        flex: 0 0 auto;
        font-size: 13px;
    }

    .reward-panel.active {
        overflow-y: auto;
        display: block;
    }

    .reward-student-pane,
    .reward-catalog-pane {
        width: 100%;
        max-width: none;
        padding: 16px 14px;
        border-right: 0;
    }

    .reward-student-pane {
        border-bottom: 1px solid #dce7e3;
    }

    .reward-student-list {
        max-height: 220px;
    }

    .reward-catalog-pane {
        min-height: 430px;
    }

    .reward-catalog-grid {
        overflow: visible;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .reward-item-card {
        padding: 11px;
    }

    .reward-item-description {
        min-height: 0;
    }

    #rewardRecordsPanel,
    #rewardManagePanel {
        padding: 14px;
    }

    .reward-status-filter {
        width: max-content;
        max-width: 100%;
        overflow-x: auto;
    }

    .reward-status-filter button {
        flex: 0 0 auto;
    }

    .reward-record-filters {
        grid-template-columns: 1fr auto;
    }

    .reward-record-filters select {
        grid-column: 1 / -1;
    }

    .reward-record-list,
    .reward-manage-list {
        overflow-x: auto;
    }

    .reward-record-row {
        min-width: 0;
        padding: 12px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 9px 12px;
    }

    .reward-record-item,
    .reward-record-time {
        grid-column: 1 / -1;
    }

    .reward-record-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .reward-record-actions button {
        flex: 1;
    }

    .reward-manage-row {
        min-width: 0;
        padding: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .reward-manage-name,
    .reward-manage-meta,
    .reward-manage-actions {
        grid-column: 1 / -1;
    }

    .reward-manage-actions {
        justify-content: stretch;
    }

    .reward-manage-actions button {
        flex: 1;
    }

    .reward-editor-body {
        flex: 1;
        padding: 16px 14px;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .reward-field-wide,
    .reward-active-check {
        grid-column: 1;
    }

    .reward-class-choices {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reward-editor-footer {
        padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 390px) {
    .reward-student-filters {
        grid-template-columns: 108px minmax(0, 1fr);
    }

    .reward-catalog-grid {
        grid-template-columns: 1fr;
    }

    .reward-item-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .reward-item-top,
    .reward-item-description,
    .reward-item-meta {
        grid-column: 1 / -1;
    }

    .reward-item-card .reward-action-button {
        grid-column: 1 / -1;
    }
}

/* ===== 帮助与客服 ===== */
.personal-support-entry {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    margin: 0 0 12px;
    padding: 9px 11px;
    border: 1px solid #d9e8e2;
    border-radius: 8px;
    color: #1f3f36;
    background: #f4faf7;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.personal-support-entry:hover {
    border-color: #a9d2c2;
    background: #edf8f3;
}

.personal-support-entry:focus-visible {
    outline: 2px solid #15936f;
    outline-offset: 2px;
}

.personal-support-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #087858;
    background: #dff4eb;
}

.personal-support-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.personal-support-copy strong {
    color: #173b31;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.personal-support-copy small {
    overflow: hidden;
    color: #6b7f78;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.personal-support-arrow {
    color: #799089;
}

.customer-service-overlay {
    z-index: 10060;
    padding: 20px;
    overflow: hidden;
    background: rgba(15, 34, 29, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content.customer-service-modal {
    width: min(560px, 100%);
    max-width: 560px;
    height: min(720px, calc(100dvh - 40px));
    min-height: 520px;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(9, 37, 29, 0.24);
    animation: customerServiceEnter 0.18s ease-out;
}

@keyframes customerServiceEnter {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.customer-service-header {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 0 0 auto;
    padding: 14px 16px;
    border-bottom: 1px solid #e5ece9;
    background: #ffffff;
}

.customer-service-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.customer-service-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #ffffff;
    background: #147b60;
}

.customer-service-heading h2 {
    margin: 0;
    color: #172b25;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: 0;
}

.customer-service-heading small {
    display: block;
    margin-top: 2px;
    color: #71817b;
    font-size: 11px;
    line-height: 1.3;
}

.customer-service-heading small.is-human {
    color: #b56b0b;
}

.customer-service-heading small.is-online {
    color: #087858;
}

.customer-service-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #71817b;
    background: transparent;
    cursor: pointer;
}

.customer-service-close:hover {
    border-color: #dce7e3;
    color: #263e36;
    background: #f4f7f6;
}

.customer-service-messages {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 18px 14px;
    background: #f5f8f7;
    -webkit-overflow-scrolling: touch;
}

.customer-service-loading,
.customer-service-empty {
    margin: auto;
    color: #75867f;
    font-size: 13px;
    text-align: center;
}

.customer-service-message {
    max-width: min(82%, 420px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.customer-service-message.is-user {
    align-self: flex-end;
    align-items: flex-end;
}

.customer-service-message.is-support {
    align-self: flex-start;
    align-items: flex-start;
}

.customer-service-bubble {
    padding: 10px 12px;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    color: #283d36;
    background: #ffffff;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.customer-service-message.is-user .customer-service-bubble {
    border-color: #147b60;
    color: #ffffff;
    background: #147b60;
}

.customer-service-message.is-system .customer-service-bubble {
    border-color: #f0d5aa;
    color: #754c12;
    background: #fff8eb;
}

.customer-service-meta {
    padding: 0 2px;
    color: #8b9994;
    font-size: 10px;
    line-height: 1.2;
}

.customer-service-quick {
    flex: 0 0 auto;
    padding: 10px 16px 11px;
    border-top: 1px solid #e4ebe8;
    background: #ffffff;
}

.customer-service-quick-label {
    margin-bottom: 7px;
    color: #6d7e78;
    font-size: 11px;
    font-weight: 650;
}

.customer-service-quick-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.customer-service-quick-button {
    min-height: 32px;
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid #cfded8;
    border-radius: 6px;
    color: #34564c;
    background: #ffffff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.customer-service-quick-button:hover {
    border-color: #91bcae;
    background: #f0f8f5;
}

.customer-service-error {
    flex: 0 0 auto;
    margin: 10px 16px 0;
    padding: 8px 10px;
    border: 1px solid #f2c9c9;
    border-radius: 6px;
    color: #a43838;
    background: #fff1f1;
    font-size: 12px;
    line-height: 1.45;
}

.customer-service-footer {
    flex: 0 0 auto;
    padding: 10px 14px 12px;
    border-top: 1px solid #e4ebe8;
    background: #ffffff;
}

.customer-service-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.customer-service-text-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid #d8e3df;
    border-radius: 6px;
    color: #4a6159;
    background: #ffffff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.customer-service-text-action[hidden] {
    display: none;
}

.customer-service-text-action:hover {
    border-color: #aac7bd;
    color: #156e56;
    background: #f2f8f5;
}

.customer-service-text-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.customer-service-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
    gap: 8px;
}

.customer-service-compose textarea {
    width: 100%;
    min-height: 42px;
    max-height: 104px;
    resize: none;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #cfdcd7;
    border-radius: 8px;
    color: #233831;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
}

.customer-service-compose textarea:focus {
    outline: none;
    border-color: #168264;
    box-shadow: 0 0 0 3px rgba(22, 130, 100, 0.12);
}

.customer-service-send {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #147b60;
    border-radius: 8px;
    color: #ffffff;
    background: #147b60;
    cursor: pointer;
}

.customer-service-send:hover {
    border-color: #0f654e;
    background: #0f654e;
}

.customer-service-send:disabled {
    opacity: 0.5;
    cursor: wait;
}

.customer-service-privacy {
    margin: 7px 1px 0;
    color: #8a9893;
    font-size: 10px;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .customer-service-overlay {
        padding: 0;
    }

    .modal-content.customer-service-modal {
        width: 100%;
        max-width: none;
        height: 100dvh;
        min-height: 100%;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .customer-service-header {
        min-height: 62px;
        padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    }

    .customer-service-mark {
        width: 36px;
        height: 36px;
    }

    .customer-service-messages {
        padding: 14px 12px 12px;
    }

    .customer-service-message {
        max-width: 88%;
    }

    .customer-service-quick {
        padding: 9px 12px 10px;
    }

    .customer-service-footer {
        padding: 9px 10px max(10px, env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-content.customer-service-modal {
        animation: none;
    }
}

/* Language controls and room for longer English interface labels. */
.interface-language-card { border-radius: 8px; }
.interface-language-card .stg-inline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.interface-language-card .stg-select { width: 180px; max-width: 60%; min-height: 44px; }
html[lang="en"] .nav-btn { font-size: 14px; padding-inline: 12px; }
html[lang="en"] .nav-btn svg { flex-shrink: 0; }
html[lang="en"] .nav-more-dropdown { min-width: 240px; max-width: calc(100vw - 24px); }
html[lang="en"] .stg-section-label { letter-spacing: 0; }
html[lang="en"] .stg-card-title,
html[lang="en"] .stg-card-desc,
html[lang="en"] .stg-toggle-label,
html[lang="en"] .stg-danger-desc { overflow-wrap: anywhere; }
html[lang="en"] .stg-btn,
html[lang="en"] .stg-sort-btn,
html[lang="en"] .student-mgmt-tab,
html[lang="en"] .pet-category-tab { white-space: normal; line-height: 1.35; }
html[lang="en"] .stg-inline-row { flex-wrap: wrap; }
html[lang="en"] .settings-header h2 { font-size: 24px; }
html[lang="en"] .stg-card-head > div:not(.stg-card-icon) { min-width: 0; }
html[lang="en"] .stg-parent-poster { flex-wrap: wrap; }
html[lang="en"] .score-header-btn { white-space: normal; }
html[lang="en"] .score-item-list-element > div { min-width: 0; }
html[lang="en"] .score-item-list-element button { flex-shrink: 0; }
@media (max-width: 768px) {
    html[lang="en"] .nav-left .nav-btn,
    html[lang="en"] .nav-more-wrap .nav-btn { font-size: 12px; padding-inline: 10px; }
    html[lang="en"] .nav-left .nav-btn,
    html[lang="en"] .nav-more-wrap { width: calc(33.333% - 4px); }
    html[lang="en"] .nav-left .nav-btn,
    html[lang="en"] .nav-more-wrap .nav-btn { height: 44px; white-space: normal; line-height: 1.3; }
    html[lang="en"] .nav-left .nav-btn span { min-width: 0; overflow-wrap: normal; }
    html[lang="en"] .select-id-navClassFilter { order: 5; flex: 1; min-width: 0; }
    html[lang="en"] .nav-more-dropdown { right: 0; left: auto; max-height: 65vh; overflow-y: auto; }
    html[lang="en"] .stg-log-usage { min-width: 0; }
    html[lang="en"] .stg-log-usage > span { white-space: normal; }
    html[lang="en"] .score-item-list-element { flex-wrap: wrap; }
}
@media (max-width: 420px) {
    html[lang="en"] .stg-log-usage { width: calc(100% - 54px); }
}

/* Pet names wrap independently of image dimensions and student names. */
html[lang="en"] .student-card .info-row { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 4px; }
html[lang="en"] .student-card .info-row .student-name { max-width: 100%; overflow-wrap: anywhere; }
html[lang="en"] .student-card .pet-breed {
    min-width: 0;
    max-width: 100%;
    min-height: 2.7em;
    text-align: left;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
html[lang="en"] .pet-selector .pet-name,
html[lang="en"] #petSwitcherSelector .pet-name,
html[lang="en"] .claim-pet-name,
html[lang="en"] .medals-modal-name {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
html[lang="en"] #petSwitcherSelector .pet-name-row { min-height: 3.9em; }
html[lang="en"] .pet-selector .pet-option,
html[lang="en"] #petSwitcherSelector .pet-option { justify-content: flex-start; }
html[lang="en"] .claim-pet-name { min-height: 2.7em; }
html[lang="en"] .pet-level-preview-title h3 { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.pet-level-preview-title h3 [data-pet-name] { display: inline; margin: 0; color: inherit; font: inherit; }
.pet-level-preview-title > span > [data-ui-i18n] { display: inline; margin: 0; }
@media (max-width: 768px) {
    html[lang="en"] .student-card .pet-breed { font-size: 12px !important; }
}
