/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Noto Sans SC', sans-serif;
    color: #e4f1fe;
    background-color: #0a0e17;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 星空背景画布 */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 主容器样式 */
.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    padding-bottom: 90px; /* 为底部控制栏留出空间 */
    z-index: 1;
    position: relative;
}

/* 显示区域样式 */
#display-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 20px; /* 增加与底部控制栏的间距 */
}

/* 3D球体容器 */
#sphere-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* 选中的名字样式 */
#selected-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: bold;
    color: #4fc3f7;
    text-shadow: 0 0 30px rgba(79, 195, 247, 0.8);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#selected-name.active {
    opacity: 1;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        text-shadow: 0 0 30px rgba(79, 195, 247, 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        text-shadow: 0 0 50px rgba(79, 195, 247, 0.9);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        text-shadow: 0 0 30px rgba(79, 195, 247, 0.8);
    }
}

/* 底部控制按钮区域 - 替代原来的控制栏 */
.bottom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    margin-bottom: 20px;
    gap: 15px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(10, 14, 23, 0.7);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

/* 添加底部控制栏隐藏状态的样式 */
.bottom-controls.hidden {
    opacity: 0;
    transform: translateY(100%);
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    background-color: rgba(38, 50, 75, 0.8);
    color: #e4f1fe;
    border: 1px solid rgba(79, 195, 247, 0.5);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    background-color: rgba(59, 89, 152, 0.8);
    border-color: rgba(79, 195, 247, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.2);
}

.btn.primary {
    background-color: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    border-color: #4fc3f7;
}

.btn.primary:hover {
    background-color: rgba(79, 195, 247, 0.3);
}

.btn.danger {
    background-color: rgba(247, 79, 79, 0.2);
    color: #f74f4f;
    border-color: #f74f4f;
}

.btn.danger:hover {
    background-color: rgba(247, 79, 79, 0.3);
}

.btn.small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn.full-width {
    width: 100%;
    justify-content: center;
    margin-bottom: 15px;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(38, 50, 75, 0.8);
    border-radius: 8px;
    padding: 5px 15px;
    border: 1px solid rgba(79, 195, 247, 0.5);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#draw-count {
    font-size: 18px;
    font-weight: bold;
    color: #4fc3f7;
    min-width: 30px;
    text-align: center;
}

/* 班级选择器样式 */
.class-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(38, 50, 75, 0.8);
    border-radius: 8px;
    padding: 5px 15px;
    border: 1px solid rgba(79, 195, 247, 0.5);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#class-select {
    background-color: transparent;
    color: #e4f1fe;
    border: none;
    padding: 5px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    cursor: pointer;
}

#class-select option {
    background-color: #0a0e17;
    color: #e4f1fe;
}

#students-count {
    background-color: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 14px;
}

/* 侧边面板样式 */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: rgba(12, 20, 33, 0.95);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(79, 195, 247, 0.3);
    z-index: 90;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}

.side-panel.hidden {
    transform: translateX(100%);
}

.side-panel.show {
    transform: translateX(0);
}

.panel-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
}

.panel-header h2 {
    color: #4fc3f7;
    font-size: 24px;
    font-weight: 500;
}

.panel-body {
    padding: 20px;
}

.panel-section {
    margin-bottom: 30px;
}

.panel-section h3 {
    font-size: 18px;
    color: #4fc3f7;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.2);
    padding-bottom: 8px;
}

/* 班级列表样式 */
.class-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.class-item {
    background: rgba(38, 50, 75, 0.8);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(79, 195, 247, 0.3);
    transition: all 0.3s ease;
}

.class-item:hover {
    background: rgba(59, 89, 152, 0.8);
    border-color: rgba(79, 195, 247, 0.6);
    transform: translateY(-2px);
}

.class-item.selected {
    background: rgba(79, 195, 247, 0.2);
    border-color: #4fc3f7;
}

.class-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.class-name {
    font-weight: 500;
    font-size: 16px;
}

.class-detail {
    font-size: 14px;
    opacity: 0.7;
}

.class-actions {
    display: flex;
    gap: 10px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(16, 25, 40, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    width: 600px;
    max-width: 90%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 195, 247, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
}

.modal-header h2 {
    color: #4fc3f7;
    font-weight: 500;
    font-size: 22px;
}

.btn-close {
    background: transparent;
    border: none;
    color: #e4f1fe;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: #4fc3f7;
}

.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4fc3f7;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background-color: rgba(38, 50, 75, 0.8);
    border: 1px solid rgba(79, 195, 247, 0.5);
    border-radius: 8px;
    color: #e4f1fe;
    font-family: inherit;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.3);
}

.modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid rgba(79, 195, 247, 0.3);
}

/* 实用工具类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .bottom-controls {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 5px;
    }
    
    #selected-name {
        font-size: 2rem;
    }
    
    .side-panel {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .bottom-controls {
        flex-wrap: wrap;
        padding: 5px 2px;
        gap: 5px;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    #selected-name {
        font-size: 1.5rem;
    }
    
    .class-selector, .btn-group {
        padding: 3px 10px;
    }
    
    .side-panel {
        width: 100%;
    }
}

/* 3D名字卡片样式 */
.name-card {
    color: #4fc3f7;
    text-shadow: 0 0 5px rgba(79, 195, 247, 0.8);
    transition: all 0.5s ease;
}

/* 星空蓝色渐变文本 */
.space-blue-text {
    background: linear-gradient(45deg, #114eec, #4fc3f7, #83eeff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 20px rgba(79, 195, 247, 0.4);
    animation: gradientFlow 5s ease infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 已选择名单样式 */
.selected-names-list {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(12, 20, 33, 0.7);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(79, 195, 247, 0.3);
    max-width: 250px;
    max-height: 70%;
    overflow-y: auto;
    z-index: 5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.selected-names-list h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #4fc3f7;
    text-align: center;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
    padding-bottom: 8px;
}

.names-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.name-item {
    font-size: 16px;
    padding: 5px;
    border-radius: 5px;
    background-color: rgba(38, 50, 75, 0.4);
    transition: all 0.3s ease;
}

.name-item:hover {
    background-color: rgba(79, 195, 247, 0.2);
    transform: translateX(-5px);
}

.space-blue-text-small {
    background: linear-gradient(45deg, #114eec, #4fc3f7, #83eeff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 8px rgba(79, 195, 247, 0.3);
    animation: gradientFlow 5s ease infinite;
}

/* 在移动设备上调整已选择名单的样式 */
@media (max-width: 768px) {
    .selected-names-list {
        top: auto;
        bottom: 80px;
        right: 10px;
        max-width: 200px;
        max-height: 180px;
        padding: 10px;
    }
    
    .selected-names-list h3 {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .name-item {
        font-size: 14px;
        padding: 3px;
    }
}

/* 多名字容器 */
.multi-name-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    z-index: 10;
    width: 90%;
    max-width: 1200px;
}

.selected-name-item {
    font-size: 3.5rem;
    font-weight: bold;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 0 30px rgba(79, 195, 247, 0.8);
    transform: scale(0.5) translateY(50px);
    padding: 0 20px;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.selected-name-item.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: floatPulse 3s infinite;
}

.selected-name-item.hidden {
    opacity: 0;
}

@keyframes floatPulse {
    0% {
        transform: translateY(0) scale(1);
        text-shadow: 0 0 30px rgba(79, 195, 247, 0.8);
    }
    50% {
        transform: translateY(-10px) scale(1.1);
        text-shadow: 0 0 40px rgba(79, 195, 247, 0.9);
    }
    100% {
        transform: translateY(0) scale(1);
        text-shadow: 0 0 30px rgba(79, 195, 247, 0.8);
    }
}

/* 响应式设计 - 多名字容器 */
@media (max-width: 992px) {
    .multi-name-container {
        gap: 30px;
    }
    
    .selected-name-item {
        font-size: 2.8rem;
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    .multi-name-container {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }
    
    .selected-name-item {
        font-size: 2.2rem;
        padding: 0 5px;
    }
}

@media (max-width: 480px) {
    .selected-name-item {
        font-size: 1.8rem;
    }
}

/* 音量控制弹出层 */
.volume-popup {
    position: absolute;
    bottom: 80px;
    right: 60px;
    background-color: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 101;
}

.volume-popup.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.volume-slider {
    width: 100%;
    margin: 10px 0;
}

.volume-slider input[type="range"] {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: linear-gradient(90deg, #4FC3F7 0%, #03A9F4 100%);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #E1F5FE;
    cursor: pointer;
    border: 2px solid #03A9F4;
}

.volume-label {
    color: #E1F5FE;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
}

/* 语音设置样式 */
.voice-settings {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(79, 195, 247, 0.2);
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.toggle-switch input[type="checkbox"] {
    position: relative;
    width: 40px;
    height: 20px;
    appearance: none;
    background-color: #455A64;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
    cursor: pointer;
    margin-right: 10px;
}

.toggle-switch input[type="checkbox"]:checked {
    background-color: #03A9F4;
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: #E1F5FE;
    transition: 0.3s;
}

.toggle-switch input[type="checkbox"]:checked::before {
    left: 22px;
}

.toggle-switch label {
    color: #B3E5FC;
    font-size: 13px;
    cursor: pointer;
}

/* 音频提示样式 */
.audio-tip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.audio-tip.hidden {
    display: none;
}

.audio-tip-content {
    background-color: #0a0e17;
    border-radius: 10px;
    padding: 30px;
    max-width: 400px;
    width: 80%;
    text-align: center;
    border: 1px solid #4FC3F7;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
}

.audio-tip h3 {
    color: #E1F5FE;
    font-size: 24px;
    margin-bottom: 15px;
}

.audio-tip p {
    color: #B3E5FC;
    margin-bottom: 20px;
}

.audio-tip button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    background: linear-gradient(135deg, #03A9F4, #0288D1);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
    margin: 0 auto;
}

.audio-tip button:hover {
    background: linear-gradient(135deg, #039BE5, #0277BD);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(3, 169, 244, 0.3);
}

/* 在移动设备上调整已选择名单的样式 */
@media (max-width: 768px) {
    .voice-list {
        max-height: 150px;
    }
    
    .voice-option {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    #volume-popup {
        max-width: 250px;
    }
}

/* 返回首页按钮 */
.back-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    padding: 8px 15px;
    background-color: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    border: 1px solid #4fc3f7;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    background-color: rgba(79, 195, 247, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.back-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .back-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
} 