.display-math-rendered,
.display-math-fallback {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 0;
}

.site-announcement {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid rgba(73, 89, 70, 0.22);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.99);
  box-shadow: 0 28px 80px rgba(32, 31, 28, 0.26);
}

.site-announcement::backdrop {
  background: rgba(27, 35, 31, 0.38);
  backdrop-filter: blur(4px);
}

.site-announcement-shell {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
}

.site-announcement-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fffaf0;
  background: var(--green);
  font-size: 26px;
  font-weight: 900;
}

.site-announcement-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.site-announcement-body > p:first-child {
  margin-bottom: 3px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.site-announcement-body h2 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
}

.site-announcement-body a {
  color: var(--green);
  font-weight: 800;
  word-break: break-all;
}

.site-announcement-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.site-announcement-actions button {
  min-width: 92px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--green);
  background: #fff8ea;
  font-weight: 800;
}

.site-announcement-actions button:first-child {
  color: #fffaf0;
  border-color: transparent;
  background: var(--green);
}

.site-announcement[open] ~ #fqy-switch {
  display: none;
}

.export-dialog {
  width: min(540px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(73, 89, 70, 0.24);
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.99);
  box-shadow: 0 30px 90px rgba(32, 31, 28, 0.3);
}

.export-dialog::backdrop {
  background: rgba(27, 35, 31, 0.46);
  backdrop-filter: blur(4px);
}

.export-dialog-panel {
  display: grid;
  gap: 0;
  margin: 0;
}

.export-dialog-panel > header,
.export-dialog-panel > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.export-dialog-panel > header {
  border-bottom: 1px solid var(--line);
  background: rgba(47, 103, 88, 0.055);
}

.export-dialog-panel > header p,
.export-dialog-panel > header h2 {
  margin: 0;
}

.export-dialog-panel > header p {
  margin-bottom: 3px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.export-dialog-panel > header h2 {
  font-size: 21px;
  line-height: 1.25;
}

#exportClose {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--green);
  background: rgba(255, 250, 240, 0.82);
  font-size: 24px;
  line-height: 1;
}

.export-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.export-dialog-body label {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.export-dialog-body label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.export-dialog-body select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.92);
  font: inherit;
}

.export-dialog-hint,
.export-status {
  margin: 0;
  line-height: 1.7;
}

.export-dialog-hint {
  padding: 11px 12px;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(195, 154, 84, 0.08);
  font-size: 13px;
}

.export-status {
  min-height: 1.7em;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.export-dialog-panel > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.export-dialog-panel > footer button {
  min-width: 98px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--green);
  background: rgba(255, 250, 240, 0.86);
  font-weight: 900;
}

.export-dialog-panel > footer .export-primary {
  color: #fffaf0;
  border-color: transparent;
  background: var(--green);
}

.export-dialog-panel > footer .export-primary:disabled {
  cursor: wait;
  opacity: 0.58;
}

.export-dialog[open] ~ #fqy-switch {
  display: none;
}

.reader {
  width: min(940px, calc(100vw - 28px));
  max-height: min(86vh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(73, 89, 70, 0.25);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.98);
  box-shadow: 0 30px 90px rgba(32, 31, 28, 0.28);
}

.reader::backdrop {
  background: rgba(27, 35, 31, 0.42);
  backdrop-filter: blur(4px);
}

.reader-shell {
  max-height: min(86vh, 900px);
  overflow-y: auto;
  overflow-x: hidden;
}

.reader-head {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.94);
  backdrop-filter: blur(14px);
}

.reader-school {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.reader-school img {
  width: 42px;
  height: 42px;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.reader-head button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--red);
  background: #fff8ea;
  font-size: 24px;
  line-height: 1;
}

.reader-head .reader-fullscreen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 86px;
  padding: 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.reader-fullscreen-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader.is-fullscreen {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.reader.is-fullscreen .reader-shell {
  width: 100%;
  height: 100dvh;
  max-height: none;
}

.reader.is-fullscreen .reader-shell > article {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.reader.is-fullscreen .reader-content {
  font-size: 17px;
  line-height: 1.95;
}

.reader-shell > article {
  padding: 20px;
}

.reader h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.reader-meta span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47, 103, 88, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.reader-content {
  color: #1f2f29;
  font-size: 15px;
  line-height: 1.85;
  white-space: normal;
  overflow-wrap: anywhere;
}

.reader-content h1,
.reader-content h2,
.reader-content h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.reader-content p {
  margin: 0 0 12px;
}

.reader-content blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--green);
  color: var(--muted);
  background: rgba(47, 103, 88, 0.07);
}

.reader-content .exam-asset-note {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px dashed rgba(47, 103, 88, 0.32);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(47, 103, 88, 0.06);
}

.reader-content .exam-asset-note strong {
  color: var(--green);
  font-size: 13px;
}

.reader-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.reader-content td,
.reader-content th {
  padding: 6px 8px;
  border: 1px solid var(--line);
}

.math-fallback {
  display: inline;
  color: inherit;
  font-family: "Times New Roman", "Microsoft YaHei", serif;
}

.reader-content .katex-error {
  color: inherit;
  font-family: "Times New Roman", "Microsoft YaHei", serif;
}

.reader-content .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 2px;
}

.reader-tabs {
  position: sticky;
  top: 70px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -4px 0 18px;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.94);
  backdrop-filter: blur(12px);
}

.reader-tab-buttons {
  display: flex;
  gap: 8px;
}

.reader-tab-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.reader-tabs > span,
.reader-tab-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reader-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.78);
  font-weight: 800;
}

.reader-tabs button.is-active {
  border-color: transparent;
  color: #fff9ed;
  background: var(--green);
}

.reader-pane[hidden] {
  display: none;
}

.solution-view {
  display: grid;
  gap: 16px;
}

.solution-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
}

.solution-block h3,
.solution-empty h3 {
  margin-top: 0;
}

.solution-toolbar {
  position: sticky;
  top: 126px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(47, 103, 88, 0.2);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.95);
  box-shadow: 0 8px 22px rgba(54, 61, 48, 0.1);
  backdrop-filter: blur(14px);
}

.solution-nav-meta {
  display: grid;
  line-height: 1.05;
}

.solution-nav-meta strong {
  color: var(--green);
  font-size: 13px;
}

.solution-nav-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.solution-question-nav {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.solution-question-nav button,
.solution-toolbar-actions button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.solution-question-nav button {
  min-width: 32px;
  padding: 0 8px;
}

.solution-question-nav button.is-active {
  border-color: transparent;
  color: #fff9ed;
  background: var(--green);
}

.solution-toolbar-actions {
  display: flex;
  gap: 6px;
}

.solution-toolbar-actions button {
  padding: 0 10px;
}

.solution-toolbar-actions button[aria-pressed="true"] {
  color: var(--green);
  border-color: rgba(47, 103, 88, 0.3);
  background: rgba(47, 103, 88, 0.08);
}

.solution-question {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  scroll-margin-top: 190px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.solution-question.is-jump-highlight {
  border-color: rgba(47, 103, 88, 0.52);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(47, 103, 88, 0.1);
}

.solution-question.is-blocked {
  border-color: rgba(137, 71, 51, 0.36);
  background: rgba(255, 248, 235, 0.72);
}

.solution-question-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.solution-question-head strong {
  display: block;
  min-width: 0;
  color: var(--green);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.solution-question-head > div {
  min-width: 0;
}

.solution-collection-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.solution-collection-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green);
  background: rgba(255, 250, 240, 0.82);
  font-size: 12px;
  font-weight: 900;
}

.solution-collection-button.is-active {
  color: #fffaf0;
  border-color: transparent;
  background: var(--green);
}

.solution-question-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--red) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em;
}

.solution-question-head span,
.solution-answer span,
.solution-callout span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.solution-answer,
.solution-question-text,
.solution-part,
.solution-callout,
.solution-details,
.solution-work {
  min-width: 0;
}

.solution-question-text {
  display: grid;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 12px 14px;
  border-left: 4px solid var(--green);
  border-radius: 10px;
  background: rgba(47, 103, 88, 0.055);
}

.solution-question-text > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.solution-question-text p {
  margin-bottom: 8px;
}

.solution-question-text p:last-child {
  margin-bottom: 0;
}

.solution-answer {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(47, 103, 88, 0.08);
}

.solution-callout {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-left: 3px solid rgba(47, 103, 88, 0.36);
  border-radius: 10px;
  background: rgba(47, 103, 88, 0.05);
}

.reader-pane.are-answers-hidden .solution-answer {
  display: none;
}

.solution-work {
  overflow: hidden;
  border: 1px solid rgba(47, 103, 88, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.solution-work summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--green);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  list-style: none;
}

.solution-work summary::-webkit-details-marker {
  display: none;
}

.solution-work summary::before {
  content: "＋";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #fff9ed;
  background: var(--green);
  font-size: 16px;
  line-height: 1;
}

.solution-work[open] summary::before {
  content: "−";
}

.solution-work summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.solution-work-open,
.solution-work[open] .solution-work-closed {
  display: none;
}

.solution-work[open] .solution-work-open {
  display: inline;
}

.solution-work-body {
  display: grid;
  gap: 18px;
  padding: 4px 14px 16px;
  border-top: 1px solid var(--line);
}

.solution-work-body .solution-part + .solution-part {
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.solution-details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
}

.solution-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.solution-details-body {
  padding: 0 12px 12px;
}

.solution-warning {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(137, 71, 51, 0.22);
  border-radius: 12px;
  color: #6f3325;
  background: rgba(137, 71, 51, 0.08);
  font-weight: 700;
}

.solution-answer p,
.solution-part p,
.solution-callout p,
.solution-details-body p {
  margin: 0 0 10px;
}

.solution-callout p:last-child,
.solution-details-body p:last-child {
  margin-bottom: 0;
}

.solution-part h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 15px;
}

.solution-exam-link,
.exam-solution-link {
  width: fit-content;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(47, 103, 88, 0.24);
  border-radius: 9px;
  color: var(--green);
  background: rgba(47, 103, 88, 0.07);
  font-size: 12px;
  font-weight: 900;
}

.solution-exam-link {
  justify-self: end;
}

.exam-solution-link {
  margin-top: 8px;
}

.solution-empty,
.solution-warning {
  padding: 16px;
  border: 1px dashed rgba(201, 91, 79, 0.34);
  border-radius: 14px;
  background: rgba(201, 91, 79, 0.06);
}

.solution-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.solution-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(47, 103, 88, 0.1);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

/* 统一规整后的卷面结构：章节标题 / 题号 / 小问 / 选项，保证各校卷面一致 */
.reader-content .exam-section {
  margin: 26px 0 14px;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  background: rgba(47, 103, 88, 0.08);
  border-left: 4px solid var(--green);
  border-radius: 6px;
}
.reader-content .exam-section:first-child { margin-top: 0; }

.reader-content .exam-q {
  display: flex;
  gap: 12px;
  margin: 0 0 16px;
  scroll-margin-top: 150px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.reader-content .exam-q.is-jump-highlight {
  margin-inline: -8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(47, 103, 88, 0.08);
  box-shadow: 0 0 0 3px rgba(47, 103, 88, 0.08);
}
.reader-content .exam-q-no {
  flex: none;
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--green);
  color: var(--paper);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}
.reader-content .exam-q-body { flex: 1; min-width: 0; }
.reader-content .exam-q-body > p:last-child,
.reader-content .exam-subq-body > p:last-child { margin-bottom: 0; }

.reader-content .exam-subq {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.reader-content .exam-subq-no {
  flex: none;
  color: var(--green);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.reader-content .exam-subq-body { flex: 1; min-width: 0; }

.reader-content .exam-options {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.reader-content .exam-options li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

[data-hidden="true"] {
  display: none;
}
.exam-plain { white-space: pre-wrap; overflow-wrap: anywhere; }
