:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: rgba(14, 14, 13, 0.82);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --gold: #c9a96e;
  --gold-soft: #ead7ad;
  --white: #ffffff;
  --ink: #0a0a0a;
  --muted: rgba(234, 215, 173, 0.68);
  --line: rgba(201, 169, 110, 0.26);
  --deep-line: rgba(255, 255, 255, 0.08);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
}

@font-face {
  font-family: "ZCoolXiaoWeiLocal";
  src: local("STKaiti"), local("KaiTi"), local("Kaiti SC");
  font-display: swap;
}

@font-face {
  font-family: "ZhiMangXingLocal";
  src: url("./assets/fonts/ZhiMangXing-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "MaShanZhengLocal";
  src: url("./assets/fonts/MaShanZheng-Regular.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 24% 22%, rgba(201, 169, 110, 0.16), transparent 26%),
    radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.055), transparent 24%),
    linear-gradient(140deg, #030303 0%, #0a0a0a 46%, #14110b 100%);
  color: var(--white);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.18) 0 0.7px, transparent 0.7px 4px),
    repeating-linear-gradient(90deg, rgba(201, 169, 110, 0.035) 0 1px, transparent 1px 13px);
  opacity: 0.18;
  mix-blend-mode: overlay;
}

body::after {
  content: "";
  position: fixed;
  inset: 24px;
  z-index: 0;
  border: 1px solid rgba(201, 169, 110, 0.11);
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

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

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.app-shell::before {
  top: 24px;
  left: 24px;
  border-top: 1px solid rgba(201, 169, 110, 0.58);
  border-left: 1px solid rgba(201, 169, 110, 0.58);
}

.app-shell::after {
  right: 24px;
  bottom: 24px;
  border-right: 1px solid rgba(201, 169, 110, 0.58);
  border-bottom: 1px solid rgba(201, 169, 110, 0.58);
}

.auth-button,
.records-button {
  position: fixed;
  right: 22px;
  z-index: 5;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.72);
  color: var(--gold-soft);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.auth-button {
  top: 22px;
}

.records-button {
  top: 74px;
}

.auth-button.is-login {
  color: var(--gold);
  border-color: rgba(201, 169, 110, 0.44);
}

.auth-button.is-suppressed,
.records-button.is-suppressed {
  display: none;
}

.home-screen {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 30px;
  container-type: inline-size;
  isolation: isolate;
  overflow: hidden;
  width: 100vw;
  min-height: calc(100vh - 48px);
  margin-inline: calc(50% - 50vw);
  padding: 86px 32px 78px;
}

.brand-watermark {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.mark-char {
  position: absolute;
  color: rgba(201, 169, 110, 0.16);
  font-family: "Zhi Mang Xing", cursive;
  font-size: clamp(300px, 40vw, 530px);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: 0;
  white-space: nowrap;
  user-select: none;
}

.mark-zi {
  top: -1.70cqw;
  left: -7.96cqw;
  right: auto;
  bottom: auto;
  font-size: 59.99cqw;
  transform: rotate(-7deg);
}

.mark-xiang {
  top: 1.31cqw;
  left: 50.13cqw;
  right: auto;
  bottom: auto;
  color: rgba(201, 169, 110, 0.18);
  font-size: 67.57cqw;
  transform: rotate(5deg);
}

.brand-intro {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(420px, 100%);
}

.brand-copy {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  text-align: center;
}

.brand-latin {
  color: rgba(255, 255, 255, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.34em;
  line-height: 1;
}

.brand-slogan {
  color: var(--gold);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.36em;
  line-height: 1.35;
}

.brand-rule {
  display: block;
  width: 190px;
  height: 1px;
  margin: 1px 0;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.74), transparent);
}

.question-input {
  width: min(236px, 100%);
  min-height: 44px;
  border: 1px solid rgba(201, 169, 110, 0.36);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.5);
  box-shadow:
    inset 0 0 24px rgba(201, 169, 110, 0.055),
    0 8px 24px rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  outline: none;
  padding: 12px 22px;
  text-align: center;
}

.question-input::placeholder {
  color: rgba(234, 215, 173, 0.62);
}

.question-input:focus {
  border-color: rgba(201, 169, 110, 0.56);
  box-shadow:
    inset 0 0 28px rgba(201, 169, 110, 0.06),
    0 0 34px rgba(201, 169, 110, 0.08);
}

h1 {
  width: min(900px, 100%);
  color: var(--white);
  font-family: "ZCoolXiaoWeiLocal", "STKaiti", "KaiTi", serif;
  font-size: 68px;
  font-weight: 500;
  line-height: 1.08;
  text-align: left;
  letter-spacing: 0;
  text-shadow: 0 0 36px rgba(201, 169, 110, 0.14);
}

.ink-form {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: 360px;
  margin: 0;
}

.handwriting-pad {
  --pad-size: 248px;
  position: relative;
  width: var(--pad-size);
  aspect-ratio: 1;
  border: 1px solid rgba(201, 169, 110, 0.44);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.7), transparent 34%),
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(117, 63, 28, 0.14) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(117, 63, 28, 0.14) 50%, transparent calc(50% + 0.5px)),
    repeating-linear-gradient(0deg, rgba(117, 63, 28, 0.035) 0 1px, transparent 1px 7px),
    #efe4c8;
  box-shadow:
    inset 0 0 0 8px rgba(117, 63, 28, 0.035),
    inset 0 0 42px rgba(117, 63, 28, 0.12),
    0 28px 80px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.input-mode-toggle {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(201, 169, 110, 0.46);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.42);
  color: var(--gold);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.input-mode-toggle:hover {
  border-color: rgba(232, 201, 122, 0.82);
  background: rgba(10, 10, 10, 0.62);
  transform: rotate(12deg);
}

.handwriting-pad:focus-within {
  border-color: rgba(201, 169, 110, 0.78);
  box-shadow:
    inset 0 0 0 8px rgba(117, 63, 28, 0.045),
    inset 0 0 46px rgba(117, 63, 28, 0.17),
    0 0 0 4px rgba(201, 169, 110, 0.08),
    0 28px 90px rgba(0, 0, 0, 0.42);
}

.handwriting-canvas,
#handwritingCanvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  cursor: crosshair;
  touch-action: none;
}

.handwriting-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(80, 43, 22, 0.32);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.handwriting-pad.has-ink .handwriting-hint {
  opacity: 0;
}

.manual-character-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.handwriting-pad.typing-mode #handwritingCanvas {
  display: none;
}

.handwriting-pad.typing-mode .handwriting-hint {
  opacity: 0;
}

.handwriting-pad.typing-mode .manual-character-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: rgba(46, 27, 14, 0.9);
  font-family: "MaShanZhengLocal", "STXingkai", "KaiTi", cursive;
  font-size: 158px;
  font-weight: 400;
  line-height: var(--pad-size);
  opacity: 1;
  outline: none;
  padding: 0 34px;
  pointer-events: auto;
  text-align: center;
}

.handwriting-pad.typing-mode .manual-character-input::placeholder {
  color: rgba(80, 43, 22, 0.34);
  font-size: 15px;
  font-weight: 800;
}

.ink-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  justify-content: center;
}

.ghost-button.compact {
  min-width: 96px;
  padding-inline: 16px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 22px;
  font-weight: 850;
}

.primary-button {
  min-width: 180px;
  border-color: rgba(201, 169, 110, 0.38);
  background: linear-gradient(135deg, #e2c78b, var(--gold));
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(201, 169, 110, 0.14);
}

.primary-button:hover {
  background: linear-gradient(135deg, #f1d9a3, var(--gold));
}

.primary-button.compact {
  width: auto;
  min-width: 132px;
}

.ghost-button,
.icon-button {
  border-color: var(--line);
  background: rgba(10, 10, 10, 0.66);
  color: var(--gold-soft);
}

.ghost-button:hover,
.icon-button:hover,
.auth-button:hover {
  border-color: rgba(201, 169, 110, 0.62);
}

.icon-button {
  min-width: 44px;
  width: 44px;
  padding: 0;
}

.report-panel,
.points-page,
.records-page {
  position: relative;
  margin: -18px auto 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 42%),
    rgba(10, 10, 10, 0.78);
  box-shadow: var(--shadow);
  padding: 22px;
  overflow: hidden;
}

.report-panel::before,
.points-page::before,
.records-page::before,
.auth-dialog::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201, 169, 110, 0.08);
  border-radius: 6px;
  pointer-events: none;
}

.report-head,
.dialog-head,
.points-head,
.records-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

h2 {
  margin-top: 7px;
  color: var(--white);
  font-family: "ZCoolXiaoWeiLocal", "STKaiti", "KaiTi", serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.detail-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
}

.detail-gate strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gold-soft);
  font-size: 17px;
}

.detail-gate p,
.detail-card p,
.detail-card li,
.points-card p {
  color: var(--muted);
  line-height: 1.86;
}

.detail-report {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(201, 169, 110, 0.018) 0 1px, transparent 1px 9px),
    rgba(5, 5, 5, 0.42);
  overflow: hidden;
}

.detail-report.locked {
  padding: 16px;
  color: var(--muted);
}

.detail-card {
  position: relative;
  padding: 20px 18px;
  background: rgba(255, 255, 255, 0.028);
}

.detail-card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 169, 110, 0.72), transparent);
}

.detail-card + .detail-card {
  border-top: 1px solid rgba(201, 169, 110, 0.12);
}

.detail-card h3 {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.detail-card.core p {
  color: var(--white);
  font-family: "ZCoolXiaoWeiLocal", "STKaiti", "KaiTi", serif;
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.32;
}

.detail-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.closing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.points-page,
.records-page {
  margin-top: 24px;
}

.points-head {
  display: grid;
  justify-items: center;
  text-align: center;
}

.points-head-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.points-head-actions .ghost-button {
  min-height: 38px;
  padding: 9px 14px;
}

.points-head strong {
  color: var(--gold);
  font-size: 96px;
  line-height: 0.94;
  text-shadow: 0 0 36px rgba(201, 169, 110, 0.16);
}

.points-head span {
  color: var(--muted);
  font-weight: 800;
}

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

.points-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 220px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 50%),
    rgba(5, 5, 5, 0.52);
  padding: 16px;
}

.points-emoji {
  font-size: 30px;
  line-height: 1;
  filter: saturate(0.7);
}

.points-card h3 {
  color: var(--gold-soft);
  font-size: 20px;
}

.records-head {
  align-items: center;
}

.records-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 48%),
    rgba(5, 5, 5, 0.5);
  padding: 15px;
}

.record-card h3 {
  color: var(--gold-soft);
  font-size: 18px;
}

.record-card time,
.record-card p,
.empty-records {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.record-card time {
  display: block;
  margin: 3px 0 7px;
  color: rgba(234, 215, 173, 0.48);
}

.record-question {
  color: rgba(255, 255, 255, 0.64);
}

.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.invite-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.invite-share span {
  min-width: 0;
  color: rgba(234, 215, 173, 0.66);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.redeem-row input,
.auth-dialog input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(201, 169, 110, 0.26);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 45%),
    rgba(0, 0, 0, 0.38);
  color: var(--white);
  outline: none;
  padding: 11px 13px;
}

.auth-dialog input {
  min-height: 50px;
  border-color: rgba(201, 169, 110, 0.28);
  background:
    linear-gradient(90deg, rgba(201, 169, 110, 0.08), transparent 22%),
    rgba(4, 4, 4, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.auth-dialog input:focus {
  border-color: rgba(232, 201, 122, 0.72);
  background:
    linear-gradient(90deg, rgba(201, 169, 110, 0.13), transparent 28%),
    rgba(5, 5, 5, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(232, 201, 122, 0.08),
    0 0 0 3px rgba(201, 169, 110, 0.08);
}

.redeem-row input::placeholder,
.auth-dialog input::placeholder {
  color: rgba(234, 215, 173, 0.36);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 42px);
  background:
    radial-gradient(circle at 28% 18%, rgba(201, 169, 110, 0.16), transparent 28%),
    radial-gradient(circle at 78% 80%, rgba(201, 169, 110, 0.09), transparent 26%),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.auth-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.16) 0 0.7px, transparent 0.7px 4px),
    linear-gradient(180deg, rgba(201, 169, 110, 0.055), transparent 34%, rgba(201, 169, 110, 0.05));
  opacity: 0.18;
  mix-blend-mode: overlay;
}

.auth-inkscape {
  position: absolute;
  inset: -8% -16%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.98;
}

.auth-inkscape svg {
  width: 132%;
  height: 118%;
  transform-origin: center;
  animation: authMountainDrift 86s ease-in-out infinite alternate;
}

.inkscape-layer {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  animation: authInkBreath 72s ease-in-out infinite alternate;
}

.layer-far {
  stroke-width: 1.2;
  stroke-opacity: 0.12;
}

.layer-mid {
  stroke-width: 1.4;
  stroke-opacity: 0.22;
  animation-duration: 84s;
  animation-delay: -18s;
}

.layer-mist {
  stroke-width: 0.9;
  stroke-opacity: 0.3;
  stroke-dasharray: 2 16;
  animation-duration: 68s;
  animation-delay: -10s;
}

.auth-overlay.is-hidden,
.is-hidden {
  display: none;
}

.auth-dialog {
  position: relative;
  display: grid;
  z-index: 1;
  gap: 16px;
  width: min(486px, 100%);
  max-height: min(760px, calc(100dvh - 32px));
  border: 1px solid rgba(201, 169, 110, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 36%),
    radial-gradient(circle at 18% 0%, rgba(201, 169, 110, 0.16), transparent 34%),
    radial-gradient(circle at 82% 100%, rgba(201, 169, 110, 0.08), transparent 34%),
    rgba(13, 13, 12, 0.96);
  color: var(--white);
  padding: clamp(22px, 3vw, 32px);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 169, 110, 0.48) rgba(0, 0, 0, 0.22);
}

.auth-dialog::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(201, 169, 110, 0.18), transparent 18%, transparent 82%, rgba(201, 169, 110, 0.12)),
    repeating-linear-gradient(0deg, rgba(201, 169, 110, 0.025) 0 1px, transparent 1px 12px);
  opacity: 0.5;
}

.auth-dialog > * {
  position: relative;
  z-index: 1;
}

.recognition-dialog {
  width: min(420px, 100%);
}

.auth-dialog .dialog-head {
  align-items: flex-start;
  border-bottom: 1px solid rgba(201, 169, 110, 0.18);
  padding-bottom: 14px;
}

.auth-calligraphy {
  margin: -8px 0 5px;
  color: var(--gold);
  font-family: "Zhi Mang Xing", "STKaiti", "KaiTi", cursive;
  font-size: clamp(58px, 7vw, 86px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.08em;
}

.auth-dialog #authTitle {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.manual-character-field input {
  text-align: center;
  font-size: 24px;
  font-family: "ZCoolXiaoWeiLocal", "STKaiti", "KaiTi", serif;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(201, 169, 110, 0.08), transparent),
    rgba(0, 0, 0, 0.34);
  padding: 6px;
}

.auth-mode-switch button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(234, 215, 173, 0.62);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.auth-mode-switch button.is-active {
  background: linear-gradient(135deg, #e2c78b, var(--gold));
  color: var(--ink);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.auth-code-row .ghost-button {
  min-width: 112px;
  padding-inline: 14px;
}

.auth-code-row .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-dialog label {
  gap: 9px;
  color: rgba(234, 215, 173, 0.72);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
  padding-top: 4px;
}

@keyframes authMountainDrift {
  from {
    transform: translate3d(-2.4%, 0, 0) scale(1.02);
  }

  to {
    transform: translate3d(2.6%, -1.4%, 0) scale(1.045);
  }
}

@keyframes authInkBreath {
  from {
    opacity: 0.72;
    transform: translateX(-1.2%);
  }

  to {
    opacity: 1;
    transform: translateX(1.2%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-inkscape svg,
  .inkscape-layer {
    animation: none;
  }
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d0c;
  color: var(--gold-soft);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  body::after {
    inset: 14px;
  }

  .app-shell {
    padding: 14px;
  }

  .auth-button {
    top: 14px;
    right: 14px;
  }

  .records-button {
    top: 66px;
    right: 14px;
  }

  .home-screen {
    min-height: calc(100svh - 28px);
    min-height: calc(100dvh - 28px);
    padding: clamp(58px, 8svh, 76px) 12px clamp(42px, 7svh, 64px);
    gap: clamp(16px, 2.4svh, 24px);
  }

  .mark-char {
    line-height: 0.82;
  }

  .mark-zi {
    top: -2.09cqw;
    left: -15.56cqw;
    right: auto;
    bottom: auto;
    font-size: 98.69cqw;
  }

  .mark-xiang {
    top: auto;
    left: 15.00cqw;
    right: auto;
    bottom: -18.00cqw;
    color: rgba(201, 169, 110, 0.15);
    font-size: 118.06cqw;
  }

  .brand-intro {
    width: min(320px, 100%);
  }

  .brand-copy {
    gap: 9px;
  }

  .brand-slogan {
    letter-spacing: 0.28em;
  }

  .question-input {
    width: min(224px, 62vw);
    min-height: 40px;
    font-size: 12px;
    padding: 11px 16px;
  }

  h1 {
    font-size: 52px;
  }

  .ink-form {
    width: 100%;
    margin-left: 0;
    justify-items: center;
    gap: clamp(14px, 2.3svh, 18px);
  }

  .handwriting-pad {
    --pad-size: min(244px, 68vw, 30svh);
  }

  .ink-actions {
    gap: 8px;
  }

  .ink-actions .primary-button {
    min-width: 142px;
  }

  .report-panel,
  .points-page,
  .records-page {
    margin-top: -14px;
    padding: 16px;
  }

  .report-head,
  .detail-gate,
    .points-card-grid,
  .records-list,
  .record-card,
    .closing-row,
  .redeem-row,
  .invite-share,
  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .auth-overlay {
    align-items: center;
    padding: 14px;
  }

  .auth-inkscape {
    inset: -5% -62%;
  }

  .auth-inkscape svg {
    width: 190%;
    height: 112%;
  }

  .auth-dialog {
    width: 100%;
    max-height: calc(100dvh - 28px);
    gap: 12px;
    padding: 18px;
  }

  .auth-dialog .dialog-head {
    padding-bottom: 11px;
  }

  .auth-calligraphy {
    margin-top: -4px;
    font-size: 58px;
  }

  .auth-dialog #authTitle {
    font-size: 15px;
  }

  .auth-mode-switch {
    gap: 5px;
    padding: 5px;
  }

  .auth-mode-switch button {
    min-height: 40px;
    font-size: 12px;
    letter-spacing: 0.06em;
  }

  .auth-code-row .ghost-button {
    min-width: 0;
    width: 100%;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .report-head,
  .closing-row {
    display: grid;
  }

  .points-card-grid {
    display: grid;
  }

  .detail-card.core p {
    font-size: 30px;
  }

  .points-head strong {
    font-size: 68px;
  }

  .primary-button.compact,
  .detail-gate .primary-button {
    width: 100%;
  }
}
