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

body {
    font-family: KaiTi, SimKai, "楷体", serif;
    background: #f5f5f5;
    color: #333;
}

/* ===== 前台样式（弹球页面） ===== */
body.front {
    overflow: hidden;
    transition: background-color 0.3s ease;
}

/* 左侧控制面板 */
.control-panel {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border-radius: 0 20px 20px 0;
    padding: 15px;
    width: 220px;
    z-index: 300;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    border-left: none;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}
.control-panel.collapsed {
    transform: translateY(-50%) translateX(-200px);
}
.toggle-arrow {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 40px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    border-radius: 0 20px 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 12px;
}
.control-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: white;
    font-size: 14px;
    margin-bottom: 12px;
}
.mic-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mic-icon {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}
.mic-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
}
.mic-icon::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: #333;
    border-radius: 2px;
}
.mic-icon.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 16px;
    height: 2px;
    background: red;
    bottom: auto;
}
.volume-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 24px;
}
.volume-bars span {
    width: 5px;
    height: 20px;
    background: #ccc;
    border-radius: 2px;
    transition: transform 0.05s linear;
    transform-origin: bottom;
    transform: scaleY(0.2);
}
input[type="range"] {
    width: 120px;
    -webkit-appearance: none;
    background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    margin-top: -4px;
    cursor: pointer;
}
.theme-options {
    display: flex;
    gap: 8px;
}
.theme-option {
    background: rgba(255,255,255,0.15);
    padding: 4px 8px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}
.theme-option.active {
    background: white;
    color: black;
}
.fullscreen-icon {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}
.fullscreen-icon::before,
.fullscreen-icon::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border: 2px solid white;
}
.fullscreen-icon::before {
    top: 4px;
    left: 4px;
    border-right: none;
    border-bottom: none;
}
.fullscreen-icon::after {
    bottom: 4px;
    right: 4px;
    border-left: none;
    border-top: none;
}
.task-card {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 450px;
    max-width: 40vw;
    min-width: 350px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    color: white;
    z-index: 200;
    border: 1px solid rgba(255,255,255,0.3);
}
.task-header {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    margin-bottom: 10px;
}
#taskTitle {
    text-align: center;
    font-size: 26px;
    font-weight: bold;
    margin: 12px 0;
}
#taskContent {
    font-size: 18px;
    line-height: 1.6;
}
#progressBarContainer {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 8px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    z-index: 200;
    overflow: hidden;
}
#progressFill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    border-radius: 4px;
    transition: width 0.5s linear;
}
#countdownText {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 201;
    pointer-events: none;
    white-space: nowrap;
    font-family: monospace;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    border-radius: 30px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}
.modal-content button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
}
canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

/* ===== 教师后台样式 ===== */
.teacher-container {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
.sidebar .menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    margin: 5px 0;
}
.sidebar .menu-item.active {
    background: rgba(255,255,255,0.2);
    border-left: 4px solid #ffaa44;
}
.sidebar .menu-item:hover {
    background: rgba(255,255,255,0.1);
}
.content-area {
    flex: 1;
    padding: 20px;
    background: #fff;
    border-radius: 20px 0 0 0;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
}
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}
button {
    background: #764ba2;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.1s;
}
button:active {
    transform: scale(0.96);
}
.task-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.task-card-item {
    flex: 1;
    min-width: 300px;
}
.rich-editor {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    min-height: 150px;
    background: #fff;
}
.toolbar {
    margin-bottom: 8px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.tool-btn {
    background: #f0f0f0;
    color: #333;
    padding: 4px 8px;
    font-size: 12px;
}
.changelog-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}