* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(145deg, #f6f9fc 0%, #eef2f7 100%);
    font-family: 'Segoe UI', 'Poppins', 'Inter', system-ui, -apple-system, 'Roboto', sans-serif;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 主容器卡片 */
.container {
    max-width: 1400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    border-radius: 2.5rem;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
}

/* 头部区域 */
.header {
    background: linear-gradient(135deg, #1e2b3c, #0f1a24);
    padding: 1.5rem 2rem;
    color: white;
    text-align: center;
    position: relative;
}

/* 返回首页按钮 */
.back-home-btn {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-home-btn i {
    font-size: 1rem;
}

.header h1 {
    font-size: 1.9rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header h1 i {
    background: #ffb347;
    background: linear-gradient(135deg, #ffb347, #ff8c2e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    font-size: 2rem;
}

.header p {
    opacity: 0.8;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* 两列布局 */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.8rem;
    padding: 2rem;
}

/* 左侧点名区 */
.roll-area {
    background: white;
    border-radius: 1.8rem;
    padding: 1.8rem;
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-card {
    width: 100%;
    background: linear-gradient(125deg, #fef9f0, #fff6e8);
    border-radius: 2rem;
    padding: 1.5rem 0.5rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02), 0 8px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,180,70,0.3);
}

.result-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #b97f2e;
    font-weight: 500;
    margin-bottom: 10px;
}

.result-name {
    font-size: 3.8rem;
    font-weight: 800;
    color: #2c3e2f;
    word-break: break-word;
    padding: 0 0.5rem;
    transition: all 0.2s ease;
    background: linear-gradient(125deg, #c4450c, #e67e22);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 点名动画闪烁特效 */
.result-name.rolling {
    animation: pulseGlow 0.3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { text-shadow: 0 0 0px #ffb347; opacity: 0.9; transform: scale(1);}
    100% { text-shadow: 0 0 12px #ffb347, 0 0 6px #ff8c2e; opacity: 1; transform: scale(1.02);}
}

.call-btn {
    background: linear-gradient(95deg, #f39c12, #e67e22);
    border: none;
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
    padding: 1rem 2rem;
    width: 80%;
    border-radius: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 18px rgba(230, 126, 34, 0.3);
    transition: 0.2s;
    margin-top: 10px;
}

.call-btn i {
    font-size: 1.7rem;
}

.call-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(230, 126, 34, 0.4);
}

.call-btn:active:not(:disabled) {
    transform: translateY(2px);
}

.call-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    filter: grayscale(0.05);
}

.stats-info {
    margin-top: 25px;
    font-size: 0.9rem;
    background: #f8f3ea;
    padding: 8px 18px;
    border-radius: 40px;
    color: #7f5a2a;
    font-weight: 500;
}

/* 右侧管理区 */
.manage-area {
    background: white;
    border-radius: 1.8rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    border-left: 5px solid #f39c12;
    padding-left: 15px;
    color: #1f2c3c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.add-group input {
    flex: 2;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    font-size: 0.9rem;
    transition: 0.2s;
    background: #fefefe;
}

.add-group input:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243,156,18,0.2);
}

button {
    background: #f1f5f9;
    border: none;
    padding: 10px 18px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1e2a3e;
}

button.primary {
    background: #f39c12;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

button.primary:hover:not(:disabled) {
    background: #e67e22;
}

button.danger {
    background: #fee2e2;
    color: #c0392b;
}
button.danger:hover:not(:disabled) {
    background: #fbc4c4;
}

button.warning {
    background: #fff0db;
    color: #b45f1b;
}

.batch-area {
    background: #fafbfd;
    border-radius: 1.2rem;
    padding: 12px;
    border: 1px solid #edf2f7;
}

textarea {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    padding: 10px;
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
    background: #ffffff;
}

.batch-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.student-list-container {
    max-height: 340px;
    overflow-y: auto;
    border-radius: 1.2rem;
    background: #fefcf7;
    padding: 5px;
    border: 1px solid #f0eadc;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 60px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #f3e9dc;
    transition: 0.1s;
}

.student-name {
    font-weight: 500;
    font-size: 1rem;
    color: #2d3e4b;
}

.del-student {
    background: none;
    color: #c0392b;
    font-size: 1.2rem;
    padding: 6px 10px;
    border-radius: 30px;
}
.del-student:hover:not(:disabled) {
    background: #fbe9e7;
    transform: scale(1.02);
}

.empty-list {
    text-align: center;
    padding: 35px 15px;
    color: #aaa2a2;
    font-style: italic;
}

/* 工具条按钮组 */
.toolbar-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 5px;
}

/* 响应式 */
@media (max-width: 780px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 1.2rem;
    }
    .result-name {
        font-size: 2.5rem;
    }
    .call-btn {
        width: 100%;
        font-size: 1.3rem;
    }
    .header h1 {
        font-size: 1.5rem;
    }
    body {
        padding: 0.8rem;
    }
    /* 移动端返回首页按钮调整 */
    .back-home-btn {
        top: 0.8rem;
        left: 0.8rem;
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .back-home-btn span {
        display: none;
    }
}

footer {
    text-align: center;
    padding: 1rem 2rem 1.2rem;
    font-size: 0.75rem;
    color: #7f8c8d;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: #fefefb;
}
footer i {
    color: #e67e22;
}
