/* ============ 封号公墓 · BAN CEMETERY ============ */
:root {
  --bg: #05070a;
  --panel: rgba(11, 14, 19, 0.9);
  --panel-solid: #0b0e13;
  --ink: #e9e4d8;
  --ink-dim: #a9a196;
  --ink-faint: #736c62;
  --gold: #d9b06b;
  --gold-dim: #9a7a45;
  --gold-soft: rgba(217, 176, 107, 0.14);
  --flame: #ffb45c;
  --line: rgba(233, 228, 216, 0.13);
  --line-strong: rgba(233, 228, 216, 0.26);
  --green: #8aa274;
  --rose: #c9837a;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

* , *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body { overscroll-behavior: none; }

img, svg, canvas { display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}
#scene:active { cursor: grabbing; }
#scene.pointing { cursor: pointer; }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 40%, rgba(2, 3, 5, 0.55) 100%),
    linear-gradient(to bottom, rgba(3, 5, 8, 0.55), transparent 22%, transparent 76%, rgba(3, 5, 8, 0.72));
  z-index: 2;
}

/* ---------------- topbar ---------------- */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.1rem 1.4rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(3, 5, 8, 0.78), rgba(3, 5, 8, 0));
}
.topbar > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--gold);
  box-shadow: inset 0 0 18px rgba(217, 176, 107, 0.12), 0 0 24px rgba(0, 0, 0, 0.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.22rem;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.brand-sub {
  margin-top: 0.28rem;
  font-size: 0.56rem;
  letter-spacing: 0.34em;
  color: var(--ink-faint);
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.74rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  padding-left: 0.4rem;
}
.topbar-stats b { color: var(--ink-dim); font-weight: 500; }
.topbar-stats .sep { opacity: 0.5; }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------------- buttons ---------------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.52rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-solid {
  background: linear-gradient(180deg, #e0c184, #b98e4e);
  border-color: transparent;
  color: #221a0c;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(217, 176, 107, 0.18);
}
.btn-solid:hover { color: #1a1308; border-color: transparent; filter: brightness(1.05); }
.btn-ghost { background: rgba(8, 10, 14, 0.35); }
.btn-wide { width: 100%; padding: 0.8rem 1rem; font-size: 0.86rem; }
.user-chip {
  border-color: var(--gold-dim);
  color: var(--gold);
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-dim);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.25s, border-color 0.25s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }

.link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-faint);
  font-size: 0.76rem;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.link-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

/* ---------------- scene tools ---------------- */
.scene-tools {
  position: absolute;
  left: 1.4rem;
  bottom: 1.4rem;
  z-index: 12;
  display: flex;
  gap: 0.5rem;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.tool:hover { color: var(--gold); border-color: var(--gold-dim); }
.tool-icon { font-size: 0.9rem; opacity: 0.8; }

.walk-btn {
  position: absolute;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(8, 10, 14, 0.62);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.walk-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
.walk-btn.active { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-dim); }
.walk-icon { font-size: 0.75rem; }
.walk-pad {
  position: absolute;
  right: 1.4rem;
  bottom: 5.4rem;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, 3.15rem);
  grid-template-rows: repeat(3, 3.15rem);
  gap: 0.4rem;
}
.walk-pad[hidden] { display: none !important; }
.walk-pad button {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(8, 10, 14, 0.7);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: 1.15rem;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.walk-pad [data-walk="forward"] { grid-area: 1 / 2; }
.walk-pad [data-walk="left"] { grid-area: 2 / 1; }
.walk-pad [data-walk="back"] { grid-area: 3 / 2; }
.walk-pad [data-walk="right"] { grid-area: 2 / 3; }
.walk-pad button:active { color: var(--gold); border-color: var(--gold-dim); background: var(--gold-soft); }
body.walking .scene-tools { opacity: 0; pointer-events: none; }
body.walking .scene-hint { display: none; }

.scene-hint {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 11;
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  pointer-events: none;
  text-shadow: 0 1px 6px #000;
  white-space: nowrap;
}

/* ---------------- drawers ---------------- */
.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(400px, 94vw);
  z-index: 30;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(13, 16, 22, 0.96), rgba(7, 9, 13, 0.98));
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0.5s;
  visibility: hidden;
}
.drawer-left { left: 0; border-radius: 0 20px 20px 0; transform: translateX(-103%); }
.drawer-right { right: 0; border-radius: 20px 0 0 20px; transform: translateX(103%); }
.drawer.open { transform: translateX(0); visibility: visible; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.4rem 0.9rem;
}
.drawer-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.28rem;
  letter-spacing: 0.18em;
  font-weight: 500;
}
.drawer-head p {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.drawer-head b { color: var(--ink-dim); font-weight: 500; }

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  margin: 0.4rem 1.4rem 0.8rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}
#auth-tabs { grid-template-columns: repeat(2, 1fr); margin: 0 0 1.1rem; }
.seg {
  appearance: none;
  border: none;
  background: none;
  color: var(--ink-faint);
  padding: 0.45rem 0.3rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  transition: color 0.2s, background 0.2s;
}
.seg:hover { color: var(--ink-dim); }
.seg.active { background: var(--gold-soft); color: var(--gold); }

.search { padding: 0 1.4rem 0.7rem; }
.search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.55rem 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.search input:focus { border-color: var(--gold-dim); }
.search input::placeholder { color: var(--ink-faint); }

.grave-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 0.9rem 1rem;
  scrollbar-width: thin;
}
.grave-item {
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: 0.7rem;
  padding: 0.78rem 0.5rem;
  border-bottom: 1px solid rgba(233, 228, 216, 0.07);
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
}
.grave-item:hover { background: rgba(255, 255, 255, 0.035); }
.grave-item.active { background: var(--gold-soft); }
.g-rank {
  font-family: var(--serif);
  font-size: 0.86rem;
  color: var(--gold-dim);
  padding-top: 0.15rem;
  text-align: right;
}
.g-rank.top { color: var(--gold); }
.g-name {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-epi {
  margin: 0.22rem 0 0.32rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--ink-faint);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.g-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.68rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.g-meta .flame { color: var(--flame); }
.g-meta .weed { color: var(--green); }
.g-meta .owner { color: var(--gold-dim); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.pager .btn { padding: 0.35rem 0.8rem; font-size: 0.7rem; }

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.4rem 1.2rem;
  border-top: 1px solid var(--line);
}
#mine-panel .drawer-foot {
  flex-direction: column;
  align-items: stretch;
  gap: 0.8rem;
}
#mine-panel .drawer-foot .link-btn {
  text-align: center;
}

/* ---------------- detail sheet ---------------- */
.sheet {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  z-index: 28;
  width: min(420px, 92vw);
  max-height: min(780px, 86vh);
  overflow-y: auto;
  padding: 1.5rem 1.6rem 1.3rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 17, 23, 0.94), rgba(8, 10, 14, 0.96));
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translate(18px, -50%);
  transition: opacity 0.35s, transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0.35s;
  scrollbar-width: thin;
}
.sheet.open { opacity: 1; visibility: visible; transform: translate(0, -50%); }
.sheet-close { position: absolute; top: 1rem; right: 1rem; }
.detail-rank {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.detail-rank b { color: var(--gold); font-weight: 500; }
.detail-name {
  margin: 0.55rem 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  word-break: break-word;
  padding-right: 1.6rem;
}
.detail-epitaph {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--ink-dim);
}
.detail-epitaph:empty { display: none; }
.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.9rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.detail-meta div { display: flex; flex-direction: column; gap: 0.18rem; }
.detail-meta dt { font-size: 0.64rem; letter-spacing: 0.14em; color: var(--ink-faint); }
.detail-meta dd { margin: 0; font-size: 0.86rem; color: var(--ink); }
.detail-block { padding: 0.9rem 0 0.2rem; }
.detail-block h3 {
  margin: 0 0 0.4rem;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  font-weight: 500;
}
.detail-block p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--ink-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-care {
  margin-top: 0.8rem;
  font-size: 0.74rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.detail-care .bar { letter-spacing: 0.12em; color: var(--green); }
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.detail-actions .btn-solid { flex: 1 1 10rem; }
.detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.9rem 0 0;
  font-size: 0.7rem;
  color: var(--ink-faint);
}
.detail-foot .link-btn { font-size: 0.7rem; }

/* ---------------- my panel ---------------- */
.care-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 1.4rem 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(217, 176, 107, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(217, 176, 107, 0.09), rgba(217, 176, 107, 0.02));
}
.care-card-text { flex: 1; min-width: 0; }
.care-card-text b { font-size: 0.84rem; letter-spacing: 0.06em; }
.care-card-text p { margin: 0.3rem 0 0; font-size: 0.7rem; line-height: 1.55; color: var(--ink-faint); }
.care-card .btn { padding: 0.5rem 0.8rem; font-size: 0.72rem; }

.my-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem 1rem;
  scrollbar-width: thin;
}
.my-item {
  padding: 0.9rem 0.6rem;
  border-bottom: 1px solid rgba(233, 228, 216, 0.07);
}
.my-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.my-item-name { font-family: var(--serif); font-size: 1.02rem; }
.my-item-rank { font-size: 0.7rem; color: var(--gold-dim); }
.my-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--ink-faint);
}
.my-item-actions { display: flex; gap: 0.4rem; margin-top: 0.55rem; }
.my-item-actions .btn { padding: 0.32rem 0.7rem; font-size: 0.68rem; }
.my-empty { padding: 2rem 1rem; text-align: center; color: var(--ink-faint); font-size: 0.8rem; line-height: 1.8; }

/* ---------------- ip banner ---------------- */
.ip-banner {
  position: absolute;
  left: 1.4rem;
  top: 5.6rem;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: min(340px, 78vw);
  padding: 0.55rem 0.7rem 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 10, 14, 0.6);
  backdrop-filter: blur(10px);
  font-size: 0.7rem;
  color: var(--ink-faint);
  transition: opacity 0.4s, transform 0.4s;
}
.ip-banner.hidden { opacity: 0; pointer-events: none; transform: translateY(-6px); }
.ip-banner p { margin: 0; line-height: 1.5; }
.ip-banner a { color: var(--gold-dim); text-decoration: none; border-bottom: 1px solid var(--gold-dim); }
.ip-banner a:hover { color: var(--gold); }
.ip-banner-icon { color: var(--gold); font-size: 0.9rem; }
.ip-banner .icon-btn { width: 1.4rem; height: 1.4rem; font-size: 0.8rem; border: none; background: none; }

/* ---------------- empty / loading / webgl error ---------------- */
.empty {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 16;
  text-align: center;
  padding: 2rem 2.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.empty h3 { margin: 0 0 0.4rem; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; letter-spacing: 0.12em; }
.empty p { margin: 0 0 1.2rem; color: var(--ink-faint); font-size: 0.82rem; }

.loading {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background: radial-gradient(60% 60% at 50% 44%, #0e1219 0%, #05070a 72%);
  transition: opacity 1s ease, visibility 1s;
}
.loading.done { opacity: 0; visibility: hidden; }
.loading-mark {
  font-family: var(--serif);
  font-size: 3.6rem;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(217, 176, 107, 0.4);
  animation: breathe 3.2s ease-in-out infinite;
}
.loading-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  margin-left: 0.5em;
  color: var(--ink);
}
.loading-sub { font-size: 0.74rem; letter-spacing: 0.18em; color: var(--ink-faint); }
.loading-bar {
  width: 180px;
  height: 1px;
  margin-top: 0.8rem;
  background: rgba(233, 228, 216, 0.12);
  overflow: hidden;
}
.loading-bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: sweep 1.8s ease-in-out infinite;
}
@keyframes sweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.webgl-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 18;
  width: min(360px, 90vw);
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 10, 14, 0.85);
}
.webgl-error h3 { margin: 0 0 0.6rem; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.webgl-error p { margin: 0 0 1.2rem; color: var(--ink-faint); font-size: 0.82rem; }

/* ---------------- dialogs ---------------- */
.dialog {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  width: min(540px, 94vw);
  max-height: 90dvh;
  overflow: visible;
}
.dialog-wide { width: min(620px, 94vw); }
.dialog::backdrop {
  background: rgba(2, 3, 5, 0.68);
  backdrop-filter: blur(4px);
}
.dialog[open] .dialog-inner { animation: rise 0.35s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

.dialog-inner {
  position: relative;
  background: linear-gradient(180deg, rgba(15, 18, 24, 0.99), rgba(8, 10, 14, 0.99));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.7rem 1.7rem 1.5rem;
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  scrollbar-width: thin;
}
.dialog-close { position: absolute; top: 0.9rem; right: 0.9rem; }
.dialog-head { margin-bottom: 1.2rem; padding-right: 2rem; }
.dialog-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.dialog-head p { margin: 0.45rem 0 0; font-size: 0.78rem; color: var(--ink-faint); line-height: 1.6; }

/* ---------------- forms ---------------- */
.form { display: flex; flex-direction: column; gap: 0.95rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.76rem; color: var(--ink-dim); }
.field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; letter-spacing: 0.06em; }
.field em { font-style: normal; font-size: 0.66rem; color: var(--ink-faint); }
.field input, .field textarea, .field output {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  padding: 0.68rem 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.field textarea { line-height: 1.65; min-height: 3.2rem; }
.field input:focus, .field textarea:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(217, 176, 107, 0.1);
}
.field input::placeholder, .field textarea::placeholder { color: #5d574f; }
.field input[type="date"] { color-scheme: dark; }
.field-locked output {
  display: block;
  color: var(--gold-dim);
  background: rgba(217, 176, 107, 0.05);
  border-style: dashed;
  letter-spacing: 0.06em;
}
.field i { font-style: normal; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { min-height: 0; }

.form-error { min-height: 1.1rem; margin: 0; font-size: 0.74rem; color: var(--rose); }
.form-error:empty { display: none; }
.form-note { margin: 0; font-size: 0.68rem; line-height: 1.6; color: var(--ink-faint); }

/* ---------------- rules / about ---------------- */
.rules { font-size: 0.82rem; line-height: 1.8; color: var(--ink-dim); }
.rules ol { margin: 0 0 1.2rem; padding-left: 1.25rem; }
.rules li { margin-bottom: 0.55rem; }
.rules li::marker { color: var(--gold-dim); }
.rules b { color: var(--ink); font-weight: 500; }
.ip-card {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(217, 176, 107, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(217, 176, 107, 0.07), rgba(217, 176, 107, 0.01));
}
.ip-card h3 { margin: 0 0 0.5rem; font-family: var(--serif); font-size: 1rem; font-weight: 500; letter-spacing: 0.06em; color: var(--ink); }
.ip-card p { margin: 0 0 0.7rem; font-size: 0.76rem; line-height: 1.7; }
.ip-links { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.7rem; }
.ip-links a {
  display: inline-block;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.75rem;
  color: var(--gold);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.ip-links a:hover { border-color: var(--gold-dim); background: rgba(217, 176, 107, 0.06); }
.ip-card .tip { margin: 0; color: var(--ink-faint); font-size: 0.7rem; }
.rules .disclaimer { margin: 1rem 0 0; font-size: 0.66rem; color: var(--ink-faint); }

/* ---------------- toasts ---------------- */
.toasts {
  position: absolute;
  left: 50%;
  bottom: 4.6rem;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  pointer-events: auto;
  max-width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.92);
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  text-align: center;
}
.toast.good { border-color: rgba(217, 176, 107, 0.4); color: var(--gold); }
.toast.bad { border-color: rgba(201, 131, 122, 0.45); color: var(--rose); }
.toast.out { animation: toastOut 0.4s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #05070a;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 2rem;
}

/* 3D 悬浮提示 */
.scene-tip {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 8, 12, 0.82);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  color: var(--ink-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  transform: translate(-50%, -140%);
}
.scene-tip.show { opacity: 1; }
.scene-tip b { color: var(--ink); font-weight: 500; font-family: var(--serif); }

/* ---------------- responsive ---------------- */
@media (max-width: 760px) {
  .topbar { padding: 0.8rem 0.9rem 1.4rem; gap: 0.6rem; }
  .brand-mark { width: 2.2rem; height: 2.2rem; font-size: 1.1rem; }
  .brand-name { font-size: 1rem; letter-spacing: 0.16em; }
  .brand-sub { display: none; }
  .topbar-stats { display: none; }
  .hide-sm { display: none; }
  .topbar-actions { gap: 0.4rem; }
  .btn { padding: 0.48rem 0.8rem; font-size: 0.74rem; }
  .brand { gap: 0.55rem; }

  .scene-tools { left: 0.8rem; bottom: 1rem; gap: 0.4rem; }
  .tool { padding: 0.42rem 0.7rem; font-size: 0.7rem; }
  .scene-hint { display: none; }
  .walk-btn { right: 0.8rem; bottom: calc(1rem + env(safe-area-inset-bottom)); padding: 0.55rem 0.95rem; font-size: 0.74rem; }
  .walk-pad { right: 0.8rem; bottom: calc(4.6rem + env(safe-area-inset-bottom)); grid-template-columns: repeat(3, 3.3rem); grid-template-rows: repeat(3, 3.3rem); }
  body.walking .scene-tools { display: none; }

  .drawer { width: 100%; border-radius: 0; }
  .drawer-left, .drawer-right { border-radius: 0; }

  .sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 74dvh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 1.3rem 1.3rem calc(1.2rem + env(safe-area-inset-bottom));
    transform: translateY(104%);
  }
  .sheet.open { transform: translateY(0); }
  .detail-name { font-size: 1.55rem; }

  .ip-banner { display: none; }

  .empty { padding: 1.6rem 1.6rem; width: min(320px, 86vw); }

  .dialog { width: 100vw; max-height: 100dvh; }
  .dialog-inner {
    border-radius: 20px 20px 0 0;
    max-height: 92dvh;
    padding: 1.4rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom));
  }
  .dialog { margin: auto 0 0; }

  .toasts { bottom: 5rem; width: min(94vw, 420px); }
}

@media (max-width: 430px) {
  .topbar { gap: 0.4rem; }
  .brand { gap: 0.45rem; }
  .brand-mark { width: 2rem; height: 2rem; font-size: 1rem; }
  .brand-name { font-size: 0.92rem; letter-spacing: 0.12em; }
  .topbar-actions { gap: 0.3rem; }
  .topbar-actions .btn { padding: 0.42rem 0.62rem; font-size: 0.7rem; }
  .user-chip { max-width: 5.4rem; }
  .detail-actions .btn { font-size: 0.74rem; padding: 0.55rem 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 细滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(233, 228, 216, 0.16); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(233, 228, 216, 0.28); }
