/* 主题自适应 - 自动适配WordPress主题背景和颜色 */
.srs-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.6;
    color: inherit;
    background: transparent;
}

/* 当检测到明确的主题背景时，使用透明背景 */
.srs-container.theme-adaptive {
    background: transparent;
    color: inherit;
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    .srs-container:not(.theme-adaptive) {
        background: #1a1a1a;
        color: #e0e0e0;
    }
}

/* 标题样式 - 自适应主题颜色 */
.srs-container h3 {
    color: inherit;
    font-size: 1.2em;
    font-weight: bold;
    margin: 2em 0 1em 0;
    font-family: inherit;
    opacity: 0.9;
}

/* 第一个标题距离顶部近一些 */
.srs-container h3:first-child,
.srs-statistics h3:first-child {
    margin-top: 1em;
}

/* 统计区域 */
.srs-statistics {
    margin-bottom: 3em;
}

.srs-activity-filter {
    margin: 1em 0 2em 0;
}

.srs-filter-btn {
    background: none;
    border: none;
    color: var(--srs-inactive-color, #999);
    font-size: 1em;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    margin-right: 1em;
    text-decoration: none;
    transition: all 0.2s ease;
}

.srs-filter-btn:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.srs-filter-btn.active {
    color: inherit;
    font-weight: bold;
    text-decoration: none;
    opacity: 1;
}

.srs-stats-grid {
    margin: 2em 0;
}

.srs-stat-item {
    margin-bottom: 1em;
    line-height: 1.4;
}

.srs-stat-label {
    display: inline;
    color: inherit;
    font-size: 1em;
    font-weight: normal;
    margin-right: 0.5em;
    opacity: 0.8;
}

.srs-stat-label::after {
    content: ":";
}

.srs-stat-value {
    display: inline;
    font-size: 1em;
    font-weight: bold;
    color: inherit;
    font-family: inherit;
    opacity: 1;
}

/* 地图区域 */
.srs-map-section {
    margin-bottom: 3em;
}

#srs-map {
    border: 1px solid var(--srs-border-color, #ddd);
    margin: 1em 0;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

/* Mapbox 控件样式修复 */
.mapboxgl-ctrl-group {
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1) !important;
}

.mapboxgl-ctrl button {
    background-color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    display: block !important;
    width: 30px !important;
    height: 30px !important;
}

.mapboxgl-ctrl button:hover {
    background-color: #f0f0f0 !important;
}

.mapboxgl-ctrl-icon {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill:%23333333;' d='M 10 6 C 9.446 6 9 6.4459904 9 7 L 9 9 L 7 9 C 6.446 9 6 9.446 6 10 C 6 10.554 6.446 11 7 11 L 9 11 L 9 13 C 9 13.55401 9.446 14 10 14 C 10.554 14 11 13.55401 11 13 L 11 11 L 13 11 C 13.554 11 14 10.554 14 10 C 14 9.446 13.554 9 13 9 L 11 9 L 11 7 C 11 6.4459904 10.554 6 10 6 z'/%3E%3C/svg%3E") !important;
}

.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill:%23333333;' d='M 7 9 C 6.446 9 6 9.446 6 10 C 6 10.554 6.446 11 7 11 L 13 11 C 13.554 11 14 10.554 14 10 C 14 9.446 13.554 9 13 9 L 7 9 z'/%3E%3C/svg%3E") !important;
}

.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon style='fill:%23333333;' points='10,8 14,17 10,14 6,17'/%3E%3Cpolygon style='fill:%23CCCCCC;' points='10,12 14,3 10,6 6,3'/%3E%3C/svg%3E") !important;
}

/* 表格区域 - bearblog 风格的简洁表格 */
.srs-activities-section {
    margin-bottom: 3em;
}

.srs-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 1em 0;
    font-family: inherit;
    font-size: 1em;
    table-layout: fixed;
}

.srs-table th {
    padding: 0.5em 0.3em;
    text-align: left;
    font-weight: bold;
    color: inherit;
    border-bottom: 1px solid var(--srs-border-color, #ddd);
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}

.srs-table td {
    padding: 0.5em 0.3em;
    color: inherit;
    border-bottom: 1px solid var(--srs-border-light-color, #eee);
    vertical-align: top;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
}

/* 表格列宽度分配 (移除活动名称列后) */
.srs-table th:nth-child(1),
.srs-table td:nth-child(1) { width: 15%; } /* 日期 */
.srs-table th:nth-child(2),
.srs-table td:nth-child(2) { width: 12%; } /* 类型 */
.srs-table th:nth-child(3),
.srs-table td:nth-child(3) { width: 15%; } /* 距离 */
.srs-table th:nth-child(4),
.srs-table td:nth-child(4) { width: 15%; } /* 时长 */
.srs-table th:nth-child(5),
.srs-table td:nth-child(5) { width: 18%; } /* 配速/速度 */
.srs-table th:nth-child(6),
.srs-table td:nth-child(6) { width: 13%; } /* 爬升 */
.srs-table th:nth-child(7),
.srs-table td:nth-child(7) { width: 12%; } /* 心率 */

.srs-table tbody tr:hover {
    background: var(--srs-hover-bg, rgba(0,0,0,0.05));
    cursor: pointer;
}

.srs-table tbody tr.active {
    background: var(--srs-active-bg, rgba(0,123,255,0.1));
}

.srs-table tbody tr:last-child td {
    border-bottom: none;
}

/* 活动类型 - 统一样式 */
.srs-activity-type {
    font-weight: normal;
    font-size: inherit;
    white-space: nowrap;
    color: inherit;
    opacity: 0.8;
}

/* 分页按钮 - bearblog 风格 */
.srs-pagination {
    text-align: left;
    margin: 2em 0;
}

#srs-load-more {
    background: none;
    border: none;
    color: var(--srs-link-color, #0073aa);
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

#srs-load-more:hover {
    text-decoration: underline;
    opacity: 0.8;
}

#srs-load-more:disabled {
    color: inherit;
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: none;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .srs-container {
        padding: 15px;
    }
    
    h3 {
        font-size: 1.1em;
        margin: 1.5em 0 0.8em 0;
    }
    
    .srs-container h3:first-child,
    .srs-statistics h3:first-child {
        margin-top: 0.5em;
    }
    
    .srs-filter-btn {
        display: inline-block;
        margin-right: 0.8em;
        margin-bottom: 0.5em;
    }
    
    .srs-stat-item {
        margin-bottom: 0.8em;
    }
    
    /* 平板端表格优化 */
    .srs-table {
        font-size: 0.85em;
    }
    
    .srs-table th,
    .srs-table td {
        padding: 0.4em 0.2em;
    }
    
    /* 平板端重新分配列宽 (移除活动名称列后) */
    .srs-table th:nth-child(1),
    .srs-table td:nth-child(1) { width: 18%; } /* 日期 */
    .srs-table th:nth-child(2),
    .srs-table td:nth-child(2) { width: 15%; } /* 类型 */
    .srs-table th:nth-child(3),
    .srs-table td:nth-child(3) { width: 18%; } /* 距离 */
    .srs-table th:nth-child(4),
    .srs-table td:nth-child(4) { width: 18%; } /* 时长 */
    .srs-table th:nth-child(5),
    .srs-table td:nth-child(5) { width: 31%; } /* 配速/速度 */
    
    /* 隐藏爬升和心率列 */
    .srs-table th:nth-child(6),
    .srs-table td:nth-child(6),
    .srs-table th:nth-child(7),
    .srs-table td:nth-child(7) {
        display: none;
    }
}

@media (max-width: 480px) {
    .srs-container {
        padding: 10px;
        overflow-x: auto;
    }
    
    /* 手机端表格优化 */
    .srs-table {
        font-size: 0.8em;
        min-width: 100%;
    }
    
    .srs-table th,
    .srs-table td {
        padding: 0.3em 0.15em;
    }
    
    /* 手机端列宽重新分配 (移除活动名称列后) */
    .srs-table th:nth-child(1),
    .srs-table td:nth-child(1) { width: 25%; } /* 日期 */
    .srs-table th:nth-child(2),
    .srs-table td:nth-child(2) { width: 18%; } /* 类型 */
    .srs-table th:nth-child(3),
    .srs-table td:nth-child(3) { width: 22%; } /* 距离 */
    .srs-table th:nth-child(4),
    .srs-table td:nth-child(4) { width: 35%; } /* 时长 */
    
    /* 隐藏配速/速度、爬升和心率列 */
    .srs-table th:nth-child(5),
    .srs-table td:nth-child(5),
    .srs-table th:nth-child(6),
    .srs-table td:nth-child(6),
    .srs-table th:nth-child(7),
    .srs-table td:nth-child(7) {
        display: none;
    }
    
    /* 活动类型文字不换行 */
    .srs-activity-type {
        white-space: nowrap;
    }
}

/* 特别小的屏幕 (iPhone SE等) */
@media (max-width: 375px) {
    .srs-table {
        font-size: 0.75em;
    }
    
    .srs-table th,
    .srs-table td {
        padding: 0.25em 0.1em;
    }
    
    /* 更紧凑的列宽 (移除活动名称列后) */
    .srs-table th:nth-child(1),
    .srs-table td:nth-child(1) { width: 22%; } /* 日期 */
    .srs-table th:nth-child(2),
    .srs-table td:nth-child(2) { width: 16%; } /* 类型 */
    .srs-table th:nth-child(3),
    .srs-table td:nth-child(3) { width: 27%; } /* 距离 */
    .srs-table th:nth-child(4),
    .srs-table td:nth-child(4) { width: 35%; } /* 时长 */
}

/* 主题颜色CSS变量定义 */
.srs-container {
    --srs-text-color: inherit;
    --srs-bg-color: transparent;
    --srs-border-color: #ddd;
    --srs-border-light-color: #eee;
    --srs-link-color: #0073aa;
    --srs-inactive-color: #999;
    --srs-hover-bg: rgba(0,0,0,0.05);
    --srs-active-bg: rgba(0,123,255,0.1);
}

/* 深色主题变量覆盖 */
@media (prefers-color-scheme: dark) {
    .srs-container:not(.theme-adaptive) {
        --srs-text-color: #e0e0e0;
        --srs-bg-color: #1a1a1a;
        --srs-border-color: #444;
        --srs-border-light-color: #333;
        --srs-link-color: #4fc3f7;
        --srs-inactive-color: #666;
        --srs-hover-bg: rgba(255,255,255,0.1);
        --srs-active-bg: rgba(79,195,247,0.2);
    }
}

/* 清理装饰性元素但保持主题适应性 */
.srs-container * {
    box-shadow: none !important;
    background-image: none !important;
}

/* 保留地图圆角 */
#srs-map {
    border-radius: 4px !important;
}



/* 主题适应的简单分割线 */
.srs-statistics,
.srs-map-section {
    border-bottom: 1px solid var(--srs-border-light-color, rgba(0,0,0,0.1));
    padding-bottom: 2em;
    margin-bottom: 2em;
}

.srs-activities-section {
    border-bottom: none;
}

/* 移除最后一个区域的分割线 */
.srs-container > *:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 专注阅读 - 当只有单个内容区域时的优化 */
.srs-container:has(.srs-statistics):not(:has(.srs-map-section)):not(:has(.srs-activities-section)) .srs-statistics,
.srs-container:has(.srs-map-section):not(:has(.srs-statistics)):not(:has(.srs-activities-section)) .srs-map-section,
.srs-container:has(.srs-activities-section):not(:has(.srs-statistics)):not(:has(.srs-map-section)) .srs-activities-section {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}