* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f8f4ed;
  color: #2f2a25;
  line-height: 1.7;
}

a {
  text-decoration: none;
  color: inherit;
}

.hero {
  min-height: 92vh;
  background: linear-gradient(135deg, #8b2e1f, #c98b4f);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 2px;
}

.nav-link {
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 999px;
  font-size: 14px;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.tag {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 12px;
}

h1 {
  font-size: 42px;
  letter-spacing: 4px;
  margin-bottom: 16px;
  line-height: 1.25;
}

.title-sub {
  font-size: 30px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 20px;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: bold;
  transition: 0.2s;
}

.btn.primary {
  background: #fff;
  color: #8b2e1f;
}

.btn.secondary {
  border: 1px solid #fff;
  color: #fff;
}

.btn:hover {
  transform: translateY(-2px);
}

.section {
  padding: 48px 20px;
  max-width: 960px;
  margin: 0 auto;
}

.section h2 {
  font-size: 28px;
  margin-bottom: 18px;
  text-align: center;
}

.section-text {
  font-size: 17px;
  background: #fff;
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: #fff;
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transition: 0.2s;
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  color: #8b2e1f;
  margin-bottom: 10px;
}

.highlight {
  text-align: center;
  background: #fff6e9;
  border-radius: 24px;
  margin-bottom: 40px;
}

.highlight p {
  margin-bottom: 20px;
}

footer {
  text-align: center;
  padding: 24px;
  background: #2f2a25;
  color: #fff;
  font-size: 14px;
}

.page-header {
  background: linear-gradient(135deg, #8b2e1f, #c98b4f);
  color: #fff;
  padding: 26px 20px;
  text-align: center;
}

.page-header h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.back-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  opacity: 0.9;
}

.list {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px;
}

.list-title {
  font-size: 22px;
  color: #8b2e1f;
  margin-bottom: 16px;
  text-align: center;
}

.empty-item {
  text-align: center;
}

.item {
  display: block;
  background: #fff;
  padding: 22px;
  border-radius: 18px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.item h3 {
  color: #8b2e1f;
  margin-bottom: 8px;
}

.map-box {
  position: relative;
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px;
}

.map-toolbar {
  max-width: 900px;
  margin: 0 auto 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.map-toolbar button {
  border: none;
  background: #8b2e1f;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.map-viewport {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background: #e8d2b5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  cursor: grab;
  touch-action: none;
}

.map-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.12s ease;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.map-viewport.is-dragging .map-canvas {
  transition: none;
}

.map-picture {
  width: 100%;
  height: 100%;
  display: block;
}

.map-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.map-markers {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  text-align: center;
  transition: opacity 0.2s, box-shadow 0.2s;
}

.map-marker:hover {
  opacity: 0.92;
}

.county-marker {
  padding: 12px 18px;
  background: rgba(139, 46, 31, 0.95);
  color: #fff;
  border-radius: 999px;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  border: 2px solid #fff6e9;
}

.town-marker {
  padding: 8px 13px;
  background: rgba(255, 246, 233, 0.96);
  color: #8b2e1f;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
  border: 2px solid #8b2e1f;
}

.heritage-marker {
  padding: 8px 12px;
  background: #8b2e1f;
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  border: 2px solid #fff6e9;
}

.map-tip {
  margin-top: 10px;
  color: #7a6a5a;
  font-size: 14px;
  text-align: center;
}

.detail {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 20px;
}

.detail-card {
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.detail-card h2 {
  color: #8b2e1f;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  background: #fff0dd;
  color: #8b2e1f;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  margin-right: 6px;
  margin-bottom: 10px;
}

.game-box {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 20px;
}

.question-card {
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.option {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font-size: 16px;
}

.option.correct {
  background: #e7f7e8;
  border-color: #57a957;
}

.option.wrong {
  background: #fde8e8;
  border-color: #d9534f;
}

.form-link {
  display: block;
  text-align: center;
  background: #8b2e1f;
  color: #fff;
  padding: 16px;
  border-radius: 16px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  .title-sub {
    font-size: 24px;
  }

  .subtitle {
    font-size: 17px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 86vh;
  }
}

.news-section-card {
  display: block;
}

.news-section-card .read-more {
  margin-top: 12px;
  color: #8b2e1f;
  font-weight: bold;
}

.timeline {
  position: relative;
  margin: 10px 0 40px;
  padding-left: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #d8b98c;
}

.timeline-item {
  position: relative;
  margin-bottom: 22px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 8px;
  width: 12px;
  height: 12px;
  background: #8b2e1f;
  border-radius: 50%;
  border: 3px solid #f8f4ed;
}

.timeline-date {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  background: #fff0dd;
  color: #8b2e1f;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
}

.timeline-content {
  background: #fff;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.timeline-content h3 {
  color: #8b2e1f;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .timeline {
    padding-left: 18px;
  }

  .timeline-item::before {
    left: -18px;
  }

  .timeline-content {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .map-toolbar {
    justify-content: center;
  }

  .map-viewport {
    border-radius: 18px;
  }

  .map-tip {
    font-size: 13px;
  }
}

.hidden {
  display: none !important;
}

.shiyi-test-box {
  max-width: 860px;
}

.test-kicker {
  color: #8b2e1f;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.test-intro {
  margin: 12px 0 24px;
  color: #5f554c;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.mode-card {
  position: relative;
  border: 2px solid #f0dfc6;
  background: #fffaf2;
  border-radius: 18px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}

.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}

.mode-card.recommended {
  border-color: #8b2e1f;
}

.mode-title {
  display: block;
  color: #8b2e1f;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
}

.mode-desc {
  display: block;
  color: #5f554c;
  font-size: 14px;
  line-height: 1.6;
}

.mode-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: #8b2e1f;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.progress-wrap {
  margin-bottom: 22px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  color: #8b2e1f;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
}

.progress-track {
  height: 10px;
  background: #f1dfc6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: #8b2e1f;
  border-radius: 999px;
  transition: width 0.2s;
}

.scale-tip {
  color: #7a6a5a;
  font-size: 14px;
  margin-bottom: 10px;
}

.scale-options {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.scale-option {
  border: 1px solid #ead9c0;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}

.scale-option:hover {
  border-color: #8b2e1f;
  background: #fff7ed;
}

.scale-option.selected {
  background: #8b2e1f;
  color: #fff;
  border-color: #8b2e1f;
  font-weight: bold;
}

.question-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.btn.red {
  background: #8b2e1f;
  color: #fff;
}

.btn.dark {
  background: #fff;
  color: #8b2e1f;
  border: 1px solid #8b2e1f;
}

.btn.disabled {
  opacity: 0.55;
}

.result-header-card,
.result-section {
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.generated-time {
  color: #7a6a5a;
  font-size: 14px;
  margin-bottom: 18px;
}

.result-main {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 20px;
  align-items: center;
}

.result-code-label {
  color: #7a6a5a;
  font-size: 14px;
}

.result-main h2 {
  color: #8b2e1f;
  font-size: 48px;
  margin: 4px 0;
  letter-spacing: 4px;
}

.result-main h3 {
  color: #2f2a25;
  font-size: 22px;
}

.profile-image-wrap {
  width: 180px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  background: #fff0dd;
  border: 2px solid #f0dfc6;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-image-fallback {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8b2e1f;
  text-align: center;
  padding: 16px;
}

.profile-image-fallback span {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 2px;
}

.profile-image-fallback p {
  font-size: 13px;
  margin-top: 8px;
}

.result-section h3 {
  color: #8b2e1f;
  margin-bottom: 16px;
}

.scale-report {
  display: grid;
  gap: 16px;
}

.scale-row {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  gap: 12px;
}

.scale-label {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.scale-label.right {
  text-align: right;
}

.scale-label strong {
  color: #8b2e1f;
  font-size: 18px;
}

.scale-label span {
  font-size: 13px;
  color: #5f554c;
}

.scale-label em {
  font-style: normal;
  font-size: 13px;
  color: #7a6a5a;
}

.scale-bar-wrap {
  position: relative;
  height: 14px;
  background: #ead9c0;
  border-radius: 999px;
  overflow: hidden;
}

.scale-bar-left {
  height: 100%;
  background: #8b2e1f;
  border-radius: 999px 0 0 999px;
}

.scale-bar-divider {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0.8);
}

.recommend-toggle {
  width: 100%;
  border: none;
  background: #fff6e9;
  color: #8b2e1f;
  padding: 16px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recommend-toggle span {
  font-size: 13px;
  color: #7a6a5a;
  font-weight: normal;
}

.recommend-list {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.recommend-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  background: #fffaf2;
  border: 1px solid #f0dfc6;
  border-radius: 16px;
  padding: 16px;
}

.recommend-rank {
  width: 36px;
  height: 36px;
  background: #8b2e1f;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.recommend-role {
  color: #8b2e1f;
  font-size: 13px;
  font-weight: bold;
}

.recommend-card h4 {
  font-size: 18px;
  margin: 4px 0;
}

.recommend-meta,
.recommend-reason,
.recommend-more {
  font-size: 14px;
  color: #6b5d50;
  margin-top: 6px;
}

.recommend-more {
  color: #8b2e1f;
  font-weight: bold;
}

.analysis-report h4 {
  color: #8b2e1f;
  margin: 16px 0 6px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }

  .question-actions {
    flex-direction: column;
  }

  .result-main {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-image-wrap {
    margin: 0 auto;
  }

  .scale-row {
    grid-template-columns: 70px 1fr 70px;
    gap: 8px;
  }

  .scale-label strong {
    font-size: 16px;
  }

  .scale-label span,
  .scale-label em {
    font-size: 12px;
  }

  .recommend-card {
    grid-template-columns: 1fr;
  }

  .recommend-rank {
    width: 32px;
    height: 32px;
  }
}

.mode-card.selected {
  border-color: #8b2e1f;
  background: #fff3e5;
  box-shadow: 0 8px 22px rgba(139, 46, 31, 0.14);
}

.selected-mode-panel {
  margin-top: 24px;
  padding: 18px;
  background: #fff6e9;
  border: 1px solid #f0dfc6;
  border-radius: 18px;
  text-align: center;
}

.selected-mode-panel p {
  color: #8b2e1f;
  font-weight: bold;
  margin-bottom: 14px;
}

.start-test-btn {
  min-width: 160px;
  text-align: center;
}

.selected-town-marker {
  background: #8b2e1f !important;
  color: #fff !important;
  border-color: #fff6e9 !important;
  box-shadow: 0 8px 22px rgba(139, 46, 31, 0.35);
}

.numbered-heritage-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: flex-start;
}

.heritage-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #8b2e1f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.heritage-card-content h3 {
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .numbered-heritage-card {
    grid-template-columns: 34px 1fr;
    gap: 10px;
  }

  .heritage-number {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
}

.map-data-note {
  max-width: 900px;
  margin: 10px auto 0;
  padding: 12px 14px;
  background: #fff6e9;
  border: 1px solid #f0dfc6;
  border-radius: 14px;
  color: #6b5d50;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.map-data-note a {
  color: #8b2e1f;
  font-weight: bold;
  text-decoration: underline;
}

.auto-next-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 12px;
  background: #fff6e9;
  border: 1px solid #f0dfc6;
  border-radius: 999px;
  color: #7a4a35;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.auto-next-toggle input {
  width: 15px;
  height: 15px;
  accent-color: #8b2e1f;
}