/* ===== Variables ===== */
:root {
  --black: #050a12;
  --navy: #0a1628;
  --navy-light: #111d35;
  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --purple-glow: rgba(124, 58, 237, 0.25);
  --sea-green: #0d9b6b;
  --sea-green-dark: #064e3b;
  --sea-green-glow: rgba(13, 155, 107, 0.2);
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --card-bg: rgba(17, 29, 53, 0.65);
  --card-border: rgba(124, 58, 237, 0.15);
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--black);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border-radius: 3px; }
::selection { background: var(--purple); color: #fff; }

/* ===== Navigation ===== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(5, 10, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

.nav-inner {
  width: 75vw;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}

.nav-brand span {
  background: linear-gradient(135deg, var(--purple), var(--sea-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 0.2rem;
  list-style: none;
}

.nav-links a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.1);
}

.nav-links a.active {
  color: #fff;
  background: rgba(124, 58, 237, 0.22);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex !important;
  align-items: center;
  gap: 0.3rem;
}

.dropdown-trigger i {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.nav-dropdown.open .dropdown-trigger i {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none !important;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 320px;
  background: rgba(10, 22, 40, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 8px;
  padding: 0.4rem 0;
  margin-top: 0.35rem;
  list-style: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.nav-dropdown.open .dropdown-menu {
  display: block !important;
}

.dropdown-menu li a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: 0;
  white-space: normal;
  line-height: 1.4;
  transition: color 0.15s, background 0.15s;
}

.dropdown-menu li a:hover {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.12);
}

@media (max-width: 768px) {
  .dropdown-menu {
    position: static !important;
    background: rgba(10, 22, 40, 0.6) !important;
    border: none !important;
    box-shadow: none !important;
    margin-top: 0;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(124, 58, 237, 0.2) !important;
    border-radius: 0 !important;
    min-width: 0;
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5, 10, 18, 0.96);
    backdrop-filter: blur(20px);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  }
  .nav-links.open { display: flex; }
}

/* ===== Tab Panels ===== */
.tab-panel {
  display: none;
  padding-top: 56px;
  min-height: calc(100vh - 80px);
  animation: fadeIn 0.35s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Sections ===== */
.hero-section {
  padding: 80px 2.5rem 40px;
  background: linear-gradient(160deg, #050a12 0%, #0a1628 40%, #111d35 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -180px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -120px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--sea-green-glow) 0%, transparent 70%);
  pointer-events: none;
}

.content-section {
  padding: 60px 2.5rem;
  background: var(--navy);
}

.content-section:nth-child(even) {
  background: linear-gradient(160deg, var(--navy) 0%, #0d1f30 100%);
}

.content-section.first-section {
  padding-top: 80px;
  background: linear-gradient(160deg, #050a12 0%, var(--navy) 50%, #0d1f30 100%);
  position: relative;
  overflow: hidden;
}

.content-section.first-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -150px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.section-inner {
  width: 50vw;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

#tab-architecture .section-inner {
  width: 50vw;
}

.arch-top-figure {
  margin-bottom: 2rem;
}

.arch-top-figure video {
  max-width: 100%;
  width: 100%;
  height: auto;
}

/* ===== Section Divider ===== */
.section-divider {
  height: 1px;
  width: 50vw;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--purple-dark), var(--sea-green-dark), transparent);
  opacity: 0.35;
}

/* ===== Hero Title ===== */
.hero-title {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #e8eaf0 0%, #c4b5fd 50%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Authors ===== */
.authors {
  text-align: center;
  margin-bottom: 0.4rem;
  line-height: 1.8;
}

.author-block {
  display: inline-block;
  font-size: 1rem;
}

.authors a {
  color: #a78bfa;
  transition: color 0.2s;
}

.authors a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.affiliation {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

/* ===== Link Buttons ===== */
.link-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.link-buttons a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.1);
  transition: all 0.2s;
}

.link-buttons a:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: var(--purple);
  transform: translateY(-1px);
}

.link-buttons a.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.link-buttons .icon {
  font-size: 1.05rem;
  display: inline-flex;
}

/* ===== Teaser ===== */
.teaser-block {
  text-align: center;
}

.teaser-block img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.4), 0 0 50px rgba(124, 58, 237, 0.12);
  margin: 0 auto;
}

.teaser-caption {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  margin-top: 1.25rem;
  font-style: italic;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Section Headers ===== */
.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  margin-top: 0.4rem;
  border-radius: 2px;
  background: var(--purple);
}

.section-header.centered { text-align: center; }
.section-header.centered h2::after {
  margin-left: auto;
  margin-right: auto;
}

/* ===== Content Card ===== */
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(6px);
}

.content-card p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.content-card p:last-child { margin-bottom: 0; }
.content-card strong { color: var(--text-primary); }

.content-card code {
  background: rgba(124, 58, 237, 0.15);
  color: #c4b5fd;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ===== Architecture Layout ===== */
.arch-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  overflow: hidden;
  min-width: 0;
}

.arch-figure {
  position: sticky;
  top: 80px;
  min-width: 0;
  overflow: hidden;
}

.arch-figure .figure-block {
  margin: 0;
}

.arch-figure video {
  width: 100%;
  height: auto;
  max-width: 100%;
}

@media (max-width: 860px) {
  .arch-layout {
    grid-template-columns: 1fr;
  }
  .arch-figure {
    position: static;
    order: -1;
  }
}

/* ===== Architecture Components ===== */
.arch-components {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  width: 35vw;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .arch-components { width: 100%; }
}

.arch-item {
  background: rgba(13, 155, 107, 0.06);
  border: 1px solid rgba(13, 155, 107, 0.18);
  border-left: 3px solid var(--sea-green);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
}

.arch-item h4 {
  color: #6ee7b7;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.arch-item p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

/* ===== Equation ===== */
.objective-eq {
  text-align: center;
  padding: 1.15rem;
  background: rgba(124, 58, 237, 0.07);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  width: 40vw;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .objective-eq { width: 100%; }
}

.objective-eq code {
  font-size: 0.95rem;
  color: #c4b5fd;
  background: none;
}

.objective-eq p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.4rem;
}

/* ===== Figure ===== */
.figure-block {
  margin: 2rem 0;
  text-align: center;
}

.figure-block img,
.figure-block video {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
  display: block;
}

.figure-block figcaption {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.65rem;
  font-style: italic;
}

/* ===== Results Grid ===== */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .results-grid { grid-template-columns: 1fr; }
}

.result-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.25s, transform 0.25s;
}

.result-item:hover {
  border-color: rgba(124, 58, 237, 0.35);
  transform: translateY(-2px);
}

.result-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 0.4rem;
}

.result-item p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

/* ===== BibTeX ===== */
.bibtex-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.bibtex-block code {
  background: none;
  color: inherit;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ===== News List ===== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(91, 33, 182, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-left: 3px solid #a78bfa;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  backdrop-filter: blur(6px);
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  color: #a78bfa;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 100px;
}

.news-text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.news-text a {
  color: #a78bfa;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-text a:hover {
  color: #c4b5fd;
}

/* ===== Footer ===== */
.site-footer {
  padding: 1.5rem;
  background: var(--black);
  border-top: 1px solid rgba(124, 58, 237, 0.08);
  text-align: center;
}

.footer-icons {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.footer-icons a {
  color: var(--text-muted);
  margin: 0 0.4rem;
  transition: color 0.2s;
}

.footer-icons a:hover { color: #a78bfa; }

.site-footer p {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.site-footer p a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer p a:hover { color: var(--text-secondary); }
