* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    overflow: hidden;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(52, 152, 219, 0.3);
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #3498db;
    font-size: 20px;
    text-align: center;
}

/* 页面标题 */
.page-title {
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 15px 20px;
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
    height: 70px;
    line-height: 40px;
}

/* 主容器 */
.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 360px);
    overflow: hidden;
}

/* 屏幕样式 */
.screen {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e0e6ed;
    height: 100%;
    position: relative;
}

/* 屏幕头部 */
.screen-header {
    background: white;
    padding: 15px;
    border-bottom: 1px solid #e0e6ed;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

/* 数据源选择器 */
.data-source-selector {
    background: white;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #e0e6ed;
}

.data-source-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

/* 数据源按钮样式调整 - 让文字和时间更紧凑 */
.data-source-btn {
    flex: 1;
    padding: 8px 4px; /* 左右内边距4px，让按钮本身更紧凑 */
    background: white;
    border: 1px solid #d0d7e2;
    border-radius: 6px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px; /* 从6px减小到2px */
}

.data-source-btn:hover {
    background: #f0f7ff;
    border-color: #3498db;
}

.data-source-btn.active {
    background: #3498db;
    border-color: #2980b9;
    color: white;
}

.data-source-btn .source-time {
    font-size: 11px;
    opacity: 0.8;
    font-family: monospace;
    margin-left: 0; /* 从4px改为0 */
    line-height: 1.3;
    text-align: left;
}

/* 确保下拉容器不增加额外间距 */
.source-time-dropdown-container {
    position: relative;
    display: inline-block;
    width: auto; /* 从100%改为auto */
    margin-left: 0;
}

/* 调整时间显示的内边距 */
.source-time-display {
    padding: 2px 20px 2px 2px; /* 从6px改为2px */
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-arrow {
    position: absolute;
    right: 2px; /* 从6px减小到2px */
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.data-source-btn.active .dropdown-arrow {
    color: rgba(255, 255, 255, 0.9);
}

.source-time-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #d0d7e2;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
}

.source-time-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.source-time-dropdown-list::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.source-time-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    font-size: 12px;
    line-height: 1.4;
}

.source-time-option:last-child {
    border-bottom: none;
}

.source-time-option:hover {
    background-color: #f0f7ff;
}

.source-time-option.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #3498db;
}

.source-time-option .option-utc {
    color: #2c3e50;
    font-weight: 500;
}

.source-time-option .option-bjt {
    color: #7f8c8d;
    font-size: 11px;
}

/* 非激活状态的按钮样式 */
.data-source-btn:not(.active) .source-time-dropdown-list {
    background-color: white;
    color: #2c3e50;
}

.data-source-btn:not(.active) .source-time-option {
    color: #2c3e50;
}

.data-source-btn:not(.active) .dropdown-arrow {
    color: #95a5a6;
}

/* 确保下拉列表在各种状态下都可见 */
.source-time-dropdown-list {
    background-color: white;
    color: #2c3e50;
}

/* 搜索框 */
.station-search {
    position: relative;
    margin-bottom: 0;
}

.station-search input[type=text] {
    width: 100%;
    padding: 10px 36px 10px 12px;
    background: white;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 15px;
    color: #2c3e50;
}

.station-search input[type=text]:focus {
    outline: none;
    border-color: #3498db;
}

.station-search i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 16px;
    pointer-events: none;
}

/* 站点列表 */
.station-list {
    max-height: 350px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    font-size: 14px;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
}

.station-list::-webkit-scrollbar {
    width: 6px;
}

.station-list::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.station-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    font-size: 14px;
}

.station-item:hover {
    background: #f8f9fa;
}

.station-item i {
    font-size: 14px;
    margin-right: 10px;
    color: #3498db;
}

.station-item.no-result {
    cursor: default;
    color: #7f8c8d;
    justify-content: center;
    gap: 8px;
}

/* 图表区域 */
.screen-charts {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 图表包装器 */
.chart-wrapper {
    width: 100%;
    height: 300px;
    min-height: 300px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e6ed;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    flex-shrink: 0;
}

.chart-wrapper > div {
    width: 100%;
    height: 100%;
}