/* --- 终端背景 --- */
#terminal-log {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a1a; 
    color: #00ff00; 
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: scroll; 
    z-index: -1;
}
#terminal-log p { margin: 0 0 5px 0; word-wrap: break-word; }
#terminal-log p .time { color: #888; margin-right: 10px; }

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: transparent; 
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 90%;
    max-width: 450px;
    z-index: 10; 
}

/* 卡片 (半透明白色) */
.card {
    background-color: rgba(255, 255, 255, 0.8); /* 80%不透明度 */
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
    padding: 25px;
    text-align: center;
    color: #333;
}

h2 {
    color: #1d3557; 
    margin-top: 0;
    border-bottom: 2px solid #a8dadc; 
    padding-bottom: 10px;
}

.datetime {
    font-size: 1.5em; 
    font-weight: bold;
    color: #1d3557; 
    letter-spacing: 1.5px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', Courier, monospace; 
}

/* --- 转盘样式 --- */
.turntable-container {
    position: relative;
    width: 100%;
    max-width: 400px; 
    margin: 20px auto;
}
.turntable-container .pointer {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #e63946;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}
#turntable-canvas { width: 100%; height: 100%; }
#magnifier-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20; 
    pointer-events: none; 
}
#timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: bold;
    color: #1d3557; 
    background-color: rgba(255, 255, 255, 0.7); 
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#timer-display.show { opacity: 1; }

/* 结果显示区 */
.result-display { margin-top: 15px; min-height: 75px; }
#random-student-name {
    font-size: 2.5em;
    font-weight: bold;
    color: #1d3557; 
    margin: 10px 0 5px;
    min-height: 50px; 
}
.nickname {
    font-size: 1.2em;
    color: #888; 
    font-style: italic;
    min-height: 25px;
}

/* --- 【已修复】控制开关 --- */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}
/* 新增：开关和文字的容器 */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 10px; /* 文字和开关的间距 */
}
/* 新增：文字标签的样式 */
.toggle-label {
    font-size: 16px;
    font-weight: bold;
    color: #1d3557; /* 深蓝色 */
    cursor: pointer;
    user-select: none;
}
/* 开关UI本身 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px; /* 保持开关大小不变 */
    height: 34px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
/* 开关的滑轨 (空label) */
.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
    /* 已移除所有文字相关属性 */
}
/* 开关的滑块 */
.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
/* 选中时的样式 */
.toggle-switch input:checked + label {
    background-color: #2a9d8f; /* 绿色 */
}
.toggle-switch input:checked + label:before {
    transform: translateX(26px);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}
#draw-button, #reset-button, #help-button {
    background-color: #457b9d;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}
#draw-button:hover, #reset-button:hover, #help-button:hover { background-color: #1d3557; }
#draw-button:disabled { background-color: #a8dadc; cursor: not-allowed; }
#reset-button { background-color: #6c757d; }
#reset-button:hover { background-color: #5a6268; }
#help-button {
    background-color: #007bff;
    padding: 12px;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
    line-height: 1;
}
#help-button:hover { background-color: #0056b3; }

/* --- Modal 样式 (不变) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.show { display: flex; }
.modal-content {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover { color: #333; }
.modal-content h2 { margin-top: 0; color: #1d3557; border-bottom: 2px solid #a8dadc; }
.modal-content p, .modal-content ul { color: #333; line-height: 1.6; }
.modal-content ul { padding-left: 20px; }
.modal-content li { margin-bottom: 10px; }
.modal-content ul ul { margin-top: 5px; margin-bottom: 5px; }
.modal-content li li { margin-bottom: 5px; }
.highlight-green { color: #2a9d8f; font-weight: bold; }
.highlight-gray { color: #6c757d; font-weight: bold; }