/**
 * app_main_tab_v3 Tab头部和通用样式
 * 包含Tab切换、性能监控、时间信息等
 */

/* Tab容器 */
.tab-container {
    margin-bottom: 20px;
}

/* Tab头部 */
.tab-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* Tab头部第一行：tab按钮 + 性能信息 + 时间等 */
.tab-header-row1 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

/* 全局日期选择区域（在tab按钮下方，固定宽度） */
.global-date-slider-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafafa;
    width: 1200px;
    flex-shrink: 0;
}

.global-date-slider-section .btn_group_description_label {
    flex-shrink: 0;
}

.global-date-slider-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
}

/* ── 手机适配(仅 ≤767px 生效，PC 端零回归) ── */
@media (max-width: 767px) {
    .global-date-slider-section { width: 100%; flex-shrink: 1; flex-wrap: wrap; }
    .tab-buttons { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .tab-button { padding: 12px 16px; font-size: 16px; }
    .tab-header-row1 { gap: 8px; }
    .performance-info, .data-notice { display: none; }
}

/* Tab按钮容器 */
.tab-buttons {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    padding: 0;
    margin-bottom: 0;
}

/* Tab按钮 */
.tab-button {
    padding: 16px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 22px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    margin: 0;
    border-radius: 0;
    position: relative;
}

.tab-button:hover {
    background: transparent;
    color: #333;
}

.tab-button.active {
    background: transparent;
    color: #ff6b35;
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #ff6b35;
}

/* Tab内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 性能监控区域样式 */
.performance-info {
    --perf-font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #495057;
    font-size: var(--perf-font-size, 16px);
    margin-left: 10px;
}

.performance-info .perf-section {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 6px;
}

.performance-info .perf-label {
    color: #6c757d;
    font-weight: 400;
    font-size: var(--perf-font-size, 16px);
}

.performance-info .perf-value {
    color: #28a745;
    font-weight: 600;
    font-size: var(--perf-font-size, 16px);
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* 时间信息区域样式 */
.time-info {
    --time-font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #495057;
    font-size: var(--time-font-size, 16px);
    font-weight: 400;
    min-width: 350px; /* 固定最小宽度，确保声明卡片位置稳定 */
}

.time-info .time-section {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 6px;
}

.time-info .time-label {
    color: #6c757d;
    font-weight: 400;
    font-size: var(--time-font-size, 16px);
}

.time-info .time-value {
    color: #ff6b35;
    font-weight: 600;
    font-size: var(--time-font-size, 16px);
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.time-info .refresh-countdown {
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: var(--time-font-size, 16px);
    font-weight: 500;
    border: 1px solid #ffeaa7;
    margin-left: 2px;
}

.time-info .refresh-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: var(--time-font-size, 16px);
    font-weight: 500;
    margin-left: 2px;
    display: inline-block;
}

.time-info .refresh-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.time-info .refresh-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 表格排序样式 */
.sort-asc::after {
    content: ' ▲';
    color: #007bff;
    font-weight: bold;
}

.sort-desc::after {
    content: ' ▼';
    color: #007bff;
    font-weight: bold;
}

th[title="点击排序"]:hover {
    background-color: #f8f9fa;
}

/* 数据声明卡片样式 */
.data-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(237, 113, 11, 0.902);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 171, 102, 0.3);
    transition: all 0.3s ease;
    margin-left: 10px;
    white-space: nowrap;
}

.data-notice:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 171, 102, 0.4);
}

.data-notice-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.data-notice-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 18px;
    font-weight: 500;
}

.data-notice-text {
    color: rgba(255, 255, 255, 0.95);
}

.data-notice-account {
    color: #fff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 隐藏列和排序按钮控制容器（统一类名） */
.hide_and_sort_btn_controls {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/**
 * 与 .hide_and_sort_btn_controls 同时使用（双类提高优先级）。
 * 缩小「列展示/排序方式」等标签与右侧按钮、单选组之间的横向间距；略收紧内边距。
 */
.hide_and_sort_btn_controls.hide_and_sort_btn_controls--tight {
    gap: 3px;
    padding: 8px 12px;
}

/* 修复 radio 按钮面板在 flex 行中的 margin-bottom 导致的中线偏移 */
.hide_and_sort_btn_controls .radio-button-group-panel {
    margin-bottom: 0;
}

/* 列控制按钮容器 — 与排序区域保持一致的间距 */
.hide_and_sort_btn_controls .column-toggle-btn-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 按钮组描述标签（统一类名） */
.btn_group_description_label {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background-color: #6c757d;
    margin: 0;
    padding: 6px 12px;
    border-radius: 6px;
    user-select: none;
    letter-spacing: 0.3px;
}

/* 列控制标签（兼容旧类名） */
.column-toggle-label {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background-color: #6c757d;
    margin: 0;
    padding: 6px 12px;
    border-radius: 6px;
    user-select: none;
    letter-spacing: 0.3px;
}

/* 列控制切换按钮 */
.column-toggle-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: white;
    transition: opacity 0.2s ease;
    user-select: none;
    outline: none;
}

/* 未选中状态：浅蓝色背景 */
.column-toggle-btn:not(.checked) {
    background-color: #87CEEB;
}

/* 选中状态：深蓝色背景 */
.column-toggle-btn.checked {
    background-color: #4169E1;
}

/* 悬停效果 */
.column-toggle-btn:hover {
    opacity: 0.85;
}

/* 当 radio-button-group-panel 在 hide_and_sort_btn_controls 内时，移除其自身的padding和margin，保持高度一致 */
.hide_and_sort_btn_controls .radio-button-group-panel.no-panel-padding {
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
}

