:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1f2630;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --gold: #f5b400;
  --green: #2ea043;
  --red: #f85149;
  --accent: #58a6ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.55; min-height: 100vh;
}

.hero {
  background: linear-gradient(135deg, #1a1f2a 0%, #0a1f3a 60%, #051226 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 24px;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #1a5fb4 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.25);
}
.brand h1 { margin: 0; font-size: 22px; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.hero-link {
  color: var(--gold); text-decoration: none;
  padding: 8px 14px;
  border: 1px solid rgba(245,180,0,0.3);
  border-radius: 8px;
  font-size: 13px;
}
.hero-link:hover { background: rgba(245,180,0,0.1); }

.container {
  max-width: 1200px; margin: 0 auto;
  padding: 24px; display: grid; gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap; gap: 12px;
}
.card-head h2 { margin: 0; font-size: 16px; }

/* Sector tabs */
.sector-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sector-tabs button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.15s;
}
.sector-tabs button:hover { color: var(--text); border-color: var(--accent); }
.sector-tabs button.active {
  background: var(--accent);
  color: #001a3a;
  border-color: var(--accent);
  font-weight: 600;
}

/* Industry grid */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.industry-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.industry-card:hover {
  background: #232b38;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.industry-card.active {
  background: rgba(88,166,255,0.12);
  border-left-color: var(--gold);
}
.industry-card .sector-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.industry-card h3 {
  margin: 4px 0;
  font-size: 15px;
  color: var(--text);
}
.industry-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Detail layout */
.industry-detail .detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
@media (max-width: 880px) {
  .industry-detail .detail-grid { grid-template-columns: 1fr; }
}
.detail-block {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.detail-block h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.chart-wrap { position: relative; height: 320px; }
.chart-wrap.small { height: 280px; }

/* Factor list */
.factor-list { list-style: none; padding: 0; margin: 0; }
.factor-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.factor-list li:last-child { border-bottom: none; }
.factor-row {
  display: flex; justify-content: space-between;
  gap: 12px; margin-bottom: 4px;
}
.factor-name { font-weight: 600; font-size: 13px; }
.factor-weight { color: var(--accent); font-size: 12px; }
.factor-direction {
  font-size: 10px; padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-left: 6px;
}
.factor-direction.bull { color: #6ddc8a; border-color: rgba(109,220,138,0.3); background: rgba(46,160,67,0.08); }
.factor-direction.bear { color: #ff8989; border-color: rgba(255,137,137,0.3); background: rgba(248,81,73,0.08); }
.factor-direction.neutral { color: #d2a8ff; border-color: rgba(210,168,255,0.3); }
.factor-detail { color: var(--muted); font-size: 12px; }

/* Fund list */
.fund-list { display: grid; gap: 8px; }
.fund-item {
  display: grid;
  grid-template-columns: 88px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.fund-code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent);
}
.fund-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.fund-name .fund-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--muted);
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.fund-nav {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fund-nav .num { font-weight: 600; font-size: 14px; }
.fund-change {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 60px;
}
.fund-change.up { color: var(--red); }
.fund-change.down { color: var(--green); }

.analysis-block {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

/* News */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-list li:last-child { border-bottom: none; }
.news-date { color: var(--muted); font-size: 12px; }
.news-title-link {
  color: var(--text); font-size: 13px;
  text-decoration: none;
  line-height: 1.5;
}
.news-title-link:hover { color: var(--accent); text-decoration: underline; }
.news-source-tag {
  font-size: 11px;
  color: var(--muted);
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.2);
  padding: 1px 8px;
  border-radius: 999px;
}

.footer {
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 11px;
  padding: 8px 4px 24px;
  flex-wrap: wrap; gap: 8px;
}

.muted { color: var(--muted); }
