/* ===== 比赛时间页面样式 ===== */

/* 主要内容容器 - 统一宽度，居中 */
.schedule-container {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 24px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.competition-section {
    margin-bottom: 64px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    overflow-x: auto;
    padding: 20px 0 24px 0;
}

.competition-section h3 {
    font-size: 1.8rem;
    padding: 0 24px 16px 24px;
    margin: 0;
    color: #1e2a3a;
    border-bottom: 3px solid #3498db;
    display: inline-block;
    width: auto;
    background: white;
}

/* ===== 表格核心样式：完美对齐、宽高一致、无错位 ===== */
.competition-table {
    width: calc(100% - 48px);
    margin: 24px auto 0 auto;
    border-collapse: collapse;
    font-size: 1.05rem;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.competition-table th,
.competition-table td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid #e9edf2;
    vertical-align: middle;
}

/* 表头背景 */
.competition-table th {
    background-color: #f1f5f9;
    font-weight: 700;
    color: #1e2a3a;
    font-size: 1rem;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #dce3ec;
}

/* 鼠标悬停效果 */
.competition-table tr:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 列宽统一规划 —— 完全对齐，无错位 */
.competition-table th:nth-child(1),
.competition-table td:nth-child(1) {
    width: 22%;
    min-width: 160px;
}

.competition-table th:nth-child(2),
.competition-table td:nth-child(2) {
    width: 18%;
    min-width: 120px;
}

.competition-table th:nth-child(3),
.competition-table td:nth-child(3) {
    width: 18%;
    min-width: 115px;
}

.competition-table th:nth-child(4),
.competition-table td:nth-child(4) {
    width: 12%;
    min-width: 90px;
}

.competition-table th:nth-child(5),
.competition-table td:nth-child(5) {
    width: 30%;
    min-width: 220px;
}

/* 学科图标 + 文字对齐更优雅 */
.subject-icon {
    font-size: 1.35rem;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}
.subject-name {
    font-weight: 600;
    vertical-align: middle;
    font-size: 1rem;
}

/* 倒计时盒子统一样式，自适应宽度 */
.countdown-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    background-color: #f0f4f9;
    color: #1f2d3d;
    min-width: 180px;
    white-space: nowrap;
    transition: all 0.1s ease;
    font-family: 'JetBrains Mono', monospace, 'Segoe UI';
}

/* 倒计时数字样式 */
.countdown-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3498db;
    margin: 0 2px;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(52, 152, 219, 0.1);
}

.countdown-box.upcoming {
    background: #2c7da0;
    color: white;
    box-shadow: 0 2px 8px rgba(44,125,160,0.2);
}

/* 即将开始状态下的倒计时数字样式 */
.countdown-box.upcoming .countdown-number {
    color: #ffeb3b;
    background-color: rgba(255, 235, 59, 0.2);
    font-size: 1.2rem;
}

.countdown-box.ongoing {
    background: #2e8b57;
    color: white;
    font-weight: 700;
}

.countdown-box.ended {
    background: #a0aec0;
    color: #2d3748;
    background: #e2e8f0;
    color: #4a5568;
}

@keyframes pulse {
    0% { opacity: 0.85; transform: scale(1);}
    50% { opacity: 1; transform: scale(1.02); background: #3aa36b;}
    100% { opacity: 0.85; transform: scale(1);}
}

/* 确保手机端可滚动且表格不错位 */
@media (max-width: 860px) {
    .competition-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .competition-table {
        width: 100%;
        min-width: 700px;
    }
    .countdown-box {
        white-space: nowrap;
        font-size: 0.75rem;
        padding: 6px 12px;
        min-width: 170px;
    }
}

/* 修复原代码中td:first-child错误布局 (之前display:flex导致错位) */
.competition-table td:first-child {
    display: table-cell;
    vertical-align: middle;
}

/* hover行效果 */
.competition-table tbody tr:hover {
    background-color: #fafcff;
    transition: 0.1s;
}

h3 i {
    margin-right: 12px;
    color: #3498db;
}
