/* ===== 期友会期货数据平台 - 主样式 ===== */
:root {
  --primary: #1a56db;
  --primary-dark: #1240aa;
  --accent: #e84d2a;
  --bg: #f4f6fa;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --nav-h: 60px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --vip-gold: #d4a017;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== 水印 ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 120px,
    rgba(100,100,120,0.05) 120px,
    rgba(100,100,120,0.05) 121px
  );
}
.watermark-layer,
.watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}
.watermark-layer::before,
.watermark::before {
  content: "";
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200'%3E%3Ctext x='50%25' y='50%25' text-anchor='middle' dominant-baseline='middle' transform='rotate(-35, 150, 100)' font-size='14' fill='rgba(60,60,80,0.13)' font-family='Arial,sans-serif'%3E期友会 www.qyh.net%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ===== 导航栏 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo .logo-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 28px;
  flex: 1;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all .18s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: #eef2ff;
}
.nav-links a.active { font-weight: 500; }
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .18s;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-vip {
  background: linear-gradient(135deg, #f5c842, #d4a017);
  color: #5a3e00;
  font-weight: 600;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .2s;
}

/* ===== 移动端导航 ===== */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 16px;
  z-index: 999;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 14px;
  transition: background .15s;
}
.mobile-nav a:hover { background: #f3f4f6; }

/* ===== 主内容 ===== */
.main-wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }

/* ===== Hero 行情速览 ===== */
.hero-bar {
  background: linear-gradient(135deg, #1a56db 0%, #0f3a99 100%);
  border-radius: var(--radius);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.hero-title {
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  margin-bottom: 4px;
}
.hero-val {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}
.hero-change.up { color: #4ade80; }
.hero-change.down { color: #f87171; }
.hero-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
}
.hero-ticker {
  flex: 1;
  overflow: hidden;
  min-width: 200px;
}
.ticker-wrap {
  display: flex;
  gap: 24px;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
}
.ticker-item .up { color: #4ade80; }
.ticker-item .down { color: #f87171; }

/* ===== 网格布局 ===== */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.section-title .dot {
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}
.section-title .more {
  margin-left: auto;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 400;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-pad { padding: 16px 20px; }

/* ===== 两列布局 ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.four-col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }

/* ===== 行情品种卡 ===== */
.variety-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.variety-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(26,86,219,.12);
}
.vc-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.vc-code { font-size: 11px; color: var(--text-muted); }
.vc-price { font-size: 20px; font-weight: 700; margin: 8px 0 4px; }
.vc-price.up { color: #ef4444; }
.vc-price.down { color: #22c55e; }
.vc-change { font-size: 12px; display: flex; gap: 10px; }
.tag-up { color: #ef4444; }
.tag-down { color: #22c55e; }

/* ===== 龙虎榜表格 ===== */
.lhb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lhb-table th {
  padding: 8px 12px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
}
.lhb-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.lhb-table tr:last-child td { border-bottom: none; }
.lhb-table tr:hover td { background: #f9fafb; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: #e5e7eb;
  color: var(--text-muted);
}
.rank-badge.top { background: #fef3c7; color: #d97706; }
.rank-badge.r2 { background: #e0e7ff; color: #4338ca; }
.rank-badge.r3 { background: #fce7f3; color: #be185d; }
.net-long { color: #ef4444; font-weight: 600; }
.net-short { color: #22c55e; font-weight: 600; }

/* ===== AI研报卡 ===== */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: all .18s;
  cursor: pointer;
}
.report-card:hover { border-color: var(--primary); box-shadow: 0 4px 18px rgba(26,86,219,.1); }
.rc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.rc-tag.ai { background: #ede9fe; color: #7c3aed; }
.rc-tag.vip { background: #fef3c7; color: #d97706; }
.rc-tag.free { background: #d1fae5; color: #065f46; }
.rc-title { font-size: 14px; font-weight: 600; line-height: 1.5; margin-bottom: 6px; }
.rc-summary { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.rc-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11px; color: var(--text-muted); }

/* ===== VIP 提示横幅 ===== */
.vip-banner {
  background: linear-gradient(135deg, #fff8e1, #fff3e0);
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.vip-banner .icon { font-size: 24px; }
.vip-banner .text h3 { font-size: 14px; font-weight: 600; color: #92400e; margin-bottom: 2px; }
.vip-banner .text p { font-size: 12px; color: #b45309; }
.vip-banner .action { margin-left: auto; }

/* ===== 底部 ===== */
footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.6);
  padding: 30px 20px 20px;
  margin-top: 40px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 24px; }
.footer-brand { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-desc { font-size: 12px; line-height: 1.8; }
.footer-col h4 { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 10px; }
.footer-col a {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color .15s;
}
.footer-col a:hover { color: rgba(255,255,255,0.9); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.tag-vip { background: #fef3c7; color: #d97706; }
.tag-free { background: #d1fae5; color: #065f46; }
.tag-new { background: #fee2e2; color: #dc2626; }
.tag-hot { background: #ffe4e6; color: #be123c; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .four-col { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .four-col { grid-template-columns: repeat(2, 1fr); }
  .hero-bar { flex-direction: column; align-items: flex-start; }
  .hero-divider { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .main-wrap { padding: 12px 12px 30px; }
  .btn-vip { display: none; }
}
@media (max-width: 400px) {
  .four-col { grid-template-columns: 1fr; }
}
