:root {
    --header-height: 60px;
    --searchbar-height: 40px;
    --shortcut-height: 50px;
    --nav-tabs-height: 40px;
    /* 新增：导航标签高度 */
    --primary-color: #ffc107;
    --text-color: #333;
    --light-text: #666;
    --border-color: #ccc;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.btn:hover {
    border: none;
}

.search-input:focus {
    outline: none;
}

.nav-link {
    color: #9b9b9b;
}

/* 固定头部区域 */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1002;
    height: calc(var(--header-height) + var(--searchbar-height));
    background: white url('/img/top-mid.png') repeat-x;
    background-size: 10px var(--header-height);
}

.header-content {
    position: relative;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.header-left,
.header-right {
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-left img,
.header-right img {
    height: var(--header-height);
    width: auto;
    object-fit: contain;
}

.header-left img {
    max-width: 250px;
}

.header-right img {
    max-width: 120px;
}

/* 搜索区域 */
.search-container {
    padding: 10px 15px;
    background: #f8f9fa;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--searchbar-height);
}

/* 主要内容区域 */
.main-content {
    position: fixed;
    top: calc(var(--header-height) + var(--searchbar-height));
    left: 0;
    width: 100%;
    height: calc(100% - var(--header-height));
    display: flex;
    flex-direction: column;
    background: white;
}

/* 站点类型导航 */
.site-type-nav {
    display: flex;
    justify-content: space-around;
    padding: 10px 5px;
    background: white;
    flex-shrink: 0;
}

.site-type-btn {
    width: 75%;
    max-width: 80px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.site-type-btn img {
    width: 100%;
    height: auto;
    transition: transform 0.2s ease;
}

.site-type-btn:active img {
    transform: scale(0.95);
}

/* 地图容器 */
.map-container {
    height: 30vh;
    min-height: 150px;
    border: none;
    margin: 0;
    flex-shrink: 0;
}

#Map1 {
    height: 100%;
    width: 100%;
}

/* 固定导航标签 */
.fixed-nav-tabs {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: white;
    margin: 0;
    padding: 0 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fixed-nav-tabs .nav-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid #dee2e6;
}

.region-selector {
    border: none;
    flex-shrink: 0;
}

.search-input {
    flex-grow: 1;
    color: #9b9d8b;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 0.8rem;
    padding: 5px 0;
    background: transparent;
    min-width: 0;
}

.search-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 课程列表 */
.courses-container {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    /* 修改：移除水平内边距 */
}

.tab-content {
    padding: 10px 15px;
    /* 新增：为内容添加内边距 */
}

.list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 20px;
}

@media (min-width: 768px) {
    .list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 课程卡片 */
.course-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    transition: all 0.2s ease;
    padding: 12px;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.course-card:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-medium);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.course-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
    flex-grow: 1;
}

.course-badge {
    font-size: 0.7rem;
    margin-left: 8px;
    flex-shrink: 0;
}

.course-info {
    font-size: 0.8rem;
    color: var(--light-text);
    margin: 2px 0;
    line-height: 1.4;
}

/* 加载指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* 模态框 */
.modal-map {
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

/* 下拉菜单优化 */
.dropdown-menu {
    max-height: 60vh;
    overflow-y: auto;
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}