/* 退想之间：刘大鹏日记里的士与日常 */

:root {
  --bg-paper: #f7f5f0;
  --bg-paper-dark: #ede9e0;
  --ink: #3d3229;
  --ink-light: #6b5e51;
  --accent: #a0522d;
  --accent-light: #c47a4f;
  --border: #d4cfc4;
  --shadow: rgba(61, 50, 41, 0.08);
  --shadow-hover: rgba(61, 50, 41, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", SimSun, "STSong", "Microsoft YaHei", serif;
  background-color: var(--bg-paper);
  color: var(--ink);
  line-height: 1.85;
  overflow-x: hidden;
}

/* 旧纸纹理 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(160, 82, 45, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(160, 82, 45, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* 导航 */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(247, 245, 240, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-light);
  font-size: 0.9rem;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.3s;
}

/* 首页 Hero */
#home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 1s ease both;
}

.hero-label {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--ink-light);
  margin-bottom: 2rem;
  font-weight: 400;
}

.hero-question {
  font-size: 1.05rem;
  color: var(--ink-light);
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 2.5rem auto;
  max-width: 680px;
  text-align: left;
  line-height: 1.9;
}

.hero-meta {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  border-radius: 2px;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
  background: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-hover);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-light);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  animation: bounce 2s infinite;
}

/* 通用区块 */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.section-number {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.section-intro {
  color: var(--ink-light);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  max-width: 720px;
  line-height: 1.9;
}

/* 导语 */
#intro .intro-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.intro-block h3 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 600;
}

.intro-block p {
  margin-bottom: 1rem;
  text-align: justify;
}

.intro-sources {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-paper-dark);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.intro-sources h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.intro-sources ul {
  list-style: none;
  font-size: 0.9rem;
}

.intro-sources li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border);
}

.intro-sources li:last-child {
  border-bottom: none;
}

/* 单元 */
.unit {
  border-top: 1px solid var(--border);
}

.unit-header {
  margin-bottom: 3rem;
}

.unit-period {
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.unit-title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.unit-desc {
  color: var(--ink-light);
  font-size: 1.05rem;
  max-width: 760px;
  line-height: 1.9;
}

/* 卡片网格 */
.exhibit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.exhibit-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.75rem;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(24px);
}

.exhibit-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.exhibit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-hover);
}

.exhibit-card.full-width {
  grid-column: 1 / -1;
}

.exhibit-date {
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.exhibit-date .solar {
  color: var(--ink-light);
  font-weight: 400;
  margin-left: 0.5rem;
}

.exhibit-label {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}

.exhibit-quote {
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-light);
  color: var(--ink);
  font-family: "FangSong", "STFangsong", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
}

.exhibit-source {
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-bottom: 1rem;
  font-style: italic;
}

.exhibit-note {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.8;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

/* 时间轴 */
#timeline {
  background: var(--bg-paper-dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.4rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-paper-dark);
}

.timeline-year {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.timeline-event {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.timeline-note {
  font-size: 0.9rem;
  color: var(--ink-light);
}

/* 参考文献 */
#references .ref-section {
  margin-bottom: 2.5rem;
}

#references h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

#references ul {
  list-style: none;
}

#references li {
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
  line-height: 1.7;
}

#references li:last-child {
  border-bottom: none;
}

.ref-note {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--bg-paper-dark);
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
  color: var(--ink-light);
}

/* 生平行踪图 */
#itinerary {
  background: var(--bg-paper);
  border-top: 1px solid var(--border);
}

.itinerary-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.itinerary-map {
  width: 100%;
  height: 480px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #e8e4df;
}

/* 底图加载失败时的占位背景 */
.itinerary-map .leaflet-tile-pane {
  opacity: 0.92;
}

.itinerary-map .leaflet-container {
  background: #e8e4df;
}

.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  gap: 6px;
}

.map-ctrl-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow);
  transition: background 0.2s ease;
}

.map-ctrl-btn:hover {
  background: var(--bg-paper-dark);
  border-color: var(--accent);
}

/* 地图图例 */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink-light);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.home { background: #a0522d; }
.legend-dot.travel { background: #4682b4; border-radius: 2px; }

.legend-line {
  width: 16px;
  height: 0;
  display: inline-block;
  border-top: 2px solid;
}

.legend-line.hist-prov { border-color: #8b4513; }
.legend-line.hist-pref { border-color: #a0522d; border-style: dashed; }
.legend-line.hist-cnty { border-color: #7a5230; border-width: 1px; opacity: 0.7; }

/* 历史地名标签 */
.map-label {
  pointer-events: none;
  text-align: center;
  text-shadow:
    0 0 3px rgba(255, 255, 255, 0.9),
    0 0 3px rgba(255, 255, 255, 0.9),
    0 0 3px rgba(255, 255, 255, 0.9);
}

.map-label-inner {
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", SimSun, serif;
  letter-spacing: 0.05em;
  white-space: nowrap;
  user-select: none;
}

.map-label-pref .map-label-inner {
  font-weight: 600;
}

.map-label-cnty .map-label-inner {
  font-weight: 500;
  opacity: 0.85;
}

/* ========== 地图标记视觉样式 ========== */
.custom-marker {
  background: transparent !important;
  border: none !important;
}

/* 常住地：徽章（圆点 + 外环脉冲 + 常住标签） */
.custom-marker-persist .marker-pin {
  position: relative;
  width: 30px;
  height: 30px;
  margin: 0 auto;
}

.custom-marker-persist .marker-pin-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(196, 102, 47, 0.18);
  border: 2px solid #c4662f;
  box-shadow:
    0 0 0 4px rgba(196, 102, 47, 0.08),
    0 0 12px rgba(196, 102, 47, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.25);
  animation: persistPulse 2.4s ease-in-out infinite;
}

.custom-marker-persist .marker-pin-core {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97842 0%, #a0522d 100%);
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-marker-persist .marker-pin-icon {
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

@keyframes persistPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.75; }
}

/* 旅途地：旗帜（旗杆 + 三角旗） */
.custom-marker-travel .marker-flag {
  position: relative;
  width: 30px;
  height: 32px;
  margin: 0 auto;
}

.custom-marker-travel .marker-flag-pole {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 2px;
  height: 26px;
  background: linear-gradient(180deg, #1e3a5f 0%, #2c5282 100%);
  border-radius: 1px;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.3);
}

.custom-marker-travel .marker-flag-cloth {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 22px;
  height: 16px;
  background: linear-gradient(135deg, #4a90c2 0%, #2c5282 100%);
  border: 1.5px solid #fff;
  border-radius: 0 2px 2px 0;
  box-shadow:
    2px 2px 5px rgba(0, 0, 0, 0.3),
    inset 0 0 4px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-marker-travel .marker-flag-icon {
  color: #fff;
  font-size: 9px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 标记下方的类型标签 */
.marker-label {
  margin-top: 2px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: #c4662f;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-align: center;
  width: max-content;
  margin-left: auto;
  margin-right: auto;
}

.marker-label-travel {
  background: #2c5282;
}

/* 年份滑动条 */
.year-slider-container {
  margin-bottom: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.25rem 1.5rem;
}

.year-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.year-label {
  font-size: 0.85rem;
  color: var(--ink-light);
  letter-spacing: 0.03em;
}

.year-display {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: 0.05em;
}

.year-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.year-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.year-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.year-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--ink-light);
  user-select: none;
}

/* 日记摘录卡片 */
.diary-excerpts {
  margin-bottom: 1.5rem;
}

.excerpts-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink-light);
  border: 1px dashed var(--border);
  border-radius: 3px;
  background: #fff;
  font-size: 0.95rem;
}

.excerpt-location {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 1rem;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  animation: excerptIn 0.35s ease forwards;
}

@keyframes excerptIn {
  to { opacity: 1; transform: translateY(0); }
}

.excerpt-location-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-paper-dark);
  border-bottom: 1px solid var(--border);
}

.excerpt-loc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.excerpt-loc-dot.home { background: #a0522d; }
.excerpt-loc-dot.city { background: #8b6914; }
.excerpt-loc-dot.work { background: #2d6a4f; }
.excerpt-loc-dot.travel { background: #4682b4; }

.excerpt-loc-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.excerpt-loc-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--ink-light);
}

.excerpt-items {
  padding: 0.75rem 1.25rem;
}

.excerpt-item {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.93rem;
  line-height: 1.8;
  color: var(--ink);
}

.excerpt-item:last-child {
  border-bottom: none;
}

.excerpt-date {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.4rem;
  white-space: nowrap;
}

.excerpt-text {
  color: var(--ink);
}

.excerpt-text .kw-highlight {
  background: rgba(160, 82, 45, 0.15);
  padding: 0 0.1rem;
  border-radius: 2px;
  font-weight: 600;
}

/* 时间轴时段条 */
.timeline-periods {
  display: flex;
  gap: 0;
  margin: 1.5rem 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
}

.period {
  flex: 1;
  min-width: 100px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background 0.25s ease, color 0.25s ease;
  user-select: none;
}

.period:last-child {
  border-right: none;
}

.period:hover {
  background: var(--bg-paper-dark);
}

.period.active {
  background: var(--accent);
  color: #fff;
}

.period.active .period-years {
  color: rgba(255, 255, 255, 0.8);
}

.period-years {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-light);
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}

.period-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* 时段详情 */
.period-detail {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: opacity 0.3s ease;
}

.period-detail h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.period-detail h3 small {
  font-weight: 400;
  color: var(--ink-light);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.detail-locations {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}

.period-detail ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style-type: square;
}

.period-detail ul li {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.period-detail ul li:last-child {
  color: var(--ink-light);
  font-size: 0.85rem;
  list-style: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

/* Leaflet 自定义样式 */
.itinerary-map .leaflet-popup-content {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 10px 14px;
}

.itinerary-map .leaflet-popup-content strong {
  color: var(--accent);
}

.itinerary-map .leaflet-popup-content em {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-top: 2px;
  font-style: normal;
}

/* 自定义标记 */
.marker-persist {
  filter: hue-rotate(0deg);
}

.marker-travel {
  filter: hue-rotate(200deg);
}

/* 行踪数据来源 */
.itinerary-sources {
  background: var(--bg-paper-dark);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.itinerary-sources h3 {
  font-size: 1rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.itinerary-sources ul {
  margin: 0;
  padding-left: 1.25rem;
}

.itinerary-sources ul li {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--ink);
}

.source-note {
  font-size: 0.83rem;
  color: var(--ink-light);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

@media (max-width: 768px) {
  .itinerary-map {
    height: 340px;
  }

  .map-controls {
    top: 8px;
    right: 8px;
  }

  .timeline-periods {
    flex-wrap: nowrap;
  }

  .period {
    min-width: 90px;
    padding: 0.75rem 0.5rem;
  }

  .period-years {
    font-size: 0.7rem;
  }

  .period-title {
    font-size: 0.82rem;
  }
}

/* 文献检索 */
#search {
  background: var(--bg-paper-dark);
  border-top: 1px solid var(--border);
}

.search-box {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  max-width: 720px;
}

#search-input {
  flex: 1;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
}

.search-status {
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
  min-height: 1.5rem;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-result {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.search-result.visible {
  opacity: 1;
  transform: translateY(0);
}

.search-result:hover {
  box-shadow: 0 8px 24px var(--shadow-hover);
}

.search-result-date {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.search-result-date .solar {
  color: var(--ink-light);
  font-weight: 400;
  margin-left: 0.5rem;
}

.search-result-text {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--ink);
}

.search-result-text mark {
  background: rgba(160, 82, 45, 0.18);
  color: var(--ink);
  padding: 0 0.15rem;
  border-radius: 2px;
  font-weight: 600;
}

.search-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-light);
  border: 1px dashed var(--border);
  border-radius: 3px;
  background: #fff;
}

.search-loading {
  color: var(--accent);
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .search-box {
    flex-direction: column;
  }

  #search-btn {
    width: 100%;
  }
}

/* 页脚 */
footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--ink-light);
  font-size: 0.85rem;
}

/* 动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* 响应式 */
@media (max-width: 900px) {
  .exhibit-grid {
    grid-template-columns: 1fr;
  }

  #intro .intro-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-paper);
    flex-direction: column;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  section {
    padding: 3.5rem 1.5rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .exhibit-card {
    padding: 1.25rem;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
