*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background-color: #0b0e11; /* Binance 深色背景 */
  color: #eaecef;
}

body {
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* 防止任何元素在移动端横向溢出 */
}

/* SPA 根容器：让当前页面主体撑满剩余空间，保证页脚贴底 */
#spa-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 允许内部页面控制自身滚动 */
}

#spa-root > [data-page] {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 避免内容把父容器高度撑大，保证内部滚动生效 */
}

.header {
  display: flex;
  justify-content: flex-start;  /* PC 端标题 + 导航靠左 */
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2b3139;
  background-color: #181a20;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.1rem;  /* 缩小侧滑按钮与标题之间的间距 */
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-left h1 {
  margin: 0;
}

.header-logo-wrap {
  display: flex;
  align-items: center;
}

.header-logo {
  display: block;
  height: 44px;
  width: auto;
}

.header-auth-btn {
  border: 1px solid #f0b90b;
  background: #f0b90b;
  color: #111827; /* 文字与图标统一为深色填充 */
  cursor: pointer;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.header-auth-btn:hover {
  background-color: #fcd535;
  border-color: #fcd535;
}

/* 顶部右侧“回币安主站”按钮：使用次级样式，避免与登录按钮视觉冲突 */
.header-auth-btn--secondary {
  background: transparent;
  border-color: #4b5563;
  color: #e5e7eb;
}

.header-auth-btn--secondary:hover {
  background: #111827;
  border-color: #6b7280;
}

.header-auth-icon {
  font-size: 1.15rem;
  color: inherit; /* 文本类图标仍使用当前颜色 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-auth-icon img {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.header-auth-text {
  font-size: 0.8rem;
}

.symbol-highlight {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f0b90b; /* Binance 主题黄 */
}

.subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav-link {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.header-nav-link:hover {
  color: #fcd535;
}

.header-nav-link--active {
  color: #f0b90b;
  font-weight: 600;
}

.header-menu-btn {
  display: none;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: auto;
}

.nav-drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
  justify-content: flex-start; /* 侧滑面板固定在左侧 */
}

.nav-drawer--open {
  display: flex;
}

.nav-drawer-backdrop {
  flex: 1;
  background-color: rgba(0, 0, 0, 0.5);
}

/* 避免 SPA 在强制刷新时出现多页面闪现：仅显示带 .spa-active 的 data-page */
#spa-root > [data-page]:not(.spa-active) {
  display: none;
}

/* 首屏防闪烁：初始隐藏 index.html 的主体，待 JS 初始化完再淡入 */
body.page-init-hide {
  opacity: 0;
  visibility: hidden;
}

body:not(.page-init-hide) {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease-out;
}

.nav-drawer-panel {
  width: 220px;
  background-color: #181a20;
  border-right: 1px solid #2b3139;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform: translateX(-100%);
  transition: transform 0.2s ease-out;
}

.nav-drawer--open .nav-drawer-panel {
  transform: translateX(0);
}

.nav-drawer-link {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-drawer-link:hover {
  color: #fcd535;
}

.nav-drawer-link--active {
  color: #f0b90b;
  font-weight: 600;
}

.nav-drawer-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e5e7eb;
  text-align: left;      /* 标题居左显示 */
  width: 100%;
  margin-bottom: 0.5rem;
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;         /* 增大导航项上下间距 */
  align-items: flex-start; /* 导航项整体居左 */
}

.nav-drawer-link {
  text-align: left;     /* 导航文字居左 */
  font-size: 1.05rem;   /* 导航文字略放大 */
}

.nav-drawer-link--button {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-drawer-link--button:hover {
  color: #fcd535;
}

.lang-switch,
.auth-lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.lang-switch {
  margin-right: 12px;
}

.lang-select {
  margin-right: 12px;
  border: 1px solid rgba(240, 185, 11, 0.5);
  background: #111827;
  color: #e5e7eb;
  padding: 4px 28px 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23F0B90B' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 8px;
}

.lang-select:focus {
  outline: none;
  border-color: #f0b90b;
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.25);
}

.lang-select:hover {
  border-color: #fcd535;
}

.lang-select option {
  color: #111;
}

.nav-drawer-lang {
  width: 100%;
}

.lang-select--drawer {
  width: 100%;
  margin-right: 0;
}

.auth-lang-switch {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 2px 4px;
}

.lang-btn--active {
  font-weight: 600;
  text-decoration: underline;
}

.lang-sep {
  opacity: 0.6;
}

/* PC 端：在保持按钮与标题紧凑的同时，拉开标题与导航的间距 */
@media (min-width: 769px) {
  .header-nav {
    margin-left: 4.8rem;  /* 加宽标题与导航之间的间距（仅 PC 端） */
  }
}

.status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background-color: #6b7280;
}

.status-dot--idle {
  background-color: #6b7280;
}

.status-dot--ok {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.status-dot--error {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.timestamp {
  display: flex;
  align-items: center;
  gap: 0.05rem; /* 减小“下次更新：”与倒计时之间的间距 */
}

.timestamp span:last-child {
  color: #9ca3af;
}

.timestamp #last-update {
  display: inline-block;
  width: 0.5ch;       /* 稍微缩短固定宽度，减少视觉空隙 */
  text-align: right;
}

.layout {
  flex: 1;
  min-height: 0;              /* 允许内部 panel 控制自身滚动，而不是撑开整页 */
  display: flex;
  justify-content: center;
  padding: 1.25rem 2rem 1.25rem;  /* 上下间距保持一致，避免主体与 header/footer 视觉不对称 */
}

.layout-column {
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 769px) {
  .layout-column {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .layout {
    min-height: 0;
    padding: 0.75rem 1rem 0.75rem;  /* 移动端同样保持上下间距一致 */
  }
}

.panel {
  background-color: #181a20;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem 0.9rem;
  border: 1px solid #2b3139;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 980px;
  width: 100%;
}

.signal-panel {
  margin-bottom: 1rem;
}

.signal-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.signal-panel-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.signal-more-btn {
  border-radius: 999px;
  border: 1px solid #334155;
  background-color: transparent;
  color: #eaecef;
  font-size: 0.75rem;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.signal-more-btn:hover {
  border-color: #f0b90b;
  color: #fcd535;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.signal-card {
  border-radius: 0.6rem;
  border: 1px solid #2b3139;
  background: #15171d;
  padding: 0.6rem 0.7rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}

.signal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.signal-symbol {
  font-size: 0.9rem;
  font-weight: 600;
  color: #eaecef;
}

.signal-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.signal-badge--long {
  background: rgba(14, 203, 129, 0.15);
  color: #0ecb81;
  border: 1px solid rgba(14, 203, 129, 0.4);
}

.signal-badge--short {
  background: rgba(246, 70, 93, 0.15);
  color: #f6465d;
  border: 1px solid rgba(246, 70, 93, 0.4);
}

.signal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.signal-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
}

.signal-meta-label {
  color: #848e9c;
}

.signal-meta-value {
  color: #eaecef;
  font-weight: 500;
}

.signal-time {
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 0;
  line-height: 1.2;
}

.signal-empty {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 0.6rem;
  padding: 1.2rem 0.8rem;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.signal-empty-icon {
  width: 40px;
  height: 40px;
  color: rgba(148, 163, 184, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.signal-empty-icon svg {
  width: 100%;
  height: 100%;
}

.signal-empty-text {
  font-size: 0.85rem;
}

#signal-empty {
  display: none;
}

.signal-panel #home-signal-empty {
  display: none;
  margin-top: 0.6rem;
}

.signal-empty--panel {
  margin-top: 0.6rem;
  min-height: 180px;
  justify-content: center;
}


.signal-pagination {
  margin-top: 0.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.signal-page-btn {
  border-radius: 999px;
  border: 1px solid #334155;
  background-color: transparent;
  color: #eaecef;
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}

.signal-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.signal-page-info {
  font-size: 0.75rem;
  color: #6b7280;
}

.index-panel {
  border-top: 2px solid #f0b90b; /* 顶部加一条 Binance 黄强调线 */
}

/* 首页：列表区域可滚动，整体卡片高度不超过可用空间 */
.index-panel {
  flex: 1;
  min-height: 0; /* 允许内部滚动而不是撑开父容器 */
  min-height: 680px; /* 提升首页卡片高度，显示更多内容 */
}

.index-table-wrapper {
  flex: 1;
  min-height: 0;
  margin-top: 0.15rem;
  overflow-y: auto;
}

.analysis-layout {
  padding-top: 1.5rem;
}

.analysis-panel {
  max-width: 1120px;
  padding-bottom: 0.4rem;  /* 减小底部内边距，让分页更贴近卡片底部 */
}

.analysis-main {
  display: flex;
  gap: 0;               /* 分割线两侧间距由 padding 控制 */
  margin-top: 0.25rem;
  min-height: 0;        /* 允许左右两侧内部滚动而不是撑开卡片 */
}

.analysis-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #2b3139;
  padding-right: 0.5rem;  /* 分割线左侧间距 */
  margin-right: 0;        /* 不额外增加外边距 */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.analysis-sidebar-header {
  font-size: 0.8rem;
  color: #848e9c;
  margin-bottom: 0.5rem;
}

.symbol-sidebar-search {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.3rem 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(75, 85, 99, 0.8);
  background-color: #181a20;
  color: #eaecef;
  font-size: 0.8rem;
}

.symbol-sidebar-search:focus {
  outline: none;
  border-color: #f0b90b;
}

.symbol-sidebar-list {
  flex: 1 1 auto;        /* 在侧边栏中占据剩余高度 */
  min-height: 0;
  overflow-y: auto;      /* 仅在内部滚动 */
  padding-right: 0.25rem;
}

/* ---- 关于我们页面专用布局修正 ------------------------------------------ */

/* About 页不需要内部主区域撑满整页高度，使用普通文档流避免页脚与主体内容重叠 */
[data-page="about"] {
  flex: 0 0 auto;
}

[data-page="about"] .layout {
  flex: 0 0 auto;
  display: block;
  padding-bottom: 1.5rem; /* 主体与页脚之间预留空间，避免视觉挤压 */
}

[data-page="about"] .panel {
  max-width: 980px;
  margin: 0 auto;          /* 在桌面端水平居中主体卡片 */
}

[data-page="about"] > .footer {
  margin-top: 0.5rem; /* 与主体内容适当分隔 */
}

/* ---- 首页布局修正：允许页面整体纵向滚动 ------------------------------ */
[data-page="home"] {
  flex: 0 0 auto;
}

[data-page="home"] .layout {
  flex: 0 0 auto;
}

[data-page="home"] .index-panel,
[data-page="home"] .signal-panel {
  flex: 0 0 auto;
}

[data-page="home"] .index-table-wrapper {
  flex: 0 0 auto;
  overflow-y: visible;
}

/* ---- 信号页布局 ----------------------------------------------------- */
[data-page="signals"] .layout {
  flex: 1 1 auto;
  padding-top: 1.5rem;
  align-items: center;
}

[data-page="signals"] .signal-page-panel {
  max-width: 1120px;
  width: 100%;
  height: calc(100vh - 220px);
}

[data-page="signals"] .signal-page-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

[data-page="signals"] .signal-grid {
  align-content: start;
}

[data-page="signals"] .signal-more-btn {
  display: none;
}

.symbol-sidebar-item {
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  border: none;
  background: transparent;
  color: #eaecef;
  font-size: 0.82rem;
  cursor: pointer;
}

.symbol-sidebar-item:hover {
  background-color: #2b3139;
}

.symbol-sidebar-item.active {
  background-color: #2b3139;
  color: #f0b90b;
}

.analysis-content {
  flex: 1 1 auto;       /* 右侧内容区域占据除侧边栏外的全部空间 */
  min-width: 0;
  padding-left: 1rem;   /* 分割线右侧间距，与左侧保持一致 */
  display: flex;
  flex-direction: column;
  min-height: 0;        /* 允许内部 section 控制自身高度与滚动 */
}

.panel h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 500;
  color: #eaecef;
  text-align: left;
}

.panel .subtitle-inline {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #848e9c;
  text-align: left;
  max-width: 100%;
  word-break: break-word;
}

/* ---- 首页：ticker 详情展开区域 --------------------------------------------- */

.detail-row {
  background-color: #15171d;
}

.detail-cell {
  padding: 0.5rem 0.75rem 0.7rem;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.detail-line {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  align-items: baseline;
}

.detail-item--right {
  margin-left: auto;
  text-align: right;
}

.detail-item-label {
  display: inline;
  color: #848e9c;
  margin-right: 0.15rem;
}

.detail-item-value {
  display: inline;
  font-weight: 500;
}

/* Binance 风格的红跌绿涨配色 */
.detail-item-value--up {
  color: #0ecb81;
}

.detail-item-value--down {
  color: #f6465d;
}

.row-expand-icon {
  display: inline-block;
  margin-right: 0.3rem;
  font-size: 0.75rem;
  color: #9ca3af;
  cursor: pointer;
}

/* PC 端：四个 ticker 字段在一行等宽显示 */
@media (min-width: 769px) {
  .detail-content {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 1.75rem;
    row-gap: 0.25rem;
  }

  .detail-line {
    display: contents; /* 让内部的 detail-item 直接参与网格布局 */
  }

  .detail-item {
    justify-content: center;
    text-align: center;
  }

  /* PC 端：通过显式类控制左右对齐 */
  .detail-item--left {
    justify-content: flex-start;
    text-align: left;
  }

  .detail-item--right {
    justify-content: flex-end;
    text-align: right;
  }
}

/* 移动端：每行第二个 ticker 项目靠右，其余保持默认（靠左） */
@media (max-width: 768px) {
  .detail-line .detail-item:last-child {
    margin-left: auto;
    text-align: right;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.75rem 0.25rem; /* 所有页面在移动端统一 header 左右内边距 */
  }

  .header-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  /* 分析页移动端：主内容区左右内边距仅由 panel 控制，避免整体偏右 */
  .page-analysis .analysis-content {
    padding-left: 0;
  }

  .header-auth-btn {
    padding: 0.15rem 0.6rem;
    gap: 0.15rem;
    margin-right: 0;
    font-size: 0.72rem;
  }

  .header-auth-icon {
    font-size: 0.95rem;
  }

  .header-auth-text {
    font-size: 0.72rem;
  }

  .panel .subtitle-inline {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  /* 首页移动端：隐藏顶部导航，使用侧滑菜单 */
  .header-nav {
    display: none;
  }

  .header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-logo {
    height: 40px; /* 移动端放大 Logo 尺寸，提升品牌识别度 */
  }

  .header-right .header-auth-btn {
    order: 1;
  }

  .header-right .lang-select {
    display: none;
  }
}

.title-dropdown-icon {
  display: inline-block;
  margin-left: 0.1rem;
  font-size: 1.2rem;
  color: #9ca3af;
  cursor: pointer;
}

.symbol-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.symbol-modal {
  width: 320px;
  max-width: 90%;
  height: 70vh;       /* 固定高度，内部列表滚动 */
  max-height: 480px;  /* 上限，避免超出小屏 */
  background-color: #181a20;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.9);
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.symbol-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.symbol-modal-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.symbol-modal-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.1rem;
  cursor: pointer;
}

.symbol-modal-close:hover {
  color: #e5e7eb;
}

.symbol-search-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(75, 85, 99, 0.8);
  background-color: #020617;
  color: #e5e7eb;
  font-size: 0.85rem;
}

.symbol-search-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.symbol-list {
  margin-top: 0.4rem;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.symbol-list-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.85rem;
  cursor: pointer;
}

.symbol-list-item:hover {
  background-color: rgba(55, 65, 81, 0.85);
}

.symbol-list-empty {
  font-size: 0.8rem;
  color: #6b7280;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table thead {
  background-color: #1f2128;
}

.table th,
.table td {
  padding: 0.55rem 0.75rem;
  text-align: center;
}

.table td:first-child a {
  color: inherit;
  text-decoration: none;
}

.table td:first-child a:hover {
  text-decoration: underline;
}

.table th {
  font-weight: 500;
  color: #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table th.sortable {
  cursor: pointer;
  user-select: none;
}

.sort-indicator {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  color: #9ca3af;
}

.table th.sortable.active .sort-indicator {
  color: #fbbf24;
}

.table tbody tr:nth-child(even) {
  background-color: #181a20;
}

.table tbody tr:nth-child(odd) {
  background-color: #15171d;
}

.table tbody tr:hover {
  background-color: #2b3139;
}

.row-changed {
  animation: row-flash 0.8s ease-out;
  background-color: rgba(250, 204, 21, 0.4); /* 立即给予明显高亮底色 */
}

@keyframes row-flash {
  0% {
    background-color: rgba(250, 204, 21, 0.4); /* 柔和黄色高亮 */
  }
  100% {
    background-color: transparent;
  }
}

.table td.price--up {
  color: #22c55e;
}

.table td.price--down {
  color: #ef4444;
}

.table td.volume {
  color: #38bdf8;
}

.empty-row {
  text-align: center !important;
  color: #6b7280;
}

.actions-col {
  text-align: right;
  width: 5.25rem;
}

/* 调整排行榜各列宽度，让各列在 PC 端分布合理 */
.col-symbol {
  width: 26%;
}

.col-price {
  width: 24%;
}

.col-volume {
  width: 24%;
}

.col-actions {
  width: 5.25rem; /* 与 .actions-col 对齐，略微缩窄 */
}

/* 交易对列居左，操作列居右，其余保持居中 */
.table thead th:first-child,
.table tbody td:first-child {
  text-align: left;
}

.table thead th.actions-col,
.table tbody td:last-child {
  text-align: right;
}

.activity-score {
  font-weight: 600;
}

.activity-score--purple {
  color: #a855f7; /* ≥80 */
}

.activity-score--green {
  color: #22c55e; /* ≥60 */
}

.activity-score--yellow {
  color: #facc15; /* ≥40 */
}

.activity-score--gray {
  color: #9ca3af; /* <40 */
}

/* 移动端下进一步收紧排行榜表格，避免任何横向溢出 */
@media (max-width: 768px) {
  .panel.index-panel {
    max-width: 100%;
    padding: 0.75rem 0.75rem 0.75rem;
  }

  .panel.index-panel .table {
    table-layout: fixed;
  }

  .panel.index-panel .table th,
  .panel.index-panel .table td {
    padding: 0.4rem 0.4rem;
  }

  .panel.index-panel .col-symbol,
  .panel.index-panel .col-price,
  .panel.index-panel .col-volume,
  .panel.index-panel .col-actions {
    width: auto;
  }

  .panel.index-panel .actions-col {
    width: auto;
    white-space: nowrap;
  }

  /* 首页移动端：缩小“捕捉信号”按钮尺寸与文字 */
  .panel.index-panel .analyze-btn {
    padding: 0.18rem 0.6rem;
    font-size: 0.7rem;
  }

  /* 首页移动端：交易对名称过长时自动缩小字号，防止布局错乱 */
  .panel.index-panel .symbol-text--small {
    font-size: 0.5rem;
  }

  .signal-panel {
    padding: 0.75rem 0.75rem 0.75rem;
    margin-bottom: 0.75rem;
  }

  .signal-panel-header {
    align-items: flex-start;
  }

  .signal-more-btn {
    padding: 0.15rem 0.6rem;
    font-size: 0.72rem;
  }

  .signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .signal-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .signal-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

.analyze-btn {
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #474d57;
  background: transparent;
  color: #eaecef;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.analyze-btn:hover {
  background-color: #2b3139;
  border-color: #848e9c;
}

.analyze-btn.primary {
  border-color: #f0b90b;
  background: #f0b90b;
  color: #181a20;
  font-weight: 600;
}

.analyze-btn.primary:hover {
  background-color: #fcd535;
  border-color: #fcd535;
  box-shadow: 0 0 12px rgba(252, 213, 53, 0.45);
}

.analysis-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem; /* 扩大“开始分析”和“行情”按钮之间的间距 */
}

.analysis-actions .analyze-btn {
  min-width: 5.5rem;  /* 统一按钮宽度 */
  text-align: center;
}

.analysis-header-right {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.symbol-menu-btn {
  display: none;
  border: none;
  background: transparent;
  color: #eaecef;
  font-size: 1.1rem;
  cursor: pointer;
}

/* 移动端：隐藏内容区域中的按钮，仅保留标题栏右上角按钮 */
@media (max-width: 768px) {
  .analysis-header-right .header-market-btn {
    min-width: 5.5rem;
    text-align: center;
  }

  #btn-open-market {
    display: none;
  }

   .symbol-menu-btn {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     margin-right: 0.25rem;
   }
}

.analysis-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.analysis-history {
  min-height: 3rem;
  border-radius: 0.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  padding: 0.75rem;
  font-size: 0.85rem;
  color: #9ca3af;
  overflow-x: hidden; /* 防止内部内容撑破虚线边框 */
  box-sizing: border-box;          /* 计算高度时包含内边距与边框 */
  flex: 1 1 auto;                  /* 在右侧内容列中占据可用高度 */
  width: 100%;                     /* 宽度沾满当前内容列（analysis-content） */
  overflow-y: auto;                /* 内容过长时仅在列表内部滚动 */
}

.analysis-section {
  max-width: 100%;  /* 右侧内容区域在 PC 端占满可用宽度 */
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;          /* 顺序：头部 → 筛选 → 历史列表 → 分页 */
  flex: 1 1 auto;
  min-height: 0;                   /* 允许历史列表内部滚动，而不是撑开卡片 */
}

.analysis-header-row {
  display: flex;
  justify-content: space-between; /* 左边标题，右边按钮 */
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.analysis-history-filters {
  display: flex;
  justify-content: flex-start;   /* 按钮靠左水平排布 */
  flex: 0 0 auto;                /* 防止被历史详情挤压 */
  flex-shrink: 0;
  gap: 0.4rem;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem; /* 与下方历史列表保持间距 */
  font-size: 0.78rem;
  color: #9ca3af;
}

.analysis-date-btn {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid #334155;
  background-color: transparent;
  color: #e5e7eb;
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.analysis-date-btn--active {
  border-color: #f0b90b;
  background-color: rgba(240, 185, 11, 0.08);
  color: #fcd535;
}

.analysis-history-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;                /* 防止被历史详情挤压 */
  flex-shrink: 0;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.analysis-page-btn {
  border-radius: 999px;
  border: 1px solid #334155;
  background-color: transparent;
  color: #e5e7eb;
  font-size: 0.78rem;
  padding: 0.15rem 0.7rem;
  cursor: pointer;
}

.analysis-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.analysis-page-info {
  font-size: 0.78rem;
  color: #6b7280;
}

@media (max-width: 768px) {
  .analysis-section {
    max-width: 100%; /* 移动端占满可用宽度 */
  }

  .analysis-main {
    flex-direction: column;
  }

  .analysis-sidebar {
    display: none; /* 移动端隐藏左侧固定交易对列表，仅通过侧滑菜单切换 */
  }

  .analysis-history-filters {
    flex-wrap: nowrap;           /* 保持一行显示 */
    overflow-x: auto;            /* 宽度不足时支持横向滚动 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;       /* Firefox 隐藏滚动条 */
    -ms-overflow-style: none;    /* IE/Edge 隐藏滚动条 */
  }

  .analysis-history-filters::-webkit-scrollbar {
    height: 0;                   /* WebKit 内核隐藏水平滚动条 */
  }
}

.analysis-history-item {
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(55, 65, 81, 0.8);
}

.analysis-history-item:last-child {
  border-bottom: none;
}

.analysis-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.analysis-history-header:hover {
  color: #e5e7eb;
}

.analysis-history-summary {
  flex-shrink: 0;
  max-width: 50%;
  font-size: 0.8rem;
  color: #6b7280;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-align: right;
}

.analysis-history-body {
  margin: 0.25rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background-color: rgba(15, 23, 42, 0.9);
  font-family: inherit; /* 使用页面正文字体，便于阅读 markdown */
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;     /* 防止长单词或长行撑破布局 */
  overflow-wrap: break-word;  /* 兼容性更好的换行控制 */
  overflow-x: hidden;         /* 不允许横向内容溢出边框 */
  max-width: 100%;            /* 绝不超过卡片宽度/屏幕宽度 */
  box-sizing: border-box;     /* 包含内边距在内计算宽度 */
  overflow-y: visible;        /* 详情高度自适应，由外层容器控制滚动 */
}

.analysis-history-body h1,
.analysis-history-body h2,
.analysis-history-body h3,
.analysis-history-body p {
  margin: 0 0 0.35rem;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;  /* 垂直居中 */
  transform: translateX(-50%) translateY(-40%);
  background-color: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
  z-index: 2000;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-50%);
}

/* 登录提示弹窗 */
.login-dialog-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}

.login-dialog {
  width: 100%;
  max-width: 340px;
  background-color: #181a20;
  border-radius: 0.75rem;
  border: 1px solid #2b3139;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
  padding: 1.1rem 1.3rem 0.7rem;  /* 底部内边距略减小，让按钮更贴近底部 */
  min-height: 160px;              /* 提升整体高度，避免显得过于紧凑 */
  display: flex;
  flex-direction: column;
}

.login-dialog-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #eaecef;
  text-align: center;
}

.login-dialog-text {
  margin: 1rem 0 0.75rem;
  font-size: 0.9rem;
  color: #e5e7eb;
  text-align: left;
}

.login-dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;      /* 将按钮区域推到底部 */
}

.login-dialog-actions .auth-secondary,
.login-dialog-actions .auth-submit {
  flex: 0 0 auto;            /* 不再拉伸占满整行 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.78rem;
  padding: 0.32rem 0.75rem;  /* 收窄按钮，避免过长 */
  min-width: 4.6rem;         /* 两个按钮宽度接近、看起来更协调 */
  width: auto;               /* 覆盖 .auth-submit 的 width:100%，防止溢出弹窗 */
  margin-top: 0;             /* 覆盖 .auth-submit 的 margin-top，保持高度一致 */
  line-height: 1;            /* 统一行高 */
}

/* 风险声明弹窗 */
.risk-dialog-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2200;
}

.risk-dialog {
  width: min(420px, calc(100% - 2rem)); /* 移动端左右保留 1rem 间距 */
  background-color: #111827;
  border-radius: 0.9rem;
  border: 1px solid #374151;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.9);
  padding: 1.1rem 1.3rem 1rem;
}

.risk-dialog-title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f9fafb;
}

.risk-dialog-text {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: #9ca3af;
  line-height: 1.8;  /* 加大行间距，提升可读性 */
}

.risk-dialog-text strong {
  color: #e5e7eb;
}

.risk-dialog-list {
  margin: 0 0 0.9rem;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

.risk-dialog-list li + li {
  margin-top: 0.3rem;
}

.risk-dialog-actions {
  display: flex;
  justify-content: space-between;  /* 左右两端对齐：左“离开本站”，右“我已知晓并同意” */
  gap: 0.75rem;
}

.risk-dialog-actions .auth-secondary,
.risk-dialog-actions .auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;           /* 覆盖 .auth-submit 的 width:100%，避免过长 */
  min-width: 6.2rem;     /* 保持两个按钮宽度接近 */
  font-size: 0.78rem;
  padding: 0.35rem 0.8rem;
  line-height: 1;        /* 统一行高，保证高度一致 */
  margin-top: 0;         /* 覆盖 .auth-submit 默认 margin-top */
}

.footer {
  padding: 0.5rem 2rem 0.75rem;
  border-top: 1px solid rgba(31, 41, 55, 0.85);
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  justify-content: center;  /* 默认居中（分析页等） */
  align-items: center;
  gap: 0.5rem;
}

.footer-index {
  justify-content: space-between; /* 左侧数据源，右侧下次更新 */
}

.footer-index .footer-timestamp {
  margin-left: auto;
}

@media (max-width: 768px) {
  .footer {
    flex-direction: column;
    gap: 0.25rem;
  }

  /* 首页在移动端仍保持左右分布的页脚布局 */
  .footer-index {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ---- 登录 / 注册页面样式 ----------------------------------------------- */

.page-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b0e11;
  padding: 1.5rem 1rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background-color: #181a20;
  border-radius: 0.9rem;
  border: 1px solid #2b3139;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  padding: 1.5rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1rem;
}

.auth-header {
  text-align: center;
}

.auth-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #eaecef;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: #9ca3af;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.25rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-field-inline {
  flex-direction: row;
  align-items: flex-end;
  gap: 0.6rem;
}

.auth-field--grow {
  flex: 1 1 auto;
}

.auth-label {
  font-size: 0.78rem;
  color: #9ca3af;
}

.auth-field input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(75, 85, 99, 0.9);
  background-color: #020617;
  color: #eaecef;
  font-size: 0.85rem;
}

.auth-field input::placeholder {
  color: #4b5563;
}

.auth-field input:focus {
  outline: none;
  border-color: #f0b90b;
  box-shadow: 0 0 0 1px rgba(240, 185, 11, 0.5);
}

.auth-submit {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #f0b90b;
  background: #f0b90b;
  color: #181a20;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.05s ease;
}

.auth-submit:hover {
  background-color: #fcd535;
  border-color: #fcd535;
  box-shadow: 0 0 12px rgba(252, 213, 53, 0.45);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-secondary {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.auth-secondary:hover {
  background-color: #111827;
  border-color: #6b7280;
}

.auth-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.auth-link {
  color: #f0b90b;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-message {
  min-height: 1.1rem;
  margin-top: 0.25rem;
  font-size: 0.78rem;
}

.auth-message--error {
  color: #f97373;
}

.auth-message--success {
  color: #22c55e;
}

@media (max-width: 480px) {
  .auth-container {
    padding: 1.25rem 1.1rem 1.5rem;
  }

  .auth-field-inline {
    flex-direction: row;      /* 移动端验证码输入与按钮同一行显示 */
    align-items: flex-end;
  }

  .auth-secondary {
    width: auto;
    text-align: center;
  }
}

/* ---- 用户账户页面 ----------------------------------------------------- */

.user-card {
  max-width: 480px;
}

.user-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.user-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #facc15, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827; /* 与登录按钮中文字同色 */
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
}

.user-avatar img {
  width: 1.7rem;
  height: 1.7rem;
  display: block;
}

.user-meta {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2b3139;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.user-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.user-meta-label {
  font-size: 0.78rem;
  color: #9ca3af;
}

.user-meta-value {
  font-size: 0.85rem;
  color: #eaecef;
}

.user-quota {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2b3139;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.user-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #eaecef;
}

.user-quota-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.user-quota-badge {
  min-width: 2.2rem;
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  background-color: rgba(34, 197, 94, 0.12);
  color: #34d399;
  text-align: center;
  font-weight: 600;
}

.user-quota-badge--paid {
  background-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.user-quota-suffix {
  color: #9ca3af;
}

.user-actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .user-actions {
    flex-direction: column;
  }
}
