:root {
  --ink: #3f2a1c;
  --cream: #fff3c7;
  --cream-2: #ffe6a0;
  --paper: #fff8e2;
  --brown: #8a5a2b;
  --brown-dark: #5f3a1c;
  --gold: #f0b93c;
  --red: #e0654a;
  --green: #5ac36a;
  --blue: #5ab0e6;
  --shadow: 0 6px 0 rgba(74, 44, 20, .4);
  font-family: "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #7cc35f; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.game-shell { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
#game {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
  pointer-events: none;
  opacity: .9;
  filter: saturate(.92) contrast(.96);
}

.game-shell::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 248, 226, .58), transparent 34%),
    linear-gradient(180deg, rgba(124, 195, 95, .05), rgba(38, 88, 71, .28));
}

/* 通用像素面板外观 */
.player-card, .quest-bar, .tool-stack button, .dock-btn, .toast {
  border: 4px solid var(--brown);
  border-radius: 10px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

/* —— 左上玩家卡 —— */
.player-card {
  position: absolute;
  z-index: 5;
  left: 16px;
  top: 16px;
  width: 258px;
  padding: 10px 12px;
}
.pc-top { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 44px;
  height: 44px;
  flex: none;
  border: 3px solid var(--brown-dark);
  border-radius: 5px;
  image-rendering: pixelated;
  background:
    linear-gradient(#5b3424 0 18%, transparent 0),
    linear-gradient(180deg, transparent 18%, #f5c18b 18% 45%, transparent 45%),
    linear-gradient(180deg, transparent 45%, #3b70d7 45% 100%);
  box-shadow: inset 0 -6px #2f5bb0;
}
.pc-meta strong { display: block; font-size: 17px; line-height: 1.1; }
.pc-meta span { display: block; margin-top: 3px; color: #9a671f; font-size: 12.5px; }

.skills { display: grid; gap: 5px; margin-top: 9px; }
.skill { display: flex; align-items: center; gap: 6px; }
.skill-name { width: 34px; font-size: 11px; font-weight: 900; }
.skill-track { flex: 1; height: 9px; border: 2px solid var(--brown-dark); border-radius: 5px; background: #f3e6c2; overflow: hidden; }
.skill-fill { height: 100%; border-radius: 3px; transition: width .35s ease; }
.skill-lv { width: 26px; font-size: 10.5px; font-weight: 900; color: #9a671f; text-align: right; }
.cloud-pill,
.profile-pill {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 5px 7px;
  border: 2px dashed #c98c3a;
  border-radius: 8px;
  background: #fffdf4;
  color: #9a671f;
  font-size: 11.5px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
  cursor: pointer;
}
.profile-pill {
  border-style: solid;
  background: #fff3c7;
  color: var(--brown-dark);
  text-align: center;
}
.cloud-pill:hover { background: #fff3c7; }
.profile-pill:hover { background: #ffe6a0; }
.cloud-pill:active,
.profile-pill:active { transform: translateY(1px); }
.cloud-pill.on { border-style: solid; color: #2d7c3e; background: #ecffd8; }
.cloud-pill.warn { color: #b64a2f; background: #fff0df; }

/* —— 今日行动台：主流程入口 —— */
.action-home {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 108px;
  width: min(456px, calc(100vw - 330px));
  transform: translateX(-50%);
}
.home-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 5px solid var(--brown);
  border-radius: 16px;
  background: rgba(255, 248, 226, .96);
  box-shadow: var(--shadow), inset 0 -5px rgba(92, 56, 31, .08);
  backdrop-filter: blur(2px);
}
.home-card h1 {
  margin: 0;
  color: var(--brown-dark);
  font-size: 22px;
  line-height: 1.16;
}
.home-subtitle {
  margin: -4px 0 0;
  color: #8a6a3a;
  font-size: 13px;
  line-height: 1.55;
}
.home-announcement {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px dashed #c98c3a;
  border-radius: 11px;
  background: #fffdf4;
  color: var(--brown-dark);
  box-shadow: none;
  text-align: left;
}
.home-announcement[hidden] { display: none; }
.home-announcement b {
  padding: 2px 7px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: #fff3c7;
  color: #9a671f;
  font-size: 11px;
  font-weight: 900;
}
.home-announcement span {
  min-width: 0;
  overflow: hidden;
  color: #7a5a2c;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-recommend {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 3px solid var(--brown);
  border-radius: 13px;
  background: linear-gradient(180deg, #fff7cf, #ffe08a);
  box-shadow: inset 0 -4px rgba(92, 56, 31, .12);
}
.home-recommend .next-tag {
  width: fit-content;
  padding: 2px 7px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: #fffdf4;
  color: var(--brown-dark);
  font-size: 10.5px;
  font-weight: 900;
}
.home-recommend b {
  color: var(--brown-dark);
  font-size: 16px;
  line-height: 1.25;
}
.home-recommend p {
  margin: 0;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
}
.home-recommend .primary {
  min-height: 40px;
  border: 3px solid var(--brown-dark);
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 0 rgba(74, 44, 20, .3);
  font-weight: 900;
}
.home-recommend .primary:active,
.home-actions button:active,
.home-stats button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(74, 44, 20, .25);
}
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.home-stats button {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 5px;
  border: 3px solid var(--brown);
  border-radius: 11px;
  background: #fffdf4;
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(92, 56, 31, .2);
}
.home-stats span {
  overflow: hidden;
  color: var(--brown-dark);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-stats b {
  color: #9a671f;
  font-size: 11px;
}
.home-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.home-actions button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 7px 4px 6px;
  border: 3px solid var(--brown);
  border-radius: 12px;
  background: var(--paper);
  color: var(--brown-dark);
  box-shadow: 0 3px 0 rgba(92, 56, 31, .2);
  font-weight: 900;
}
.home-actions .ic {
  width: 24px;
  height: 24px;
}
.home-actions b {
  font-size: 12px;
  line-height: 1.1;
}

/* —— 主线进度条 —— */
.quest-bar {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  max-width: min(340px, calc(100vw - 300px));
}
.qb-day { flex: none; padding: 2px 8px; border-radius: 6px; background: var(--red); color: #fff; font-size: 12px; font-weight: 900; }
.qb-title { font-size: 13.5px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* —— 右侧工具栏 —— */
.tool-stack {
  position: absolute;
  z-index: 5;
  right: 14px;
  top: 16px;
  display: grid;
  gap: 9px;
}
.tool-stack button {
  width: 66px;
  padding: 7px 0 5px;
  display: grid;
  place-items: center;
  gap: 3px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}
.tool-stack button:active { transform: translateY(2px); box-shadow: 0 4px 0 rgba(74,44,20,.4); }

/* —— 底部行动区 —— */
.action-dock {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
}
.dock-btn {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 88px;
  padding: 9px 14px 7px;
  background: var(--gold);
  color: var(--brown-dark);
}
.dock-btn b { font-size: 13px; }
.dock-btn.danger { background: var(--red); color: #fff; }
.dock-btn.ghost { background: var(--paper); }
.dock-btn:active { transform: translateY(2px); box-shadow: 0 4px 0 rgba(74,44,20,.4); }

/* —— 像素图标（CSS 绘制，无 emoji）—— */
.ic { width: 26px; height: 26px; image-rendering: pixelated; background-repeat: no-repeat; background-size: 100% 100%; }
.dock-btn .ic { width: 24px; height: 24px; }
.ic-quest {
  background:
    linear-gradient(#8a5a2b 0 0) 0 0/100% 100% no-repeat;
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px #fff8e2, inset 0 8px 0 6px #e0654a;
}
.ic-map {
  border-radius: 50%;
  background: conic-gradient(from 45deg, #e0654a 0 25%, #fff8e2 0 50%, #e0654a 0 75%, #fff8e2 0);
  box-shadow: inset 0 0 0 3px #8a5a2b;
}
.ic-monster {
  border-radius: 6px 6px 3px 3px;
  background: #8a6fd0;
  box-shadow: inset 4px 6px 0 -2px #fff, inset -8px 6px 0 -6px #fff, inset 0 -6px 0 #6b52b0;
}
.ic-vault {
  border-radius: 3px;
  background: #e8c15a;
  box-shadow: inset 0 0 0 3px #8a5a2b, inset 0 0 0 7px #e8c15a, inset 0 0 0 9px #8a5a2b;
}
.ic-report {
  border-radius: 2px;
  background:
    linear-gradient(#8a5a2b 0 0) 0 20%/100% 2px no-repeat,
    linear-gradient(#8a5a2b 0 0) 0 50%/70% 2px no-repeat,
    linear-gradient(#8a5a2b 0 0) 0 80%/85% 2px no-repeat,
  #fff8e2;
  box-shadow: inset 0 0 0 2px #8a5a2b;
}
.ic-share {
  border-radius: 5px;
  background:
    radial-gradient(circle at 30% 28%, #fff8e2 0 12%, transparent 13%),
    radial-gradient(circle at 72% 20%, #fff8e2 0 12%, transparent 13%),
    radial-gradient(circle at 68% 74%, #fff8e2 0 12%, transparent 13%),
    linear-gradient(35deg, transparent 0 43%, #fff8e2 44% 50%, transparent 51%),
    linear-gradient(145deg, transparent 0 43%, #fff8e2 44% 50%, transparent 51%),
    #5ab0e6;
  box-shadow: inset 0 0 0 3px #5f3a1c;
}
.ic-cloud {
  border-radius: 50% 50% 7px 7px;
  background:
    radial-gradient(circle at 35% 42%, #fff8e2 0 24%, transparent 25%),
    radial-gradient(circle at 55% 34%, #fff8e2 0 28%, transparent 29%),
    radial-gradient(circle at 70% 48%, #fff8e2 0 22%, transparent 23%),
    linear-gradient(#5ab0e6 0 0);
  box-shadow: inset 0 0 0 3px #5f3a1c, inset 0 -5px 0 rgba(0,0,0,.12);
}
.ic-cam {
  border-radius: 4px;
  background: #5f3a1c;
  box-shadow: inset 0 0 0 3px #fff8e2, inset 0 0 0 4px #5f3a1c, 0 -5px 0 -1px #5f3a1c;
  position: relative;
}
.ic-cam::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: #5ab0e6; box-shadow: inset 0 0 0 2px #fff8e2; }
.ic-catch {
  border-radius: 50%;
  background: linear-gradient(#e0654a 0 50%, #fff8e2 0 100%);
  box-shadow: inset 0 0 0 3px #5f3a1c;
  position: relative;
}
.ic-catch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; transform: translate(-50%,-50%); border-radius: 50%; background: #fff8e2; box-shadow: 0 0 0 2px #5f3a1c; }
.ic-spirit {
  border-radius: 50% 50% 45% 45%;
  background: #8fd0e6;
  box-shadow: inset -4px -3px 0 rgba(0,0,0,.12);
  position: relative;
}
.ic-spirit::after { content: ""; position: absolute; left: 28%; top: 40%; width: 4px; height: 4px; border-radius: 50%; background: #3f2a1c; box-shadow: 10px 0 0 #3f2a1c; }

/* —— 弹窗 —— */
dialog { width: min(500px, calc(100vw - 24px)); padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(48, 30, 18, .5); }
.sheet {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 22px 20px 20px;
  border: 5px solid var(--brown);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 10px 0 rgba(60, 36, 20, .4);
  max-height: min(86vh, calc(100dvh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
  height: 32px;
  border: 3px solid var(--brown);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
.eyebrow { margin: 0; color: #a46d21; font-size: 12px; font-weight: 900; letter-spacing: 1px; }
.sheet h1 { margin: 0; font-size: 23px; line-height: 1.15; }
.sheet p { margin: 0; font-size: 14px; line-height: 1.6; }
.panel-notice {
  padding: 8px 10px;
  border: 2px dashed #c98c3a;
  border-radius: 9px;
  background: #fffdf4;
  color: #9a671f;
  font-size: 12.5px;
  font-weight: 900;
}
.panel-notice.error {
  border-color: var(--red);
  background: #fff0df;
  color: #b64a2f;
}
.panel-notice.ok {
  border-color: var(--green);
  background: #ecffd8;
  color: #2d7c3e;
}

/* 商机卡牌 */
.oppo-card {
  border: 3px solid var(--brown);
  border-radius: 10px;
  background: var(--cream);
  padding: 12px;
  display: grid;
  gap: 6px;
}
.opportunity-entry {
  padding: 0;
  overflow: hidden;
  scroll-margin-top: 8px;
}
.opportunity-entry > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.opportunity-entry > summary::-webkit-details-marker,
.route-step > summary::-webkit-details-marker { display: none; }
.opportunity-summary > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.opportunity-summary small,
.opportunity-summary em {
  overflow: hidden;
  color: #9a671f;
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-summary small {
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 1px 5px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: #fffdf4;
  color: var(--brown-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
}
.status-badge.blue,
.status-strip .blue { background: #e6f5ff; color: #2f6f9c; border-color: #5ab0e6; }
.status-badge.yellow,
.status-strip .yellow { background: #fff3c7; color: #956313; border-color: #f0b93c; }
.status-badge.green,
.status-strip .green { background: #ecffd8; color: #2d7c3e; border-color: #5ac36a; }
.status-badge.orange,
.status-strip .orange { background: #fff0df; color: #b64a2f; border-color: #e0894a; }
.status-badge.purple,
.status-strip .purple { background: #f1e8ff; color: #6b52b0; border-color: #8a6fd0; }
.opportunity-summary b {
  overflow: hidden;
  color: var(--brown-dark);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-summary > strong {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border: 3px solid var(--brown);
  border-radius: 9px;
  background: var(--gold);
  color: var(--brown-dark);
  font-size: 14px;
  box-shadow: inset 0 -4px rgba(92, 56, 31, .15);
}
.opportunity-entry[open] > .opportunity-summary {
  border-bottom: 2px dashed #d0a360;
  background: #fff0b8;
}
.opportunity-body {
  display: grid;
  gap: 7px;
  padding: 12px;
}
.status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.status-strip.compact {
  margin: 0;
}
.status-filter-hint {
  margin: 0 0 -2px;
  color: #8a6a3a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}
.status-strip span,
.status-strip button {
  min-width: 0;
  display: grid;
  gap: 1px;
  padding: 6px 4px;
  border: 2px solid var(--brown);
  border-radius: 10px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 900;
}
.status-strip button {
  min-height: 44px;
  appearance: none;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(92, 56, 31, .22);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.status-strip button.all {
  background: #fffdf4;
  color: var(--brown-dark);
  border-color: var(--brown);
}
.status-strip button:hover {
  filter: saturate(1.06) brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(92, 56, 31, .24);
}
.status-strip button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(92, 56, 31, .18);
}
.status-strip button.active {
  outline: 3px solid rgba(95, 58, 28, .22);
  outline-offset: 1px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.75), 0 1px 0 rgba(92, 56, 31, .2);
}
.status-strip b {
  color: var(--brown-dark);
  font-size: 15px;
  line-height: 1;
}
.status-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 2px solid #d0a360;
  border-radius: 10px;
  background: #fffdf4;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}
.status-card b {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--brown-dark);
  white-space: nowrap;
}
.status-card span {
  color: #7a5a2c;
}
.status-card em {
  color: #9a671f;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.status-card.blue { background: #e6f5ff; border-color: #5ab0e6; }
.status-card.yellow { background: #fff3c7; border-color: #f0b93c; }
.status-card.green { background: #ecffd8; border-color: #5ac36a; }
.status-card.orange { background: #fff0df; border-color: #e0894a; }
.status-card.purple { background: #f1e8ff; border-color: #8a6fd0; }
.decision-card {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 2px solid #d0a360;
  border-radius: 10px;
  background: #fffdf4;
  font-size: 12px;
  line-height: 1.45;
}
.decision-card b { color: var(--brown-dark); }
.decision-card span { color: #7a5a2c; }
.decision-card.green { background: #ecffd8; border-color: #5ac36a; }
.decision-card.yellow { background: #fff3c7; border-color: #f0b93c; }
.decision-card.orange { background: #fff0df; border-color: #e0894a; }
.decision-card.purple { background: #f1e8ff; border-color: #8a6fd0; }
.oppo-card .oc-scene { font-size: 12px; color: #a46d21; font-weight: 900; }
.oppo-card .oc-title { font-size: 16px; font-weight: 900; }
.oc-row { display: grid; grid-template-columns: 52px 1fr; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.oc-row b { color: var(--brown-dark); }
.oc-risk { color: #b64a2f; }
.oppo-photo {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border: 3px solid var(--brown);
  border-radius: 8px;
  image-rendering: auto;
  background: #fffdf4;
}
.proof-thumb {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  margin-top: 5px;
  border: 2px solid var(--brown);
  border-radius: 7px;
  image-rendering: auto;
  background: #fffdf4;
}
.oppo-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 3px;
}
.oppo-actions button {
  min-height: 34px;
  border: 2px solid var(--brown);
  border-radius: 8px;
  background: #fffdf4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(92, 56, 31, .22);
}
.oppo-actions button.danger {
  background: var(--red);
  color: #fff;
}
.action-log {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 2px dashed #c98c3a;
  border-radius: 9px;
  background: #fffdf4;
}
.action-log div {
  display: grid;
  gap: 2px;
  font-size: 12px;
  line-height: 1.45;
}
.action-log b { color: var(--brown-dark); }
.action-log span { color: #8a6a3a; }
.route-map {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 3px solid var(--brown);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff9dc, #fff0b8);
  box-shadow: inset 0 -4px rgba(92, 56, 31, .1);
}
.route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--brown-dark);
  font-size: 13px;
  font-weight: 900;
}
.route-head span {
  min-width: 42px;
  padding: 3px 7px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: var(--gold);
  text-align: center;
}
.route-map > p {
  color: #8a6a3a;
  font-size: 12px;
  line-height: 1.55;
}
.route-source {
  padding: 6px 8px;
  border: 2px dashed #d0a360;
  border-radius: 8px;
  background: rgba(255, 253, 244, .72);
}
.next-mission {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 2px solid var(--brown-dark);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff5bd, #ffd86f);
  box-shadow: inset 0 -4px rgba(92, 56, 31, .12);
}
.next-mission.done {
  background: linear-gradient(180deg, #f4ffd9, #bcf28c);
  border-color: var(--green);
}
.next-mission .next-tag {
  width: fit-content;
  padding: 2px 6px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: #fffdf4;
  color: var(--brown-dark);
  font-size: 10.5px;
  font-weight: 900;
}
.next-mission b {
  color: var(--brown-dark);
  font-size: 13px;
}
.next-mission p,
.next-mission small {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}
.next-mission small.advanced {
  color: #8a6a3a;
}
.next-mission button {
  width: fit-content;
  margin-top: 2px;
  padding: 6px 10px;
  border: 2px solid var(--brown-dark);
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(74, 44, 20, .28);
}
.route-steps {
  display: grid;
  gap: 7px;
}
.route-step {
  padding: 8px;
  border: 2px dashed #c98c3a;
  border-radius: 9px;
  background: #fffdf4;
  opacity: .78;
}
.route-step.locked { opacity: .55; }
.route-step.active {
  border-style: solid;
  background: #fff8d1;
  opacity: 1;
  box-shadow: 0 3px 0 rgba(92, 56, 31, .16);
}
.route-step.done {
  border-color: var(--green);
  background: #f0ffd7;
  opacity: .92;
}
.route-step-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--brown-dark);
  font-size: 12.5px;
  list-style: none;
  cursor: pointer;
}
.route-step-title em {
  margin-left: auto;
  color: #9a671f;
  font-size: 10.5px;
  font-style: normal;
  white-space: nowrap;
}
.route-step-title span {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid var(--brown);
  border-radius: 7px;
  background: var(--gold);
  font-weight: 900;
}
.route-step.done .route-step-title span {
  background: var(--green);
  color: #fff;
}
.route-step-content {
  display: grid;
  gap: 6px;
  padding-top: 7px;
}
.route-step p {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px;
  margin: 0;
  color: var(--ink);
  font-size: 11.8px;
  line-height: 1.45;
}
.route-step p b { color: var(--brown-dark); }
.route-step p.route-advanced {
  color: #8a6a3a;
}
.route-step-content button {
  min-height: 34px;
  border: 2px solid var(--brown);
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(92, 56, 31, .22);
}
.route-step-content button:disabled {
  background: #e7d5ad;
  color: #8a6a3a;
  box-shadow: none;
}
.radar-result {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 2px dashed #c98c3a;
  border-radius: 9px;
  background: #fffdf4;
  font-size: 12.5px;
  line-height: 1.45;
}
.radar-score {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 3px solid var(--brown);
  border-radius: 9px;
  background: var(--gold);
  color: var(--brown-dark);
  font-size: 16px;
  font-weight: 900;
  box-shadow: inset 0 -4px rgba(92, 56, 31, .15);
}
.signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.signal-list span {
  padding: 3px 7px;
  border: 2px solid #d0a360;
  border-radius: 999px;
  background: #fff8e2;
  color: #9a671f;
  font-size: 11px;
  font-weight: 900;
}
.cloud-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 3px solid var(--brown);
  border-radius: 10px;
  background: var(--cream);
}
.cloud-box h2 {
  margin: 0;
  font-size: 16px;
}
.cloud-note {
  color: #8a6a3a;
  font-size: 12.5px;
  line-height: 1.6;
}
.cloud-grid {
  display: grid;
  gap: 10px;
}
.score-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 3px solid var(--brown);
  border-radius: 12px;
  background: linear-gradient(180deg, #e6f5ff, #fff8e2);
  box-shadow: inset 0 -4px rgba(92, 56, 31, .08);
}
.score-card span {
  color: #2f6f9c;
  font-size: 12px;
  font-weight: 900;
}
.score-card b {
  color: var(--brown-dark);
  font-size: 24px;
  line-height: 1;
}
.score-card p {
  color: #7a5a2c;
  font-size: 12px;
  line-height: 1.55;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.asset-grid div {
  display: grid;
  gap: 3px;
  padding: 9px 6px;
  border: 2px solid var(--brown);
  border-radius: 10px;
  background: #fffdf4;
  text-align: center;
}
.asset-grid b {
  color: var(--brown-dark);
  font-size: 16px;
  line-height: 1;
}
.asset-grid span {
  color: #9a671f;
  font-size: 10.5px;
  font-weight: 900;
}
.share-card-box {
  display: grid;
  gap: 10px;
}
.share-preview {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border: 4px solid var(--brown);
  border-radius: 12px;
  background: #fffdf4;
  box-shadow: inset 0 -4px rgba(92, 56, 31, .08);
}
.share-tips {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 2px dashed #c98c3a;
  border-radius: 10px;
  background: #fffdf4;
  color: #7a5a2c;
  font-size: 12px;
  line-height: 1.55;
}
.share-tips b {
  color: var(--brown-dark);
}

/* 动作按钮 */
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sheet-actions button, .sheet .primary {
  min-height: 44px;
  border: 3px solid var(--brown);
  border-radius: 10px;
  background: var(--cream-2);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(92, 56, 31, .3);
  font-weight: 900;
  font-size: 14px;
}
.sheet .primary, .sheet-actions button.primary { grid-column: 1 / -1; background: var(--gold); }
.sheet .primary.danger, .sheet-actions button.danger { background: var(--red); color: #fff; }
.sheet .secondary {
  min-height: 40px;
  border: 3px solid var(--brown);
  border-radius: 10px;
  background: #fffdf4;
  color: var(--brown-dark);
  box-shadow: 0 4px 0 rgba(92, 56, 31, .2);
  font-weight: 900;
  font-size: 13px;
}
.sheet-actions button:disabled, .sheet .primary:disabled {
  opacity: .62;
  filter: grayscale(.25);
  box-shadow: none;
  cursor: wait;
}
.sheet-actions button.full { grid-column: 1 / -1; }

/* 表单 */
label { display: grid; gap: 6px; font-weight: 900; font-size: 13px; }
textarea, input, select {
  width: 100%;
  border: 3px solid #c98c3a;
  border-radius: 8px;
  padding: 9px;
  outline: none;
  color: var(--ink);
  background: #fffdf4;
}
textarea:focus, input:focus, select:focus { border-color: var(--red); }
.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 2px dashed #c98c3a;
  border-radius: 9px;
  background: #fffdf4;
  color: #8a6a3a;
  font-size: 12.5px;
}
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
.file-box input { display: none; }
.file-box span {
  min-height: 90px;
  border: 3px dashed #c98c3a;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #a46d21;
  font-weight: 700;
  background: #fffdf4;
}
.file-box img { width: 100%; max-height: 180px; object-fit: cover; }

/* 吞金兽选择网格 */
.monster-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.monster-pick {
  display: grid;
  gap: 3px;
  padding: 6px 2px;
  border: 3px solid var(--brown);
  border-radius: 9px;
  background: #fffdf4;
  text-align: center;
}
.monster-pick.on { background: var(--cream-2); box-shadow: inset 0 0 0 2px var(--gold); }
.mp-face { width: 30px; height: 30px; margin: 0 auto; border-radius: 8px 8px 5px 5px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 13px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); }
.mp-name { font-size: 10px; font-weight: 900; line-height: 1.1; }
.monster-log {
  display: grid;
  gap: 8px;
}
.monster-record {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 3px solid var(--brown);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff9dc, #fff0b8);
  box-shadow: inset 0 -4px rgba(92, 56, 31, .1);
}
.monster-record.avoided {
  background: linear-gradient(180deg, #f4ffd9, #d7f7a6);
  border-color: #4b9f4d;
}
.monster-record-head {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
}
.monster-record-head .mp-face {
  width: 34px;
  height: 34px;
  margin: 0;
}
.monster-record-head b {
  display: block;
  color: var(--brown-dark);
  font-size: 13.5px;
}
.monster-record-head span {
  display: block;
  margin-top: 2px;
  color: #8a6a3a;
  font-size: 11.5px;
  line-height: 1.35;
}
.monster-record-head strong {
  color: var(--red);
  font-size: 14px;
  white-space: nowrap;
}
.monster-record-head strong.positive {
  color: #2d7c3e;
}
.monster-record p {
  color: #8a6a3a;
  font-size: 12px;
  line-height: 1.5;
}

/* 周小结 */
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.report-grid div {
  display: grid;
  gap: 3px;
  padding: 10px 6px;
  border: 3px solid var(--brown);
  border-radius: 11px;
  background: #fffdf4;
  text-align: center;
  box-shadow: inset 0 -3px rgba(92, 56, 31, .08);
}
.report-grid b {
  color: var(--brown-dark);
  font-size: 18px;
  line-height: 1;
}
.report-grid span {
  color: #9a671f;
  font-size: 11px;
  font-weight: 900;
}
.insight-card {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 3px solid var(--brown);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9dc, #fff0b8);
  box-shadow: inset 0 -4px rgba(92, 56, 31, .1);
}
.insight-card.warn {
  background: linear-gradient(180deg, #fff2dc, #ffd5b6);
}
.insight-card.challenge {
  background: linear-gradient(180deg, #edffe0, #c9f595);
  border-color: #4b9f4d;
}
.insight-kicker {
  width: fit-content;
  padding: 2px 6px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: #fffdf4;
  color: #9a671f;
  font-size: 10.5px;
  font-weight: 900;
}
.insight-card b {
  color: var(--brown-dark);
  font-size: 15px;
  line-height: 1.35;
}
.insight-card p {
  margin: 0;
  color: #7a5a2c;
  font-size: 12.5px;
  line-height: 1.55;
}
.mini-list {
  display: grid;
  gap: 7px;
}
.mini-list div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 2px dashed #d0a360;
  border-radius: 9px;
  background: #fffdf4;
}
.mini-list span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: #8a6a3a;
  font-size: 12px;
  line-height: 1.35;
}
.mini-list b {
  overflow: hidden;
  color: var(--brown-dark);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 能力雷达 / 数值行 */
.stat-row { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; border-bottom: 2px dotted #d8c08a; }
.stat-row b { color: var(--brown-dark); }
.hint-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }

/* toast */
.toast {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 11px 18px;
  text-align: center;
  font-weight: 900;
  font-size: 14px;
  background: var(--paper);
}

@media (max-width: 720px) {
  .game-shell {
    height: 100dvh;
    min-height: 100dvh;
  }
  #game {
    opacity: .52;
    filter: saturate(.85) contrast(.92);
  }
  .game-shell::after {
    background:
      linear-gradient(180deg, rgba(255, 248, 226, .5), rgba(124, 195, 95, .18) 34%, rgba(38, 88, 71, .26)),
      radial-gradient(circle at 50% 28%, rgba(255, 248, 226, .62), transparent 38%);
  }
  .player-card {
    left: 10px;
    right: 10px;
    top: max(8px, env(safe-area-inset-top));
    width: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    padding: 8px;
    border-width: 3px;
    border-radius: 12px;
    transform: none;
    box-shadow: 0 4px 0 rgba(74, 44, 20, .34);
  }
  .pc-top {
    grid-column: 1 / -1;
    min-width: 0;
    gap: 8px;
  }
  .avatar {
    width: 34px;
    height: 34px;
    border-width: 2px;
  }
  .pc-meta {
    min-width: 0;
  }
  .pc-meta strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pc-meta span {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .skills {
    display: none;
  }
  .profile-pill,
  .cloud-pill {
    width: auto;
    min-width: 0;
    min-height: 28px;
    margin-top: 7px;
    padding: 5px 6px;
    border-width: 2px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
  }
  .action-home {
    top: calc(max(8px, env(safe-area-inset-top)) + 150px);
    left: 10px;
    right: 10px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: auto;
    transform: none;
  }
  .home-card {
    max-height: 100%;
    overflow-y: auto;
    padding: 12px;
    gap: 9px;
    border-width: 4px;
    border-radius: 14px;
    overscroll-behavior: contain;
  }
  .home-card h1 { font-size: 18px; }
  .home-subtitle,
  .home-recommend p { font-size: 12px; }
  .home-recommend {
    gap: 6px;
    padding: 10px;
    border-width: 3px;
  }
  .home-recommend b {
    font-size: 15px;
  }
  .home-recommend .primary {
    min-height: 42px;
  }
  .home-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .home-stats button {
    padding: 7px 3px 6px;
    border-width: 2px;
    border-radius: 9px;
  }
  .home-stats span {
    font-size: 16px;
  }
  .home-stats b {
    font-size: 10px;
    line-height: 1.15;
  }
  .home-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .home-actions button {
    min-height: 48px;
    padding: 6px 2px 5px;
    border-width: 2px;
    border-radius: 10px;
  }
  .home-actions .ic {
    width: 20px;
    height: 20px;
  }
  .home-actions b {
    font-size: 10.5px;
  }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  .status-card { grid-template-columns: 1fr; }
  .quest-bar { display: none; }
  .tool-stack {
    left: 10px;
    right: 10px;
    top: calc(max(8px, env(safe-area-inset-top)) + 94px);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }
  .tool-stack button {
    width: auto;
    min-width: 0;
    min-height: 46px;
    padding: 4px 0 3px;
    border-width: 3px;
    border-radius: 10px;
    font-size: 10.5px;
    box-shadow: 0 3px 0 rgba(74,44,20,.3);
  }
  .tool-stack .ic { width: 18px; height: 18px; }
  .action-dock {
    gap: 7px;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    justify-content: center;
    transform: none;
  }
  .dock-btn {
    min-width: 0;
    flex: 1;
    padding: 7px 4px 6px;
    border-width: 3px;
  }
  .dock-btn b { font-size: 12px; }
  dialog {
    width: min(500px, calc(100vw - 12px));
  }
  .sheet {
    max-height: calc(100dvh - 12px);
    padding: 18px 14px 14px;
    border-width: 4px;
    border-radius: 14px;
  }
  .sheet h1 {
    padding-right: 34px;
    font-size: 20px;
  }
  .sheet-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .opportunity-entry > summary {
    align-items: stretch;
  }
  .opportunity-summary small,
  .opportunity-summary em {
    white-space: normal;
  }
  .opportunity-summary > strong {
    width: 40px;
    height: 40px;
  }
  .oc-row {
    grid-template-columns: 44px 1fr;
  }
  .route-step-title {
    flex-wrap: wrap;
  }
  .route-step-title em {
    margin-left: 31px;
  }
  .route-step p {
    grid-template-columns: 38px 1fr;
    font-size: 12px;
  }
  .monster-grid { grid-template-columns: repeat(3, 1fr); }
  .oppo-actions { grid-template-columns: 1fr; }
  .toast {
    top: auto;
    bottom: calc(92px + env(safe-area-inset-bottom));
    width: calc(100vw - 28px);
  }
}

@media (max-width: 380px) {
  .home-stats,
  .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-stack button {
    font-size: 10px;
  }
}
