:root {
  --palace-red: #8f1d1c;
  --palace-red-dark: #5e1110;
  --gold: #c9a35a;
  --gold-light: #efd8a4;
  --ink: #2f241a;
  --paper: #f8f0dc;
  --paper-deep: #eadbb8;
  --jade: #25685c;
  --shadow: rgba(58, 31, 18, 0.22);
  --phone-w: 390px;
  --phone-h: 844px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.6), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(201, 163, 90, 0.25), transparent 28%),
    linear-gradient(135deg, #fcf6e8, #f4e4c4 45%, #eadeb8);
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  overflow: hidden;
}

.stage {
  display: grid;
  grid-template-columns: 66px var(--phone-w) 66px;
  gap: 18px;
  align-items: center;
  padding: 20px;
}

.phone {
  width: var(--phone-w);
  height: min(var(--phone-h), calc(100vh - 40px));
  min-height: 720px;
  border-radius: 42px;
  padding: 14px;
  background: linear-gradient(145deg, #351612, #0f0806);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  position: relative;
}

.screen {
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: var(--paper);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(88, 43, 25, 0.15);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(143, 29, 28, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 29, 28, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.notch {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 28px;
  border-radius: 0 0 18px 18px;
  background: #160a08;
  z-index: 30;
}

.page {
  position: absolute;
  inset: 0;
  padding: 48px 22px 92px;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(18px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 1;
}

.page.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  z-index: 2;
}

.page::-webkit-scrollbar {
  display: none;
}

.top-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--palace-red-dark);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.top-mark::before,
.top-mark::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(143, 29, 28, 0.48), transparent);
}

.top-mark span {
  padding: 0 10px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.hero-card,
.paper-card,
.route-card,
.activity-panel,
.profile-card {
  position: relative;
  background:
    /* 细微的纸张纤维肌理 */
    repeating-linear-gradient(45deg, rgba(120, 80, 40, 0.04) 0px, rgba(120, 80, 40, 0.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(-45deg, rgba(120, 80, 40, 0.03) 0px, rgba(120, 80, 40, 0.03) 1px, transparent 1px, transparent 4px),
    /* 做旧晕染效果 */
    radial-gradient(circle at 10% 10%, rgba(160, 110, 60, 0.05), transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(180, 100, 50, 0.08), transparent 30%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(139, 90, 43, 0.12) 80%, rgba(100, 50, 20, 0.25) 100%),
    /* 旧纸底色 */
    linear-gradient(180deg, #ebd8b7, #d5b98b);
  border: none;
  border-radius: 4px;
}

.hero-card,
.activity-panel,
.profile-card {
  border-top: 10px solid #5C3A21;
  border-bottom: 10px solid #5C3A21;
  box-shadow: 0 14px 28px var(--shadow), 0 -2px 4px rgba(0, 0, 0, 0.3) inset, 0 2px 4px rgba(0, 0, 0, 0.3) inset;
}

.paper-card,
.route-card {
  border-left: 10px solid #5C3A21;
  border-right: 10px solid #5C3A21;
  box-shadow: 0 14px 28px var(--shadow), -2px 0 4px rgba(0, 0, 0, 0.3) inset, 2px 0 4px rgba(0, 0, 0, 0.3) inset;
}

.hero-card::after,
.paper-card::after,
.activity-panel::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 163, 90, 0.42);
  border-radius: 2px;
  pointer-events: none;
}

.hero-card {
  padding: 36px 22px 24px;
  min-height: 528px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-card>.btn {
  margin-top: auto;
  width: 100%;
}

.hero-desc {
  text-align: center;
  margin-bottom: 24px;
  padding: 0 10px;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: auto -30px -80px -30px;
  height: 260px;
  background:
    radial-gradient(ellipse at center, rgba(143, 29, 28, 0.18), transparent 63%),
    repeating-linear-gradient(90deg, rgba(143, 29, 28, 0.13) 0 10px, rgba(201, 163, 90, 0.1) 10px 20px);
  clip-path: polygon(0 42%, 7% 34%, 14% 42%, 21% 30%, 28% 42%, 35% 34%, 42% 42%, 49% 28%, 56% 42%, 63% 34%, 70% 42%, 77% 31%, 84% 42%, 91% 34%, 100% 42%, 100% 100%, 0 100%);
}

.logo-guofeng {
  width: 46px;
  height: 46px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #a42c2a, var(--palace-red-dark));
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px var(--gold),
    inset 0 0 0 4px var(--palace-red-dark),
    0 8px 16px rgba(94, 17, 16, 0.35);
  transform: rotate(45deg);
  margin: 0 8px;
}

.logo-guofeng>span {
  transform: rotate(-45deg);
  color: var(--gold-light);
  font-size: 26px;
  font-family: "STKaiti", "Kaiti SC", "STSong", serif;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.title-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  justify-content: center;
  width: 100%;
}

.title-row h1 {
  font-size: 28px;
  color: var(--palace-red-dark);
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.subtitle {
  margin-top: 10px;
  font-size: 14px;
  color: #5e422b;
  line-height: 1.6;
}

.mascot-wrap {
  margin: 30px auto 22px;
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
}

.ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(201, 163, 90, 0.62);
  background: radial-gradient(circle, rgba(201, 163, 90, 0.14), transparent 62%);
}

.ring::before,
.ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  height: 2px;
  background: rgba(143, 29, 28, 0.22);
  transform: translate(-50%, -50%);
}

.ring::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.mascot-character {
  width: 158px;
  height: 158px;
  position: relative;
  z-index: 2;
  background: url('../assets/images/xiaoheng.png') center / contain no-repeat;
  filter: drop-shadow(0 10px 16px rgba(55, 30, 15, 0.18));
  animation: float 3.8s ease-in-out infinite;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.98);
}

.primary {
  width: 100%;
  background: linear-gradient(135deg, var(--palace-red), #b7332b);
  color: #fff8e7;
  box-shadow: 0 10px 20px rgba(143, 29, 28, 0.28);
  font-size: 15px;
  letter-spacing: 0.1em;
}

.secondary {
  background: rgba(201, 163, 90, 0.16);
  color: var(--palace-red-dark);
  border: 1px solid rgba(143, 29, 28, 0.24);
}

.ghost {
  background: rgba(255, 250, 235, 0.68);
  color: var(--palace-red-dark);
  border: 1px dashed rgba(143, 29, 28, 0.34);
}

.page-title {
  font-size: 20px;
  color: var(--palace-red-dark);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 600;
}

.page-desc {
  font-size: 13px;
  color: #72543b;
  line-height: 1.6;
  margin-bottom: 14px;
}

.start-hint,
.route-summary,
.location-status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 250, 235, 0.72);
  border: 1px solid rgba(143, 29, 28, 0.16);
  color: #62432f;
  font-size: 13px;
  line-height: 1.55;
}

.pref-summary {
  margin-top: 0;
  margin-bottom: 12px;
  text-align: center;
  font-size: 12px;
  color: #5d3d2a;
}
.pref-summary b {
  color: var(--palace-red-dark);
  font-weight: 600;
}

.start-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.sticky-bottom-action {
  position: sticky;
  bottom: -92px;
  left: 0;
  right: 0;
  padding: 24px 22px 92px 22px;
  margin: 20px -22px -92px -22px;
  background: linear-gradient(to bottom, transparent, var(--paper) 24px, var(--paper));
  z-index: 30;
  pointer-events: none;
}

.sticky-bottom-action > * {
  pointer-events: auto;
}

.compass-mini {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  position: relative;
  flex: 0 0 20px;
}

.compass-mini::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 4px;
  height: 12px;
  background: var(--palace-red);
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
  transform-origin: 50% 80%;
}

.start-hint.loading .compass-mini::after {
  animation: spin 0.9s linear infinite;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 16px;
}

.flow-step {
  padding: 9px 4px;
  border-radius: 15px;
  text-align: center;
  font-size: 12px;
  color: #76533b;
  background: rgba(255, 250, 235, 0.66);
  border: 1px solid rgba(143, 29, 28, 0.14);
}

.flow-step.active {
  color: #fff8e7;
  background: var(--palace-red);
  box-shadow: 0 8px 16px rgba(143, 29, 28, 0.18);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(143, 29, 28, 0.14);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row b {
  color: var(--palace-red-dark);
  font-weight: 700;
}

.btn.loading {
  opacity: 0.82;
  pointer-events: none;
}

.btn.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.paper-card {
  padding: 20px 18px;
  margin-bottom: 14px;
}

.extra-info-card {
  padding-bottom: 18px;
}

.extra-info-tip {
  margin: -4px 0 14px;
  color: #6a4730;
  font-size: 13px;
  line-height: 1.6;
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--palace-red-dark);
  font-size: 12px;
  font-weight: 600;
}

.profile-field.full {
  grid-column: 1 / -1;
}

.profile-field input,
.profile-field select {
  width: 100%;
  border: 1px solid rgba(143, 29, 28, 0.28);
  border-radius: 6px;
  padding: 9px 10px;
  background: rgba(255, 248, 231, 0.74);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.profile-field input:focus,
.profile-field select:focus {
  border-color: var(--palace-red);
  box-shadow: 0 0 0 3px rgba(143, 29, 28, 0.1);
}

.question-title {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.question-title::before {
  content: "◆";
  color: var(--gold);
  font-size: 13px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid rgba(143, 29, 28, 0.35);
  background: linear-gradient(135deg, rgba(250, 240, 220, 0.7), rgba(230, 210, 175, 0.5));
  color: var(--palace-red-dark);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 6px rgba(90, 50, 20, 0.08);
}

.chip::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(143, 29, 28, 0.15);
  border-radius: 2px;
  pointer-events: none;
  transition: all 0.2s ease;
}

.chip.active,
.chip:hover {
  color: #fff8e7;
  background: linear-gradient(135deg, var(--palace-red), #9e2321);
  border-color: var(--palace-red-dark);
  box-shadow: 0 6px 14px rgba(143, 29, 28, 0.35);
  transform: translateY(-2px);
}

.chip.active::before,
.chip:hover::before {
  border-color: rgba(255, 248, 231, 0.45);
}

.route-card {
  padding: 16px 16px 16px 76px;
  margin-bottom: 13px;
  min-height: 86px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.route-card:hover,
.route-card.selected {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px var(--shadow);
  border-color: rgba(143, 29, 28, 0.46);
}

.route-card.selected::after {
  content: "已选";
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff8e7;
  background: var(--jade);
  font-size: 12px;
}

.route-no {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--palace-red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--palace-red);
  background: transparent;
  font-family: "STKaiti", "Kaiti SC", "STSong", serif;
  font-size: 18px;
  font-weight: bold;
  transform: rotate(-4deg);
  opacity: 0.85;
}

.route-no::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--palace-red);
  border-radius: 2px;
  opacity: 0.6;
}

.route-card.selected .route-no {
  background: var(--palace-red);
  color: #fff8e7;
  opacity: 1;
}

.route-card.selected .route-no::before {
  border-color: rgba(255, 248, 231, 0.45);
}

.route-card h3 {
  color: var(--palace-red-dark);
  font-size: 16px;
  margin-bottom: 4px;
  font-weight: 600;
}

.route-card p {
  color: #6a4b34;
  font-size: 12px;
  line-height: 1.5;
}

.progress-tip {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 16px;
  color: #5d3d2a;
  background: rgba(37, 104, 92, 0.09);
  border: 1px solid rgba(37, 104, 92, 0.16);
  font-size: 13px;
  line-height: 1.55;
}

.activity-panel {
  padding: 18px 16px;
  border-radius: 30px;
  background:
    /* 细微的纸张纤维肌理 */
    repeating-linear-gradient(45deg, rgba(120, 80, 40, 0.04) 0px, rgba(120, 80, 40, 0.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(-45deg, rgba(120, 80, 40, 0.03) 0px, rgba(120, 80, 40, 0.03) 1px, transparent 1px, transparent 4px),
    /* 做旧晕染效果 */
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(139, 90, 43, 0.12) 80%, rgba(100, 50, 20, 0.25) 100%),
    /* 顶部高光 */
    radial-gradient(circle at 50% 0%, rgba(201, 163, 90, 0.35), transparent 36%),
    /* 旧纸底色 */
    linear-gradient(180deg, #ebd8b7, #d5b98b);
  border: 2px solid rgba(143, 29, 28, 0.28);
  box-shadow: 0 24px 44px rgba(86, 36, 18, 0.28);
}

.activity-hero {
  position: relative;
  min-height: 178px;
  border-radius: 22px;
  padding: 18px;
  overflow: hidden;
  color: #fff7df;
  background:
    linear-gradient(rgba(91, 22, 17, 0.1), rgba(91, 22, 17, 0.72)),
    url('../assets/images/palace.png') center/cover;
  border: 1px solid rgba(255, 245, 215, 0.38);
}

.activity-hero::after {
  content: "纹样寻宝";
  position: absolute;
  right: -20px;
  bottom: 10px;
  font-size: 44px;
  color: rgba(255, 245, 215, 0.18);
  letter-spacing: 0.18em;
  transform: rotate(-8deg);
}

.tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #5a1b16;
  background: rgba(255, 236, 181, 0.92);
  margin-bottom: 36px;
}

.activity-hero h2 {
  font-size: 20px;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  font-weight: 600;
}

.activity-hero p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 250px;
}

.scan-box {
  margin-top: 14px;
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 250, 235, 0.72);
  border: 1px solid rgba(143, 29, 28, 0.18);
  position: relative;
  overflow: hidden;
}

.scan-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.scan-status {
  color: var(--jade);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(37, 104, 92, 0.12);
}

.dialog {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #5d3e2a;
  font-size: 13px;
  line-height: 1.55;
}

.avatar-mini {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--palace-red-dark);
  background: #fff4cf;
  border: 1px solid rgba(143, 29, 28, 0.18);
  font-weight: 700;
}

.bubble {
  flex: 1;
  padding: 10px 12px;
  background: #fff8e8;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid rgba(201, 163, 90, 0.28);
}

.spinner-line {
  height: 3px;
  margin: 12px 0 4px 46px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(143, 29, 28, 0.1);
}

.spinner-line span {
  display: block;
  width: 46%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--palace-red), transparent);
  animation: scan 1.35s infinite ease-in-out;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.pattern-card {
  min-height: 118px;
  border-radius: 18px;
  padding: 11px 8px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 250, 235, 0.9), rgba(238, 219, 176, 0.9));
  border: 1px solid rgba(143, 29, 28, 0.2);
  box-shadow: 0 8px 16px rgba(83, 43, 19, 0.12);
  position: relative;
  overflow: hidden;
}

.pattern-card.featured {
  transform: translateY(-5px);
  border: 2px solid var(--gold);
  box-shadow: 0 16px 26px rgba(143, 29, 28, 0.2);
}

.pattern-icon {
  height: 54px;
  margin-bottom: 8px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(201, 163, 90, 0.4);
}

.pattern-icon.caisson {
  background-image: url('../assets/images/caisson.png');
}

.pattern-icon.dougong {
  background-image: url('../assets/images/dougong.png');
}

.pattern-icon.beast {
  background-image: url('../assets/images/beast.png');
}

.pattern-card h3 {
  font-size: 14px;
  color: var(--palace-red-dark);
  margin-bottom: 4px;
  font-weight: 600;
}

.pattern-card p {
  font-size: 11px;
  color: #72543b;
  line-height: 1.35;
}

.pattern-card.collected {
  border-color: var(--palace-red);
}

.pattern-card.collected::after {
  content: "已收錄";
  position: absolute;
  right: -2px;
  bottom: 12px;
  transform: rotate(-15deg);
  padding: 4px 6px;
  border: 2px solid rgba(143, 29, 28, 0.6);
  border-radius: 4px;
  color: rgba(143, 29, 28, 0.85);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.1em;
  font-family: "STSong", "Songti SC", serif;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 4px rgba(143, 29, 28, 0.1);
  z-index: 10;
  mix-blend-mode: multiply;
}

.collection-drawer {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(37, 104, 92, 0.08);
  border: 1px solid rgba(37, 104, 92, 0.18);
  color: #4f3a2a;
  font-size: 13px;
  line-height: 1.7;
}

.collection-drawer.show {
  display: block;
}

.activity-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.activity-actions .primary {
  grid-column: span 2;
  font-size: 15px;
  padding: 12px 16px;
}

.reward {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 18px;
  background: rgba(143, 29, 28, 0.08);
  color: #5f3926;
  border: 1px solid rgba(143, 29, 28, 0.14);
  font-size: 13px;
}

.badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--palace-red);
  color: #fff;
  font-size: 22px;
  font-family: 'Kaiti', serif;
  font-weight: bold;
  border: 2px solid var(--palace-red-dark);
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4), 0 4px 10px rgba(143, 29, 28, 0.25);
  transform: rotate(45deg);
  position: relative;
  flex-shrink: 0;
}

.badge span {
  transform: rotate(-45deg);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 14px 0;
}

.mode-tab {
  padding: 10px 4px;
  border-radius: 16px;
  border: 1px solid rgba(143, 29, 28, 0.2);
  background: rgba(255, 250, 235, 0.72);
  color: #60442c;
  cursor: pointer;
  font-family: inherit;
}

.mode-tab.active {
  background: var(--palace-red);
  color: #fff8e7;
}

.map-card {
  height: 176px;
  border: none;
  border-left: 10px solid #5C3A21;
  border-right: 10px solid #5C3A21;
  border-radius: 4px;
  box-shadow: 0 14px 28px var(--shadow), -2px 0 4px rgba(0, 0, 0, 0.3) inset, 2px 0 4px rgba(0, 0, 0, 0.3) inset;
  background:
    radial-gradient(circle at 52% 44%, rgba(143, 29, 28, 0.16), transparent 16%),
    linear-gradient(90deg, transparent 48%, rgba(143, 29, 28, 0.32) 49%, rgba(143, 29, 28, 0.32) 51%, transparent 52%),
    repeating-linear-gradient(45deg, rgba(143, 29, 28, 0.02) 0px, rgba(143, 29, 28, 0.02) 2px, transparent 2px, transparent 6px),
    repeating-linear-gradient(-45deg, rgba(143, 29, 28, 0.02) 0px, rgba(143, 29, 28, 0.02) 2px, transparent 2px, transparent 6px),
    linear-gradient(180deg, rgba(37, 104, 92, 0.12), rgba(201, 163, 90, 0.16));
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.map-card::before {
  content: attr(data-status);
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 235, 0.82);
  color: var(--jade);
  font-size: 12px;
}

.map-route {
  position: absolute;
  left: 48%;
  top: 24%;
  width: 2px;
  height: 108px;
  background: linear-gradient(var(--palace-red), var(--gold), var(--jade));
  opacity: 0.72;
}

.map-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  max-width: 150px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 250, 235, 0.86);
  color: #5d3d2a;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid rgba(143, 29, 28, 0.14);
}

.pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  background: var(--palace-red);
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -70%) rotate(-45deg);
  box-shadow: 0 0 0 10px rgba(143, 29, 28, 0.12), 0 0 0 24px rgba(143, 29, 28, 0.06);
  animation: pulse 2s infinite;
}

.pin::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff8e7;
  left: 8px;
  top: 8px;
}

.ai-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 250, 235, 0.82);
  border: 1px solid rgba(143, 29, 28, 0.18);
}

.ai-card h3 {
  color: var(--palace-red-dark);
  margin-bottom: 8px;
}

.ai-card p {
  color: #5e422b;
  line-height: 1.75;
  font-size: 14px;
}

.quick-qs {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.quick-qs .ghost {
  width: 100%;
  padding: 12px;
}

.custom-question-box {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 250, 235, 0.76);
  border: 1px solid rgba(143, 29, 28, 0.16);
}

.custom-question-box input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(143, 29, 28, 0.24);
  border-radius: 999px;
  padding: 10px 12px;
  background: #fff8e7;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.custom-question-box input:focus {
  border-color: var(--palace-red);
  box-shadow: 0 0 0 3px rgba(143, 29, 28, 0.1);
}

.custom-question-box .btn {
  padding: 10px 14px;
  white-space: nowrap;
}

.profile-card {
  padding: 18px;
  margin-bottom: 14px;
}

.profile-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff5d6, #dec28a);
  border: 2px solid var(--gold);
  color: var(--palace-red-dark);
  font-size: 26px;
  font-weight: 700;
  object-fit: contain;
  padding: 4px;
  box-shadow: 0 6px 14px rgba(90, 50, 20, 0.18);
}

.profile-head h2 {
  color: var(--palace-red-dark);
  font-size: 20px;
  font-weight: 600;
}

.profile-head p {
  color: #72543b;
  font-size: 12px;
  margin-top: 2px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat {
  min-height: 62px;
  padding: 12px 10px;
  border-radius: 18px;
  background: rgba(255, 250, 235, 0.78);
  border: 1px solid rgba(143, 29, 28, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 20px;
  color: var(--palace-red);
  margin-bottom: 4px;
}

.stat span {
  color: #654832;
  font-size: 12px;
}

.share-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(201, 163, 90, 0.32), transparent 42%),
    linear-gradient(180deg, rgba(143, 29, 28, 0.1), rgba(255, 250, 235, 0.78));
  border: 1px solid rgba(143, 29, 28, 0.18);
}

.back-link {
  border: none;
  background: transparent;
  color: var(--palace-red-dark);
  font: inherit;
  margin: -4px 0 12px;
  cursor: pointer;
}

.poster-card {
  padding: 22px 18px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, #fff5dd, #ead2a3);
  border: 1px solid rgba(143, 29, 28, 0.2);
  box-shadow: 0 16px 32px var(--shadow);
}

.poster-seal {
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--palace-red);
  color: #fff8e7;
  transform: rotate(45deg);
}

.poster-kicker,
.poster-user,
.poster-desc,
.poster-footer {
  color: #6a4730;
  font-size: 12px;
}

.poster-card h2 {
  color: var(--palace-red-dark);
  font-size: 22px;
}

.poster-avatar-wrap {
  width: 96px;
  height: 96px;
  margin: 14px auto 8px;
  border-radius: 50%;
  background: rgba(255, 248, 231, 0.75);
  border: 2px solid var(--gold);
  display: grid;
  place-items: center;
}

.poster-avatar {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.poster-route {
  margin: 12px auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--palace-red);
  color: #fff8e7;
  font-weight: 600;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.poster-grid div {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 250, 235, 0.68);
}

.poster-grid strong,
.poster-grid span {
  display: block;
}

.poster-grid strong {
  color: var(--palace-red);
  font-size: 18px;
}

.poster-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.poster-tags span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(143, 29, 28, 0.1);
  color: var(--palace-red-dark);
  font-size: 12px;
}

.poster-footer,
.share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.fake-qr {
  width: 38px;
  height: 38px;
  background:
    linear-gradient(90deg, var(--ink) 50%, transparent 50%) 0 0 / 10px 10px,
    linear-gradient(var(--ink) 50%, transparent 50%) 0 0 / 10px 10px;
  border: 5px solid #fff8e7;
}

.share-actions {
  margin-top: 14px;
}

.share-actions .btn {
  flex: 1;
  padding-inline: 12px;
}

.bottom-nav {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  height: 66px;
  border-radius: 25px;
  background: rgba(74, 28, 20, 0.86);
  backdrop-filter: blur(14px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  z-index: 20;
  box-shadow: 0 12px 30px rgba(42, 16, 8, 0.35);
  border: 1px solid rgba(255, 240, 196, 0.18);
}

.nav-item {
  border: none;
  background: transparent;
  color: rgba(255, 242, 210, 0.72);
  border-radius: 18px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.2s ease;
  font-size: 12px;
}

.nav-item .icon {
  font-size: 19px;
  line-height: 1;
}

.nav-item.active {
  background: #fff4d8;
  color: var(--palace-red-dark);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.18);
}

.side-control {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 240, 198, 0.32);
  background: rgba(255, 245, 221, 0.12);
  color: #fff3c6;
  cursor: pointer;
  font-size: 26px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.camera-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.camera-overlay.show {
  transform: translateY(0);
}

.camera-header {
  padding: 48px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 16px;
}

.camera-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
}

.camera-viewfinder {
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
}

.camera-frame {
  width: 260px;
  height: 260px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  position: relative;
}

.camera-frame::before,
.camera-frame::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border: 4px solid var(--gold);
}

.camera-frame::before {
  top: -4px;
  left: -4px;
  border-right: none;
  border-bottom: none;
}

.camera-frame::after {
  bottom: -4px;
  right: -4px;
  border-left: none;
  border-top: none;
}

.camera-controls {
  height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 30px;
}

.shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid rgba(255, 255, 255, 0.4);
  background-clip: padding-box;
  cursor: pointer;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(16px);
  background: rgba(47, 36, 26, 0.9);
  color: #fff8e7;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(230%);
  }
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 8px rgba(143, 29, 28, 0.12), 0 0 0 20px rgba(143, 29, 28, 0.05);
  }

  50% {
    box-shadow: 0 0 0 14px rgba(143, 29, 28, 0.08), 0 0 0 32px rgba(143, 29, 28, 0.035);
  }
}

@media (max-width: 560px) {
  body {
    overflow: auto;
  }

  .stage {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .side-control {
    display: none;
  }

  .phone {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    padding: 0;
  }

  .screen {
    border-radius: 0;
  }

  .notch {
    display: none;
  }
}