/* Components — 仪表盘、卡片、按钮、表单 */
/* ============ 新布局样式 ============ */

/* 新首页容器 */
.new-home-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    padding-top: 0.5rem;
}

/* 主内容区域 */
.main-content-wrapper {
    display: flex;
    flex: 1;
    gap: 1.25rem;
    padding: 0 0.5rem;
}

/* 左侧导航（板块1） */
.left-sidebar {
    width: 230px;
    background: var(--surface);
    border-radius: 24px;
    padding: 1.6rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    align-self: flex-start;
}

.sidebar-kicker,
.section-kicker,
.resource-eyebrow,
.resource-card-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.sidebar-heading,
.section-heading {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
    text-decoration: none;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-weight: 600;
}

.sidebar-link:hover {
    background: rgba(15, 118, 110, 0.1);
    border-color: rgba(59, 130, 246, 0.16);
}

/* 右侧主内容区 */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ========== 仪表盘指标卡片 ========== */
.dashboard-header {
    margin-bottom: 1rem;
}
.dashboard-header .section-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.dashboard-header .section-subtitle {
    font-size: 0.75rem;
    color: var(--text-soft);
    margin-bottom: 0.7rem;
    font-weight: 500;
}
.dashboard-header h3 {
    font-size: 1.6rem;
    color: var(--text-main);
    font-weight: 700;
}
.dashboard-header .description {
    color: var(--text-soft);
    margin-bottom: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}
.metric-card:hover {
    border-color: var(--brand-2);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
#metric-kp .metric-icon { background: rgba(244,208,111,0.2); color: #f4d06f; }
#metric-dst .metric-icon { background: rgba(59,130,246,0.15); color: #3b82f6; }
#metric-f107 .metric-icon { background: rgba(251,146,60,0.2); color: #fb923c; }
#metric-tec .metric-icon { background: rgba(15,118,110,0.2); color: #0f766e; }
#metric-sw .metric-icon { background: rgba(147,197,253,0.2); color: #93c5fd; }
#metric-bz .metric-icon { background: rgba(192,132,252,0.2); color: #c084fc; }

.metric-body {
    flex: 1;
    min-width: 0;
}
.metric-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    display: block;
    line-height: 1.2;
}
.metric-desc {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.source-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    color: #22c55e;
    background: rgba(34,197,94,0.1);
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.25rem;
    vertical-align: middle;
}
.source-tag.sim {
    color: #f59e0b;
    background: rgba(245,158,11,0.12);
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--text-faint);
}
.dashboard-link {
    color: var(--brand-2);
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.dashboard-link:hover { gap: 0.6rem; }

/* ========== 数据源卡片 ========== */
.datasource-section { }
.datasource-section .section-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 0.7rem;
}
.datasource-section h3 {
    font-size: 1.6rem;
    color: var(--text-main);
    font-weight: 700;
}
.datasource-section .description {
    color: var(--text-soft);
    margin-bottom: 1rem;
}

.datasource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.datasource-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow-sm);
}
.datasource-card:hover { border-color: var(--border-strong); }
.ds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.ds-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}
.ds-status {
    font-size: 0.7rem;
    font-weight: 600;
}
.status-online { color: #22c55e; }
.status-offline { color: #ef4444; }
.ds-status i { font-size: 0.5rem; margin-right: 0.25rem; }
.ds-desc {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-bottom: 0.6rem;
    line-height: 1.5;
}
.ds-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ds-size {
    font-size: 0.75rem;
    color: var(--text-faint);
}
.ds-link {
    color: var(--text-faint);
    font-size: 0.85rem;
    transition: color 0.2s;
}
.ds-link:hover { color: var(--brand-2); }

/* ========== 模型预测入口卡片 ========== */
.predict-entry-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem 2rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.predict-entry-card:hover {
    border-color: var(--brand-2);
}
.predict-entry-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(59,130,246,0.12);
    color: var(--brand-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.predict-entry-body {
    flex: 1;
    min-width: 0;
}
.predict-entry-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-2);
    font-weight: 700;
}
.predict-entry-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}
.predict-entry-desc {
    font-size: 0.82rem;
    color: var(--text-soft);
    display: block;
    margin-top: 0.15rem;
}
.predict-entry-note {
    font-size: 0.65rem;
    color: var(--text-faint);
    display: block;
    margin-top: 0.3rem;
    line-height: 1.4;
}
.predict-entry-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-2);
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.predict-entry-card:hover .predict-entry-arrow {
    background: var(--brand-2);
    color: white;
    border-color: var(--brand-2);
}

/* 快捷导航双卡片 */
.quick-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 768px) {
    .quick-nav-grid { grid-template-columns: 1fr; }
}

/* 首页双栏布局 */
.home-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
}
@media (max-width: 768px) {
    .home-two-col { grid-template-columns: 1fr; }
}

/* 板块3：全球电子密度图 */
.section-3 {
    background: var(--surface);
    border-radius: 24px;
    padding: 1.8rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.ne-visualization {
    margin-top: 0;
}

.ne-visualization h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.9rem;
}

.ne-visualization .description {
    color: var(--text-soft);
    font-size: 0.98rem;
    margin-bottom: 1.4rem;
    max-width: 780px;
}

/* 时间选择器 */
.time-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.3rem;
    border-radius: 980px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    background: var(--text-main);
    color: var(--bg-main);
    border: none;
}
.play-btn:hover {
    background: var(--brand);
}

.forecast-toggle-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.forecast-toggle-btn:hover { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.06); }
.forecast-toggle-btn.active { background: rgba(59,130,246,0.13); border-color: #3b82f6; color: #3b82f6; }
.forecast-toggle-btn i { font-size: 0.75rem; }

/* ================================================================
   IRI 纬向剖面热力图
   ================================================================ */
.cross-section-panel {
    margin-top: 1rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0.8rem 1rem;
}
.cs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.cs-header h4 { margin: 0; font-size: 0.95rem; color: var(--text-main); }
.cs-info { font-size: 0.72rem; color: var(--text-faint); }
.cs-canvas-wrap {
    position: relative;
    background: #0a0a1a;
    border-radius: 8px;
    overflow: hidden;
}
.cs-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.cs-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

/* 全局数据源状态指示器 */
.global-data-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 14px;
    white-space: nowrap;
}
.global-data-status i { font-size: 0.5rem; }
.gds-real { background: rgba(34,197,94,0.12); color: #22c55e; }
.gds-derived { background: rgba(59,130,246,0.12); color: #3b82f6; }
.gds-sim { background: rgba(245,158,11,0.12); color: #f59e0b; }
.gds-offline { background: rgba(239,68,68,0.12); color: #ef4444; }

.time-selector select {
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: 980px;
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.time-selector select:hover {
    border-color: var(--text-soft);
}

/* 电子密度地图容器 */
.ne-map-container {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
}

/* 地图框架：经度标签 + (纬度标签 + canvas) */
.map-frame {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lon-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 2px 0 34px;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-soft);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    user-select: none;
}

.lon-labels span {
    text-align: center;
    min-width: 32px;
}

.map-row {
    display: flex;
    gap: 2px;
    flex: 1;
}

.lat-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-soft);
    text-align: right;
    padding: 1px 4px 1px 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    user-select: none;
}

.lat-labels span {
    line-height: 1;
}

.map-canvas-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}

#neMapCanvas {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--canvas-bg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

/* ===== 图例（彩色渐变条，与 getColor 热力图颜色一致） ===== */
.map-legend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0.6rem 0.5rem;
    margin-top: 8px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    min-width: 0;
    width: 60px;
}

.legend-title {
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--text-main);
    line-height: 1.1;
    text-align: center;
}

.legend-subtitle {
    font-size: 0.55rem;
    color: var(--text-faint);
    text-align: center;
    margin-bottom: 2px;
}

.legend-bar-wrap {
    display: flex;
    gap: 4px;
    align-items: stretch;
}

.legend-gradient {
    width: 16px;
    height: 140px;
    border-radius: 4px;
    background: linear-gradient(to top,
        #0d1b4d, #143689, #1d66c6, #2d97d6, #42bdbe,
        #57d08a, #7ddb4e, #aed822, #ddc015, #f4940f,
        #f85d14, #eb2a1e, #c80f23
    );
}

.legend-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-soft);
    font-family: "Segoe UI", system-ui, sans-serif;
    line-height: 1;
}

.legend-labels span {
    display: block;
}

.legend-note {
    font-size: 0.55rem;
    color: var(--text-faint);
    line-height: 1.3;
    text-align: left;
    border-top: 1px solid var(--border);
    padding-top: 0.25rem;
    margin-top: 0.2rem;
}

/* 当前时间显示 */
.current-time {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--brand);
    font-weight: bold;
}

.data-source-line {
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-bottom: 0.5rem;
}

/* 板块2：模型信息 */
.section-2 {
    background: var(--surface);
    border-radius: 24px;
    padding: 1.8rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.model-info {
    margin-top: 0;
}

.model-info h3 {
    color: var(--text-main);
    margin-bottom: 1.2rem;
    font-size: 1.8rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.info-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.info-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

.info-card h4 {
    color: var(--brand);
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 底部数据按钮（板块5） */
.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.6rem 2rem;
    background: var(--surface);
    border-radius: 24px;
    margin: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.bottom-bar-copy {
    max-width: 620px;
}

.bottom-bar-copy p:last-child {
    color: var(--text-soft);
    line-height: 1.6;
}

.data-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.data-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    padding: 0.9rem 1.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--brand);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
}

.data-btn:hover {
    background: var(--brand);
    color: #fff;
    border-color: transparent;
}

