﻿/* 重置和基础样式 */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 主容器 */
.event-detail-container {
    width: 100%;
    padding: 20px;
}

.container-box {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* 赛事标题 */
.event-header {
    margin-bottom: 30px;
    text-align: center;
}

.event-title {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    color: #333;
    word-wrap: break-word;
    word-break: break-word;
}

/* 基本信息区域 */
.event-basic-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.info-icon {
    flex-shrink: 0;
}

.info-label {
    font-size: 16px;
    color: #010101;
    min-width: 90px;
    flex-shrink: 0;
}

.info-value {
    font-size: 16px;
    color: #010101;
    flex: 1;
    word-wrap: break-word;
    word-break: break-word;
}

/* 赛事状态区域 */
.event-status-section {
    margin-bottom: 40px;
}

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.status-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-icon {
    flex-shrink: 0;
}

.status-text {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.total-distance {
    display: flex;
    align-items: center;
    gap: 17px;
}

.distance-text {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

/* 地图显示区域 */
.map-display {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.map-content {
    width: 100%;
    height: 100%;
    /* background-image: url(../images/map-line-info/map-line-info_25_25.jpg); */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 比赛状态区域 */
.race-status-section {
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.race-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.status-nav {
    flex: 1;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.nav-item2 {
    font-size: 18px;
    color: #333;
    padding: 10px 0;
    cursor: pointer;
}

.nav-item2.active {
    border-bottom: 2px solid #007bff;
    color: #007bff;
    font-weight: 600;
}

.status-info-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.deadline-info {
    font-size: 16px;
    color: #666;
}

.race-status {
    display: flex;
    align-items: center;
}

/* 状态标识 */
.status-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
    background-color: #28a745;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-badge.completed {
    background-color: #6c757d;
    cursor: default;
}

/* 报名参赛样式 */
.status-badge:not(.completed) {
    background-color: #9AFF00;
    color: #333;
    font-weight: 600;
}

.status-badge:not(.completed):hover {
    background-color: #8AEF00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(154, 255, 0, 0.3);
}

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* 弹窗内容 */
.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* 弹窗标题 */
.modal-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #9AFF00;
    padding-bottom: 15px;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #9AFF00;
}

/* 表单样式 */
.registration-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.form-input,
.form-select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: #fff;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #9AFF00;
    box-shadow: 0 0 0 3px rgba(154, 255, 0, 0.1);
}

.form-select {
    cursor: pointer;
}

/* 提交按钮 */
.submit-btn {
    background-color: #9AFF00;
    color: #333;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #8AEF00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(154, 255, 0, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container-box {
        padding: 30px;
    }
    
    .map-display {
        height: 350px;
    }
}

@media (max-width: 992px) {
    .container-box {
        padding: 25px;
    }
    
    .event-title {
        font-size: 24px;
    }
    
    .status-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .status-group {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .status-text,
    .distance-text {
        font-size: 18px;
    }
    
    .race-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .status-info-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .performance-summary {
        flex-direction: column;
        gap: 15px;
    }
    
    .map-display {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .event-detail-container {
        padding: 15px;
    }
    
    .container-box {
        padding: 20px;
    }
    
    .event-title {
        font-size: 22px;
    }
    
    .description-title {
        font-size: 24px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-label {
        min-width: auto;
    }
    
    .status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .total-distance {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .status-text,
    .distance-text {
        font-size: 16px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .participant-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .participant-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .map-display {
        height: 250px;
    }
    
    /* 移动端排行榜卡片式布局 */
    .table-container {
        margin: 0 -20px;
        border-radius: 0;
        box-shadow: none;
        overflow-x: visible;
    }
    
    .leaderboard-table {
        min-width: auto;
        border-collapse: separate;
        border-spacing: 0;
    }
    
    .leaderboard-table thead {
        display: none; /* 隐藏表头 */
    }
    
    .leaderboard-table tbody {
        display: block;
    }
    
    .leaderboard-row {
        display: block;
        background-color: white;
        border-radius: 10px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        padding: 15px;
        border: none;
    }
    
    .leaderboard-row:hover {
        background-color: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .leaderboard-table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }
    
    .leaderboard-table td:last-child {
        border-bottom: none;
    }
    
    /* 显示字段标签 */
    .field-label {
        display: block;
        font-weight: 600;
        color: #666;
        font-size: 14px;
        margin-bottom: 5px;
        flex-shrink: 0;
    }
    
    /* 排名单元格特殊处理 */
    .rank-cell {
        align-items: center;
        text-align: center;
        padding: 15px 0;
        border-bottom: 2px solid #e9ecef;
        margin-bottom: 10px;
        background-color: #f8f9fa;
        border-radius: 5px;
    }
    
    .rank-cell .field-label {
        display: none; /* 排名字段不显示标签 */
    }
    
    .rank-number {
        justify-content: center;
    }
    
    /* 参赛者信息卡片式布局 */
    .participant-cell {
        align-items: flex-start;
        padding: 15px 0;
    }
    
    .participant-info {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        width: 100%;
        margin-top: 5px;
    }
    
    .participant-name {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    /* 其他单元格 */
    .team-cell,
    .time-cell,
    .gap-cell,
    .bonus-cell,
    .points-cell {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .team-name,
    .time-value,
    .gap-value,
    .bonus-value,
    .points-value {
        width: 100%;
        margin-top: 5px;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .form-input,
    .form-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .event-title {
        font-size: 20px;
    }
    
    .description-title {
        font-size: 20px;
    }
    
    .status-text,
    .distance-text {
        font-size: 14px;
    }
    
    .summary-label,
    .summary-value {
        font-size: 16px;
    }
    
    .map-display {
        height: 200px;
    }
    
    /* 极小屏幕下的排行榜优化 */
    .leaderboard-row {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .leaderboard-table td {
        padding: 8px 0;
    }
    
    .field-label {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .rank-cell {
        padding: 12px 0;
    }
    
    .participant-cell {
        padding: 12px 0;
    }
    
    .participant-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-top: 3px;
    }
    
    .participant-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .team-name,
    .time-value,
    .gap-value,
    .bonus-value,
    .points-value {
        margin-top: 3px;
    }
}

/* 文本换行优化 */
.info-value,
.event-title,
.description-title,
.description-content p,
.description-content li,
.name-text,
.team-name,
.time-value,
.gap-value,
.bonus-value,
.points-value {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* 确保图片响应式 */
img {
    max-width: 100%;
    height: auto;
}

/* 表格行悬停效果 */
.leaderboard-row:hover {
    background-color: #f8f9fa;
}

/* 打印样式 */
@media print {
    .event-detail-container {
        padding: 0;
    }
    
    .container-box {
        box-shadow: none;
        padding: 20px;
    }
    
    .map-display {
        height: 300px;
    }
}

/* 提高可访问性 */
.nav-item2:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* 动画过渡 */
.nav-item2,
.status-badge,
.leaderboard-row {
    transition: all 0.3s ease;
}

/* 滚动条样式 */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 成绩摘要 */
.performance-summary {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-label {
    font-size: 18px;
    color: #333;
}

.summary-value {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.summary-value.highlight {
    color: #007bff;
    font-weight: bold;
}

/* 字段标签在桌面端隐藏 */
.field-label {
    display: none;
}

/* 排行榜区域 */
.leaderboard-section {
    margin-bottom: 40px;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    min-width: 700px; /* 确保表格在小屏幕上可以横向滚动 */
}

.leaderboard-table thead {
    background-color: #f8f9fa;
}

.leaderboard-table th {
    padding: 15px 10px;
    text-align: center;
    color: #666666;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid #e9ecef;
}

.leaderboard-table td {
    padding: 15px 10px;
    text-align: center;
    color: #000000;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

/* 表格列宽设置 */
.rank-col { width: 80px; }
.participant-col { width: 280px; }
.team-col { width: 200px; }
.time-col { width: 120px; }
.gap-col { width: 120px; }
.bonus-col { width: 80px; }
.points-col { width: 80px; }

/* 排名单元格 */
.rank-cell {
    text-align: center;
}

.rank-number {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 参赛者信息 */
.participant-cell {
    text-align: left;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.participant-avatar {
    flex-shrink: 0;
}

.participant-details {
    flex: 1;
    min-width: 0;
}

.participant-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.flag-icon {
    flex-shrink: 0;
}

.name-text {
    font-weight: 500;
    word-wrap: break-word;
    word-break: break-word;
}

/* 团队、时间等单元格 */
.team-name,
.time-value,
.gap-value,
.bonus-value,
.points-value {
    word-wrap: break-word;
    word-break: break-word;
}

/* 分隔线 */
.section-divider {
    height: 36px;
    background-image: url(../images/map-line-info/map-line-info_63_63.jpg);
    background-size: cover;
    background-position: center;
    margin: 40px 0;
    border-radius: 5px;
}

/* 赛事描述区域 */
.event-description {
    margin-bottom: 40px;
}

.description-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
    word-wrap: break-word;
    word-break: break-word;
}

.description-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.description-content p {
    margin-bottom: 15px;
    word-wrap: break-word;
    word-break: break-word;
}

.description-content strong {
    font-weight: bold;
    color: #000;
}

.description-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.description-content li {
    margin-bottom: 8px;
    word-wrap: break-word;
    word-break: break-word;
}