@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');
:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.85);
    --card-bg-solid: #1e293b;
    --text: #f1f5f9;
    --text-light: #cbd5e1;
    --border: #334155;
    --shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.4);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', 'Microsoft YaHei', sans-serif;
    background: radial-gradient(circle at 10% 20%, #1e1a2f, #0b0b1a);
    color: var(--text);
    min-height: 100vh;
}
/* 角色选择大厅 */
.role-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #c4b5fd, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 2rem;
    text-align: center;
}
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    width: 90%;
    margin: 0 auto;
}
.role-btn {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 2rem;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text);
    width: 100%;
    min-width: 160px;
}
.role-btn:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.95);
}
.role-teacher, .role-personal {
    grid-column: 1 / -1;
}
.role-teacher {
    background: linear-gradient(95deg, #dc2626, #ea580c);
    color: white;
    border: none;
    font-size: 1.2rem;
    padding: 1.2rem;
}
.role-personal {
    background: linear-gradient(95deg, #8b5cf6, #a855f7);
    color: white;
    border: none;
    font-size: 1.3rem;
    padding: 1.2rem;
}
/* 教师看板 */
#teacher-dashboard { padding: 2rem; max-width: 1400px; margin: 0 auto; }
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.dashboard-header h1 {
    font-size: 1.8rem;
    background: linear-gradient(120deg, #a78bfa, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.reset-btn, .logout-btn {
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 40px;
    cursor: pointer;
}
.reset-btn { background: #ef4444; color: white; }
.logout-btn { background: #475569; color: white; margin-left: 0.5rem; }
.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.8rem;
}
.team-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border-radius: 1.8rem;
    padding: 1.5rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.team-name { font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; }
.progress-wrapper {
    background: #0f172a;
    border-radius: 60px;
    overflow: hidden;
    height: 32px;
    position: relative;
    margin: 1rem 0;
}
.progress-bar {
    background: linear-gradient(90deg, #10b981, #34d399);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}
.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    line-height: 32px;
    font-weight: 600;
    color: #0f172a;
}
.team-status { font-size: 0.9rem; color: var(--text-light); margin-top: 0.5rem; }
/* 小组赛学生端 */
.student-container {
    max-width: 1300px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}
.student-header {
    text-align: center;
    margin-bottom: 2rem;
}
.student-header h1 {
    font-size: 2.2rem;
    background: linear-gradient(to right, #a78bfa, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.labels-pool {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    padding: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 2rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.label-item {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 40px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.1s;
    color: var(--text);
}
.label-item:hover {
    background: #334155;
    transform: scale(1.02);
    border-color: var(--primary);
}
.label-item.selected {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}
.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.principle-card {
    background: #1e293b;
    border-radius: 1.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #334155;
    transition: 0.2s;
}
.principle-card:hover {
    transform: translateY(-5px);
    border-color: #8b5cf6;
    box-shadow: var(--shadow);
}
.card-header {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    padding: 1rem;
    text-align: center;
    font-weight: 700;
}
.card-body {
    min-height: 180px;
    padding: 1rem;
    background: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.card-body .label-item {
    cursor: default;
    background: #334155;
    border-color: #475569;
}
/* 个人挑战赛 */
.personal-container {
    max-width: 1300px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}
.personal-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}
.personal-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.personal-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}
.stat-card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 2rem;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
}
.back-btn, .restart-personal {
    position: absolute;
    top: 0.5rem;
    background: #475569;
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    font-weight: 600;
}
.back-btn { left: 1rem; }
.restart-personal { right: 1rem; background: #f59e0b; color: #1e293b; }
/* 弹窗 */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
}
.game-overlay h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s;
}
.game-overlay button {
    margin-top: 2rem;
    background: #8b5cf6;
    border: none;
    border-radius: 3rem;
    padding: 0.75rem 2rem;
    color: white;
    cursor: pointer;
    font-size: 1rem;
}
@keyframes bounce {
    0%,100%{ transform: translateY(0); }
    50%{ transform: translateY(-20px); }
}
.fullscreen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid #8b5cf6;
    border-radius: 40px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    z-index: 999;
    display: none;
}
.error-tip {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 3rem;
    font-weight: 600;
    z-index: 1000;
    animation: fadeOut 2s forwards;
    white-space: nowrap;
}
@keyframes fadeOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); visibility: hidden; }
}
@media (max-width: 800px) {
    .role-grid { grid-template-columns: 1fr; }
    .role-teacher, .role-personal { grid-column: auto; }
    .principles-grid { grid-template-columns: repeat(2, 1fr); }
    .personal-stats { flex-direction: column; align-items: center; gap: 0.5rem; }
    .back-btn, .restart-personal { position: static; margin: 0.5rem; display: inline-block; }
    .personal-header { display: flex; flex-direction: column; align-items: center; }
}