﻿:root {
  --ink: #245f72;
  --line: #f0d3c5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f9f8ef 0%, #e8f2e7 100%);
}

button { font: inherit; color: inherit; cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 72px 1fr;
  background: #fff;
}

.side-nav {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 12px 8px;
  border-right: 3px solid #8a82ff;
  background: #fff3ea;
  box-shadow: 8px 0 24px rgba(115, 94, 70, .1);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  font-size: 11px;
  line-height: 1.12;
}

.brand strong { display: block; font-size: 15px; color: #237489; }
.brand span { display: block; margin-top: 8px; letter-spacing: 1px; }

.brand-mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffe3a1;
  font-weight: 900;
}

.nav-item {
  width: 45px;
  min-height: 56px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform .2s ease, background .2s ease;
}

.nav-item:hover, .nav-item.active { background: #a7efc6; transform: translateY(-1px); }
.nav-item span { font-size: 16px; font-weight: 900; }
.nav-item small { font-size: 10px; font-weight: 700; }

.map-page { min-width: 0; display: grid; grid-template-rows: auto 1fr; background: linear-gradient(180deg, #fff 0%, #f7fbfb 100%); }

.top-actions { display: none; }

.map-stage { min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0; }

.map-card {
  position: relative;
  width: 100%;
  height: 100vh;
  border: 4px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,.16)),
    repeating-linear-gradient(78deg, rgba(62, 171, 207, .24) 0 1px, transparent 1px 74px),
    linear-gradient(160deg, #dff4fb 0%, #f7f3e7 45%, #bfeaf7 100%);
  box-shadow: inset 0 0 42px rgba(255,255,255,.7);
}

.map-title {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 3;
  padding: 4px 18px;
  border-radius: 12px;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 2px;
  color: #195f64;
  text-shadow: 0 3px 0 rgba(255,255,255,.75);
  white-space: nowrap;
  pointer-events: none;
}

.china-map {
  width: 100%;
  height: 100%;
}

.prov-list-toggle {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  font-size: 22px;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.prov-list-toggle:hover { background: #fff; transform: scale(1.08); }

.prov-list-panel {
  position: absolute;
  right: 16px;
  top: 68px;
  z-index: 6;
  width: 180px;
  max-height: calc(100vh - 90px);
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  border: 2px solid #d0e8e8;
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  display: none;
  flex-direction: column;
  overflow: hidden;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.prov-list-panel.open { display: flex; }

.prov-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 10px;
  border-bottom: 2px solid #e8f0f0;
  font-size: 15px;
  color: #286f83;
}
.prov-list-header button {
  border: 0;
  background: transparent;
  font-size: 16px;
  color: #6a8a96;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.prov-list-header button:hover { background: #eef4f4; }

.prov-list-content {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.prov-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #245f72;
  cursor: pointer;
  transition: background .15s;
}
.prov-list-item:hover { background: #eef7f7; }
.prov-list-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,.08);
}

.map-error {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #a53636;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.map-error[hidden] {
  display: none;
}

.guide {
  position: absolute;
  right: 22px;
  bottom: 16px;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.guide-bubble {
  position: relative;
  padding: 15px 18px;
  border: 3px solid #f3d4c7;
  border-radius: 18px;
  background: #fff;
  color: #24677e;
  font-size: clamp(14px, 2vw, 21px);
  font-weight: 900;
  line-height: 1.28;
  box-shadow: 0 10px 22px rgba(102, 83, 73, .13);
}

.guide-bubble::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -12px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-right: 3px solid #f3d4c7;
  border-bottom: 3px solid #f3d4c7;
  transform: rotate(45deg);
}

.guide-kid {
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(77, 86, 88, .16);
  color: #d28a28;
  font-size: 30px;
  font-weight: 900;
}

.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; display: none; -webkit-box-align: center; -webkit-box-pack: center; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 42% 30%, rgba(255,255,255,.7), transparent 20%), rgba(223, 232, 213, .74);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.province-card {
  position: relative;
  z-index: 1;
  width: min(96vw, 860px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 20px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 20px 50px rgba(64, 76, 66, .2);
}

.close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #c71921;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(133, 27, 32, .28);
  z-index: 2;
}

.province-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.province-outline {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: #fff4b8;
  box-shadow: inset 0 -4px 0 rgba(211, 183, 87, .22);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.province-outline svg { max-width: 100%; max-height: 100%; display: block; margin: auto; }

.province-title-group { flex: 1; min-width: 0; }
.province-header h2 { margin: 0; font-size: 32px; color: #286f83; line-height: 1.15; }
.province-abbr { font-size: 18px; color: #5a9aaa; font-weight: 700; vertical-align: middle; margin-left: 4px; }
.province-header p { margin: 2px 0 0; font-size: 16px; font-weight: 900; color: #31748b; }

.voice-btn {
  width: 44px;
  height: 44px;
  border: 3px solid #86d9a8;
  border-radius: 50%;
  background: #b5efca;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform .15s;
}
.voice-btn:hover { transform: scale(1.1); }

.tab-bar { display: flex; gap: 8px; margin: 16px 0 14px; flex-shrink: 0; }
.tab-btn { flex: 1; padding: 10px 0; border: 2px solid #d0e8e8; border-radius: 14px; background: #f0f8f8; font-size: 15px; font-weight: 800; color: #4a7a86; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.tab-btn.active { background: #a7efc6; color: #1a5a3a; border-color: #6dc89a; }
.tab-btn:hover { background: #d4f5e6; }

.tab-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
  min-height: 0;
  align-content: start;
  max-height: 70vh;
}

.feature-card {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(55, 67, 69, .12);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(55, 67, 69, .18); }
.feature-card:active { transform: translateY(0); }

.card-emoji, .card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
@supports not (aspect-ratio: 1 / 1) {
  .card-emoji, .card-img-wrap { height: 0; padding-bottom: 100%; }
  .card-emoji, .card-img-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
}
.card-emoji { font-size: 48px; background: rgba(255,255,255,.5); }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-info { padding: 6px 8px 8px; }
.card-info h3, .card-info p { margin: 0; }
.card-info h3 { color: #163f4d; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-info small { font-size: 10px; color: #335d69; }
.card-info p { margin-top: 2px; color: #386471; font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.feature-card.animal { background: #abe3f6; border: 3px solid #80cce4; }
.feature-card.animal .card-emoji, .feature-card.animal .card-img { background: #d4f2fc; }
.feature-card.food { background: #ffb4c5; border: 3px solid #f59eb2; }
.feature-card.food .card-emoji, .feature-card.food .card-img { background: #ffd6e0; }
.feature-card.place { background: #9df0ca; border: 3px solid #7bd9ad; }
.feature-card.place .card-emoji, .feature-card.place .card-img { background: #c8f7e0; }
.feature-card.city { background: #ffe58b; border: 3px solid #f1cc5d; }
.feature-card.city .card-emoji, .feature-card.city .card-img { background: #fff1c2; }

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 58px 1fr; }
  .side-nav { gap: 16px; padding-inline: 5px; }
  .brand strong { font-size: 12px; }
  .brand span { font-size: 10px; }
  .map-stage { padding: 0 4px 4px; }
  .map-card { height: calc(100vh - 52px); }
  .guide { right: 10px; bottom: 10px; }
  .guide-kid { width: 64px; height: 64px; font-size: 24px; }
  .guide-bubble { padding: 10px 12px; }
  .province-card { width: 96vw; padding: 18px 14px 14px; }
  .province-outline { width: 60px; height: 60px; }
  .province-header h2 { font-size: 24px; }
  .tab-content { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card-emoji { font-size: 32px; }
  .card-info h3 { font-size: 12px; }
  .card-info p { font-size: 10px; }
}
