
/* assets/custom.css */

body {
  background-color: #0F172A; 
  /* 全局应用 bg2.png，覆盖一层 88%~95% 的深蓝遮罩，使其变成淡淡的高级暗纹 */
  background-image: linear-gradient(rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.96)), url('/assets/bg2.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #F8FAFC;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.header-container {
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 0.55rem 1.5rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-title {
  margin: 0;
  color: #38BDF8; 
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.8px;
}

/* 1. 放大导航栏字体 */
.nav-link-custom {
  color: #CBD5E1;
  font-size: 1.05rem; /* 从 1.05rem 放大到 1.2rem */
  padding: 0.45rem 0.8rem;
  margin: 0 0.15rem;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 600; /* 加粗 */
  line-height: 1.25;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.nav-link-custom:hover, .nav-link-custom.active {
  color: #FFFFFF;
  background-color: rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}
.nav-link-custom.active { border-bottom: 2px solid #38BDF8; }

.main-container {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* --- 子页面通用组件设计 --- */

/* 限制所有子页面的宽度，防止过宽 */
.inner-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* 毛玻璃高级卡片效果，替代原有的死板框框 */
.glass-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3), 0 0 15px rgba(56, 189, 248, 0.1);
}

.glass-header {
  font-size: 1.5rem;
  font-weight: 700;
  color: #38BDF8;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

/* --- 首页样式保持不变 --- */
.hero-section {
  min-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 5%;
  background-image: radial-gradient(circle at center, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%), url('/assets/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 10;
}
.hero-title { font-size: 5rem; font-weight: 900; background: -webkit-linear-gradient(45deg, #38BDF8, #818CF8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem; text-align: center; }
.hero-subtitle { font-size: 1.35rem; color: #F8FAFC; text-align: center; max-width: 1000px; line-height: 1.7; margin: 0 auto 2.5rem auto; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
.search-container { display: flex; background: rgba(15, 23, 42, 0.7); border: 2px solid #38BDF8; border-radius: 60px; padding: 0.6rem; width: 100%; max-width: 1050px; margin: 0 auto 3.5rem auto; box-shadow: 0 0 25px rgba(56, 189, 248, 0.4); backdrop-filter: blur(10px); }
.search-input-hero { flex: 1; background: transparent !important; border: none !important; color: #FFFFFF !important; font-size: 1.35rem !important; padding: 0.8rem 2rem; outline: none !important; box-shadow: none !important; }
.search-input-hero::placeholder { color: #94A3B8; }
.search-btn-hero { background: linear-gradient(45deg, #0EA5E9, #2563EB); color: white; border: none; border-radius: 50px; padding: 1rem 3.5rem; font-size: 1.25rem; font-weight: bold; cursor: pointer; transition: all 0.3s ease; }
.search-btn-hero:hover { box-shadow: 0 0 20px #38BDF8; transform: scale(1.05); }
.module-btn { background: rgba(30, 41, 59, 0.6); border: 1px solid #334155; color: #E2E8F0; padding: 1.2rem 2.5rem; border-radius: 12px; font-size: 1.25rem; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; backdrop-filter: blur(8px); min-width: 200px; cursor: pointer; }
.module-btn:hover { background: rgba(56, 189, 248, 0.15); border-color: #38BDF8; color: #38BDF8; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(56, 189, 248, 0.2); }
.external-card { background: rgba(30, 41, 59, 0.5); border: 1px solid #1E293B; border-radius: 16px; padding: 1.8rem; text-decoration: none; color: #94A3B8; display: flex; flex-direction: column; transition: all 0.3s ease; height: 100%; }
.external-card:hover { background: rgba(30, 41, 59, 0.8); border-color: #38BDF8; transform: translateY(-5px); color: #E2E8F0; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); }
.external-title { font-size: 1.8rem; font-weight: 800; color: #38BDF8; margin-bottom: 1rem; }
.footer-container { text-align: center; padding: 2rem; color: #64748B; background-color: #0B1120; border-top: 1px solid #1E293B; }

/* 首页底部统计面板的毛玻璃效果 (默认暗黑模式) */
.stats-glass {
  width: 100%;
  max-width: 1000px;
  background: rgba(15, 23, 42, 0.65);
  padding: 30px;
  border-radius: 25px;
  border: 1px solid #1E293B;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  margin: 0 auto;
}

/* ========================================================= */
/* --- 追加：明亮主题 (Light Theme) 样式覆盖 --- */
/* ========================================================= */

body.light-theme {
  /* 全局底色：降低纯白比例，改用极浅的灰蓝色（Slate 100/200），降低刺眼感，凸显底图 */
  background-image: linear-gradient(rgba(241, 245, 249, 0.75), rgba(226, 232, 240, 0.9)), url('/assets/bg2.png');
  color: #0F172A;
}


body.light-theme .header-container { background-color: rgba(255, 255, 255, 0.85); border-bottom: 1px solid rgba(15, 23, 42, 0.1); }
body.light-theme .nav-link-custom { color: #475569; }
body.light-theme .nav-link-custom:hover, body.light-theme .nav-link-custom.active { color: #0284C7; background-color: rgba(14, 165, 233, 0.1); }
body.light-theme .nav-link-custom.active { border-bottom: 2px solid #0284C7; }

body.light-theme .glass-card { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(15, 23, 42, 0.1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); color: #1E293B; }
body.light-theme .glass-card:hover { border-color: rgba(14, 165, 233, 0.3); box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1), 0 0 15px rgba(14, 165, 233, 0.1); }
body.light-theme .glass-header { color: #0284C7; border-bottom: 1px solid rgba(15, 23, 42, 0.1); }
body.light-theme .text-muted, body.light-theme p, body.light-theme li { color: #475569 !important; }

body.light-theme .module-btn { 
  background: rgba(255, 255, 255, 0.85) !important; /* 晶莹的白底 */
  border: 2px solid rgba(14, 165, 233, 0.4) !important; /* 清新的浅蓝色边框 */
  color: #0F172A !important; 
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1) !important; /* 淡淡的蓝光阴影 */
}

/* 鼠标悬停时的加强发光效果 */
body.light-theme .module-btn:hover { 
  color: #0284C7 !important; 
  border-color: #0EA5E9 !important; /* 边框变亮 */
  background: rgba(14, 165, 233, 0.1) !important; 
  transform: translateY(-3px); 
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.25) !important; 
}

body.light-theme .theme-btn { color: #0F172A !important; }

/* === 首页亮色模式的专属文字变色 === */
.dynamic-subtitle { color: #F8FAFC; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
.dynamic-stat-num { color: #38BDF8; }
.dynamic-stat-label { color: #CBD5E1; }

body.light-theme .dynamic-subtitle { color: #334155 !important; text-shadow: none !important; }
body.light-theme .dynamic-stat-num { color: #0284C7 !important; }
body.light-theme .dynamic-stat-label { color: #64748B !important; font-weight: 600 !important; }
body.light-theme .hero-title { background: -webkit-linear-gradient(45deg, #0284C7, #4F46E5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* === 搜索栏亮色适配 === */
body.light-theme .search-container {
  background: rgba(255, 255, 255, 0.85); 
  border: 2px solid #0EA5E9; 
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.15); 
}
body.light-theme .search-input-hero { background: transparent !important; color: #0F172A !important; }
body.light-theme .search-input-hero::placeholder { color: #94A3B8 !important; }
body.light-theme #pos-input { background: rgba(255, 255, 255, 0.9) !important; color: #0F172A !important; border: 2px solid #0EA5E9 !important; }

/* ========================================================= */
/* --- 修复：Accordion 折叠面板样式优化 (完美适配暗黑/明亮) --- */
/* ========================================================= */

/* 1. 暗黑模式（默认）下的手风琴样式 */
.custom-accordion {
  /* 强制抹除 Bootstrap 5 的原生默认变量 */
  --bs-accordion-bg: transparent; 
  --bs-accordion-btn-bg: transparent;
}

.custom-accordion .accordion-item {
  background-color: transparent !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  margin-bottom: 0.8rem;
  border-radius: 10px !important;
  overflow: hidden;
}

.custom-accordion .accordion-button {
  background-color: rgba(15, 23, 42, 0.6) !important; /* 暗色半透明底色 */
  color: #F8FAFC !important;
  font-weight: 600;
  box-shadow: none !important;
  border: none !important;
}

.custom-accordion .accordion-button:not(.collapsed) {
  color: #38BDF8 !important; /* 展开时文字变亮青色 */
  background-color: rgba(56, 189, 248, 0.15) !important; /* 展开时背景泛出淡淡的蓝光 */
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.2) !important;
}

.custom-accordion .accordion-body {
  background-color: rgba(15, 23, 42, 0.3) !important; /* 内部面板底色更深邃 */
  color: #CBD5E1 !important;
  line-height: 1.8;
  border-top: 1px solid rgba(148, 163, 184, 0.1) !important;
}

/* 2. 亮色模式下的手风琴适配 */
body.light-theme .custom-accordion .accordion-item {
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
}

body.light-theme .custom-accordion .accordion-button {
  background-color: rgba(255, 255, 255, 0.8) !important;
  color: #0F172A !important;
}

body.light-theme .custom-accordion .accordion-button:not(.collapsed) {
  color: #0284C7 !important;
  background-color: rgba(14, 165, 233, 0.1) !important;
}

body.light-theme .custom-accordion .accordion-body {
  background-color: rgba(248, 250, 252, 0.6) !important;
  color: #475569 !important;
  border-top: 1px solid rgba(15, 23, 42, 0.1) !important;
}

/* ========================================================= */
/* --- 终极修复：首页底部统计面板 (明暗模式强制适配) --- */
/* ========================================================= */

/* 1. 暗黑模式（默认）下的样式 */
.stats-glass {
  background: rgba(15, 23, 42, 0.75) !important; 
  border: 1px solid #1E293B !important;
}
.dynamic-stat-num { color: #38BDF8 !important; }
.dynamic-stat-label { color: #CBD5E1 !important; }

/* 2. 亮色模式下的强制覆盖 */
body.light-theme .stats-glass {
  background: rgba(255, 255, 255, 0.85) !important; /* 强制变成白底半透明毛玻璃 */
  border: 1px solid rgba(14, 165, 233, 0.3) !important; /* 清新的浅蓝色边框 */
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.1) !important; /* 淡淡的蓝光阴影 */
}

body.light-theme .dynamic-stat-num { 
  color: #0284C7 !important; /* 数字变成深蓝色，避免刺眼 */
}

body.light-theme .dynamic-stat-label { 
  color: #334155 !important; /* 文字变成极深的灰黑色，绝对清晰 */
  font-weight: 700 !important; /* 字体加粗 */
}

#home-page-wrapper {
  background-color: #0F172A; /* 与暗黑模式底色一致，完美阻隔透视 */
  min-height: 100vh;
  width: 100%;
}

body.light-theme #home-page-wrapper {
  background-color: #F1F5F9; /* 铺一层实心浅灰底，彻底挡住 body 透过来的重影 */
}

body.light-theme .hero-section {
  background: 
    linear-gradient(rgba(174, 181, 189, 0.4), rgba(226, 232, 240, 0.55)),
    url('/assets/bg2.png') center center / cover no-repeat,
    #ffffff !important;
}

/* 为了保证首页下方的 External Resources 卡片区域不漏底，强制设为实心极浅灰 */
body.light-theme > div > div:nth-child(2) {
  background-color: #F8FAFC !important;
}

/* ========================================================= */
/* --- 修复：Analysis Workspace 标签页 (Tabs) 样式优化 --- */
/* ========================================================= */
.custom-tabs .nav-tabs {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  padding: 0 1rem;
}
.custom-tabs .nav-link {
  color: #94A3B8;
  border: none !important;
  padding: 1.2rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}
.custom-tabs .nav-link:hover { color: #38BDF8; }
.custom-tabs .nav-link.active {
  color: #38BDF8 !important;
  background: transparent !important;
  border-bottom: 3px solid #38BDF8 !important;
}

body.light-theme .custom-tabs .nav-tabs { background: rgba(241, 245, 249, 0.8); border-bottom-color: rgba(15, 23, 42, 0.1); }
body.light-theme .custom-tabs .nav-link { color: #64748B; }
body.light-theme .custom-tabs .nav-link.active { color: #0284C7 !important; border-bottom-color: #0284C7 !important; }

/* ========================================================= */
/* --- 修复：Markdown 代码块高亮与亮色适配 --- */
/* ========================================================= */
.markdown-code-block pre {
  background-color: #0B1120 !important; /* 暗色模式下：极深的 VS Code 背景 */
  border-radius: 8px !important;
  padding: 1.5rem !important;
  border: 1px solid #1E293B !important;
  color: #38BDF8 !important; /* 代码主色调变亮青色 */
  overflow-x: auto !important;
}

.markdown-code-block code {
  font-family: 'Fira Code', 'Consolas', monospace !important;
  font-size: 1.05rem !important;
}

/* API 文档下方普通文字的颜色保护 */
.markdown-code-block p, .markdown-code-block li {
  color: #CBD5E1 !important;
  line-height: 1.8 !important;
}
.markdown-code-block h3 {
  color: #F8FAFC !important;
}

/* --- 亮色模式下的强制反转 --- */
body.light-theme .markdown-code-block {
  background-color: transparent !important;
  border: none !important;
}

body.light-theme .markdown-code-block pre {
  background-color: #F8FAFC !important; /* 亮色模式下变为纯净浅灰白底 */
  border: 1px solid #CBD5E1 !important;
  color: #0369A1 !important; /* 亮色模式下代码变成深海蓝，绝对清晰 */
}

body.light-theme .markdown-code-block p, 
body.light-theme .markdown-code-block li {
  color: #334155 !important; /* 亮色模式下的普通文字变成极深灰，告别隐形！ */
}

body.light-theme .markdown-code-block h3 {
  color: #0F172A !important;
}

/* 修复下拉菜单（Dropdown）在全景图中的极简风格 */
.Select-control { background: transparent !important; border: 1px solid #38BDF8 !important; color: #fff !important;}
body.light-theme .Select-control { border: 1px solid #0284C7 !important; color: #0F172A !important; background: rgba(255,255,255,0.5) !important;}

/* ========================================================= */
/* --- 修复：Analysis Workspace 标签页 (Tabs) 样式优化 --- */
/* ========================================================= */
.custom-tabs .nav-tabs {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  padding: 0 1rem;
}
.custom-tabs .nav-link {
  color: #94A3B8;
  border: none !important;
  padding: 1.2rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}
.custom-tabs .nav-link:hover { color: #38BDF8; }
.custom-tabs .nav-link.active {
  color: #38BDF8 !important;
  background: transparent !important;
  border-bottom: 3px solid #38BDF8 !important;
}

body.light-theme .custom-tabs .nav-tabs { background: rgba(241, 245, 249, 0.8); border-bottom-color: rgba(15, 23, 42, 0.1); }
body.light-theme .custom-tabs .nav-link { color: #64748B; }
body.light-theme .custom-tabs .nav-link.active { color: #0284C7 !important; border-bottom-color: #0284C7 !important; }

/* ========================================================= */
/* --- 修复：Markdown 代码块高亮与亮色适配 --- */
/* ========================================================= */
.markdown-code-block pre {
  background-color: #0B1120 !important; /* 暗色模式下：极深的 VS Code 背景 */
  border-radius: 8px !important;
  padding: 1.5rem !important;
  border: 1px solid #1E293B !important;
  color: #38BDF8 !important; /* 代码主色调变亮青色 */
  overflow-x: auto !important;
}

.markdown-code-block code {
  font-family: 'Fira Code', 'Consolas', monospace !important;
  font-size: 1.05rem !important;
}

/* API 文档下方普通文字的颜色保护 */
.markdown-code-block p, .markdown-code-block li {
  color: #CBD5E1 !important;
  line-height: 1.8 !important;
}
.markdown-code-block h3 {
  color: #F8FAFC !important;
}

/* --- 亮色模式下的强制反转 --- */
body.light-theme .markdown-code-block {
  background-color: transparent !important;
  border: none !important;
}

body.light-theme .markdown-code-block pre {
  background-color: #F8FAFC !important; /* 亮色模式下变为纯净浅灰白底 */
  border: 1px solid #CBD5E1 !important;
  color: #0369A1 !important; /* 亮色模式下代码变成深海蓝，绝对清晰 */
}

body.light-theme .markdown-code-block p, 
body.light-theme .markdown-code-block li {
  color: #334155 !important; /* 亮色模式下的普通文字变成极深灰，告别隐形！ */
}

body.light-theme .markdown-code-block h3 {
  color: #0F172A !important;
}

/* ========================================================= */
/* --- 核弹级修复：下拉菜单 (Dropdown) 选项字体颜色强制统一 --- */
/* ========================================================= */

/* 1. 暗黑模式（默认）*/
.Select-control { 
  background-color: rgba(15, 23, 42, 0.6) !important; 
  border: 1px solid rgba(56, 189, 248, 0.5) !important; 
}
/* 强制选中框内的文字为白色 */
.Select-value-label, .Select-placeholder { color: #F8FAFC !important; } 

/* 强制下拉面板背景和文字 */
.Select-menu-outer {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  z-index: 9999 !important; /* 防止被其他图表遮挡 */
}
/* 不管它内部套了多少层 div 和 span，所有选项文字强制浅灰！ */
.Select-menu-outer div, .Select-menu-outer span {
  color: #94A3B8 !important;
}

/* 选项悬浮高亮 */
.Select-option:hover, .Select-option.is-focused, 
.Select-option:hover *, .Select-option.is-focused * {
  background-color: rgba(56, 189, 248, 0.2) !important;
  color: #38BDF8 !important;
}


/* 2. 明亮模式 (Light Theme) */
body.light-theme .Select-control { 
  background-color: rgba(255, 255, 255, 0.7) !important; 
  border: 1px solid #0EA5E9 !important; 
}
body.light-theme .Select-value-label, body.light-theme .Select-placeholder { 
  color: #0F172A !important; 
}

/* 亮色模式弹窗强制覆盖 */
body.light-theme .Select-menu-outer {
  background-color: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}
/* 所有选项文字强制深灰！ */
body.light-theme .Select-menu-outer div, body.light-theme .Select-menu-outer span {
  color: #334155 !important;
}

/* 选项悬浮高亮 (亮色) */
body.light-theme .Select-option:hover, body.light-theme .Select-option.is-focused,
body.light-theme .Select-option:hover *, body.light-theme .Select-option.is-focused * {
  background-color: rgba(14, 165, 233, 0.1) !important;
  color: #0284C7 !important;
}
/* =========================================================
   Homepage-only desktop scaling
   Only affects the homepage, not Plotly/query pages
   ========================================================= */
@media (min-width: 1200px) {
    #home-page-wrapper {
        zoom: 0.70;
    }
}
