:root {
 --ink: #202124;
 --muted: #5f6368;
 --line: #dfe3e8;
 --paper: #ffffff;
 --soft: #f6f8fb;
 --purple: #7C3AED;
 --purple-soft: #F3EFFF;
 --green: #2e7d52;
 --amber: #a86a00;
 --red: #a64242;
 --shadow: 0 12px 32px rgba(32, 33, 36, 0.08);
}

* {
 box-sizing: border-box;
}

html {
 scroll-behavior: smooth;
}

body {
 margin: 0;
 background: var(--paper);
 color: var(--ink);
 font-family:
 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
 line-height: 1.6;
}

a {
 color: var(--purple);
 text-decoration: none;
}

a:hover {
 text-decoration: underline;
}

img {
 display: block;
 width: 100%;
}

.paper-width {
 width: min(1120px, calc(100% - 36px));
 margin: 0 auto;
}

.topbar {
 position: sticky;
 top: 0;
 z-index: 20;
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 24px;
 padding: 12px max(18px, calc((100vw - 1120px) / 2));
 background: rgba(255, 255, 255, 0.94);
 border-bottom: 1px solid var(--line);
 backdrop-filter: blur(10px);
}

.brand {
 display: flex;
 align-items: center;
 color: var(--ink);
 font-weight: 800;
 letter-spacing: 0;
}

.brand-icon {
 width: 22px;
 height: 22px;
 margin-right: 6px;
 object-fit: contain;
}

.topbar nav {
 display: flex;
 align-items: center;
 gap: 18px;
 font-size: 14px;
}

.hero {
 padding: 72px 0 28px;
 text-align: center;
}

h1,
h2,
h3 {
 line-height: 1.18;
 letter-spacing: 0;
}

h1 {
 max-width: 980px;
 margin: 0 auto;
 font-size: clamp(22px, 3.2vw, 36px);
 font-weight: 800;
}

.title-brand {
 background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 40%, #A78BFA 100%);
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
 background-clip: text;
}

.hero-icon {
 display: block;
 width: 120px;
 height: 120px;
 margin: 0 auto 2px;
 object-fit: contain;
}

.subtitle {
 max-width: 830px;
 margin: 20px auto 0;
 color: var(--muted);
 font-size: 20px;
}

.authors {
 display: flex;
 flex-wrap: wrap;
 justify-content: center;
 align-items: baseline;
 gap: 4px 12px;
 margin: 28px auto 0;
 max-width: 980px;
 font-size: 16px;
 line-height: 1.35;
}

.authors span {
 display: inline-block;
 min-height: 1.35em;
 transition: color 0.15s ease;
}

.authors sup {
 line-height: 0;
}

.authors a {
 color: var(--ink);
 text-decoration: none;
}

.authors a:hover {
 color: var(--purple);
 text-decoration: underline;
}

.affiliations {
 max-width: 960px;
 margin: 18px auto 0;
 color: var(--muted);
 font-size: 14px;
}

.affiliations p {
 margin: 4px 0;
}

.actions {
 display: flex;
 flex-wrap: wrap;
 justify-content: center;
 gap: 12px;
 margin-top: 28px;
}

.button {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 min-height: 42px;
 padding: 0 18px;
 border: 1px solid var(--line);
 border-radius: 8px;
 color: var(--ink);
 font-weight: 700;
 background: var(--paper);
 transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
 transform: translateY(-1px);
 box-shadow: 0 4px 12px rgba(32, 33, 36, 0.1);
 text-decoration: none;
}

.button.primary {
 background: var(--purple);
 border-color: var(--purple);
 color: #ffffff;
}

.teaser {
 margin-top: 10px;
}

.teaser.paper-width {
 width: min(820px, calc(100% - 36px));
}

.teaser img,
.paper-figure img {
 border: 1px solid var(--line);
 border-radius: 10px;
 background: var(--soft);
 box-shadow: var(--shadow);
 transition: transform 0.3s ease;
}

.teaser img:hover {
 transform: scale(1.02);
}

.teaser figcaption {
 max-width: 980px;
 margin: 14px auto 0;
 text-align: left;
}

.paper-figure {
 margin: 28px 0 0;
}

.results-figure {
 grid-column: 1 / -1;
 margin: 0;
}

figcaption {
 margin-top: 10px;
 color: var(--muted);
 font-size: 14px;
 text-align: center;
}

.section {
 padding: 54px 0;
 border-top: 1px solid var(--line);
}

.section h2 {
 margin: 0 0 16px;
 font-size: 30px;
 padding-left: 14px;
 border-left: 4px solid var(--purple);
}

.section > p {
 max-width: 1040px;
 margin: 0 0 14px;
 color: #34383d;
}

.note,
.disclaimer {
 color: var(--muted) !important;
 font-size: 14px;
}

.contrib-grid,
.results-grid {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: 16px;
 margin-top: 24px;
}

.contrib-grid article,
.result-card {
 border: 1px solid var(--line);
 border-radius: 12px;
 padding: 20px;
 background: var(--soft);
}

.result-card.wide {
 grid-column: 1 / -1;
}

.contrib-grid h3,
.result-card h3 {
 margin: 0 0 10px;
 font-size: 15px;
 font-weight: 700;
 color: var(--ink);
}

.contrib-grid p,
.result-card p {
 margin: 0;
 color: var(--muted);
 font-size: 13px;
}

.stat-grid {
 display: grid;
 grid-template-columns: repeat(4, minmax(0, 1fr));
 gap: 12px;
 margin: 22px 0 4px;
}

.stat-grid div {
 padding: 16px;
 border: 1px solid var(--line);
 border-radius: 10px;
 background: var(--purple-soft);
 text-align: center;
}

.stat-grid strong {
 display: block;
 color: var(--purple);
 font-size: 28px;
 line-height: 1;
}

.stat-grid span {
 display: block;
 margin-top: 8px;
 color: var(--muted);
 font-size: 14px;
}

.table-scroll {
 width: 100%;
 margin-top: 12px;
 overflow-x: auto;
 -webkit-overflow-scrolling: touch;
 border: 1px solid var(--line);
 border-radius: 8px;
 background: #ffffff;
}

.results-table {
 width: 100%;
 min-width: 100%;
 border-collapse: collapse;
 font-size: 14px;
}

.metric-table {
 min-width: 500px;
}

.category-table {
 min-width: 860px;
}

.external-table {
 min-width: 500px;
}

.results-table th,
.results-table td {
 padding: 10px 12px;
 border-bottom: 1px solid var(--line);
 text-align: center;
 vertical-align: middle;
}

.results-table th {
 color: var(--muted);
 font-weight: 700;
 background: var(--soft);
 white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child {
 min-width: 160px;
 text-align: left;
 white-space: normal;
}

.category-table th:first-child,
.category-table td:first-child {
 min-width: 175px;
}

.external-table th:first-child,
.external-table td:first-child {
 min-width: 190px;
}

.results-table tbody tr:last-child td {
 border-bottom: 0;
}

.results-table tr.highlight td {
 color: var(--purple);
 font-weight: 800;
 background: rgba(124, 58, 237, 0.06);
}

.results-table tbody tr:hover td {
 background: rgba(124, 58, 237, 0.03);
}

.filters {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
 margin: 20px 0;
}

.filter-button {
 min-height: 34px;
 padding: 0 12px;
 border: 1px solid var(--line);
 border-radius: 999px;
 background: var(--paper);
 color: var(--ink);
 font: inherit;
 font-size: 14px;
 cursor: pointer;
}

.filter-button.is-active {
 background: var(--purple);
 border-color: var(--purple);
 color: #ffffff;
}

.gallery-grid {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 18px;
}

.case-card {
 overflow: hidden;
 border: 1px solid var(--line);
 border-radius: 10px;
 background: var(--paper);
 box-shadow: 0 6px 18px rgba(32, 33, 36, 0.05);
 transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.case-card:hover {
 box-shadow: 0 12px 32px rgba(32, 33, 36, 0.12);
 transform: translateY(-2px);
}

.case-card img {
 aspect-ratio: 1 / 1;
 object-fit: cover;
 background: var(--soft);
}

.case-body {
 padding: 14px;
}

.case-body h3 {
 margin: 0 0 8px;
 font-size: 17px;
}

.case-body p {
 margin: 8px 0 0;
 color: var(--muted);
 font-size: 14px;
}

.prompt-details {
 margin-top: 10px;
 border-top: 1px solid var(--line);
 padding-top: 10px;
}

.prompt-details summary {
 color: var(--purple);
 font-size: 14px;
 font-weight: 700;
 cursor: pointer;
}

.prompt-details p {
 max-height: 180px;
 overflow: auto;
 padding-right: 4px;
}

.tag-row {
 display: flex;
 flex-wrap: wrap;
 gap: 6px;
 margin-bottom: 10px;
}

.tag {
 display: inline-flex;
 align-items: center;
 min-height: 24px;
 padding: 0 8px;
 border-radius: 999px;
 background: var(--soft);
 color: var(--muted);
 font-size: 12px;
 font-weight: 700;
}

.resource-list {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 12px;
}

.resource-list span,
.resource-list a {
 display: block;
 padding: 16px;
 border: 1px solid var(--line);
 border-radius: 10px;
 background: var(--soft);
 color: var(--ink);
}

.resource-list a:hover {
 border-color: var(--purple);
 color: var(--purple);
 text-decoration: none;
}

pre {
 overflow-x: auto;
 padding: 18px;
 border: 1px solid var(--line);
 border-radius: 10px;
 background: #f3f4f6;
 font-size: 13px;
}

/* ===== Key Stats Banner ===== */
.key-stats {
 display: flex;
 gap: 14px;
 flex-wrap: wrap;
 margin: 0 0 32px;
}

.key-stat {
 flex: 1;
 min-width: 140px;
 background: var(--purple-soft);
 border: 1px solid #ddd6fe;
 border-radius: 12px;
 padding: 18px 20px;
 text-align: center;
}

.key-stat .ks-val {
 font-size: 28px;
 font-weight: 800;
 color: var(--purple);
 line-height: 1;
}

.key-stat .ks-label {
 font-size: 12px;
 color: var(--muted);
 margin-top: 6px;
 font-weight: 600;
}

/* ===== Image Placeholder ===== */
.img-placeholder {
 background: var(--soft);
 border: 2px dashed var(--line);
 border-radius: 12px;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 min-height: 220px;
 text-align: center;
 padding: 32px;
 position: relative;
 overflow: hidden;
}

.img-placeholder::before {
 content: '';
 position: absolute;
 inset: 0;
 background: repeating-linear-gradient(
 -45deg,
 transparent, transparent 12px,
 rgba(223, 227, 232, 0.5) 12px, rgba(223, 227, 232, 0.5) 13px
 );
}

.img-placeholder-inner {
 position: relative;
 z-index: 1;
}

.img-placeholder .ip-icon {
 font-size: 2.2rem;
 margin-bottom: 10px;
 opacity: 0.35;
}

.img-placeholder .ip-title {
 font-size: 14px;
 font-weight: 700;
 color: var(--ink);
 margin-bottom: 6px;
}

.img-placeholder .ip-sub {
 font-size: 12px;
 color: var(--muted);
 max-width: 360px;
 line-height: 1.6;
}

/* ===== Citation Block ===== */
.citation-block {
 background: var(--soft);
 border: 1px solid var(--line);
 border-radius: 12px;
 padding: 20px 24px;
 font-family: 'JetBrains Mono', 'Courier New', monospace;
 font-size: 12px;
 color: var(--muted);
 overflow-x: auto;
 white-space: pre-wrap;
 word-break: break-all;
 line-height: 1.8;
}

/* ===== Pipeline Diagram ===== */
.pipeline-diagram {
 display: flex;
 align-items: stretch;
 gap: 0;
 margin: 24px 0 0;
 overflow-x: auto;
 padding-bottom: 6px;
}

.pipeline-step {
 display: flex;
 flex-direction: column;
 align-items: center;
 min-width: 130px;
 flex: 1;
}

.pipeline-node {
 background: var(--paper);
 border: 1px solid var(--line);
 border-radius: 10px;
 padding: 12px 14px;
 text-align: center;
 width: 100%;
 margin-bottom: 6px;
 font-size: 13px;
 font-weight: 600;
}

.pipeline-node.p-base {
 border-color: #d1d5db;
 color: #6b7280;
}

.pipeline-node.p-s1 {
 border-color: #ddd6fe;
 color: var(--purple);
 background: var(--purple-soft);
}

.pipeline-node.p-s2 {
 border-color: #a5f3fc;
 color: #0891b2;
 background: #ecfeff;
}

.pipeline-node.p-out {
 border-color: #fde68a;
 color: #b45309;
 background: #fffbeb;
}

.pipeline-node.p-teacher {
 border-color: #bbf7d0;
 color: #047857;
 background: #ecfdf5;
 font-size: 12px;
 padding: 6px 10px;
 margin-bottom: 3px;
}

.pipeline-label {
 font-size: 11px;
 color: var(--muted);
 text-align: center;
 margin-bottom: 5px;
 font-weight: 700;
 letter-spacing: 0.5px;
 text-transform: uppercase;
}

.pipeline-teacher-col {
 display: flex;
 flex-direction: column;
 gap: 3px;
 width: 100%;
}

.pipeline-arrow {
 display: flex;
 align-items: center;
 padding: 0 6px;
 color: #d1d5db;
 font-size: 1.3rem;
 flex-shrink: 0;
}

/* ===== Responsive overrides ===== */
@media (max-width: 680px) {
 .pipeline-diagram {
 flex-direction: column;
 }

 .pipeline-arrow {
 transform: rotate(90deg);
 padding: 4px 0;
 justify-content: center;
 }

 .results-grid {
 grid-template-columns: 1fr !important;
 }

 .key-stats {
 flex-direction: column;
 }
}

.footer {
 padding: 32px 0 54px;
 color: var(--muted);
 border-top: 1px solid var(--line);
 font-size: 14px;
}

@media (max-width: 860px) {
 .topbar {
 position: static;
 align-items: flex-start;
 flex-direction: column;
 }

 .topbar nav {
 flex-wrap: wrap;
 gap: 10px 14px;
 }

 .contrib-grid,
 .results-grid,
 .gallery-grid,
 .resource-list {
 grid-template-columns: 1fr;
 }

 .stat-grid {
 grid-template-columns: repeat(2, minmax(0, 1fr));
 }

 .hero {
 padding-top: 44px;
 }
}

@media (max-width: 560px) {
 .paper-width {
 width: min(100% - 24px, 1120px);
 }

 h1 {
 font-size: 32px;
 }

 .subtitle {
 font-size: 17px;
 }

 .result-card {
 padding: 14px;
 }

 .results-table {
 font-size: 13px;
 }

 .results-table th,
 .results-table td {
 padding: 8px 10px;
 }

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