* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  color: #2A211B;
  background: #F3E6DA;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body:before {
  content: "";
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 240px;
  background: linear-gradient(180deg, #FF8A3D 0%, #FFA15E 55%, rgba(243, 230, 218, 0) 100%);
  pointer-events: none;
  z-index: 0;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 2px solid #FF8A3D; outline-offset: 2px; }
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 212px;
  border-radius: 28px;
  padding: 20px 16px 22px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, .34), transparent 28%),
    linear-gradient(155deg, #FFB15A 0%, #FF7A2E 46%, #E85D16 100%);
  box-shadow: 0 16px 32px rgba(214, 92, 24, .28);
  color: #fff;
}
.hero-copy { position: relative; z-index: 3; max-width: calc(100% - 108px); }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.kicker .mp-icon { width: 16px; height: 16px; }
.hero h1 {
  margin: 10px 0 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 0 rgba(160, 50, 0, .16);
}
.hero .lead {
  margin: 8px 0 0;
  max-width: none;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  color: rgba(255, 255, 255, .92);
}
.skyline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 70px;
  z-index: 1;
}
.villain {
  position: absolute;
  right: 92px;
  bottom: 8px;
  width: 86px;
  height: 128px;
  opacity: .32;
  z-index: 1;
}
.mascot {
  position: absolute;
  right: -10px;
  bottom: 0;
  width: 142px;
  height: 168px;
  z-index: 2;
}

.me {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  text-align: left;
  background: rgba(255, 248, 242, .94);
  border: 1px solid rgba(255, 138, 61, .22);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(160, 78, 24, .1);
}
.me:active { transform: scale(.985); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #FFE0C8;
  color: #C44E0C;
  flex: none;
}
.avatar .mp-icon { width: 22px; height: 22px; }
.me-k { display: block; font-size: 12px; color: #8D7364; font-weight: 700; }
.me-n { display: block; margin-top: 1px; font-size: 16px; font-weight: 800; }
.me .trail { margin-left: auto; color: #C44E0C; flex: none; }

.block-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 2px 10px;
}
.block-h h2 { margin: 0; font-size: 16px; font-weight: 800; }
.block-h .mp-icon { width: 20px; height: 20px; color: #C44E0C; }
.hint {
  margin: -4px 2px 10px;
  color: #8D7364;
  font-size: 12px;
  line-height: 1.45;
}

.resume, .case, .clue, .pick, .step, .me, .btn { transition: transform .12s ease; }
.resume, .case {
  width: 100%;
  display: block;
  text-align: left;
  background: #FFF8F2;
  border: 1px solid rgba(255, 138, 61, .2);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(160, 78, 24, .1);
}
.resume { padding: 12px; }
.resume:active, .case:active, .clue:active, .pick:active, .me:active { transform: scale(.985); }
.resume-top, .case {
  display: flex;
  gap: 12px;
  align-items: center;
}
.case { padding: 12px; margin-bottom: 10px; }
.thumb {
  width: 84px; height: 84px;
  border-radius: 18px;
  display: grid; place-items: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  flex: none;
}
.resume .thumb { width: 96px; height: 84px; }
.thumb .mp-icon { width: 36px; height: 36px; position: relative; z-index: 1; }
.thumb:after {
  content: "";
  position: absolute;
  width: 54px; height: 54px;
  border-radius: 50%;
  right: -12px; top: -14px;
  background: rgba(255, 255, 255, .16);
}
.tone-house { background: linear-gradient(160deg, #3C5CB8, #1A2348); }
.tone-lib { background: linear-gradient(160deg, #6A568F, #2C2348); }
.tone-boat { background: linear-gradient(160deg, #1F7A96, #102C44); }
.tone-gem { background: linear-gradient(160deg, #3A74D4, #162E58); }
.case-copy { min-width: 0; flex: 1; }
.chapter, .case-title, .blurb { display: block; }
.chapter { font-size: 12px; font-weight: 800; color: #C44E0C; }
.case-title {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.blurb {
  margin: 4px 0 0;
  color: #8D7364;
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-top: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #FFE6D2;
  color: #C44E0C;
  font-size: 11px;
  font-weight: 800;
}
.tag.done { background: #FF8A3D; color: #fff; }
.tag.mid { background: #FFF1D6; color: #A15C00; }
.resume-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: #F0E2D6;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #FFB15A, #FF7A2E);
}
.bar-label { font-size: 12px; font-weight: 800; color: #8D7364; flex: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFA15C, #FF7A2E);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(232, 106, 34, .28);
  flex: none;
}
.pill .mp-icon { width: 18px; height: 18px; }

.stack { display: flex; flex-direction: column; gap: 10px; }

.file {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 16px 16px 14px;
  color: #fff;
  background: linear-gradient(155deg, #FFB15A, #FF7A2E 55%, #F06A22);
  box-shadow: 0 14px 28px rgba(214, 92, 24, .28);
}
.file.bad { background: linear-gradient(155deg, #6E5E72, #3A2E3C); box-shadow: 0 14px 28px rgba(40, 24, 36, .22); }
.file.mid { background: linear-gradient(155deg, #F0A04A, #D86A18); }
.file .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  opacity: .95;
}
.file h1 {
  margin: 8px 0 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.file .sub {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .92);
  font-weight: 700;
}
.file-mark {
  position: absolute;
  right: -6px;
  bottom: -14px;
  width: 96px;
  height: 96px;
  opacity: .16;
}

.steps { display: flex; gap: 6px; margin: 12px 0; }
.step {
  flex: 1;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 248, 242, .55);
  color: #8D7364;
  font-size: 12px;
  font-weight: 800;
}
.step.on {
  background: #FFF8F2;
  color: #C44E0C;
  border-color: rgba(255, 138, 61, .28);
  box-shadow: 0 4px 10px rgba(160, 78, 24, .1);
}
.step.done { color: #C44E0C; background: rgba(255, 138, 61, .16); }
.step:disabled { opacity: .45; cursor: default; }
.step:not(:disabled):active { transform: scale(.97); }

.story, .panel {
  background: #FFF8F2;
  border: 1px solid rgba(255, 138, 61, .18);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(160, 78, 24, .08);
}
.story p, .panel p { margin: 0; color: #5A4638; font-size: 15px; line-height: 1.65; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #FFE8D6;
  color: #C44E0C;
  font-size: 12px;
  font-weight: 800;
}
.meta .mp-icon { width: 14px; height: 14px; }
.phase-lead {
  margin: 0 2px 10px;
  color: #8D7364;
  font-size: 13px;
  line-height: 1.5;
}

.clue, .pick {
  width: 100%;
  display: block;
  margin-top: 10px;
  text-align: left;
  background: #FFF8F2;
  border: 1.5px solid rgba(255, 138, 61, .2);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(160, 78, 24, .07);
}
.clue.open { border-color: #FF8A3D; background: #FFF6EE; }
.clue-h, .pick {
  display: flex;
  align-items: center;
  gap: 10px;
}
.clue-ico {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: #FFE6D2;
  color: #C44E0C;
  flex: none;
}
.clue-ico .mp-icon { width: 20px; height: 20px; }
.clue-name, .who { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; }
.seen { margin-left: auto; color: #FF8A3D; flex: none; width: 18px; height: 18px; }
.seen.dim { color: #C8B4A6; }
.clue-body {
  display: block;
  margin: 10px 0 0;
  color: #5A4638;
  font-size: 14px;
  line-height: 1.65;
}
.who { display: block; }
.who b { display: block; font-size: 15px; }
.who small { display: block; margin-top: 2px; color: #8D7364; font-size: 12px; font-weight: 700; }
.quote {
  display: block;
  margin-top: 8px;
  color: #5A4638;
  font-size: 14px;
  line-height: 1.6;
}
.group-label {
  margin: 14px 2px 8px;
  font-size: 13px;
  font-weight: 800;
  color: #8D7364;
}
.pick b { display: block; font-size: 15px; line-height: 1.4; }
.pick small { display: block; margin-top: 2px; color: #8D7364; font-size: 12px; font-weight: 700; }
.pick .mp-icon { color: #C44E0C; flex: none; }
.pick.on {
  border-color: #FF8A3D;
  background: #FFF1E4;
  box-shadow: 0 8px 18px rgba(255, 138, 61, .16);
}

.dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFA15C, #FF7A2E);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(232, 106, 34, .32);
}
.btn .mp-icon { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { opacity: .42; box-shadow: none; cursor: default; }
.btn.ghost {
  background: #FFF8F2;
  color: #C44E0C;
  border: 1px solid rgba(255, 138, 61, .28);
  box-shadow: none;
}
.btn-block { width: 100%; }

.score-card {
  margin-top: 12px;
  background: #FFF8F2;
  border: 1px solid rgba(255, 138, 61, .18);
  border-radius: 22px;
  padding: 16px 14px 14px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(160, 78, 24, .1);
}
.score-num {
  margin: 0;
  font-size: 56px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #C44E0C;
}
.score-num span { margin-left: 4px; font-size: 16px; font-weight: 800; }
.score-card .rank { margin: 6px 0 0; color: #8D7364; font-size: 13px; font-weight: 700; }
.panel { margin-top: 10px; }
.panel h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
}
.panel h3 .mp-icon { width: 18px; height: 18px; color: #C44E0C; }
.cracks { list-style: none; margin: 0; padding: 0; }
.cracks li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  color: #5A4638;
  font-size: 14px;
  line-height: 1.5;
}
.cracks .mp-icon { width: 18px; height: 18px; margin-top: 1px; color: #FF8A3D; flex: none; }
.judge { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.judge .mp-icon { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.judge.ok .mp-icon { color: #E07020; }
.judge.bad .mp-icon { color: #A8988C; }
.judge b { display: block; font-size: 14px; }
.judge span { display: block; margin-top: 2px; color: #5A4638; font-size: 13px; line-height: 1.45; }

.mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(42, 24, 16, .46);
}
.mask[hidden] { display: none; }
.sheet {
  width: min(480px, 100%);
  background: #FFF8F2;
  border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 32px rgba(0, 0, 0, .14);
}
.sheet-kicker { margin: 0; color: #8D7364; font-size: 12px; font-weight: 700; }
.sheet h2 { margin: 4px 0 0; font-size: 22px; font-weight: 900; }
.sheet input {
  width: 100%;
  height: 52px;
  margin: 12px 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 138, 61, .28);
  border-radius: 14px;
  background: #fff;
  font-size: 16px;
}
@media (min-width: 380px) {
  .hero { min-height: 228px; }
  .hero h1 { font-size: 34px; }
  .mascot { width: 156px; height: 184px; }
}
@media (max-width: 360px) {
  .file h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .resume, .case, .clue, .pick, .step, .me, .btn { transition: none; }
}
