@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

:root {
  --accent: #615ced;
  --accent-dark: #4a45d4;
  --accent-soft: rgba(97, 92, 237, 0.10);
  --sidebar-bg: #f6f2ec;
  --page-bg: #f3f2f7;
  --card: #ffffff;
  --text: #24242e;
  --muted: #6b6b78;
  --border: #e6e3ee;
  --wo: #5b7cfa;
  --pe: #e45757;
  --shadow: 0 6px 24px rgba(40, 36, 80, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(97, 92, 237, 0.10), transparent 60%),
    var(--page-bg);
  color: var(--text);
  display: flex;
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- mobile warning ---------- */
#mobile-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 20, 30, 0.92);
  color: #fff;
  text-align: center;
  padding: 40px 24px;
}
#mobile-warning button {
  margin-top: 18px;
  padding: 10px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- sidebar ---------- */
.sidebar {
  width: 230px;
  background: var(--sidebar-bg);
  padding: 26px 16px 100px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  border-right: 1px solid var(--border);
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-title {
  font-family: Montserrat, sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0 0 24px;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sidebar-logo { height: 1.2em; width: auto; }

.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li { margin: 6px 0; }
.sidebar ul li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.sidebar ul li a i { width: 18px; text-align: center; opacity: 0.85; }
.sidebar ul li a:hover,
.sidebar ul li a.active { color: #fff; background: var(--accent); }

.sidebar-foot {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  text-align: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--accent);
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.2s;
}
.sidebar-brand:hover { background: var(--accent-soft); }
.sidebar-wordmark { display: block; width: 120px; height: auto; }

/* ---------- content ---------- */
.content {
  margin-left: 230px;
  padding: 28px 32px 70px;
  width: calc(100% - 230px);
  max-width: 1400px;
}

.paper-info,
.section-card,
.contact-us {
  margin: 0 0 26px;
  padding: 30px 36px;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ---------- hero ---------- */
.paper-info {
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #faf9ff 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.hero-badge img { height: 20px; width: auto; }

.paper-info h1 {
  font-family: Montserrat, sans-serif;
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 auto 20px;
  max-width: 980px;
  color: #1c1c2b;
  letter-spacing: -0.01em;
}

.authors {
  max-width: 1000px;
  margin: 0 auto;
  font-size: 0.95rem;
}
.author-list { margin: 0 0 10px; line-height: 1.9; }
.author { white-space: nowrap; }
.author sup, .affiliations sup {
  font-size: 0.68em;
  color: var(--accent);
  font-weight: 700;
  margin-left: 1px;
}
.affiliations {
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.8;
}
.affiliations span { display: inline-block; margin: 0 8px; }

.contributions {
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}
.contributions span { display: inline-block; margin: 0 10px; }
.contributions sup { font-style: normal; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  background: #23232f;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.2s, transform 0.15s;
}
.links a:hover { background: var(--accent); transform: translateY(-1px); }

/* ---------- sections ---------- */
.section-card h2,
.contact-us h2 {
  font-family: Montserrat, sans-serif;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 22px;
  color: #1c1c2b;
  position: relative;
}
.section-card h2::after,
.contact-us h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  margin: 10px auto 0;
}

.prose {
  max-width: 940px;
  margin: 0 auto;
  color: #383846;
  font-size: 1.03rem;
  text-align: justify;
}
.prose p { margin: 0; }

.figure-wrap { margin: 0 auto; max-width: 1150px; text-align: center; }
.figure-wrap img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

/* ---------- results table ---------- */
.results-table-block {
  margin-top: 32px;
}
.results-table-block h3 {
  margin: 0 0 8px;
  text-align: center;
  font-family: Montserrat, sans-serif;
  font-size: 1.2rem;
  color: #1c1c2b;
}
.table-caption {
  max-width: 1050px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}
.results-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.results-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 0.82rem;
  line-height: 1.35;
}
.results-table th,
.results-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.results-table thead th {
  background: #27263a;
  color: #fff;
  font-weight: 700;
}
.results-table thead th:first-child,
.results-table tbody th[scope="row"] {
  text-align: left;
}
.results-table tbody th[scope="row"] {
  padding-left: 14px;
  font-weight: 600;
  color: #30303c;
}
.results-table .experiment-row th {
  padding: 8px;
  background: rgba(97, 92, 237, 0.12);
  color: var(--accent-dark);
  font-weight: 800;
  text-align: center;
}
.results-table .generator-row td {
  padding: 6px 8px;
  background: #f3f3f6;
  color: var(--muted);
  font-style: italic;
}
.results-table .score-best { font-weight: 800; }
.results-table .score-second {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- speed ---------- */
.speed-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -6px 0 22px;
}
.speed-label { color: var(--muted); font-weight: 600; font-size: 0.9rem; margin-right: 4px; }
.speed-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.speed-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- demos ---------- */
.demo-block {
  margin: 0 0 30px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfaff;
  position: relative;
}
.demo-block:last-child { margin-bottom: 0; }

.demo-index {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--accent);
  color: #fff;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 999px;
}

.prompt-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 6px 0 16px;
  overflow: hidden;
}
.prompt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}
.prompt-body {
  padding: 12px 14px;
  font-size: 0.92rem;
  color: #3b3b48;
  line-height: 1.6;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.video-col { display: flex; flex-direction: column; gap: 10px; }

.video-card {
  background: #0f0f14;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.video-card video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
}
.video-label {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.video-label.wo { background: rgba(91, 124, 250, 0.9); }
.video-label.pe { background: rgba(228, 87, 87, 0.92); }

.pe-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.pe-details summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pe);
  background: rgba(228, 87, 87, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.pe-details summary::-webkit-details-marker { display: none; }
.pe-details summary i { transition: transform 0.2s; font-size: 0.75rem; }
.pe-details[open] summary i { transform: rotate(90deg); }
.pe-details[open] summary { border-bottom: 1px solid var(--border); }
.pe-body {
  padding: 12px 14px;
  font-size: 0.88rem;
  color: #3b3b48;
  line-height: 1.6;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.prompt-body::-webkit-scrollbar,
.pe-body::-webkit-scrollbar { width: 8px; }
.prompt-body::-webkit-scrollbar-thumb,
.pe-body::-webkit-scrollbar-thumb { background: #cfcde0; border-radius: 4px; }
.prompt-body::-webkit-scrollbar-thumb:hover,
.pe-body::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- citation ---------- */
.contact-us { text-align: center; }
.bibtex {
  text-align: left;
  background: #1c1c28;
  color: #e9e9f2;
  border-radius: 12px;
  padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.55;
  max-width: 940px;
  margin: 0 auto;
}

/* ---------- responsive ---------- */
@media screen and (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .content { margin-left: 0; width: 100%; padding: 16px; }
  #mobile-warning { display: block; }
  .compare-grid { grid-template-columns: 1fr; }
  .paper-info, .section-card, .contact-us { padding: 20px 16px; }
}
