:root {
  --bg: #f5efe0;
  --paper: #fef9ed;
  --ink: #4b2e1a;
  --muted: #7b613b;
  --rule: #dbb87c;
  --accent: #b87333;
  --accent2: #517c43;
  --deep: #3b2410;
  --old: #b85c3a;
  --farm: #6f9440;
  --civ: #9e7a4a;
  --dynasty: #b85c3a;
  --change: #6f9440;
  --culture: #9e7a4a;
  --unify: #b85c3a;
  --rule: #6f9440;
  --exchange: #9e7a4a;
  --split: #b85c3a;
  --merge: #6f9440;
  --prosperity: #6f9440;
  --shadow: 0 22px 38px rgba(100, 70, 30, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 30px 20px;
  color: var(--ink);
  font-family: "Segoe UI", "Noto Serif SC", "华文楷体", "楷体", KaiTi, serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 215, 150, 0.35), transparent 24rem),
    radial-gradient(circle at 86% 20%, rgba(160, 97, 59, 0.16), transparent 28rem),
    linear-gradient(135deg, #f5efe0 0%, #ead5b8 100%);
}

.hero {
  text-align: center;
  margin: 0 auto 24px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 7px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: #6f4e2e;
  background: rgba(255, 250, 240, 0.72);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 0;
  color: #5e3c1c;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 3px;
  text-shadow: 2px 2px 0 rgba(255, 215, 150, 0.62);
}

.lead {
  display: inline-block;
  max-width: 880px;
  margin: 12px auto 0;
  padding-bottom: 6px;
  color: #8b6b4b;
  border-bottom: 2px dashed #c9a87b;
  font-size: 1.08rem;
  line-height: 1.7;
}

main {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.mode-switch {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 1300px;
  margin: 0 auto 16px;
}

.mode-button {
  min-width: 140px;
  padding: 12px 22px;
  border: 2px solid var(--rule);
  border-radius: 999px;
  color: #5a3a1e;
  background: linear-gradient(145deg, #fff7e6, #f3e5cb);
  box-shadow: 0 5px 12px rgba(100, 70, 30, 0.16);
  font-weight: 800;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.mode-button:hover,
.mode-button.active {
  color: #fbe9c3;
  background: linear-gradient(145deg, #8b5d32, #3b2410);
  transform: translateY(-3px);
}

.practice-mode .timeline-shell {
  margin-bottom: 22px;
}

.practice-mode .timeline-track {
  height: 560px;
  align-items: flex-start;
  padding-top: 62px;
  background-position: 0 18%;
}

.practice-mode .timeline-item {
  width: 245px;
}

.practice-mode .event-card {
  min-height: 138px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  max-width: 1300px;
  margin: 0 auto 14px;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.filter-group,
.scroll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter,
.scroll-actions button {
  padding: 10px 17px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: #5a3a1e;
  background: linear-gradient(145deg, #fff7e6, #f3e5cb);
  box-shadow: 0 4px 10px rgba(100, 70, 30, 0.14);
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.filter:hover,
.scroll-actions button:hover,
.filter.active {
  color: #fbe9c3;
  background: linear-gradient(145deg, #7a5a3a, #4b2e1a);
  transform: translateY(-3px);
}

.timeline-shell {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 56px 20px 38px;
  border: 1px solid rgba(222, 184, 135, 0.85);
  border-radius: 50px;
  background:
    linear-gradient(to bottom, rgba(253, 247, 237, 0.95), rgba(243, 229, 203, 0.96)),
    repeating-linear-gradient(90deg, rgba(156, 122, 84, 0.04) 0 14px, transparent 14px 28px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.timeline-shell::before,
.timeline-shell::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  width: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8f6035, #deb887, #7a4c28);
  box-shadow: inset 0 0 10px rgba(55, 30, 10, 0.35);
}

.timeline-shell::before {
  left: 18px;
}

.timeline-shell::after {
  right: 18px;
}

.side-scroll {
  position: absolute;
  top: 50%;
  z-index: 8;
  width: 54px;
  height: 74px;
  border: 2px solid rgba(219, 184, 124, 0.95);
  border-radius: 999px;
  color: #fbe9c3;
  background: linear-gradient(145deg, #7a5a3a, #3b2410);
  box-shadow: 0 12px 22px rgba(55, 30, 10, 0.28);
  font-size: 3rem;
  line-height: 1;
  transform: translateY(-50%);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.side-scroll:hover,
.side-scroll:focus-visible {
  background: linear-gradient(145deg, #9a6b3b, #4b2e1a);
  transform: translateY(-50%) scale(1.06);
  outline: none;
}

.side-scroll-left {
  left: 28px;
}

.side-scroll-right {
  right: 28px;
}

.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 30px 0 42px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #b08968 #f3e5cb;
}

.timeline-scroll::-webkit-scrollbar {
  height: 10px;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: #f3e5cb;
  border-radius: 10px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  background: #b08968;
  border-radius: 10px;
}

.timeline-track {
  position: relative;
  display: flex;
  align-items: center;
  min-width: max-content;
  height: 260px;
  padding: 0 54px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='8'><line x1='0' y1='4' x2='120' y2='4' stroke='%239c7a54' stroke-width='4' stroke-dasharray='9 6' stroke-linecap='round'/></svg>") repeat-x center;
  background-size: 120px 8px;
  background-position: 0 51%;
}

.era-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 142px;
  margin: 0 22px;
  flex-shrink: 0;
  position: relative;
}

.era-text {
  padding: 9px 18px;
  border: 2px solid var(--rule);
  border-radius: 30px;
  color: #fbe9c3;
  background: linear-gradient(145deg, #5e3c1c, #3b2410);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 2px;
  white-space: nowrap;
}

.era-time {
  margin-top: 7px;
  padding: 4px 12px;
  border-radius: 20px;
  color: #f2d39d;
  background: rgba(75, 46, 26, 0.76);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.era-line {
  width: 3px;
  height: 26px;
  margin-top: 6px;
  background: #9c7a54;
}

.timeline-item {
  width: 178px;
  margin: 0 22px;
  flex-shrink: 0;
  position: relative;
}

.event-card {
  width: 100%;
  min-height: 156px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 12px;
  border: 0;
  color: inherit;
  background: transparent;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-9px);
  outline: none;
}

.event-card.dimmed {
  opacity: 0.22;
}

.node-dot {
  width: 30px;
  height: 30px;
  margin-bottom: 15px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #d89e5c;
  box-shadow: 0 0 0 4px #a47148, 0 8px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  z-index: 3;
}

.event-card:hover .node-dot,
.event-card:focus-visible .node-dot {
  background: #f7b05e;
  box-shadow: 0 0 0 7px #c08854, 0 12px 18px rgba(0, 0, 0, 0.25);
  transform: scale(1.12);
}

.year-badge {
  margin-bottom: 11px;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 30px;
  color: #f9eac3;
  background: linear-gradient(145deg, #7a5a3a, #5a3a1e);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.name {
  padding: 5px 14px;
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.11);
  backdrop-filter: blur(4px);
  font-size: 1.22rem;
  font-weight: 800;
  white-space: nowrap;
}

.practice-mode .hide-title .name {
  font-size: 0;
}

.practice-mode .hide-title .name::after {
  content: attr(data-practice-label);
  font-size: 1rem;
  color: #fbe9c3;
  background: linear-gradient(145deg, #7a5a3a, #4b2e1a);
  padding: 5px 12px;
  border-radius: 999px;
}

.timeline-item[data-type="old"] .node-dot {
  background: var(--old);
  box-shadow: 0 0 0 4px #a47148, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="farm"] .node-dot {
  background: var(--farm);
  box-shadow: 0 0 0 4px #4b6a2a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="civ"] .node-dot {
  background: var(--civ);
  box-shadow: 0 0 0 4px #7a5a3a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="dynasty"] .node-dot {
  background: var(--dynasty);
  box-shadow: 0 0 0 4px #a47148, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="change"] .node-dot {
  background: var(--change);
  box-shadow: 0 0 0 4px #4b6a2a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="culture"] .node-dot {
  background: var(--culture);
  box-shadow: 0 0 0 4px #7a5a3a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="unify"] .node-dot {
  background: var(--unify);
  box-shadow: 0 0 0 4px #a47148, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="rule"] .node-dot {
  background: var(--rule);
  box-shadow: 0 0 0 4px #4b6a2a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="exchange"] .node-dot {
  background: var(--exchange);
  box-shadow: 0 0 0 4px #7a5a3a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="split"] .node-dot {
  background: var(--split);
  box-shadow: 0 0 0 4px #a47148, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="merge"] .node-dot {
  background: var(--merge);
  box-shadow: 0 0 0 4px #4b6a2a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="prosperity"] .node-dot {
  background: var(--prosperity);
  box-shadow: 0 0 0 4px #4b6a2a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="dream"] .node-dot,
.timeline-item[data-type="milestone"] .node-dot {
  background: #b85c3a;
  box-shadow: 0 0 0 4px #a47148, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="governance"] .node-dot,
.timeline-item[data-type="xiaokang"] .node-dot {
  background: #6f9440;
  box-shadow: 0 0 0 4px #4b6a2a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="security"] .node-dot,
.timeline-item[data-type="unity"] .node-dot,
.timeline-item[data-type="diplomacy"] .node-dot {
  background: #9e7a4a;
  box-shadow: 0 0 0 4px #7a5a3a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="party"] .node-dot,
.timeline-item[data-type="modernization"] .node-dot {
  background: #b85c3a;
  box-shadow: 0 0 0 4px #a47148, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="development"] .node-dot {
  background: #6f9440;
  box-shadow: 0 0 0 4px #4b6a2a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item[data-type="science"] .node-dot {
  background: #9e7a4a;
  box-shadow: 0 0 0 4px #7a5a3a, 0 8px 12px rgba(0, 0, 0, 0.2);
}

.practice-node-card {
  pointer-events: auto;
  display: none;
  width: 100%;
  min-height: 260px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(219, 184, 124, 0.9);
  border-radius: 22px;
  color: #3d2b13;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 10px 22px rgba(100, 70, 30, 0.16), inset 0 1px 4px rgba(231, 210, 181, 0.82);
}

.practice-mode .practice-node-card {
  pointer-events: auto;
  display: block;
}

.practice-node-card.no-question {
  min-height: 120px;
  opacity: 0.78;
}

.practice-node-meta {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fbe9c3;
  background: linear-gradient(145deg, #7a5a3a, #4b2e1a);
  font-size: 0.82rem;
  font-weight: 800;
}

.practice-node-card p {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.practice-node-card .blank-input {
  margin-top: 8px;
  font-size: 0.95rem;
}

.blank-submit {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: #fbe9c3;
  background: linear-gradient(145deg, #7a5a3a, #4b2e1a);
  font-size: 0.9rem;
  font-weight: 800;
}

.blank-submit:hover,
.blank-submit:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.practice-node-card .option-list {
  gap: 7px;
}

.practice-node-card .option-item {
  padding: 7px 9px;
  font-size: 0.84rem;
}

.practice-node-card.answered .node-feedback {
  display: block;
}

.node-feedback {
  display: none;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(250, 243, 229, 0.9);
  font-size: 0.86rem;
  line-height: 1.55;
}

.practice-node-card.correct {
  border-color: #6f9440;
  background: rgba(237, 250, 224, 0.9);
}

.practice-node-card.wrong {
  border-color: #b85c3a;
  background: rgba(255, 237, 226, 0.92);
}

.inline-score {
  width: fit-content;
  margin: 14px auto 0;
  padding: 9px 15px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: #5a3a1e;
  background: rgba(255, 250, 240, 0.86);
  font-weight: 800;
}

.inline-score strong {
  color: var(--accent);
}

.hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hint span {
  display: inline-block;
  font-size: 1.35rem;
  animation: slideHint 1.2s infinite alternate;
}

@keyframes slideHint {
  from { transform: translateX(0); }
  to { transform: translateX(10px); }
}

.practice-panel {
  width: min(1300px, 100%);
  margin: 22px auto 0;
  padding: 26px;
  border: 1px solid rgba(222, 184, 135, 0.9);
  border-radius: 36px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 215, 150, 0.22), transparent 22rem),
    linear-gradient(to bottom, rgba(253, 247, 237, 0.96), rgba(243, 229, 203, 0.98));
  box-shadow: var(--shadow);
}

.practice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.practice-label {
  display: inline-block;
  margin: 0 0 8px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fbe9c3;
  background: linear-gradient(145deg, #7a5a3a, #4b2e1a);
  font-weight: 800;
}

.practice-head h2 {
  margin: 0;
  color: #5e3c1c;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.practice-head p:last-child {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.score-card {
  min-width: 150px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 250, 240, 0.88);
}

.score-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.score-card strong {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 1.8rem;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 18px;
}

.practice-actions button {
  padding: 11px 18px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: #fbe9c3;
  background: linear-gradient(145deg, #7a5a3a, #4b2e1a);
  font-weight: 800;
}

.practice-actions button:last-child {
  color: #5a3a1e;
  background: linear-gradient(145deg, #fff7e6, #f3e5cb);
}

.question-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.question-card {
  padding: 18px;
  border: 1px solid rgba(219, 184, 124, 0.9);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.86);
  box-shadow: inset 0 1px 4px rgba(231, 210, 181, 0.8);
}

.question-card.correct {
  border-color: #6f9440;
  background: rgba(237, 250, 224, 0.84);
}

.question-card.wrong {
  border-color: #b85c3a;
  background: rgba(255, 237, 226, 0.86);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.question-title {
  margin: 0 0 12px;
  color: #3d2b13;
  font-size: 1.08rem;
  line-height: 1.65;
}

.blank-input {
  width: 100%;
  pointer-events: auto;
  position: relative;
  z-index: 5;
  padding: 11px 12px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  color: var(--ink);
  background: #fffaf1;
  font: inherit;
}

.option-list {
  display: grid;
  gap: 9px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(219, 184, 124, 0.76);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}

.option-item input {
  margin-top: 4px;
}

.feedback {
  display: none;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 16px;
  color: #3d2b13;
  background: rgba(250, 243, 229, 0.86);
  line-height: 1.65;
}

.question-card.answered .feedback {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px;
  background-color: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(7px);
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.25s ease;
}

.modal-backdrop.show {
  visibility: visible;
  opacity: 1;
}

.modal-card {
  width: min(760px, 94%);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  padding: 32px 30px 28px;
  border: 2px solid var(--rule);
  border-radius: 60px 20px 60px 20px;
  background:
    radial-gradient(circle at 20% 10%, #fff7e6 5%, #fae7cb 80%);
  box-shadow: 0 35px 55px rgba(0, 0, 0, 0.42), inset 0 2px 8px rgba(255, 255, 200, 0.8);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.show .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 24px;
  color: #6b4e2b;
  background: none;
  font-size: 2.2rem;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: #b0451a;
  transform: rotate(90deg);
  outline: none;
}

.modal-era {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 13px;
  border-radius: 999px;
  color: #fbe9c3;
  background: linear-gradient(145deg, #6f4e2e, #3b2410);
  font-weight: 800;
}

.modal-card h2 {
  margin: 0 46px 14px 0;
  padding-left: 18px;
  border-left: 12px solid var(--accent);
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.15;
}

.modal-time,
.modal-location,
.modal-feature {
  margin: 12px 0;
  padding: 11px 15px;
  border-radius: 18px;
  color: #3d2b13;
  background: rgba(250, 243, 229, 0.82);
  box-shadow: inset 0 1px 4px #e7d2b5;
  font-size: 1.04rem;
  line-height: 1.6;
}

.modal-body {
  display: grid;
  grid-template-columns: 1.2fr 0.82fr;
  gap: 16px;
  margin-top: 14px;
}

.modal-body > div {
  padding: 17px;
  border: 1px solid rgba(219, 184, 124, 0.9);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: inset 0 1px 4px #e7d2b5;
}

.modal-body h3 {
  margin: 0 0 10px;
  color: #5e3c1c;
}

.modal-body ul {
  margin: 0;
  padding-left: 1.2rem;
}

.modal-body li {
  margin: 0.5rem 0;
  color: #3d2b13;
  line-height: 1.68;
}

#modal-tip {
  margin: 0;
  color: #5f4a31;
  line-height: 1.78;
}

footer {
  width: min(1180px, 100%);
  margin: 24px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  body {
    padding: 24px 14px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-switch {
    flex-direction: column;
  }

  .practice-head {
    flex-direction: column;
  }

  .question-list {
    grid-template-columns: 1fr;
  }

  .timeline-shell {
    padding: 42px 14px 30px;
    border-radius: 34px;
  }

  .timeline-shell::before,
  .timeline-shell::after {
    display: none;
  }

  .side-scroll {
    width: 42px;
    height: 58px;
    font-size: 2.3rem;
    opacity: 0.9;
  }

  .side-scroll-left {
    left: 8px;
  }

  .side-scroll-right {
    right: 8px;
  }

  .timeline-track {
    height: 240px;
    padding: 0 20px;
  }

  .practice-mode .timeline-track {
    height: 560px;
    padding-top: 62px;
  }

  .timeline-item {
    width: 154px;
    margin: 0 18px;
  }

  .practice-mode .timeline-item {
    width: 235px;
  }

  .era-divider {
    width: 128px;
    margin: 0 16px;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  body {
    min-height: auto;
    padding: 0;
    background: #fff8ea !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .eyebrow,
  .lead,
  .mode-switch,
  .toolbar,
  .hint,
  .practice-panel,
  .side-scroll,
  .modal-backdrop,
  footer {
    display: none !important;
  }

  .nav,
  .page-banner,
  .auth-nav {
    display: none !important;
  }

  .hero {
    margin: 0 0 8mm;
  }

  .hero h1 {
    color: #4b2e1a !important;
    font-size: 24pt;
    text-shadow: none;
  }

  main {
    width: 100%;
  }

  .timeline-shell {
    max-width: none;
    width: 100%;
    padding: 12mm 5mm 8mm;
    border-radius: 14mm;
    overflow: visible;
    break-inside: avoid;
  }

  .timeline-shell::before,
  .timeline-shell::after {
    display: none;
  }

  .timeline-scroll {
    overflow: visible;
    padding: 0;
  }

  .timeline-track {
    transform-origin: top left;
    transform: scale(0.62);
    height: 250px;
    padding: 0 20px;
  }

  .timeline-item {
    width: 150px;
    margin: 0 14px;
  }

  .era-divider {
    width: 118px;
    margin: 0 14px;
  }

  .era-text {
    font-size: 1rem;
  }

  .era-time,
  .year-badge {
    font-size: 0.78rem;
  }

  .name {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
