:root {
  --bg: #0a0e17;
  --surface: #121826;
  --surface2: #1a2236;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --muted: #8b95a8;
  --accent: #3b82f6;
  --accent2: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 12px;
  --font: "DM Sans", "Noto Sans TC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.hero {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent2);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--muted);
  max-width: 720px;
  font-size: 0.95rem;
}

.subtitle strong {
  color: var(--text);
  font-weight: 500;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-top: 1.5rem;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: inherit;
  min-width: 140px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, border-color 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.45);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.status {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.status.loading {
  color: var(--accent2);
}

.status.error {
  color: var(--red);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.source-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.source-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.source-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.source-card .count {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent2);
}

.source-card .badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.5rem;
}

.badge.live {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}

.badge.demo {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
}

.section {
  margin-bottom: 2rem;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.section-head p {
  font-size: 0.85rem;
  color: var(--muted);
}

.hot-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  transition: border-color 0.2s;
}

.hot-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

.rank-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 2rem;
}

.rank-num.top3 {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hot-main h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--muted);
}

.tag.score {
  color: var(--accent2);
  background: rgba(34, 211, 238, 0.1);
}

.tag.src-google { border-left: 2px solid #4285f4; }
.tag.src-exploding { border-left: 2px solid #f59e0b; }
.tag.src-similarweb { border-left: 2px solid #10b981; }

.stocks-block h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.stock-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
}

.stock-chip .sym {
  font-weight: 700;
  color: var(--green);
  margin-right: 0.35rem;
}

.stock-chip .reason {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

.no-stocks {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mini-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.mini-item .title {
  font-weight: 500;
}

.mini-item .sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.industry-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.industry-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.industry-bar .label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.bar-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
}

.disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .hot-card {
    grid-template-columns: 1fr;
  }
  .rank-num {
    font-size: 1.1rem;
  }
}
