/* ========================================
   Layout Styles - Topbar, Bottombar, Main, Section
   ======================================== */

/* Topbar - 顶部导航栏 */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: block;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: #ffffff;
  border-bottom: none;
  box-shadow: none;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.brand .logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  background-color: #fff;
  background-image: url('/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 4px 10px rgba(125,211,252,0.35);
}

.actions {
  display: flex;
  gap: 10px;
}

.actions .icon.bot {
  width: 26px; height: 26px;
  border-radius: 50%; border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  box-shadow: inset 0 1px rgba(255,255,255,0.70), 0 4px 12px var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
}

.actions .icon.bot:active { transform: translateY(1px); }

.actions .tg-user {
  margin-left: -5px;
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  line-height: 1;
  vertical-align: middle;
  transform: translateY(1px);
}

.actions .tg-user.active { color: var(--text); font-weight: 500; }

/* Main Content Area */
main {
  padding: 12px 12px;
  display: grid;
  gap: 16px;
  padding-top: calc(48px + 12px);
}

/* Section - 内容区块 */
.section {
  display: grid;
  gap: 10px;
}

/* X信号专用：缩小筛选与内容间距；同时让"重点关注"离顶部更多一些 */
.opinions-section { gap: 6px; margin-top: 2px; margin-bottom: -4px; }

/* 行情板块：增加顶部间距，减少与重点关注板块间距 */
.market-section { gap: 10px; margin-top: 8px; margin-bottom: -10px; }

/* 资源网络板块：增加顶部间距 */
.network-section { gap: 10px; margin-top: 10px; }

/* 认证横幅板块：调整上下间距 */
.verify-banner-section { margin-top: 12px; margin-bottom: 4px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.section-title-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.hl-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }

.hl-inline:hover { color: var(--text); }

.title-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-1);
  box-shadow: 0 0 0 6px rgba(125,211,252,0.22);
}

/* Bottom Navigation Bar - 底部导航栏 */
.bottombar {
  position: fixed;
  bottom: 20px; left: 20px; right: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(17, 24, 39, 0.12), 
              0 2px 8px rgba(17, 24, 39, 0.08),
              inset 0 1px rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  max-width: calc(100% - 40px);
  margin: 0 auto;
  gap: 4px;
}

.bottombar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  gap: 2px;
  cursor: pointer;
  color: var(--muted);
  transition: all 200ms ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 16px;
  position: relative;
}

.bottombar-item.active {
  color: var(--accent-2);
  background: rgba(167, 139, 250, 0.1);
}

.bottombar-item:hover:not(.active) {
  color: var(--text);
  background: rgba(17, 24, 39, 0.04);
}

.bottombar-item span {
  font-size: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.bottombar-item.active span {
  font-weight: 600;
}

/* 移动端视觉尺寸与安全区 */
@supports(padding: env(safe-area-inset-top)) {
  .topbar { padding-top: 0; }
  .topbar-inner { padding-top: calc(10px + env(safe-area-inset-top)); }
  .bottombar { 
    bottom: calc(20px + env(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@supports not (padding: env(safe-area-inset-top)) {
  main { padding-bottom: 80px; }
}

/* 小屏幕优化：减少底部间距 */
@media (max-width: 767px) {
  .bottombar {
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: calc(100% - 32px);
    border-radius: 18px;
    padding: 6px 12px;
  }
  .bottombar-item {
    padding: 6px 12px;
    border-radius: 14px;
  }
}


