/* 华园暖像素主题：取自项目演示稿中的奶油白、木棕、砖橙与草木绿。 */
:root {
  --bg: #f5ecd9;
  --bg2: #fff8e7;
  --panel: #fff8e7;
  --panel2: #f5e6c8;
  --ink: #3d2c1e;
  --ink-dim: #786450;
  --gold: #e8833a;
  --green: #6a994e;
  --red: #c85050;
  --line: #c8aa82;
  --shadow: 0 2px 0 #5a4632;
  --pixel: 3px;
  color-scheme: light;
}

* { scrollbar-color: #c8aa82 #fff8e7; }
html, body { min-height: 100%; }
body {
  background: #f5ecd9;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* 顶栏：标题、进度和模式在第一眼内各自成组。 */
.hud {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 14px 22px;
  padding: 12px clamp(16px, 2vw, 28px);
  background: #fff8e7;
  border-bottom: 3px solid #6a994e;
}
.hud .logo {
  flex: 0 0 auto;
  margin: 0;
  color: #3d2c1e;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .02em;
  text-shadow: none;
}
.hud .logo small {
  margin-top: 4px;
  color: #786450;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.hud .stats {
  flex: 1 1 390px;
  gap: clamp(12px, 2vw, 26px);
}
.stat { color: #786450; font-size: 12px; }
.stat b { color: #3d2c1e; font-size: 14px; }
.lv-badge {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid #d8b56e;
  border-radius: 5px;
  background: #ffe6b4;
  color: #5a4632;
  box-shadow: none;
  font-size: 12px;
}
.xp-wrap, .progress-wrap { min-width: 135px; }
.xp-bar, .progress-bar {
  height: 10px;
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid #c8aa82;
  border-radius: 3px;
  background: #f5e6c8;
}
.xp-fill { background: #e8833a; }
.progress-fill { background: #6a994e; }
.mode-switch {
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid #c8aa82;
  border-radius: 7px;
  background: #f5e6c8;
}
.mode-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 5px;
  color: #786450;
  font-size: 12px;
}
.mode-btn:hover { background: #ffe6b4; color: #3d2c1e; }
.mode-btn.active { background: #e8833a; color: #3d2c1e; }
.hud .hint {
  flex: 1 0 100%;
  margin-top: -7px;
  color: #786450;
  font-size: 11px;
  text-align: right;
}

/* 主体：地图是主视线，面板负责承载任务和工具。 */
.layout {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 350px);
  gap: 16px;
  max-width: 1540px;
  padding: 16px clamp(12px, 1.6vw, 24px) 24px;
}
.map-wrap {
  border: 3px solid #b98755;
  border-radius: 5px;
  outline: 1px solid rgba(90, 70, 50, .24);
  outline-offset: -5px;
  background: #c5d8bd;
  box-shadow: 0 4px 0 #a98258, 0 8px 18px rgba(61, 44, 30, .12);
  cursor: default;
}
.map-night { filter: brightness(.94) saturate(.98) contrast(1.08); }
.map-region image { filter: brightness(1.04) saturate(1.08) contrast(1.06); }
.map-glow { box-shadow: inset 0 0 28px 5px rgba(61, 44, 30, .06); }
.map-wrap.all-complete { box-shadow: 0 4px 0 #a98258, 0 8px 18px rgba(61, 44, 30, .12); }
.building-module:hover, .building-module:focus-visible {
  background: rgba(255, 200, 120, .25);
  filter: none;
}
.building-module:focus-visible { outline: 2px solid #e8833a; }
.site-label {
  --label-bg: #3d2c1e;
  gap: 6px;
  padding: 7px 11px 7px 9px;
  border: 2px solid #fff8e7;
  border-radius: 4px;
  outline: 1px solid #5a4632;
  background: var(--label-bg);
  color: #fff8e7;
  box-shadow: 2px 3px 0 rgba(61, 44, 30, .3);
  font-size: 12px;
}
.site-label::before { width: 8px; height: 8px; border-radius: 1px; }
.coord-layer { --coord-line: rgba(61, 44, 30, .16); }
.coord-guide-x, .coord-guide-y { background: rgba(200, 80, 80, .6); }
.coord-point { border-color: #fff8e7; box-shadow: 0 0 0 2px #5a4632; }
.coord-readout {
  border: 1px solid #5a4632;
  border-radius: 5px;
  background: #fff8e7;
  color: #3d2c1e;
  box-shadow: 2px 3px 0 rgba(61, 44, 30, .25);
}
.coord-readout button {
  border: 1px solid #5a4632;
  border-radius: 4px;
  background: #e8833a;
  color: #3d2c1e;
}
.coord-toggle {
  border: 1px solid #c8aa82;
  border-radius: 5px;
  background: #f5e6c8;
  color: #5a4632;
}
.coord-toggle.active {
  border-color: #5a4632;
  background: #e8833a;
  color: #3d2c1e;
}

/* 工具栏用两行网格展示全部入口，避免横向滚动藏住功能。 */
.panel {
  max-height: min(78vh, 760px);
  border: 2px solid #c8aa82;
  border-radius: 8px;
  background: #fff8e7;
  box-shadow: none;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
  border-bottom: 1px solid #c8aa82;
  background: #f5e6c8;
}
.tab {
  min-height: 39px;
  padding: 8px 4px;
  color: #786450;
  font-size: 11px;
  white-space: nowrap;
}
.tab:hover { color: #3d2c1e; background: #ffe6b4; }
.tab.active { background: #e4efd8; color: #35552b; }
.tab-body { padding: 14px; }
.section-title, .question-form label, .pending-questions > b { color: #5a7e3e; }
.chapter-head { border-color: #e5d4b4; }
.chapter-head span { background: #ffe6b4; color: #5a4632; }
.chapter-head b, .task .t-name, .npc-card .n-name, .ach .a-name { color: #3d2c1e; }
.chapter-complete {
  border: 1px solid #96c882;
  border-radius: 5px;
  background: #edf5e5;
  color: #4f783b;
}
.chapter-locked {
  border: 1px dashed #c8aa82;
  border-radius: 5px;
  background: #f8efdE;
}
.chapter-locked span { color: #783f19; font-size: 11px; }
.chapter-locked b { color: #3d2c1e; }
.chapter-locked small, .task .t-tag, .npc-card .n-title, .ach .a-desc { color: #786450; font-size: 11px; }
.task, .npc-card, .ach, .info-card, .post-card {
  border: 1px solid #dfc9a4;
  border-radius: 5px;
  background: #fffdf5;
}
.task { padding: 9px 10px; }
.task:hover { border-color: #e8833a; background: #fff8e7; }
.task .num {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: #f5e6c8;
  color: #786450;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
}
.task.done .num { background: #6a994e; color: #fff8e7; }
.task.done .check { color: #6a994e; }
.btn {
  border: 1px solid #c8aa82;
  border-radius: 5px;
  background: #f5e6c8;
  color: #3d2c1e;
}
.btn:hover { border-color: #6a994e; background: #edf5e5; }
.btn.primary { border-color: #c46c2f; background: #e8833a; color: #3d2c1e; }
.npc-card .av { border-radius: 4px; border: 2px solid #fff8e7; }
.ach .a-ic { color: #a9642f; }
.ai-log, .schedule-day, .pending-question {
  border: 1px solid #dfc9a4;
  border-radius: 5px;
  background: #fffdf5;
  color: #3d2c1e;
}
.ai-msg .who, .ai-tip, .feature-help, .file-status, .empty-state,
.course-card span, .course-card small, .scene-preview small { color: #786450; }
.ai-msg .bubble, .ai-msg.me .bubble {
  border: 1px solid #dfc9a4;
  border-radius: 5px;
  background: #f5e6c8;
  color: #3d2c1e;
}
.ai-msg.me .who { color: #a9642f; }
.ai-input input, .schedule-form input, .schedule-form select,
.post-form input, .post-form select, .post-form textarea,
.question-form input, .search-row input {
  border: 1px solid #c8aa82;
  border-radius: 5px;
  background: #fffdf5;
  color: #3d2c1e;
}
.ai-input input:focus, .schedule-form input:focus, .schedule-form select:focus,
.post-form input:focus, .post-form select:focus, .post-form textarea:focus,
.question-form input:focus, .search-row input:focus {
  outline: 2px solid #e8833a;
  outline-offset: 1px;
}
.schedule-form, .post-form, .question-form {
  border: 1px solid #dfc9a4;
  border-radius: 6px;
  background: #f8efde;
}
.schedule-day h4 { color: #5a7e3e; }
.course-card {
  border-left-color: #e8833a;
  border-radius: 3px;
  background: #fff8e7;
  color: #3d2c1e;
}
.empty-slot { color: #786450; font-size: 11px; }
.text-button { color: #b84e42; }
.info-card b, .post-card h4 { color: #5a7e3e; }
.info-card p, .post-card p { color: #3d2c1e; }
.info-card small, .post-card small { color: #786450; font-size: 11px; }
.forum-category.active { border-color: #5a7e3e; background: #6a994e; color: #fffdf5; }
.pending-question { border-left: 3px solid #6a994e; }
.location-actions { border-color: #e5d4b4; }
.scene-card { border: 1px solid #dfc9a4; border-radius: 5px; background: #fffdf5; }
.scene-card figcaption b { color: #3d2c1e; }
.scene-card .scene-delete { color: #b84e42; }
.scene-preview img { border: 2px solid #dfc9a4; border-radius: 5px; }
.scene-name-field {
  border: 1px solid #c8aa82;
  border-radius: 5px;
  background: #f8efde;
  color: #3d2c1e;
}
.scene-name-field input {
  border: 1px solid #c8aa82;
  border-radius: 5px;
  background: #fffdf5;
  color: #3d2c1e;
}
.scene-name-field input:focus {
  outline: 2px solid #e8833a;
  outline-offset: 1px;
}
.scene-name-field .scene-help { color: #786450; }
.map-role-button {
  border: 1px solid #c8aa82;
  border-radius: 5px;
  background: #f5e6c8;
  color: #5a4632;
}
.map-role-button:hover {
  border-color: #5a4632;
  background: #ffe6b4;
}

/* 建筑详情和通关提示保留像素边框，内容区保持浅色便于阅读。 */
.modal-mask, .stage-mask { background: rgba(61, 44, 30, .48); }
.modal, .stage-card {
  border: 3px solid #5a4632;
  border-radius: 7px;
  background: #fff8e7;
  color: #3d2c1e;
  box-shadow: 4px 4px 0 rgba(61, 44, 30, .25);
}
.modal-head { border-bottom: 1px solid #dfc9a4; }
.modal-head .m-title { color: #3d2c1e; }
.modal-head .m-tag { color: #a9642f; }
.modal-close { border: 1px solid #c8aa82; color: #5a4632; }
.modal-close:hover { border-color: #c85050; color: #c85050; }
.layer-tabs { gap: 5px; }
.layer-tab {
  border: 1px solid #c8aa82;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #f5e6c8;
  color: #786450;
}
.layer-tab.active { background: #e4efd8; color: #35552b; }
.layer-body { border-color: #dfc9a4; }
.layer-tab .lt { font-size: 11px; }
.layer-body h4 { color: #5a7e3e; }
.layer-body p { color: #3d2c1e; }
.exp-item { border: 1px solid #dfc9a4; border-radius: 5px; background: #fffdf5; }
.stage-card h2 { color: #a9642f; text-shadow: none; }
.stage-card p { color: #3d2c1e; }
.start-card h2 { text-shadow: none; }
.modal-head .m-ic, .stage-card h2 { font-family: inherit; }
.start-btn {
  border: 2px solid #5a4632;
  border-radius: 5px;
  background: #e8833a;
  color: #3d2c1e;
  box-shadow: none;
}
.start-btn:hover { box-shadow: none; }
.toast {
  border: 2px solid #5a4632;
  border-radius: 5px;
  background: #6a994e;
  color: #fff8e7;
  box-shadow: none;
}

/* 进入网页后直接看地图；保留遮罩节点以兼容现有脚本。 */
.start { display: none !important; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel { max-height: none; }
  .hud .hint { text-align: left; }
}

@media (max-width: 620px) {
  .hud { gap: 10px 14px; padding: 11px 18px; }
  .hud .logo { font-size: 18px; }
  .hud .stats { flex-basis: 100%; order: 3; gap: 10px 18px; }
  .stat { font-size: 11px; }
  .xp-wrap, .progress-wrap { min-width: 118px; flex: 1; }
  .mode-switch { order: 2; width: auto; margin-left: auto; }
  .mode-btn { padding-inline: 9px; font-size: 11px; }
  .hud .hint { order: 4; margin-top: -3px; }
  .layout { gap: 13px; padding: 12px 12px 20px; }
  .map-wrap { border-width: 3px; }
  .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tab { min-height: 40px; font-size: 11px; }
  .tab-body { padding: 12px; }
  .layer-tabs { padding: 12px 12px 0; }
  .layer-tab { padding: 8px 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}



