@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────── */
:root {
  --bg:            #0b0f14;
  --surface:       #141a22;
  --surface-hover: #1a2230;
  --surface-alt:   #111720;
  --border:        #1e2a38;
  --border-hover:  #2a3a4e;

  --text:          #d1d9e6;
  --text-bright:   #eaf0f8;
  --text-muted:    #7a8da6;
  --text-dim:      #4a5c73;

  --accent:        #f85149;
  --accent-soft:   rgba(248,81,73,0.12);
  --green:         #3fb950;
  --green-soft:    rgba(63,185,80,0.12);
  --orange:        #d29922;
  --orange-soft:   rgba(210,153,34,0.12);
  --purple:        #bc8cff;
  --purple-soft:   rgba(188,140,255,0.12);
  --blue:          #58a6ff;
  --blue-soft:     rgba(88,166,255,0.10);

  --yellow-bg:     rgba(210,153,34,0.08);
  --yellow-border: #d29922;
  --red-bg:        rgba(248,81,73,0.08);
  --red-border:    #f85149;
  --green-bg:      rgba(63,185,80,0.08);

  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 2px 8px rgba(0,0,0,0.3), 0 0 1px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 30px rgba(0,0,0,0.4);
  --transition:    0.2s cubic-bezier(0.4,0,0.2,1);

  --font:          'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: #79bbff; }

/* ── Layout ────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow);
}

/* ── Breadcrumb ────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 13px;
  color: var(--text-dim);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--blue); }

/* ── Headers ───────────────────────────────────────── */
h1 {
  color: var(--text-bright);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 12px;
  margin-bottom: 0.5rem;
}

h2 {
  color: var(--text-bright);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

h3.red { color: var(--accent); }
h3.green { color: var(--green); }
h3.orange { color: var(--orange); }
h3.purple { color: var(--purple); }

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 1.5rem;
}

.date-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Tables ────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

thead tr {
  background: var(--surface-alt);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

tbody tr { transition: background var(--transition); }
tbody tr:nth-child(even) { background: var(--surface-alt); }
tbody tr:hover { background: var(--surface-hover); }

/* ── Alert Boxes ───────────────────────────────────── */
.note {
  background: var(--yellow-bg);
  border-left: 3px solid var(--yellow-border);
  padding: 12px 16px;
  font-size: 13px;
  margin: 1rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

.warning {
  background: var(--red-bg);
  border-left: 3px solid var(--red-border);
  padding: 12px 16px;
  font-size: 13px;
  margin: 1rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

/* ── Pros / Cons ───────────────────────────────────── */
.pros-cons {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 13px;
}

.pros-cons td {
  padding: 14px;
  vertical-align: top;
  width: 50%;
  line-height: 1.8;
  border-radius: var(--radius-sm);
}
.pros-cons td:first-child { background: var(--green-bg); }
.pros-cons td:last-child  { background: var(--red-bg); }

/* ── Lists ─────────────────────────────────────────── */
ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.3rem; }

/* ── Score / Tags ──────────────────────────────────── */
.score {
  display: inline-block;
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.up      { color: var(--green); font-weight: 600; }
.down    { color: var(--accent); font-weight: 600; }
.neutral { color: var(--orange); font-weight: 600; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Home: Report Type Cards ───────────────────────── */
.cards {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.card h2 a { color: var(--text-bright); }
.card h2 a:hover { color: var(--blue); }
.card .meta { color: var(--text-muted); font-size: 13px; margin: 0; }
.card .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ── IPO Index: Search + Filter Bar ────────────────── */
.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}
.search-box::placeholder { color: var(--text-dim); }
.search-box:focus { border-color: var(--blue); }

.filter-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--text); }
.filter-btn.active { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }

/* ── IPO Index: Month Group ────────────────────────── */
.month-group {
  margin-bottom: 1.5rem;
}

.month-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding-bottom: 8px;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── IPO Index: Report Items ───────────────────────── */
.report-list { margin: 0.5rem 0; }

.report-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}
.report-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateX(2px);
}

.report-item .date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  min-width: 90px;
}
.report-item .title {
  flex: 1;
  font-weight: 500;
  color: var(--text-bright);
}
.report-item .tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.report-item .arrow {
  color: var(--text-dim);
  transition: all var(--transition);
}
.report-item:hover .arrow { color: var(--accent); transform: translateX(2px); }

/* ── Report: Section ───────────────────────────────── */
.section { margin-bottom: 1.5rem; }

/* ── Report: Nav (prev/next) ───────────────────────── */
.report-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* ── Pagination ────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1.5rem;
}
.pagination button {
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.pagination button:hover { border-color: var(--border-hover); color: var(--text); }
.pagination button.active { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.pagination button:disabled { opacity: 0.3; cursor: default; }

/* ── Empty State ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

/* ── Stats Bar ─────────────────────────────────────── */
.stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 13px;
  color: var(--text-muted);
}
.stats .num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-bright);
}

/* ── Report Page: Specific Components ──────────────── */
.data-table { /* inherits from table */ }

.analysis-block {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1rem 0;
}

.tracking-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1rem 0;
}

.pros-cons-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 8px;
  margin: 0.75rem 0;
  font-size: 13px;
}

.pros-cell {
  padding: 14px;
  vertical-align: top;
  width: 50%;
  background: var(--green-bg);
  border-radius: var(--radius-sm);
  line-height: 1.8;
}

.cons-cell {
  padding: 14px;
  vertical-align: top;
  width: 50%;
  background: var(--red-bg);
  border-radius: var(--radius-sm);
  line-height: 1.8;
}

.warning-box {
  background: var(--red-bg);
  border-left: 3px solid var(--red-border);
  padding: 12px 16px;
  font-size: 13px;
  margin: 1rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

.recommendation {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin: 0.5rem 0;
}
.recommendation.green {
  background: var(--green-soft);
  color: var(--green);
}
.recommendation.red {
  background: var(--accent-soft);
  color: var(--accent);
}
.recommendation.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.rating {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

.navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* ── Footer ────────────────────────────────────────── */
footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 640px) {
  .page { padding: 1.5rem 1.25rem; }
  h1 { font-size: 1.3rem; }
  table { font-size: 12px; }
  th, td { padding: 8px 10px; }
  .report-item { flex-wrap: wrap; gap: 0.5rem; }
  .report-item .tags { display: none; }
  .toolbar { flex-direction: column; }
  .stats { flex-wrap: wrap; gap: 0.75rem; }
}
