:root {
  color-scheme: light;
  --paper: #f7f1e4;
  --paper-2: #fffaf0;
  --ink: #25362f;
  --muted: #718076;
  --line: rgba(78, 66, 45, 0.16);
  --green: #2f6758;
  --green-2: #9cb7a5;
  --red: #c95b4f;
  --gold: #c39a54;
  --shadow: 0 18px 48px rgba(48, 45, 34, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  overflow-x: clip;
  background: var(--paper);
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(201, 91, 79, 0.09), transparent 26rem),
    linear-gradient(120deg, #f6f0e3 0%, #fbf7ed 48%, #eef3e8 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.ink-bg {
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: 42vh;
  opacity: 0.24;
  pointer-events: none;
}

.ink-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ink-bg path:first-child {
  fill: #738576;
}

.ink-bg path:last-child {
  fill: #b8c6b3;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(280px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(249, 244, 232, 0.9);
  backdrop-filter: blur(18px);
  /* 提升到独立合成层，滚动时 blur 不连带重绘内容区 */
  will-change: transform;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.practice-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  color: #fff9ed;
  background: linear-gradient(135deg, var(--red), #b14a3f);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(201, 91, 79, 0.22);
}

.practice-cta span {
  font-size: 15px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-seal,
.hero-seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fbf4e5;
  background: linear-gradient(145deg, #1f5448, #3a7465);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 10px 24px rgba(47, 103, 88, 0.22);
}

.brand-seal {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-family: Georgia, serif;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.search {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.78);
}

.search span {
  color: var(--muted);
  font-size: 21px;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.68);
}

.mode-tabs button,
.mode-tabs .tab-link,
.toolbar-actions button,
.next-list button {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.82);
}

.mode-tabs button,
.mode-tabs .tab-link {
  display: grid;
  place-items: center;
  height: 32px;
  min-width: 78px;
  padding: 0 12px;
  text-decoration: none;
  font-size: 14px;
}

.mode-tabs button.is-active,
.mode-tabs .tab-link.is-active,
.toolbar-actions button:first-child,
.next-list button:hover {
  border-color: transparent;
  color: #fff9ed;
  background: var(--green);
}

.layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 20px;
  width: min(1480px, calc(100vw - 40px));
  margin: 22px auto 36px;
}

.sidebar,
.rightbar {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 246, 235, 0.72);
  box-shadow: 0 12px 32px rgba(49, 45, 33, 0.08);
}

.side-title,
.section-head,
.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.side-title small {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(47, 103, 88, 0.09);
}

.school-list {
  display: grid;
  gap: 9px;
}

.school-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  color: var(--ink);
  background: transparent;
}

.school-btn:hover,
.school-btn.is-active {
  border-color: rgba(47, 103, 88, 0.26);
  background: rgba(255, 250, 240, 0.86);
}

.school-btn img,
.paper-logo img,
.reader-school img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.school-btn .logo {
  width: 42px;
  height: 42px;
  padding: 2px;
  border-radius: 13px;
  background: #fbf6eb;
  box-shadow: inset 0 0 0 1px var(--line);
}

.school-btn strong,
.school-btn span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-btn strong {
  font-size: 14px;
}

.school-btn span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.school-btn em {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47, 103, 88, 0.1);
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

/* compact name shown only in the mobile horizontal school strip */
.school-btn .school-chip {
  display: none;
}

.hero-facts {
  display: grid;
  gap: 10px;
}

.hero-facts:empty {
  display: none;
}

.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fact {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47, 103, 88, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.fact-prog {
  color: #9a4a40;
  background: rgba(201, 91, 79, 0.12);
}

.hero-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hero-topics-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-topic-chip {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.hero-topic-chip.is-active {
  color: #fff9ed;
  border-color: transparent;
  background: var(--green);
}

.reader-loading {
  padding: 40px 18px;
  color: var(--muted);
  text-align: center;
}

.content {
  min-width: 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr);
  gap: 22px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(244, 249, 239, 0.88));
  box-shadow: var(--shadow);
}

.hero-title {
  display: flex;
  gap: 14px;
  min-width: 0;
  align-items: center;
}

.hero-seal {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 34px;
}

.hero-title p,
.section-head p {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.hero-title h1,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero-title h1 {
  font-size: 26px;
}

.hero-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
}

.filter-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chips button {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.76);
}

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

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.toolbar-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.wall-section,
.topic-section,
.note-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(250, 246, 235, 0.76);
  box-shadow: 0 16px 36px rgba(49, 45, 33, 0.08);
}

.wall-section,
.topic-section {
  padding: 18px;
}

.topic-section {
  margin-top: 18px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.section-head h2 {
  font-size: 19px;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}

.paper-card {
  position: relative;
  min-width: 0;
  min-height: 258px;
  overflow: hidden;
  padding: 68px 14px 14px;
  border: 1px solid rgba(85, 70, 44, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(39, 58, 50, 0.12) 0 8px, transparent 8px),
    linear-gradient(160deg, rgba(255, 252, 244, 0.98), rgba(244, 239, 224, 0.84));
  box-shadow: 0 12px 30px rgba(56, 50, 35, 0.1);
}

.paper-card::before {
  content: "";
  position: absolute;
  inset: 48px 12px auto;
  height: 1px;
  border-top: 2px dashed rgba(128, 104, 63, 0.18);
}

.paper-logo {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  padding: 2px;
  border-radius: 13px;
  background: #fff8ea;
  box-shadow: 0 8px 18px rgba(59, 47, 34, 0.13), inset 0 0 0 1px rgba(100, 81, 52, 0.12);
}

.paper-year {
  position: absolute;
  top: 18px;
  right: 14px;
  padding: 4px 10px;
  border: 1px solid rgba(201, 91, 79, 0.45);
  border-radius: 10px;
  color: var(--red);
  background: rgba(255, 250, 240, 0.86);
  font-weight: 800;
}

.paper-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.paper-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.topic-pill {
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  color: #2f6254;
  background: rgba(47, 103, 88, 0.1);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.paper-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #2f6254;
  background: rgba(47, 103, 88, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.topic-pill:nth-child(2n) {
  color: #9a4a40;
  background: rgba(201, 91, 79, 0.1);
}

.program-pill {
  color: #9a4a40 !important;
  background: rgba(201, 91, 79, 0.12) !important;
}

.paper-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.paper-actions button {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.9);
}

.paper-actions button:first-child {
  color: #fff9ed;
  border-color: transparent;
  background: var(--green);
}

.empty {
  grid-column: 1 / -1;
  padding: 44px 18px;
  border: 1px dashed rgba(47, 103, 88, 0.28);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.topic-bars {
  overflow-x: auto;
  padding-bottom: 4px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: minmax(140px, 190px) repeat(var(--year-count), minmax(54px, 1fr));
  gap: 7px;
  align-items: center;
  min-width: max-content;
}

.heatmap-corner,
.heatmap-year {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.heatmap-corner {
  padding-left: 10px;
  text-align: left;
}

.heatmap-topic,
.heatmap-cell {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
}

.heatmap-topic {
  display: block;
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
}

.heatmap-topic strong,
.heatmap-topic span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-topic strong {
  color: var(--green);
  font-size: 13px;
}

.heatmap-topic span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.heatmap-cell {
  display: grid;
  place-items: center;
  min-width: 54px;
  padding: 0 6px;
  color: #17382f;
  background-color: rgba(47, 103, 88, calc(0.06 + var(--heat) * 0.62));
  font-size: 12px;
  font-weight: 800;
}

.heatmap-cell:empty,
.heatmap-cell.is-empty {
  background-color: rgba(91, 92, 68, 0.06);
}

.heatmap-cell.is-empty {
  cursor: default;
}

.heatmap-topic.is-active,
.heatmap-cell.is-active {
  border-color: rgba(201, 91, 79, 0.58);
  box-shadow: 0 0 0 2px rgba(201, 91, 79, 0.1);
}

.rightbar {
  position: sticky;
  top: 90px;
  align-self: start;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.note-card {
  padding: 16px;
}

.note-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.note-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.next-list {
  display: grid;
  gap: 8px;
}

.next-list button {
  min-height: 38px;
}


/* hero 方章承载校徽时：换成浅色底，深绿渐变会压住徽章本身的颜色 */
.hero-seal.has-logo {
  background: #fbf6eb;
  padding: 5px;
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 24px rgba(47, 103, 88, 0.16);
}

.hero-seal.has-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
