:root {
  --bg: #f7f8fb;
  --paper: #ffffff;
  --ink: #17202a;
  --muted: #65707c;
  --soft: #f5f7fb;
  --soft-blue: #f0f5ff;
  --line: #e3e8ef;
  --line-strong: #cfd8e3;
  --accent: #285f9f;
  --accent-soft: #e8f1ff;
  --shadow: 0 18px 48px rgba(31, 45, 61, 0.08);
  --radius: 12px;
  font-family:
    "Inter", "Segoe UI", Arial, Helvetica, "Microsoft YaHei", "PingFang SC",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(40, 95, 159, 0.08), transparent 32rem),
    linear-gradient(180deg, #ffffff 0, var(--bg) 18rem);
  font-size: 16px;
  line-height: 1.68;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code {
  padding: 2px 6px;
  border: 1px solid #e8edf4;
  border-radius: 5px;
  color: #334155;
  background: #f8fafc;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.container {
  width: min(1120px, calc(100% - 44px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.paper-header {
  max-width: 980px;
  margin: 0 auto 28px;
  padding: 28px 18px 34px;
  text-align: center;
}

.paper-header h1 {
  max-width: 940px;
  margin: 0 auto 16px;
  color: #111827;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.12;
}

.subtitle {
  max-width: 820px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: clamp(17px, 2.3vw, 21px);
  line-height: 1.55;
}

.authors {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 500;
}

.authors sup,
.affiliations sup {
  margin-left: 1px;
  font-size: 0.72em;
  line-height: 0;
}

.affiliations {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.link-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid #c9d9ee;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.74);
  font-size: 14px;
  font-weight: 600;
}

.section {
  margin: 22px 0;
  padding: 26px 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

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

h2,
h3,
h4,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 14px;
  color: #111827;
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 650;
  line-height: 1.25;
}

h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--accent);
}

h3 {
  margin: 30px 0 12px;
  color: #1f2937;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.35;
}

h4 {
  margin: 22px 0 10px;
  color: #27466f;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
}

p {
  margin-bottom: 15px;
}

.section-note {
  color: var(--muted);
}

.contents ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
}

.contents li::marker {
  color: var(--accent);
  font-weight: 700;
}

.demo-table {
  width: 100%;
  margin: 12px 0 26px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.demo-table th,
.demo-table td {
  padding: 13px 15px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.demo-table th:last-child,
.demo-table td:last-child {
  border-right: 0;
}

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

.demo-table th {
  color: #263241;
  background: linear-gradient(180deg, #f7faff, var(--accent-soft));
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

.demo-table td {
  color: #303943;
  background: #ffffff;
  overflow-wrap: anywhere;
}

.demo-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.demo-table tbody tr:hover td {
  background: #f8fbff;
}

.demo-table td[rowspan] {
  color: #243f63;
  background: #f4f8ff;
  font-weight: 650;
}

.demo-table audio {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 4px 0;
}

.editing-table {
  table-layout: fixed;
}

.editing-table .task-col {
  width: 12%;
}

.editing-table .sample-col {
  width: 21%;
}

.editing-table .operation-col {
  width: 20%;
}

.editing-table .diagram-col {
  width: 26%;
}

.audio-example {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.audio-example p {
  margin: 0;
}

.edit-operation {
  color: var(--muted);
  font-size: 15px;
}

.diagram-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.diagram-comparison img,
.zoomable-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(31, 45, 61, 0.08);
  cursor: zoom-in;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.diagram-comparison img:hover,
.zoomable-image:hover {
  border-color: #9bb9df;
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.14);
  transform: translateY(-1px);
}

.diagram-comparison span {
  color: #7c8794;
  font-weight: 700;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 34px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
}

.image-modal.is-open {
  display: grid;
}

.image-modal img {
  max-width: min(1160px, 94vw);
  max-height: 88vh;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #111827;
  background: rgba(255, 255, 255, 0.92);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.f0 {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      to bottom,
      #ffffff 0,
      #ffffff 15px,
      #edf1f5 16px
    );
}

.f0 path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 4;
}

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

figure {
  margin: 0;
}

.figure-placeholder {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed #b6c2d0;
  border-radius: 10px;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(40, 95, 159, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(40, 95, 159, 0.06) 1px, transparent 1px),
    var(--soft);
  background-size: 22px 22px;
  font-weight: 650;
  text-align: center;
}

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

@media (max-width: 900px) {
  .container {
    width: min(100% - 28px, 1120px);
    padding-top: 24px;
  }

  .section {
    padding: 22px 18px 24px;
  }

  .paper-header {
    padding-inline: 0;
  }

  .demo-table {
    display: block;
    overflow-x: auto;
    table-layout: auto;
    border-radius: 8px;
  }

  .demo-table th,
  .demo-table td {
    min-width: 190px;
  }

  .editing-table th,
  .editing-table td {
    min-width: 180px;
  }

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

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .container {
    width: min(100% - 20px, 1120px);
    padding-bottom: 44px;
  }

  .paper-header h1 {
    font-size: 30px;
  }

  .subtitle {
    font-size: 16px;
  }

  .link-row span {
    min-width: 72px;
  }

  .section {
    margin: 16px 0;
    padding: 20px 14px;
  }

  .image-modal {
    padding: 18px;
  }
}
