:root {
  --ink: #20282a;
  --ink-soft: #536063;
  --ink-faint: #7a8587;
  --paper: #f4f5f1;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --line: #dce3dc;
  --line-strong: #c8d1c8;
  --cinnabar: #b54a34;
  --cinnabar-dark: #8f3526;
  --teal: #1f6f68;
  --teal-soft: #e1efeb;
  --ochre: #c3913f;
  --ochre-soft: #f5ecd8;
  --shadow-sm: 0 1px 2px rgba(31, 42, 44, 0.06), 0 5px 16px rgba(31, 42, 44, 0.05);
  --shadow-md: 0 18px 50px rgba(20, 30, 31, 0.22);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 276px;
  --header-max: 1180px;
  --page-max: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(31, 111, 104, 0.28);
  outline-offset: 2px;
}

svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
}

.site-header {
  position: relative;
  min-height: 360px;
  color: #f8f6f1;
  isolation: isolate;
  overflow: hidden;
}

.header-image,
.header-overlay {
  position: absolute;
  inset: 0;
}

.header-image {
  z-index: -2;
  background-image: url("https://commons.wikimedia.org/wiki/Special:FilePath/Dwelling_in_the_Fuchun_Mountains_(first_half).JPG?width=1800");
  background-position: center 36%;
  background-size: cover;
  background-color: #2c3d3c;
  transform: scale(1.03);
}

.header-overlay {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(18, 28, 28, 0.34) 0%, rgba(18, 28, 28, 0.72) 100%),
    linear-gradient(90deg, rgba(17, 28, 27, 0.72) 0%, rgba(17, 28, 27, 0.2) 58%, rgba(17, 28, 27, 0.48) 100%);
}

.header-inner {
  width: min(calc(100% - 48px), var(--header-max));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-seal {
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  color: #fff7ee;
  background: var(--cinnabar);
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(64, 22, 13, 0.24);
}

.eyebrow {
  margin: 0 0 4px;
  color: #f0d8c1;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
}

.header-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.header-count strong {
  font-size: 1.55rem;
  line-height: 1;
}

.header-count span {
  color: rgba(255, 255, 255, 0.82);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.84rem;
}

.hero-search {
  max-width: 820px;
  margin-top: 42px;
}

.hero-search > label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.search-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 35px rgba(13, 22, 22, 0.22);
}

.search-control .icon {
  color: var(--teal);
  font-size: 1.15rem;
}

.search-control input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
}

.search-control input::placeholder {
  color: #879395;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface);
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

.search-control .icon-button {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border: 0;
  background: transparent;
}

.search-control .icon-button:hover {
  color: var(--cinnabar);
  background: transparent;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
}

.search-suggestions button {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.search-suggestions button:hover {
  border-color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.2);
}

.page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 28px;
  width: min(calc(100% - 48px), var(--page-max));
  margin: 28px auto 60px;
  align-items: start;
}

.filter-panel {
  position: sticky;
  top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-heading .icon {
  color: var(--teal);
}

.panel-heading h2,
.results-toolbar h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.4;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--cinnabar);
  background: transparent;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.filter-section {
  margin-top: 20px;
}

.filter-section h3 {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segment {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.84rem;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.segment:hover {
  color: var(--teal);
}

.segment.is-active {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 2px 8px rgba(31, 111, 104, 0.2);
}

.theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.theme-chip {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.theme-chip:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.theme-chip.is-active {
  border-color: var(--ochre);
  color: #765516;
  background: var(--ochre-soft);
}

.filter-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: var(--surface);
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.filter-row:hover,
.filter-row.is-active {
  border-color: var(--ochre);
  color: #765516;
  background: var(--ochre-soft);
}

.filter-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.84rem;
}

.filter-count {
  color: var(--ink-faint);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.76rem;
}

.compact-controls label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
}

.compact-controls select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.content-panel {
  min-width: 0;
}

.site-footer {
  margin-top: 48px;
  color: #eef1ed;
  background: #253031;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1.2fr);
  gap: 38px;
  width: min(calc(100% - 48px), var(--page-max));
  margin: 0 auto;
  padding: 34px 0 40px;
}

.footer-copyright {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-seal {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  font-size: 22px;
}

.footer-brand strong {
  display: block;
  font-size: 1.04rem;
}

.footer-brand p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
}

.copyright-line {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.76rem;
  line-height: 1.8;
}

.footer-history {
  min-width: 0;
}

.footer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.footer-heading .icon {
  color: #e1ad76;
}

.footer-heading h2 {
  margin: 0;
  font-size: 0.96rem;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.76rem;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.history-item:hover {
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.history-item .history-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #d4775c;
}

.history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
}

.footer-visitor-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.visitor-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: rgba(255, 255, 255, 0.82);
}

.visitor-stat strong {
  font-size: 1.05rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.visitor-stat small {
  color: rgba(255, 255, 255, 0.52);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.72rem;
}

.visitor-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
}

.results-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.results-toolbar h2 {
  font-size: 1.35rem;
}

.results-toolbar p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.primary-button {
  border: 1px solid var(--cinnabar);
  color: #fff;
  background: var(--cinnabar);
}

.primary-button:hover {
  background: var(--cinnabar-dark);
  box-shadow: 0 7px 18px rgba(181, 74, 52, 0.2);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--surface);
}

.secondary-button:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

.text-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.text-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    border-color 170ms ease;
}

.text-card:hover {
  transform: translateY(-3px);
  border-color: #b9c9ba;
  box-shadow: 0 12px 28px rgba(31, 42, 44, 0.1);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
}

.level-小学 {
  color: #8f3526;
  background: #f7e0d9;
}

.level-初中 {
  color: #175f59;
  background: #dceee9;
}

.level-高中 {
  color: #755611;
  background: #f3e6c1;
}

.card-bookmark {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.card-bookmark.is-bookmarked {
  border-color: var(--ochre);
  color: #8c651f;
  background: var(--ochre-soft);
}

.text-card h3 {
  margin: 14px 0 3px;
  font-size: 1.22rem;
  line-height: 1.35;
}

.card-collection {
  margin: 0;
  color: var(--ink-faint);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
}

.card-quote {
  margin: 14px 0 12px;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.card-quote mark,
.original-text mark,
.translation-text mark,
.analysis-list mark,
.lesson-list mark,
.related-card mark {
  padding: 0 2px;
  color: inherit;
  background: #f7d9a6;
  border-radius: 2px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.card-tag {
  color: var(--ink-faint);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.72rem;
}

.card-tag::before {
  content: "#";
  color: var(--ochre);
}

.card-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--teal);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.card-engagement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.card-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink-faint);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.74rem;
}

.card-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.card-metric .icon {
  width: 1em;
  height: 1em;
  color: var(--ink-faint);
}

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

.card-action {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-color: transparent;
  color: var(--ink-faint);
  background: transparent;
}

.card-action:hover {
  border-color: var(--line);
  color: var(--teal);
  background: var(--surface-soft);
}

.empty-state {
  padding: 60px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}

.empty-state .icon {
  width: 38px;
  height: 38px;
  color: var(--ink-faint);
}

.empty-state h3 {
  margin: 12px 0 4px;
  font-size: 1.1rem;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--ink-faint);
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.detail-overlay[hidden] {
  display: none;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 25, 25, 0.66);
  backdrop-filter: blur(5px);
}

.detail-panel {
  position: relative;
  display: flex;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: panel-in 180ms ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.detail-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-title-row h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-view-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-faint);
}

.detail-view-stat::before {
  content: "浏览";
}

#detailBookmark.is-bookmarked {
  border-color: var(--ochre);
  color: #8c651f;
  background: var(--ochre-soft);
}

.detail-author {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.theme-badge {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.72rem;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 30px;
}

.key-quote {
  position: relative;
  margin: 0 0 22px;
  padding: 18px 20px 18px 56px;
  border-left: 4px solid var(--cinnabar);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fbf2ed;
}

.key-quote .icon {
  position: absolute;
  top: 20px;
  left: 19px;
  width: 22px;
  height: 22px;
  color: var(--cinnabar);
}

.key-quote p {
  margin: 0;
  color: #5e2c22;
  font-size: 1.05rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.bilingual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 16px;
}

.text-block {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.translation-block {
  background: var(--surface-soft);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-number {
  color: var(--cinnabar);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
}

.section-label h3 {
  margin: 0;
  font-size: 0.96rem;
}

.scope-tag {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.7rem;
}

.original-text,
.translation-text {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 2;
  overflow-wrap: anywhere;
}

.original-text {
  white-space: pre-line;
}

.translation-text {
  color: #3e4b4d;
  white-space: pre-line;
}

.analysis-block {
  margin-top: 18px;
}

.analysis-list,
.lesson-list {
  display: grid;
  gap: 12px;
}

.analysis-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 0 2px;
}

.analysis-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
}

.analysis-item p,
.lesson-item p {
  margin: 0;
  line-height: 1.85;
}

.lesson-block {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #eadcbd;
  border-radius: var(--radius);
  background: #fdf8ed;
}

.lesson-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.lesson-item .icon {
  margin-top: 5px;
  color: var(--ochre);
}

.lesson-item p {
  color: #51401f;
}

.related-block {
  margin-top: 22px;
}

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

.related-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    transform 150ms ease;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.related-card strong {
  display: block;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.related-card span {
  display: block;
  margin-top: 5px;
  color: var(--ink-faint);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.7rem;
}

.detail-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-footer .secondary-button {
  min-width: 106px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: min(420px, calc(100% - 36px));
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(27, 36, 37, 0.92);
  box-shadow: 0 12px 30px rgba(15, 23, 24, 0.22);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.modal-open {
  overflow: hidden;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  html,
  body,
  body.modal-open,
  body.print-article {
    background: #fff !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.print-article > :not(#detailOverlay):not(.svg-sprite) {
    display: none !important;
  }

  body.print-article #detailOverlay {
    position: static;
    display: block !important;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 0;
    background: #fff;
  }

  body.print-article .detail-backdrop,
  body.print-article .detail-actions,
  body.print-article .detail-view-stat,
  body.print-article .detail-footer,
  body.print-article .related-block {
    display: none !important;
  }

  body.print-article .detail-panel {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.print-article .detail-body {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 18px 0;
  }

  body.print-article .bilingual-grid {
    grid-template-columns: 1fr;
  }

  body.print-article .text-block,
  body.print-article .lesson-block {
    break-inside: avoid;
    box-shadow: none;
  }
}

@media (max-width: 920px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }

  .filter-section:not(:first-of-type) {
    display: inline-block;
    width: auto;
    margin-right: 18px;
    vertical-align: top;
  }

  .filter-section:first-of-type {
    display: block;
  }

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

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

@media (max-width: 640px) {
  .site-header {
    min-height: 0;
  }

  .header-inner,
  .page-shell {
    width: min(calc(100% - 28px), var(--page-max));
  }

  .header-inner {
    padding: 24px 0 28px;
  }

  .brand-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-seal {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 24px;
  }

  .brand-lockup h1 {
    font-size: 1.75rem;
  }

  .brand-subtitle {
    max-width: 220px;
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .header-count {
    padding: 8px 10px;
  }

  .header-count strong {
    font-size: 1.2rem;
  }

  .hero-search {
    margin-top: 26px;
  }

  .search-control {
    min-height: 52px;
  }

  .search-suggestions {
    gap: 6px;
  }

  .page-shell {
    margin-top: 18px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 26px;
    width: min(calc(100% - 28px), var(--page-max));
    padding-top: 28px;
  }

  .filter-panel {
    padding: 16px;
  }

  .filter-section:not(:first-of-type) {
    display: block;
    margin-right: 0;
  }

  .results-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .text-card {
    min-height: 230px;
  }

  .detail-overlay {
    padding: 0;
  }

  .detail-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .detail-header {
    padding: 18px 18px 15px;
  }

  .detail-title-row h2 {
    font-size: 1.35rem;
  }

  .detail-title-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .detail-body {
    padding: 18px 18px 24px;
  }

  .key-quote {
    padding: 15px 15px 15px 44px;
  }

  .key-quote .icon {
    top: 17px;
    left: 14px;
  }

  .related-list {
    grid-template-columns: 1fr;
  }

  .detail-footer {
    padding: 12px 18px;
  }
}
