/* 扩散模型训练数据扩充调研 — Academic light theme */
:root {
  --bg: #f7f5f1;
  --bg-elevated: #ffffff;
  --bg-muted: #f0ede6;
  --ink: #1a1a1a;
  --ink-secondary: #4a4a4a;
  --ink-muted: #6b6b6b;
  --accent: #1e5a8a;
  --accent-hover: #16466c;
  --accent-soft: #e8f1f8;
  --border: #ddd8ce;
  --border-strong: #c4bdb0;
  --success: #2d6a4f;
  --warn: #9a5b1a;
  --danger: #8b2e2e;
  --shadow: 0 1px 3px rgba(26, 26, 26, 0.06), 0 4px 16px rgba(26, 26, 26, 0.04);
  --shadow-lg: 0 8px 28px rgba(26, 26, 26, 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, monospace;
  --max: 1120px;
  --sticky-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
}

/* Header */
.site-header {
  background: linear-gradient(165deg, #142d45 0%, #1e5a8a 48%, #2a7ab0 100%);
  color: #fff;
  padding: 3.2rem 1.25rem 2.6rem;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 90% 20%, rgba(255, 255, 255, 0.12), transparent),
    radial-gradient(ellipse 40% 50% at 10% 90%, rgba(0, 0, 0, 0.15), transparent);
  pointer-events: none;
}
.site-header .wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.site-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.55rem, 3.5vw, 2.15rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.lead {
  margin: 0;
  max-width: 42rem;
  font-size: 1.02rem;
  opacity: 0.92;
  line-height: 1.65;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.4rem;
  font-size: 0.88rem;
  opacity: 0.88;
}
.meta-row span::before {
  content: "·";
  margin-right: 0.55rem;
  opacity: 0.5;
}
.meta-row span:first-child::before {
  content: none;
  margin: 0;
}

/* Nav */
.toc-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 245, 241, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.toc-nav .wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.toc-nav a {
  flex: 0 0 auto;
  padding: 0.85rem 0.75rem;
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.toc-nav a:hover,
.toc-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Layout */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  padding-bottom: 4rem;
}

section {
  padding: 2.75rem 0 0.5rem;
}
section > .wrap > h2 {
  margin: 0 0 1.15rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}
section > .wrap > h2 .num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.prose {
  color: var(--ink-secondary);
  max-width: 48rem;
}
.prose p {
  margin: 0 0 1rem;
}
.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}
.prose li {
  margin-bottom: 0.4rem;
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid #c5d9ea;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  color: var(--ink-secondary);
  font-size: 0.95rem;
  margin: 1rem 0 0;
}
.callout strong {
  color: var(--accent);
}

/* Filter bar */
.filter-bar {
  position: sticky;
  top: 3.05rem;
  z-index: 30;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
  display: grid;
  gap: 0.75rem;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.filter-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  min-width: 2.8rem;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover {
  border-color: var(--border-strong);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.search-input {
  flex: 1;
  min-width: 12rem;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
}
.search-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.sort-select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
}
.filter-meta {
  font-size: 0.82rem;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-ghost {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.btn-ghost:hover {
  text-decoration: underline;
}

/* Papers layout */
.papers-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 960px) {
  .papers-layout {
    grid-template-columns: 1fr minmax(300px, 340px);
    align-items: start;
  }
  .detail-panel {
    position: sticky;
    top: 9.5rem;
  }
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

table.papers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 640px;
}
.papers-table th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  background: var(--bg-muted);
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.papers-table th:hover {
  color: var(--accent);
}
.papers-table th .sort-ind {
  opacity: 0.35;
  margin-left: 0.25rem;
  font-size: 0.7rem;
}
.papers-table th.sorted .sort-ind {
  opacity: 1;
  color: var(--accent);
}
.papers-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink-secondary);
}
.papers-table tr {
  cursor: pointer;
  transition: background 0.12s;
}
.papers-table tbody tr:hover {
  background: var(--accent-soft);
}
.papers-table tr.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.papers-table tr:last-child td {
  border-bottom: none;
}
.papers-table .title-cell {
  color: var(--ink);
  font-weight: 560;
  max-width: 22rem;
  line-height: 1.45;
}
.papers-table .title-cell .en-title {
  display: block;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--ink-secondary);
  white-space: nowrap;
}
.badge.theme-少样本\/零样本,
.badge[data-theme="少样本/零样本"] { background: #e8f0fe; color: #1a4a8a; }
.badge[data-theme="少样本"] { background: #e8f0fe; color: #1a4a8a; }
.badge[data-theme="大规模扩充"] { background: #e6f4ea; color: #1e5c35; }
.badge[data-theme="领域多样化"] { background: #f3e8fd; color: #5b2d8e; }
.badge[data-theme="医学影像"] { background: #fce8ef; color: #8a1f4a; }
.badge[data-theme="长尾"] { background: #fff3e0; color: #8a4b12; }
.badge[data-theme="分布感知扩充"] { background: #e0f7f4; color: #0d5c54; }
.badge[data-theme="标签保持混合"] { background: #eef2ff; color: #3730a3; }
.badge[data-theme="综述"] { background: #f0f0f0; color: #444; }
.badge[data-theme="隐私/记忆化"] { background: #fde8e8; color: #8b2e2e; }

.year-cell {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Detail panel */
.detail-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  min-height: 280px;
}
.detail-panel.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  text-align: center;
  font-size: 0.92rem;
  padding: 2rem 1.5rem;
}
.detail-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink);
}
.detail-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}
.detail-meta a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.detail-dl {
  margin: 0;
}
.detail-dl dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  margin-top: 0.85rem;
  margin-bottom: 0.2rem;
}
.detail-dl dt:first-child {
  margin-top: 0;
}
.detail-dl dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}
.tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

/* Compare table */
.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}
table.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 720px;
}
.compare-table th,
.compare-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  background: var(--bg-muted);
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
}
.compare-table tr:last-child td {
  border-bottom: none;
}
.compare-table td:first-child {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 0.85rem;
}
.steps li {
  counter-increment: step;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.1rem 3.4rem;
  position: relative;
  box-shadow: var(--shadow);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.1rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--ink);
}
.steps p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

/* Risks */
.risk-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .risk-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.risk-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.risk-card.danger {
  border-left-color: var(--danger);
}
.risk-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}
.risk-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

/* Reading list */
.reading-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.reading-list li {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.reading-list .r-title {
  font-weight: 560;
  color: var(--ink);
  flex: 1 1 16rem;
  font-size: 0.92rem;
  line-height: 1.4;
}
.reading-list .r-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.reading-list a.arxiv {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer .wrap {
  max-width: var(--max);
}

/* Empty state */
.empty-rows td {
  text-align: center;
  padding: 2rem;
  color: var(--ink-muted);
  cursor: default;
}

/* Print */
@media print {
  .toc-nav,
  .filter-bar {
    position: static;
  }
  .site-header {
    background: #fff !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
  }
}
