/* ============================================================
   DEEPSEEK RESEARCH — Official Research Portal
   Design System: Pro Academic · Dark · Crystalline
   Competitive with top AI research lab websites
   ============================================================ */

:root {
  --bg: #08080d;
  --bg-panel: #0c0c14;
  --bg-card: #0e0e18;
  --bg-card-hover: #111120;
  --bg-code: #06060c;
  --border: #181830;
  --border-glow: #1a1a3a;
  --border-active: #252550;

  /* DeepSeek Blue */
  --ds-blue: #3b6cff;
  --ds-blue-bright: #5b8cff;
  --ds-blue-center: #9bb9ff;
  --ds-blue-dim: #1a3a8a;
  --ds-blue-dark: #0a1030;
  --ds-blue-glow: 0 0 24px rgba(59, 108, 255, 0.4);
  --ds-blue-text: 0 0 10px rgba(59, 108, 255, 0.3);

  /* Accent */
  --white: #eaeaf0;
  --text: #b0b8c8;
  --text-dim: #606878;
  --text-faint: #2a3040;
  --green: #10b981;
  --green-glow: 0 0 12px rgba(16, 185, 129, 0.3);
  --amber: #f59e0b;
  --red: #ef4444;

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  --font-display: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Spacing */
  --gap: 24px;
  --radius: 8px;
  --radius-sm: 5px;
  --max-width: 1240px;
  --nav-h: 60px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== PARTICLE BACKGROUND ===== */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ds-blue-dim); }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--white);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.6rem; letter-spacing: -0.03em; }
h2 { font-size: 1.75rem; letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

a {
  color: var(--ds-blue);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}
a:hover {
  color: var(--ds-blue-bright);
  text-shadow: var(--ds-blue-text);
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  overflow-x: auto;
  color: var(--text);
  line-height: 1.55;
  font-size: 0.82rem;
}

code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ds-blue-bright);
  font-size: 0.88em;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

/* ===== CLASSIFICATION BANNER ===== */
.classification-banner {
  background: linear-gradient(90deg, var(--ds-blue-dim), var(--ds-blue), var(--ds-blue-dim));
  color: #fff;
  text-align: center;
  padding: 7px 16px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 101;
  animation: bannerPulse 4s ease-in-out infinite;
}
@keyframes bannerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ===== TOP NAVIGATION ===== */
.topnav {
  position: sticky;
  top: 28px;
  z-index: 100;
  background: rgba(8, 8, 13, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}

.topnav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.85; text-shadow: none; }

.nav-logo .ds-icon {
  width: 34px; height: 34px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(59, 108, 255, 0.3);
}
.nav-logo .ds-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--text-dim);
  padding: 7px 15px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}

.nav-links a:hover {
  color: var(--ds-blue-bright);
  background: rgba(59, 108, 255, 0.06);
  text-shadow: none;
}

.nav-links a.active {
  color: var(--ds-blue-bright);
  background: rgba(59, 108, 255, 0.1);
  text-shadow: none;
}

/* ===== HERO ===== */
.hero {
  padding: 90px 28px 70px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(155, 185, 255, 0.08) 0%, rgba(91, 140, 255, 0.04) 30%, rgba(59, 108, 255, 0.01) 55%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 840px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--ds-blue-bright), var(--ds-blue-center));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 36px;
  font-weight: 400;
  line-height: 1.7;
}

.hero .badge-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  background: var(--bg-panel);
  transition: all 0.25s;
}

.badge.highlight {
  border-color: var(--ds-blue-dim);
  color: var(--ds-blue-bright);
  background: var(--ds-blue-dark);
  box-shadow: 0 0 12px rgba(59, 108, 255, 0.1);
}

/* ===== SECTIONS ===== */
.section {
  padding: 72px 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 44px;
}

.section-header h2 {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 .num {
  color: var(--ds-blue-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--ds-blue-dark);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(59, 108, 255, 0.15);
}

.section-header p {
  color: var(--text-dim);
  max-width: 680px;
  font-size: 0.95rem;
}

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--gap);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at top left, rgba(59, 108, 255, 0.04) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 108, 255, 0.08);
}
.card:hover::after { opacity: 1; }

.card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

.card h3 .icon {
  color: var(--ds-blue);
  margin-right: 8px;
  font-size: 1.1em;
}

.card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.card .meta {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-faint);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* ===== MODEL CARDS ===== */
.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-card:hover {
  border-color: var(--ds-blue-dim);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 108, 255, 0.1);
  transform: translateY(-2px);
}

.model-card.featured {
  border-color: var(--ds-blue-dim);
  box-shadow: 0 0 32px rgba(59, 108, 255, 0.1);
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--ds-blue-dark) 100%);
}

.model-card-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.model-card-header .model-icon {
  width: 48px; height: 48px;
  background: var(--ds-blue-dark);
  border: 1px solid var(--ds-blue-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-blue-bright);
  font-weight: 900;
  font-size: 1.15rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(59, 108, 255, 0.15);
}

.model-card-header .model-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
}

.model-card-header .model-tag {
  font-size: 0.73rem;
  color: var(--ds-blue-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.model-card-body {
  padding: 22px 26px;
}

.model-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}

.model-spec {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  padding: 5px 0;
  border-bottom: 1px solid rgba(24, 24, 48, 0.4);
}

.model-spec .spec-key {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.model-spec .spec-val {
  color: var(--text);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.model-spec .spec-val.highlight {
  color: var(--ds-blue-bright);
}

.model-card-footer {
  padding: 15px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
}

.btn:hover {
  border-color: var(--ds-blue-dim);
  color: var(--ds-blue-bright);
  text-shadow: none;
  background: var(--bg-card-hover);
}

.btn-primary {
  background: var(--ds-blue);
  color: #fff;
  border-color: var(--ds-blue);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--ds-blue-bright);
  color: #fff;
  box-shadow: var(--ds-blue-glow);
  text-shadow: none;
}

.btn-outline {
  border-color: var(--ds-blue-dim);
  color: var(--ds-blue-bright);
  background: transparent;
}

.btn-outline:hover {
  background: var(--ds-blue-dark);
  box-shadow: var(--ds-blue-glow);
  text-shadow: none;
}

.btn-sm {
  padding: 5px 13px;
  font-size: 0.76rem;
}

/* ===== TABLES ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.data-table th {
  text-align: left;
  padding: 11px 16px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--border);
  background: var(--bg-panel);
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(24, 24, 48, 0.35);
  color: var(--text);
}

.data-table tbody tr {
  transition: background 0.2s;
}

.data-table tbody tr:hover td {
  background: rgba(59, 108, 255, 0.03);
}

.data-table .ts {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 11px;
  border-radius: 14px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.tag.verified {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.tag.archived {
  background: rgba(59, 108, 255, 0.08);
  color: var(--ds-blue-bright);
  border: 1px solid rgba(59, 108, 255, 0.2);
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--ds-blue-dim), var(--border), var(--ds-blue-dim));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s;
}

.timeline-item:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ds-blue);
  box-shadow: var(--ds-blue-glow);
  border: 2px solid var(--bg);
}

.timeline-item .tl-date {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ds-blue-bright);
  margin-bottom: 6px;
  font-weight: 600;
}

.timeline-item .tl-title {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.timeline-item .tl-desc {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ===== SCALE GRID ===== */
.scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
}

.scale-node {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 8px;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
}

.scale-node:hover {
  border-color: var(--ds-blue-dim);
  box-shadow: 0 0 16px rgba(59, 108, 255, 0.1);
  transform: translateY(-2px);
}

.scale-node.built {
  border-color: var(--ds-blue-dim);
  background: rgba(59, 108, 255, 0.05);
}

.scale-node.active {
  border-color: var(--ds-blue);
  box-shadow: var(--ds-blue-glow);
  background: var(--ds-blue-dark);
  animation: nodeGlow 3s ease-in-out infinite;
}
@keyframes nodeGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(59, 108, 255, 0.3); }
  50% { box-shadow: 0 0 28px rgba(91, 140, 255, 0.5); }
}

.scale-node .sn-dim {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ds-blue-bright);
}

.scale-node .sn-states {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  color: var(--text-faint);
  margin-top: 5px;
}

.scale-node .sn-tag {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 5px;
  color: var(--text-dim);
  font-weight: 600;
}

/* ===== HIGHLIGHT BOX ===== */
.highlight-box {
  background: var(--ds-blue-dark);
  border: 1px solid var(--ds-blue-dim);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 22px 0;
}

.highlight-box h4 {
  color: var(--ds-blue-bright);
  margin-bottom: 10px;
}

.highlight-box p {
  color: var(--text);
  font-size: 0.9rem;
}

/* ===== CODE BLOCK ===== */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-block .cb-header {
  padding: 9px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-block .cb-header .cb-lang {
  color: var(--ds-blue-bright);
  font-weight: 600;
}

.code-block pre {
  border: none;
  margin: 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 52px 28px 36px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.page-header h1 {
  margin-bottom: 10px;
}

.page-header .breadcrumb {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.page-header .breadcrumb a {
  color: var(--text-dim);
}

.page-header .breadcrumb a:hover {
  color: var(--ds-blue-bright);
}

/* ===== FOOTER ===== */
.footer {
  padding: 36px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.footer a {
  color: var(--text-dim);
  margin: 0 6px;
}

.footer a:hover {
  color: var(--ds-blue-bright);
}

/* ===== ANIMATIONS ===== */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(59, 108, 255, 0.3); }
  50% { box-shadow: 0 0 22px rgba(91, 140, 255, 0.6); }
}

.pulse {
  animation: pulse-glow 2.5s infinite;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .topnav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 0;
    gap: 10px;
  }

  .nav-links {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-links a {
    font-size: 0.76rem;
    padding: 5px 10px;
  }

  .hero {
    padding: 52px 18px 40px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .section {
    padding: 44px 18px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .model-specs {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.4rem; }
}

/* ===== PRINT ===== */
@media print {
  body { background: #fff; color: #000; }
  .topnav, .footer, .classification-banner, #particles-canvas { display: none; }
}
