html[data-theme="classic"] {
    --theme-body-bg: linear-gradient(to bottom right, #eef2ff, #faf5ff, #eff6ff);
    --theme-card-bg: #ffffff;
    --theme-header-bg: linear-gradient(to right, #9333ea, #2563eb);
    --theme-panel-bg: #f9fafb;
    --theme-panel-inner-bg: #ffffff;
    --theme-title: #6d28d9;
    --theme-link: #9333ea;
    --theme-link-hover: #6b21a8;
    --theme-badge-bg: #faf5ff;
    --theme-badge-text: #9333ea;
    --theme-muted: #6b7280;
    --theme-border: rgba(229, 231, 235, 0.8);
    --theme-btn-bg: linear-gradient(to right, #a855f7, #3b82f6);
    --theme-btn-bg-hover: linear-gradient(to right, #9333ea, #2563eb);
    --theme-btn-stop-bg: #ef4444;
    --theme-btn-stop-hover: #dc2626;
    --theme-btn-ring: rgba(196, 181, 253, 0.85);
    --theme-name-bg: linear-gradient(145deg, #faf5ff, #eff6ff);
    --theme-name-border: #c4b5fd;
    --theme-name-text: #1f2937;
    --theme-circle-1: #8b5cf6;
    --theme-circle-2: #ec4899;
    --theme-circle-3: #3b82f6;
    --theme-circle-4: #10b981;
    --theme-pulse: rgba(147, 112, 219, 0.4);
    --theme-reveal-glow: rgba(139, 92, 246, 0.55);
    --theme-reveal-shadow: rgba(147, 112, 219, 0.3);
    --theme-selected-bg: linear-gradient(145deg, #e6e6ff, #ffffff);
    --theme-selected-shadow: rgba(147, 112, 219, 0.3);
    --theme-flash-tint: rgba(167, 139, 250, 0.15);
    --theme-history-hover: #faf5ff;
    --theme-history-index: #a78bfa;
    --theme-btn-active-bg: linear-gradient(to right, #8b5cf6, #3b82f6);
    --theme-presentation-bg: radial-gradient(ellipse at 50% 0%, #312e81 0%, #1e1b4b 42%, #0f172a 100%);
    --theme-presentation-name-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(237, 233, 254, 0.92));
    --theme-presentation-glow: rgba(167, 139, 250, 0.42);
    --theme-icon: #8b5cf6;
}

html[data-theme="sports"] {
    --theme-body-bg: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 42%, #eef8f7 100%);
    --theme-card-bg: #ffffff;
    --theme-header-bg: linear-gradient(125deg, #0c4a6e 0%, #0f766e 46%, #155e75 100%);
    --theme-panel-bg: #f8fafc;
    --theme-panel-inner-bg: #ffffff;
    --theme-title: #115e59;
    --theme-link: #0d9488;
    --theme-link-hover: #0f766e;
    --theme-badge-bg: #ecfdf5;
    --theme-badge-text: #0f766e;
    --theme-muted: #64748b;
    --theme-border: rgba(148, 163, 184, 0.32);
    --theme-btn-bg: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
    --theme-btn-bg-hover: linear-gradient(135deg, #0f766e 0%, #0e7490 100%);
    --theme-btn-stop-bg: #e11d48;
    --theme-btn-stop-hover: #be123c;
    --theme-btn-ring: rgba(45, 212, 191, 0.42);
    --theme-name-bg: linear-gradient(145deg, #f0fdfa, #f8fafc);
    --theme-name-border: #99f6e4;
    --theme-name-text: #134e4a;
    --theme-circle-1: #14b8a6;
    --theme-circle-2: #fb7185;
    --theme-circle-3: #38bdf8;
    --theme-circle-4: #a3e635;
    --theme-pulse: rgba(20, 184, 166, 0.34);
    --theme-reveal-glow: rgba(251, 113, 133, 0.48);
    --theme-reveal-shadow: rgba(15, 118, 110, 0.26);
    --theme-selected-bg: linear-gradient(145deg, #ecfdf5, #ffffff);
    --theme-selected-shadow: rgba(15, 118, 110, 0.22);
    --theme-flash-tint: rgba(45, 212, 191, 0.14);
    --theme-history-hover: #f0fdfa;
    --theme-history-index: #0d9488;
    --theme-btn-active-bg: linear-gradient(135deg, #0d9488, #0891b2);
    --theme-presentation-bg: radial-gradient(ellipse at 50% 0%, #134e4a 0%, #0c4a6e 44%, #0f172a 100%);
    --theme-presentation-name-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 253, 245, 0.94));
    --theme-presentation-glow: rgba(20, 184, 166, 0.34);
    --theme-icon: #14b8a6;
}

html[data-theme="dark"] {
    --theme-body-bg: #0a0a0a;
    --theme-card-bg: #141414;
    --theme-header-bg: linear-gradient(180deg, #1c1a18 0%, #111010 100%);
    --theme-panel-bg: #0a0a0a;
    --theme-panel-inner-bg: #1a1816;
    --theme-title: #f5f2ed;
    --theme-link: #b8a088;
    --theme-link-hover: #d4c4b0;
    --theme-badge-bg: rgba(184, 160, 136, 0.1);
    --theme-badge-text: #c9b89a;
    --theme-muted: #6b6560;
    --theme-border: rgba(255, 255, 255, 0.06);
    --theme-btn-bg: linear-gradient(180deg, #3a3632 0%, #2a2622 100%);
    --theme-btn-bg-hover: linear-gradient(180deg, #4a4540 0%, #35302c 100%);
    --theme-btn-stop-bg: #9f3d30;
    --theme-btn-stop-hover: #7f2f25;
    --theme-btn-ring: rgba(184, 160, 136, 0.22);
    --theme-name-bg: linear-gradient(145deg, #1e1c1a, #161412);
    --theme-name-border: rgba(184, 160, 136, 0.18);
    --theme-name-text: #f5f2ed;
    --theme-circle-1: #8a7f72;
    --theme-circle-2: #a39688;
    --theme-circle-3: #6e6560;
    --theme-circle-4: #c4b5a5;
    --theme-pulse: rgba(184, 160, 136, 0.18);
    --theme-reveal-glow: rgba(212, 196, 176, 0.28);
    --theme-reveal-shadow: rgba(0, 0, 0, 0.38);
    --theme-selected-bg: linear-gradient(145deg, #2a2622, #1e1c1a);
    --theme-selected-shadow: rgba(0, 0, 0, 0.32);
    --theme-flash-tint: rgba(212, 196, 176, 0.08);
    --theme-history-hover: #1a1816;
    --theme-history-index: #b8a088;
    --theme-btn-active-bg: #3a3632;
    --theme-presentation-bg: radial-gradient(ellipse 80% 55% at 50% -10%, #1c1a18 0%, #0a0a0a 55%, #000000 100%);
    --theme-presentation-name-bg: linear-gradient(145deg, rgba(30, 28, 26, 0.98), rgba(20, 18, 16, 0.96));
    --theme-presentation-glow: rgba(184, 160, 136, 0.08);
    --theme-icon: #b8a088;
}

.theme-body {
    background: var(--theme-body-bg);
}

.theme-card {
    background: var(--theme-card-bg);
    color: #1f2937;
}

html[data-theme="dark"] .theme-card {
    color: #f5f2ed;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .theme-header {
    box-shadow: inset 0 -1px 0 rgba(184, 160, 136, 0.12);
}

html[data-theme="dark"] .theme-panel-inner {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .theme-btn-primary {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(184, 160, 136, 0.1);
}

html[data-theme="dark"] .theme-section-title {
    color: #ece6df;
}

.theme-header {
    background: var(--theme-header-bg);
}

.theme-panel {
    background: var(--theme-panel-bg);
}

.theme-panel-inner {
    background: var(--theme-panel-inner-bg);
}

.theme-section-title {
    color: var(--theme-title);
}

.theme-icon {
    color: var(--theme-icon);
}

.theme-muted-text {
    color: var(--theme-muted);
}

.theme-border {
    border-color: var(--theme-border);
}

.theme-badge {
    background: var(--theme-badge-bg);
    color: var(--theme-badge-text);
}

.theme-link {
    color: var(--theme-link);
}

.theme-link:hover {
    color: var(--theme-link-hover);
}

.theme-btn-primary {
    background: var(--theme-btn-bg);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.theme-btn-primary:hover {
    background: var(--theme-btn-bg-hover);
}

.theme-btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--theme-btn-ring);
}

.theme-btn-primary.theme-btn-stop {
    background: var(--theme-btn-stop-bg);
}

.theme-btn-primary.theme-btn-stop:hover {
    background: var(--theme-btn-stop-hover);
}

#nameDisplay.theme-name-circle {
    background: var(--theme-name-bg);
    border-color: var(--theme-name-border);
}

#studentName {
    color: var(--theme-name-text);
}

.theme-dropdown {
    position: relative;
    z-index: 3;
}

.header-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
    min-height: 2.25rem;
}

.header-slot-left {
    justify-self: start;
    z-index: 3;
}

.header-slot-center {
    min-width: 0;
    width: 100%;
    justify-self: center;
    padding: 0 0.1rem;
    pointer-events: none;
}

.header-slot-center h1 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-slot-center h1 i {
    margin-right: 0.3rem;
    font-size: 0.9rem;
}

.header-slot-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: end;
    z-index: 3;
}

.header-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.theme-header {
    padding: 0.75rem 0.75rem 0.9rem;
}

@media (min-width: 768px) {
    .theme-header {
        padding: 1.25rem 1.5rem;
    }

    .header-slot-center h1 {
        font-size: 1.875rem;
        line-height: 1.3;
    }

    .header-slot-center h1 i {
        margin-right: 0.75rem;
        font-size: 1.5rem;
    }

    .header-subtitle {
        margin-top: 0.5rem;
        font-size: 1rem;
    }
}

.theme-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.65rem 0 0.55rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.28);
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.theme-dropdown-trigger:hover,
.theme-dropdown.open .theme-dropdown-trigger {
    background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 767px) {
    .theme-header {
        --header-touch: 2.75rem;
    }

    .header-bar {
        column-gap: 0;
        min-height: var(--header-touch);
    }

    .header-slot-left {
        margin-left: -0.35rem;
    }

    .header-slot-right {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        margin-right: -0.2rem;
        padding: 0;
        background: none;
        border-radius: 0;
    }

    .theme-dropdown-trigger {
        width: var(--header-touch);
        height: var(--header-touch);
        min-width: var(--header-touch);
        min-height: var(--header-touch);
        padding: 0;
        border: none;
        border-radius: 0.5rem;
        background: transparent;
        box-shadow: none;
        color: rgba(255, 255, 255, 0.88);
        opacity: 1;
        transition: background-color 0.15s ease, color 0.15s ease;
        gap: 0;
        font-size: 0;
    }

    .sound-btn,
    .presentation-btn {
        padding: 0;
        border: none;
        border-radius: 0.5rem;
        background: transparent;
        box-shadow: none;
        color: rgba(255, 255, 255, 0.88);
        opacity: 1;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .header-slot-right .sound-btn,
    .header-slot-right .presentation-btn {
        width: 2.125rem;
        height: 2.125rem;
        min-width: 2.125rem;
        min-height: 2.125rem;
    }

    .theme-dropdown-trigger i {
        font-size: 1.0625rem;
        line-height: 1;
    }

    .header-slot-right .sound-btn i,
    .header-slot-right .presentation-btn i {
        font-size: 0.9375rem;
        line-height: 1;
    }

    .theme-dropdown-trigger:hover,
    .sound-btn:hover,
    .presentation-btn:hover {
        background: transparent;
        transform: none;
    }

    .theme-dropdown-trigger:active,
    .sound-btn:active,
    .presentation-btn:active {
        background: rgba(255, 255, 255, 0.14);
    }

    .theme-dropdown.open .theme-dropdown-trigger {
        background: rgba(255, 255, 255, 0.16);
        color: #fff;
    }

    .sound-btn:not(.active) {
        color: rgba(255, 255, 255, 0.72);
    }

    .sound-btn.active {
        background: transparent;
        box-shadow: none;
        color: #fff;
    }

    .sound-btn.active:active {
        background: rgba(255, 255, 255, 0.14);
    }
}

.theme-dropdown-caret {
    font-size: 0.625rem;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.theme-dropdown.open .theme-dropdown-caret {
    transform: rotate(180deg);
}

.theme-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 7.5rem;
    padding: 0.3rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.theme-dropdown.open .theme-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: none;
    border-radius: 0.45rem;
    background: transparent;
    color: #374151;
    font-size: 0.75rem;
    line-height: 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-dropdown-item:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #111827;
}

.theme-dropdown-item.active {
    background: var(--theme-btn-active-bg);
    color: #fff;
}

html[data-theme="dark"] .theme-dropdown-menu {
    background: rgba(16, 16, 16, 0.98);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .theme-dropdown-item {
    color: #a8a29e;
}

html[data-theme="dark"] .theme-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f5f2ed;
}

html[data-theme="dark"] .theme-dropdown-item.active {
    background: #3a3632;
    color: #d4c4b0;
    box-shadow: inset 0 0 0 1px rgba(184, 160, 136, 0.22);
}

html[data-theme="dark"] .class-btn,
html[data-theme="dark"] .roll-count-btn {
    background: #1a1816;
    color: #a8a29e;
    border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .class-btn.active,
html[data-theme="dark"] .roll-count-btn.active {
    background: #3a3632;
    color: #d4c4b0;
    border-color: rgba(184, 160, 136, 0.28);
    box-shadow: inset 0 0 0 1px rgba(184, 160, 136, 0.12);
}

html[data-theme="dark"] .history-item {
    background: #1a1816;
    color: #f5f2ed;
}

html[data-theme="dark"] .student-list-item {
    background: #22201e;
    color: #f5f2ed;
}

html[data-theme="dark"] .student-list-item.called {
    color: #6b6560;
}

html[data-theme="dark"] .empty-hint {
    color: #6b6560;
}

html[data-theme="dark"] .class-grade-label {
    color: #6b6560;
}

/* 样式保持不变，与原始代码相同 */
@keyframes outerSpin {
    0% { 
        transform: rotate(0deg) scale(1);
        opacity: 0.7;
    }
    50% {
        opacity: 1;
        transform: rotate(180deg) scale(1.1);
    }
    100% { 
        transform: rotate(360deg) scale(1);
        opacity: 0.7;
    }
}

@keyframes innerSpin {
    0% { 
        transform: rotate(0deg) scale(1);
        border-width: 8px;
    }
    50% {
        transform: rotate(-180deg) scale(1.05);
        border-width: 12px;
    }
    100% { 
        transform: rotate(-360deg) scale(1);
        border-width: 8px;
    }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--theme-pulse); }
    70% { box-shadow: 0 0 0 20px rgba(0, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

@keyframes charPop {
    0% {
        opacity: 0;
        transform: scale(0.2) translateY(12px);
    }
    55% {
        opacity: 1;
        transform: scale(1.18) translateY(-3px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes revealBurst {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--theme-reveal-glow);
    }
    45% {
        transform: scale(1.1);
        box-shadow: 0 0 0 18px rgba(0, 0, 0, 0);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 10px 25px var(--theme-reveal-shadow);
    }
}

@keyframes revealFlash {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    35% {
        opacity: 0.85;
    }
    100% {
        opacity: 0;
        transform: scale(1.25);
    }
}

@keyframes decelFlash {
    0% {
        opacity: 0.45;
        transform: scale(0.96);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes settlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.035);
    }
}

.roll-call-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 13.75rem;
    margin-top: 10px;
    margin-bottom: 22px;
}

@media (min-width: 768px) {
    .roll-call-stage {
        height: 17.5rem;
        margin-top: 5px;
        margin-bottom: 29px;
    }
}

.outer-circle {
    position: absolute;
    width: 13.75rem;
    height: 13.75rem;
    border: 6px solid transparent;
    border-top-color: var(--theme-circle-1);
    border-right-color: var(--theme-circle-2);
    border-bottom-color: var(--theme-circle-3);
    border-left-color: var(--theme-circle-4);
    border-radius: 50%;
    animation: outerSpin 3s linear infinite;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

@media (min-width: 768px) {
    .outer-circle {
        width: 280px;
        height: 280px;
    }
}

.inner-circle {
    position: absolute;
    width: 11.75rem;
    height: 11.75rem;
    border: 8px solid transparent;
    border-top-color: var(--theme-circle-2);
    border-right-color: var(--theme-circle-3);
    border-bottom-color: var(--theme-circle-4);
    border-left-color: var(--theme-circle-1);
    border-radius: 50%;
    animation: innerSpin 2.5s linear infinite;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.5s ease;
}

@media (min-width: 768px) {
    .inner-circle {
        width: 240px;
        height: 240px;
    }
}

.circle-active {
    opacity: 1;
}

.pulse-effect {
    animation: pulse 1.5s infinite;
}

.name-display {
    position: relative;
    z-index: 7;
    transition: all 0.3s ease;
}

#studentName {
    letter-spacing: 0;
    font-size: 2.4375rem;
    transition: letter-spacing 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
    #studentName:not(.name-multi-2):not(.name-multi-3):not(.name-multi-4):not(.name-multi-5) {
        font-size: 2.925rem;
    }
}

#studentName.name-selected:not(.name-multi-2):not(.name-multi-3):not(.name-multi-4):not(.name-multi-5) {
    letter-spacing: 5px;
}

#studentName .name-line {
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    transition: letter-spacing 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

#studentName.name-selected .name-line {
    letter-spacing: 5px;
}

#studentName.decel-flash {
    animation: decelFlash 0.14s ease-out;
}

#studentName.decel-settled {
    transform: scale(1);
}

#studentName.name-revealing .name-char {
    display: inline-block;
    opacity: 0;
    animation: charPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.name-display.reveal-burst {
    animation: revealBurst 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.name-display.settling {
    animation: settlePulse 0.7s ease-in-out infinite;
}

.name-display::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, var(--theme-flash-tint) 45%, transparent 72%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.name-display.reveal-burst::after {
    animation: revealFlash 0.75s ease-out forwards;
}

.roll-call-stage.decelerating .outer-circle {
    animation-duration: 4s;
    transition: animation-duration 1.8s ease, opacity 0.8s ease;
}

.roll-call-stage.decelerating .inner-circle {
    animation-duration: 3.2s;
    transition: animation-duration 1.8s ease, opacity 0.8s ease;
}

.roll-call-stage.settling .outer-circle,
.roll-call-stage.settling .inner-circle {
    animation-duration: 12s;
    opacity: 0.35;
}

.roll-call-stage.finalizing .outer-circle,
.roll-call-stage.finalizing .inner-circle {
    opacity: 0;
}

#toggleBtn:disabled {
    opacity: 0.78;
    cursor: not-allowed;
    transform: none;
}

.selected {
    transform: scale(1.05);
    background: var(--theme-selected-bg);
    box-shadow: 0 10px 25px var(--theme-selected-shadow);
}

.class-btn {
    transition: all 0.2s ease;
    padding: 0.2rem 0.65rem;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid transparent;
    white-space: nowrap;
}

.class-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.class-btn.active {
    background: var(--theme-btn-active-bg);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.roll-count-btn {
    flex: 1;
    transition: all 0.2s ease;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
    border-radius: 9999px;
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.roll-count-btn:hover:not(:disabled) {
    border-color: var(--theme-name-border);
    color: var(--theme-title);
}

.roll-count-btn.active {
    background: var(--theme-btn-active-bg);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.roll-count-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#studentName.name-multi-2,
#studentName.name-multi-3,
#studentName.name-multi-4,
#studentName.name-multi-5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    letter-spacing: 0;
    text-align: center;
    padding: 0 0.35rem;
}

#studentName.name-multi-2 {
    font-size: 2.015rem;
}

#studentName.name-multi-3 {
    font-size: 1.56rem;
    gap: 0.3rem;
}

#studentName.name-multi-4 {
    font-size: 1.3rem;
    gap: 0.2rem;
}

#studentName.name-multi-5 {
    font-size: 1.1rem;
    gap: 0.12rem;
}

@media (min-width: 768px) {
    #studentName.name-multi-2 {
        font-size: 2.275rem;
    }

    #studentName.name-multi-3 {
        font-size: 1.755rem;
    }

    #studentName.name-multi-4 {
        font-size: 1.43rem;
    }

    #studentName.name-multi-5 {
        font-size: 1.2rem;
    }
}

body.presentation-mode #studentName.name-multi-2 {
    font-size: clamp(1.755rem, 6.24vmin, 2.86rem);
}

body.presentation-mode #studentName.name-multi-3 {
    font-size: clamp(1.365rem, 4.94vmin, 2.275rem);
}

body.presentation-mode #studentName.name-multi-4 {
    font-size: clamp(1.17rem, 4.16vmin, 1.885rem);
}

body.presentation-mode #studentName.name-multi-5 {
    font-size: clamp(1rem, 3.5vmin, 1.6rem);
}

.class-picker {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.class-grade-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.class-grade-label {
    flex-shrink: 0;
    width: 2.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    text-align: right;
}

.class-grade-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    background: white;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.history-item:hover {
    border-left-color: var(--theme-icon);
    background-color: var(--theme-history-hover);
}

.history-index {
    flex-shrink: 0;
    width: 1.1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--theme-history-index);
    text-align: center;
}

.history-name {
    flex: 1;
    min-width: 0;
    color: var(--theme-name-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-btn {
    flex-shrink: 0;
    opacity: 0;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.15rem;
    color: #f87171;
    transition: all 0.2s ease;
}

.history-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: #dc2626;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

/* 删除动画 */
@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 48px;
    }
    to {
        opacity: 0;
        transform: translateX(100%);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}

.deleting {
    animation: slideOut 0.5s forwards;
    overflow: hidden;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4F46E5;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

.undo-btn {
    margin-left: 15px;
    padding: 4px 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.undo-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.presentation-btn {
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 2;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sound-btn {
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 2;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sound-btn:hover,
.presentation-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.sound-btn.active {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

body.presentation-mode {
    padding-top: 0;
    padding-bottom: 0;
    background: var(--theme-presentation-bg) !important;
    --pm-outer: min(72vmin, 23rem);
    --pm-inner: calc(var(--pm-outer) * 0.857);
    --pm-name: calc(var(--pm-outer) * 0.714);
}

body.presentation-mode .presentation-page {
    padding: 0;
    max-width: none;
    width: 100%;
    height: 100%;
}

body.presentation-mode #appCard {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: none;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
}

body.presentation-mode .presentation-hide {
    display: none !important;
}

body.presentation-mode .presentation-compact-header {
    padding: clamp(0.85rem, 2.5vh, 1.35rem) clamp(1rem, 3vw, 2rem);
    flex-shrink: 0;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.presentation-mode .presentation-compact-header h1 {
    font-size: clamp(1.05rem, 2.4vw, 1.45rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.96);
}

body.presentation-mode .presentation-compact-header h1 i {
    opacity: 0.88;
}

body.presentation-mode .presentation-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(1rem, 3vh, 2rem) clamp(1rem, 4vw, 2.5rem) clamp(1.5rem, 4vh, 2.5rem);
}

body.presentation-mode .presentation-layout {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

body.presentation-mode .presentation-roll-wrap {
    width: 100%;
    max-width: min(92vw, 40rem);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.presentation-mode .presentation-stage-shell {
    position: relative;
    width: var(--pm-outer);
    height: var(--pm-outer);
    margin: 0 auto clamp(1.5rem, 4vh, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.presentation-mode .presentation-stage-shell::before {
    content: '';
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--theme-presentation-glow) 0%, rgba(99, 102, 241, 0.12) 45%, transparent 72%);
    filter: blur(18px);
    pointer-events: none;
}

body.presentation-mode .roll-call-stage {
    position: relative;
    width: var(--pm-outer);
    height: var(--pm-outer);
    margin: 0;
}

body.presentation-mode .outer-circle {
    width: var(--pm-outer);
    height: var(--pm-outer);
    inset: 0;
    margin: auto;
}

body.presentation-mode .inner-circle {
    width: var(--pm-inner);
    height: var(--pm-inner);
    inset: 0;
    margin: auto;
}

body.presentation-mode #nameDisplay {
    width: var(--pm-name) !important;
    height: var(--pm-name) !important;
    min-width: var(--pm-name);
    min-height: var(--pm-name);
    border-width: 4px;
    border-color: rgba(196, 181, 253, 0.85);
    background: var(--theme-presentation-name-bg);
    box-shadow:
        0 18px 50px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.presentation-mode #nameDisplay.selected {
    background: var(--theme-selected-bg);
    box-shadow:
        0 22px 55px var(--theme-reveal-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.presentation-mode #studentName:not(.name-multi-2):not(.name-multi-3):not(.name-multi-4):not(.name-multi-5) {
    font-size: clamp(2.6rem, 9.75vmin, 4.55rem);
    color: var(--theme-name-text);
}

body.presentation-mode #toggleBtn {
    width: min(100%, 20rem);
    margin: 0;
    padding: clamp(0.85rem, 2vh, 1.05rem) clamp(1.5rem, 4vw, 2.5rem);
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    letter-spacing: 0.06em;
    box-shadow: 0 14px 36px rgba(79, 70, 229, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

body.presentation-mode #toggleBtn:hover {
    box-shadow: 0 16px 42px rgba(79, 70, 229, 0.48);
}

body.presentation-mode .presentation-class-label {
    display: inline-flex;
    margin-top: 0.65rem;
    padding: 0.35rem 0.95rem;
    border-radius: 9999px;
    font-size: clamp(0.78rem, 1.8vw, 0.92rem);
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

body.presentation-mode .presentation-btn,
body.presentation-mode .sound-btn,
body.presentation-mode .theme-dropdown-trigger {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

@media (max-width: 767px) {
    #themeDropdownLabel,
    .theme-dropdown-caret {
        display: none;
    }

    .header-slot-center h1 {
        font-size: clamp(0.92rem, 4.2vw, 1.05rem);
    }

    .theme-dropdown-menu {
        left: 0;
        min-width: 10.5rem;
        padding: 0.35rem;
        border-radius: 0.75rem;
        border: none;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
    }

    .theme-dropdown-item {
        padding: 0.7rem 0.85rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
    }

    body.presentation-mode .header-slot-center h1 {
        font-size: clamp(0.88rem, 3.8vw, 1rem);
    }

    body.presentation-mode .theme-dropdown-trigger,
    body.presentation-mode .sound-btn,
    body.presentation-mode .presentation-btn {
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    body.presentation-mode .theme-dropdown.open .theme-dropdown-trigger {
        background: rgba(255, 255, 255, 0.14);
    }

    body.presentation-mode .header-slot-right {
        background: none;
    }
}

@media (max-width: 360px) {
    .header-slot-center h1 i {
        display: none;
    }
}

.presentation-class-label {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.92;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.presentation-hint {
    display: none;
    margin-top: clamp(1rem, 2.5vh, 1.5rem);
    font-size: clamp(0.72rem, 1.6vw, 0.82rem);
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.38);
    text-align: center;
}

body.presentation-mode .presentation-hint {
    display: block;
}

@media (min-width: 768px) {
    body.presentation-mode {
        --pm-outer: min(64vmin, 28rem);
    }
}