/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
}

/* Index Page Styles */
.container {
    display: flex !important;
    gap: 40px !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100vh !important;
}

.role-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 200px;
    background-color: #ffffff;
    border-radius: 15px;
    text-decoration: none;
    color: #333;
    font-size: 20px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.role-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.role-button h2 {
    margin: 0;
}

/* Login Page Styles */
.login-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 320px;
    text-align: center;
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    color: #333;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
}

.login-form button {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-form button:hover {
    background-color: #0056b3;
}

.back-link {
    display: block;
    margin-top: 20px;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

/* Admin Dashboard Layout */
.admin-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    background-color: #f7f9fc;
}

.sidebar {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    background-color: #ffffff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    color: #333;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 22px;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #495057;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav li a:hover {
    background-color: #f0f2f5;
    color: #007bff;
}

.sidebar-nav li.active a {
    background-color: #007bff;
    color: #ffffff;
    font-weight: 500;
}

/* 有二级菜单的主菜单项激活时不显示背景色 */
.sidebar-nav li.active.has-submenu > a {
    background-color: transparent;
    color: #007bff;
    font-weight: 500;
}

/* Submenu Styles */
.sidebar-nav .submenu {
    list-style: none;
    padding-left: 20px;
    display: none;
    background-color: transparent;
}

.sidebar-nav li.active .submenu {
    display: block;
}

.sidebar-nav .submenu li {
    background-color: transparent;
}

.sidebar-nav .submenu li a {
    display: block;
    padding: 8px 20px 8px 30px;
    font-size: 14px;
    text-decoration: none;
    color: #6c757d;
    background-color: transparent;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav .submenu li a:hover {
    color: #007bff;
}

.sidebar-nav .submenu li.active-submenu a {
    color: #007bff;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.sidebar-footer a {
    display: block;
    text-align: center;
    text-decoration: none;
    color: #495057;
    padding: 10px;
    background-color: #f0f2f5;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.sidebar-footer a:hover {
    background-color: #e2e6ea;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-header {
    padding: 20px 30px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    margin: 0;
    font-size: 24px;
}

.content-area {
    padding: 30px;
    flex-grow: 1;
}

/* User Management Styles */
.user-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-management-header h2 {
    margin: 0;
}

.table-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background-color: #f1f3f5;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(90deg, #007bff 0%, #0056d6 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,123,255,0.08);
    transition: background .18s;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #0056d6 0%, #007bff 100%);
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Form Styles */
.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    max-width: 600px;
}

.form-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Checkbox Group Styles */
.checkbox-group {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.checkbox-label {
    display: block;
    padding: 8px 0;
    cursor: pointer;
}

.checkbox-label:hover {
    background-color: #e9ecef;
}

.checkbox-label input {
    margin-right: 10px;
}

/* Status Badge Styles */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending {
    color: #fff;
    background-color: #6c757d;
}

.status-active {
    color: #007bff;
    background-color: #cce5ff;
}

.status-completed {
    color: #fff;
    background-color: #1fa53e;
}

/* Status Messages */
.status-message-success {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.status-message-error {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

/* Competition Console Styles */
.console-body {
    background-color: #f0f2f5;
    color: #333;
}

.console-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.console-main {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.console-panel {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.teams-panel, .judges-panel {
    width: 20%;
    overflow-y: auto;
}

.controls-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.console-list {
    list-style: none;
    padding: 0;
}

.console-list li {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.console-list li:hover {
    background-color: #f0f0f0;
}

.console-list li.active {
    background-color: #e9f5ff;
    border-left: 3px solid #007bff;
}

.current-status {
    margin-bottom: 20px;
}

.main-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.25rem;
}

.timer-display {
    font-size: 4rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 25px;
}

.judge-status {
    font-style: italic;
    color: #6c757d;
}

/* Avatar Styles */
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    object-fit: cover;
}

/* 项目状态样式 */
.project-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    min-width: 70px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

li[data-status="未开始"] .project-status {
    background-color: #6c757d;
}

li[data-status="进行中"] .project-status {
    background-color: #007bff;
}

li[data-status="已完成"] .project-status {
    background-color: #28a745;
}

/* 评委项目卡片自适应美化 */
.project-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); 
    gap: 20px; 
    margin: 32px 0; 
}

.project-card {
    aspect-ratio: 1/1;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    border-radius: 14px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    background: #fff; 
    transition: box-shadow .2s, border .2s, background .2s;
    cursor: default; 
    border: 2px solid #f0f2f5; 
    position: relative;
    min-width: 0; 
    min-height: 0; 
    padding: 10px;
}

.project-card.current {
    border: 2px solid #007bff; 
    box-shadow: 0 2px 12px rgba(0,123,255,0.10);
    background: linear-gradient(135deg, #e3f0ff 0%, #fafdff 100%);
    cursor: pointer;
}

.project-card.completed {
    border: 2px solid #2ecc71; 
    background: linear-gradient(135deg, #eaffea 0%, #fafdff 100%);
}

.project-card.disabled {
    background: #f5f6fa; 
    color: #bbb; 
    border: 2px dashed #e0e0e0; 
    cursor: not-allowed;
}

.project-card .project-title {
    font-size: 1rem; 
    font-weight: 600; 
    margin-bottom: 6px;
}

.project-card .team-name {
    font-size: 0.95rem; 
    color: #666; 
    margin-bottom: 8px;
}

.project-card .score-status {
    font-size: 0.95rem; 
    font-weight: 500; 
    margin-bottom: 8px;
}

.project-card .score-btn {
    padding: 6px 16px; 
    border-radius: 7px; 
    font-size: 0.95rem; 
    border: none; 
    background: #007bff; 
    color: #fff; 
    cursor: pointer; 
    transition: background .2s;
}

.project-card .score-btn:hover { 
    background: #0056b3; 
}

.project-card.completed .score-btn { 
    background: #2ecc71; 
    color: #fff; 
    cursor: default; 
}

.project-card.disabled .score-btn { 
    background: #ccc; 
    color: #fff; 
    cursor: not-allowed; 
}

@media (max-width: 600px) {
    .project-grid { 
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); 
        gap: 10px; 
    }
    .project-card { 
        padding: 4px; 
    }
}

/* 打分弹窗现代化样式 */
.modern-modal {
    max-width: 350px;
    margin: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 32px 28px 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    animation: modalIn .25s cubic-bezier(.4,0,.2,1);
}

@keyframes modalIn {
    from { 
        transform: translateY(40px) scale(.96); 
        opacity: 0; 
    }
    to { 
        transform: none; 
        opacity: 1; 
    }
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0; 
    top: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn {
    position: absolute;
    right: 18px;
    top: 18px;
    font-size: 1.5rem;
    color: #bbb;
    cursor: pointer;
    transition: color .2s;
}

.close-btn:hover { 
    color: #333; 
}

.score-input-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    grid-gap: 12px;
    justify-content: center;
    margin: 0 auto;
}

.numpad .num-key {
    font-size: 1.6rem;
    background: #f7f8fa;
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    padding: 18px 0;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    outline: none;
    color: #222;
    font-weight: 500;
}

.numpad .num-key:hover {
    background: #e6f0ff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.08);
}

.numpad #num-del {
    color: #e74c3c;
    font-size: 1.3rem;
}

.scored-btn {
    background: #e74c3c !important;
    color: #fff !important;
    border-radius: 7px;
    border: none;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 2px 8px rgba(231,76,60,0.08);
}

.scored-btn:hover {
    background: #c0392b !important;
    color: #fff !important;
}

.readonly-score {
    background: #f5f6fa !important;
    color: #333 !important;
    border: none !important;
    cursor: default !important;
    user-select: none;
    pointer-events: none;
    box-shadow: none !important;
}

/* Module card colors */
.module-card.disabled {
    background-color: #f5f6fa;
    color: #bbb;
    cursor: not-allowed;
    opacity: 0.7;
}

.module-card.module-card-active {
    background-color: #28a745;
    color: #fff;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.module-card.module-card-active:hover {
    background-color: #218838;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

/* Judge Scoring Page Styles */
.judge-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.judge-header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.judge-content {
    margin-top: 80px;
    padding: 24px;
}

.scoring-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.scoring-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.score-item {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 6px;
}

.score-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.score-item input[type="number"] {
    width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.score-submit {
    background: #1890ff;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.score-submit:hover {
    background: #40a9ff;
}

.score-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 自动关闭消息样式 */
.status-message-success,
.status-message-error {
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.status-message-success.auto-close,
.status-message-error.auto-close {
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 1.7s forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}