* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 顶部导航 */
.header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: #fff;
  padding: 16px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
}

.header .nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.header .nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s;
}

.header .nav a:hover,
.header .nav a.active {
  background: rgba(255,255,255,0.2);
}

/* 面包屑 */
.breadcrumb {
  background: #fff;
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-size: 13px;
  color: #666;
}

.breadcrumb a {
  color: #2d5a87;
  text-decoration: none;
}

.breadcrumb .sep {
  margin: 0 8px;
  color: #ccc;
}

/* 页面标题 */
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title h2 {
  font-size: 20px;
  color: #1e3a5f;
}

.page-title .subtitle {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* Tab切换（中美区分） */
.tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.tabs .tab {
  flex: 1;
  padding: 10px 20px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  color: #666;
  transition: all 0.2s;
}

.tabs .tab:hover {
  color: #2d5a87;
}

.tabs .tab.active {
  background: #2d5a87;
  color: #fff;
  font-weight: 500;
}

.tabs .tab.active.cn { background: #c0392b; }
.tabs .tab.active.hk { background: #f39c12; }
.tabs .tab.active.us { background: #2980b9; }

/* 提示标签 */
.tip-box {
  background: #fff8e1;
  border-left: 4px solid #ffa000;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #666;
}

.tip-box strong {
  color: #c0392b;
}

/* 表格 */
.table-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: #f8f9fa;
}

th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  color: #1e3a5f;
  border-bottom: 2px solid #e9ecef;
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

tbody tr:hover {
  background: #f8f9fa;
}

/* 排名列 */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.rank-1 { background: linear-gradient(135deg, #ffd700, #ff9500); }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #8a8a8a); }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #8b4513); }
.rank-other { background: #adb5bd; color: #fff; }

/* 股票代码 */
.stock-code {
  font-family: 'Consolas', monospace;
  color: #2d5a87;
  font-weight: 500;
}

.stock-link {
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}
.stock-link:hover {
  color: #2d5a87;
  text-decoration: underline;
}
.stock-link .stock-code {
  margin-left: 4px;
}

/* 涨跌颜色 */
.up { color: #e74c3c; }
.down { color: #27ae60; }

/* 建议标签 */
.suggest-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.suggest-danger { background: #ffebee; color: #c0392b; }    /* 高风险 - 深红 */
.suggest-high   { background: #fff3e0; color: #e64a19; }    /* 中高风险 - 橙红 */
.suggest-warn   { background: #fffde7; color: #f57f17; }    /* 中风险 - 黄 */
.suggest-neutral { background: #e3f2fd; color: #1565c0; }
.suggest-good    { background: #e8f5e9; color: #2e7d32; }    /* 低风险 - 绿 */

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.pagination button {
  padding: 6px 14px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}

.pagination button:hover:not(:disabled) {
  border-color: #2d5a87;
  color: #2d5a87;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .info {
  font-size: 13px;
  color: #888;
}

/* 首页卡片 */
.home-hero {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: #fff;
  border-radius: 10px;
  margin-bottom: 30px;
}

.home-hero h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.home-hero p {
  font-size: 15px;
  opacity: 0.9;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card-item {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
  border-top: 4px solid #2d5a87;
}

.card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.card-item h3 {
  font-size: 17px;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.card-item p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.card-item .icon {
  font-size: 32px;
  margin-bottom: 12px;
}

/* 首页排行榜板块 */
.ranking-section {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 24px;
  overflow: hidden;
  border-top: 4px solid #2d5a87;
}

.ranking-section.ranking-red { border-top-color: #c0392b; }
.ranking-section.ranking-orange { border-top-color: #e67e22; }
.ranking-section.ranking-yellow { border-top-color: #f39c12; }
.ranking-section.ranking-blue { border-top-color: #3498db; }
.ranking-section.ranking-purple { border-top-color: #9b59b6; }

.ranking-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.ranking-header h2 {
  font-size: 16px;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-header h2 .emoji {
  font-size: 20px;
}

.ranking-header .view-all {
  font-size: 13px;
  color: #2d5a87;
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid #2d5a87;
  border-radius: 4px;
  transition: all 0.2s;
}

.ranking-header .view-all:hover {
  background: #2d5a87;
  color: #fff;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mini-table th {
  background: #f8f9fa;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  border-bottom: 1px solid #eee;
}

.mini-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f5f5f5;
}

.mini-table tr:hover {
  background: #f8f9fa;
}

.mini-table tr:last-child td {
  border-bottom: none;
}

.mini-table .rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  font-size: 11px;
  font-weight: 600;
}

.mini-table .rank-1 { background: #f1c40f; color: #fff; }
.mini-table .rank-2 { background: #bdc3c7; color: #fff; }
.mini-table .rank-3 { background: #cd7f32; color: #fff; }

.mini-table .stock-code {
  color: #999;
  font-size: 12px;
  margin-left: 4px;
}

.mini-table .value-up {
  color: #c0392b;
  font-weight: 600;
}

.mini-table .value-down {
  color: #27ae60;
  font-weight: 600;
}

.mini-table .amount {
  font-weight: 600;
  color: #1e3a5f;
}

.mini-table .ratio-bar {
  position: relative;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}

.mini-table .ratio-fill {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #f39c12);
  border-radius: 3px;
}

.mini-table .ratio-low .ratio-fill {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.mini-table .ratio-high .ratio-fill {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #fff;
  color: #1e3a5f;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-btn.cn.active { color: #c0392b; }
.tab-btn.hk.active { color: #e67e22; }
.tab-btn.us.active { color: #3498db; }

/* 页脚 */
.footer {
  text-align: center;
  padding: 24px;
  color: #999;
  font-size: 12px;
  margin-top: 40px;
  clear: both;
  width: 100%;
  box-sizing: border-box;
}

/* 数据状态栏 */
.data-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
  border: 1px solid #b3d4f0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #2d5a87;
}
.data-status-bar .status-icon {
  font-size: 16px;
}
.data-status-bar .status-sep {
  color: #b0c4de;
}
.data-status-bar strong {
  color: #1e3a5f;
}

/* 搜索框 */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* 时间筛选 Tab */
.time-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.time-tab {
  padding: 8px 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.time-tab:hover {
  border-color: #2d5a87;
  color: #2d5a87;
}
.time-tab.active {
  background: #2d5a87;
  color: #fff;
  border-color: #2d5a87;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.search-box input:focus {
  border-color: #2d5a87;
}

.search-box button {
  padding: 10px 20px;
  background: #2d5a87;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.search-box button:hover {
  background: #1e3a5f;
}

/* 股票详情页 */
.stock-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  border-radius: 10px;
  color: #fff;
}
.stock-detail-header .stock-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stock-detail-header h2 {
  color: #fff;
  font-size: 24px;
}
.stock-code-big {
  font-family: 'Consolas', monospace;
  font-size: 18px;
  color: #b3d4f0;
}
.exchange-link {
  color: #7fb3e0;
  font-size: 13px;
  text-decoration: none;
  margin-left: 8px;
}
.exchange-link:hover { text-decoration: underline; }

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.info-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.info-card.highlight-red {
  border-left: 4px solid #e74c3c;
}
.info-card .info-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}
.info-card .info-value {
  font-size: 22px;
  font-weight: 700;
  color: #2d5a87;
}
.info-card .info-sub {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* 点赞与浏览统计 */
.page-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-item, .like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-size: 13px;
  color: #555;
}

.like-btn {
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.like-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.like-btn.liked {
  background: #fff0f0;
}

.stat-icon {
  font-size: 16px;
}

.stat-num {
  font-weight: 600;
  color: #1e3a5f;
}

.like-btn.liked .stat-num {
  color: #e74c3c;
}

.stat-label {
  color: #888;
}

/* 免责声明弹窗 */
.disclaimer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.disclaimer-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.disclaimer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.disclaimer-header h3 {
  font-size: 18px;
  color: #1e3a5f;
  margin: 0;
  flex: 1;
}

.disclaimer-header .warn-icon {
  font-size: 24px;
}

.disclaimer-body {
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.8;
  color: #444;
}

.disclaimer-body h4 {
  font-size: 14px;
  color: #c0392b;
  margin: 16px 0 8px;
  font-weight: 600;
}

.disclaimer-body h4:first-child {
  margin-top: 0;
}

.disclaimer-body p {
  margin: 8px 0;
}

.disclaimer-body ul {
  margin: 8px 0 8px 20px;
}

.disclaimer-body li {
  margin: 4px 0;
}

.disclaimer-body .contact {
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 16px;
  font-size: 13px;
}

.disclaimer-body .contact strong {
  color: #2d5a87;
}

.disclaimer-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.disclaimer-footer button {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-disagree {
  background: #f5f5f5;
  color: #666;
}

.btn-disagree:hover {
  background: #e0e0e0;
}

.btn-agree {
  background: #2d5a87;
  color: #fff;
}

.btn-agree:hover {
  background: #1e3a5f;
}

/* 榜单说明条 */
.ranking-desc {
  padding: 12px 20px;
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-bottom: 1px solid #ffe082;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ranking-desc .desc-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ranking-desc .desc-content {
  flex: 1;
  font-size: 13px;
  color: #6d4c00;
  line-height: 1.6;
}

.ranking-desc .desc-content strong {
  color: #e65100;
  font-weight: 600;
}

.ranking-desc .desc-content .tip {
  display: inline-block;
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #c0392b;
  margin-left: 6px;
  border: 1px solid #ffcdd2;
}

/* 页脚数据来源 */
.footer-source {
  font-size: 11px;
  color: #bbb;
  margin-top: 6px;
}
.footer-source a {
  color: #4a90d9;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-source a:hover {
  color: #6ba8e8;
  text-decoration: underline;
}

/* ========== 响应式适配（手机端） ========== */
@media (max-width: 768px) {
  .container {
    padding: 12px;
    max-width: 100%;
  }

  .header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header h1 {
    font-size: 18px;
  }

  .header .nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .header .nav a {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .breadcrumb {
    font-size: 12px;
    padding: 8px 12px;
  }

  .home-hero {
    padding: 24px 16px;
    margin-bottom: 16px;
  }

  .home-hero h1 {
    font-size: 20px;
  }

  .home-hero p {
    font-size: 13px;
  }

  .page-stats {
    gap: 10px;
  }

  .stat-item, .like-btn {
    padding: 6px 12px;
    font-size: 12px;
    gap: 4px;
  }

  .ranking-section {
    margin-bottom: 16px;
  }

  .ranking-header {
    padding: 12px 14px;
  }

  .ranking-header h2 {
    font-size: 14px;
  }

  .ranking-header .view-all {
    padding: 4px 10px;
    font-size: 12px;
  }

  .ranking-desc {
    padding: 10px 14px;
  }

  .ranking-desc .desc-content {
    font-size: 12px;
  }

  /* 表格：手机端横向滚动 */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0 14px;
  }

  .mini-table, table {
    font-size: 12px;
    min-width: 600px;
  }

  .mini-table th,
  .mini-table td,
  table th,
  table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .tabs {
    margin: 10px 14px 0;
  }

  .tab-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box input,
  .search-box button {
    width: 100%;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 6px;
  }

  .page-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .disclaimer-modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
  }

  .disclaimer-header {
    padding: 14px 16px;
  }

  .disclaimer-header h3 {
    font-size: 16px;
  }

  .disclaimer-body {
    padding: 14px 16px;
    font-size: 13px;
  }

  .disclaimer-footer {
    padding: 12px 16px;
  }

  .disclaimer-footer button {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 16px;
  }

  .home-hero h1 {
    font-size: 18px;
  }

  .home-hero p {
    font-size: 12px;
  }

  .ranking-header h2 {
    font-size: 13px;
  }

  .mini-table, table {
    font-size: 11px;
    min-width: 550px;
  }
}

/* ========== 可排序表头 ========== */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

th.sortable:hover {
  background: #e9ecef;
}

th.sortable .sort-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.3;
  transition: all 0.2s;
}

th.sortable.sort-asc .sort-icon,
th.sortable.sort-desc .sort-icon {
  opacity: 1;
  color: #1976d2;
  font-weight: 700;
}

th.sortable.sort-asc .sort-icon::before {
  content: '↑';
}

th.sortable.sort-desc .sort-icon::before {
  content: '↓';
}

.mini-table th.sortable {
  padding: 10px 12px;
}

