:root {
  --bg: #f7f3ec;
  --card: rgba(255,255,255,.88);
  --text: #33261d;
  --muted: #7b6658;
  --line: #e7dccf;
  --accent: #8b5e3c;
  --danger: #d95a4e;
  --success: #38b37a;
  --warning: #f0aa5a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "PingFang SC", "Microsoft YaHei", serif;
  background: var(--bg);
  color: var(--text);
}
button, input, textarea {
  font: inherit;
}
.game-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 16%, rgba(232, 205, 152, .16), transparent 22%),
    radial-gradient(circle at 82% 18%, rgba(108, 69, 38, .18), transparent 24%),
    radial-gradient(circle at 14% 84%, rgba(78, 47, 28, .14), transparent 22%),
    linear-gradient(180deg, #201815 0%, #15100d 45%, #0f0b09 100%);
  color: #f3eadc;
}
.game-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(transparent 0 96%, rgba(255,255,255,.06) 96% 100%),
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08), transparent 28%);
  background-size: 100% 14px, 100% 100%;
  mix-blend-mode: screen;
}
.game-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,219,168,.08), transparent 32%),
    linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.06) 50%, rgba(0,0,0,0) 100%);
}
.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.game-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 18px 42px;
}
.prompt-text {
  color: rgba(239, 224, 197, .9);
  font-size: 15px;
  letter-spacing: .3px;
  text-align: center;
}
.hero-copy {
  text-align: center;
  margin-bottom: 8px;
  position: relative;
}
.hero-copy::before,
.hero-copy::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, rgba(220,195,148,0), rgba(220,195,148,.6), rgba(220,195,148,0));
}
.hero-copy::before { left: -72px; }
.hero-copy::after { right: -72px; }
.hero-mark {
  font-size: 12px;
  letter-spacing: .45em;
  text-indent: .45em;
  color: rgba(226, 204, 164, .72);
  margin-bottom: 10px;
}
.hero-title {
  margin: 0;
  font-size: clamp(42px, 10vw, 68px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .18em;
  text-indent: .18em;
  color: #f3e3c8;
  text-shadow: 0 0 18px rgba(223,185,122,.08), 0 6px 24px rgba(0,0,0,.28);
}
.hero-subtitle {
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: .28em;
  text-indent: .28em;
  color: rgba(235, 220, 191, .78);
}
.history-fab {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 10px 14px;
  color: #f0e0c3;
  background: rgba(160, 116, 67, .14);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.history-cue {
  position: fixed;
  top: 70px;
  right: 18px;
  z-index: 19;
  max-width: min(58vw, 220px);
  padding: 7px 10px;
  border: 1px solid rgba(241, 217, 177, .12);
  border-radius: 14px;
  background: rgba(49, 35, 27, .56);
  color: rgba(247, 234, 211, .74);
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
}
.history-cue.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.history-cue.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}
.history-cue::after {
  content: "";
  position: absolute;
  top: -5px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: rgba(49, 35, 27, .82);
  border-top: 1px solid rgba(241, 217, 177, .12);
  border-left: 1px solid rgba(241, 217, 177, .12);
  transform: rotate(45deg);
}
.voice-card {
  width: min(92vw, 460px);
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(83,57,36,.28), rgba(37,26,20,.4));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 16px 50px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}
.reply-card {
  background: linear-gradient(180deg, rgba(94,63,39,.24), rgba(34,24,18,.46));
}
.voice-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.voice-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.voice-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #f2dfbf;
}
.voice-card-subtitle {
  font-size: 13px;
  color: rgba(229, 211, 180, .72);
  margin-top: 4px;
}
.icon-btn,
.tiny-btn {
  border: none;
  cursor: pointer;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(139, 97, 52, .22);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.icon-btn.subtle {
  background: rgba(120, 84, 49, .16);
}
.tiny-btn {
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(118, 82, 47, .16);
  color: #f2dec0;
  font-size: 12px;
}
.reply-text-box {
  margin-top: 0;
  padding: 0 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(154, 116, 73, .18), rgba(83, 57, 36, .14)),
    linear-gradient(90deg, rgba(244, 226, 193, .05), rgba(180, 137, 84, .04), rgba(244, 226, 193, .05));
  border: 1px solid rgba(224, 193, 145, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -10px 24px rgba(0,0,0,.12);
  color: #f7eee6;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow: hidden;
  height: 0;
  opacity: 0;
  transform-origin: top center;
  transform: translateY(-10px) scaleY(.96);
  filter: blur(4px);
  transition:
    height .62s cubic-bezier(.22, 1, .36, 1),
    opacity .42s ease,
    transform .62s cubic-bezier(.22, 1, .36, 1),
    filter .42s ease,
    margin-top .62s cubic-bezier(.22, 1, .36, 1),
    padding-top .62s cubic-bezier(.22, 1, .36, 1),
    padding-bottom .62s cubic-bezier(.22, 1, .36, 1);
}
.reply-text-box.is-open {
  margin-top: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
  opacity: 1;
  transform: translateY(0) scaleY(1);
  filter: blur(0);
}
.reply-text-box::before,
.reply-text-box::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, rgba(224,193,145,0), rgba(224,193,145,.5), rgba(224,193,145,0));
}
.reply-text-box::before {
  margin-bottom: 14px;
}
.reply-text-box::after {
  margin-top: 14px;
}
.reply-notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(120, 84, 49, .12);
  border: 1px solid rgba(224,193,145,.10);
  color: rgba(236, 224, 201, .76);
  line-height: 1.8;
  font-size: 13px;
}
.reply-notice strong {
  color: #f2dec0;
  font-weight: 600;
}
.reply-notice em {
  font-style: normal;
  color: rgba(246, 228, 197, .88);
}
audio {
  width: 100%;
}
.error {
  min-height: 22px;
  color: #dcb78c;
  font-size: 14px;
  text-align: center;
}
.main-orb {
  width: min(66vw, 240px);
  height: min(66vw, 240px);
  min-width: 210px;
  min-height: 210px;
  max-width: 240px;
  max-height: 240px;
  border: none;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.26);
  transition: transform .18s ease, box-shadow .18s ease, background .22s ease;
}
.main-orb:hover { transform: translateY(-2px) scale(1.01); }
.main-orb:active { transform: scale(.985); }
.main-orb.is-idle {
  background: radial-gradient(circle at 32% 28%, #f1d4a2, #b88345 46%, #6e4527 100%);
  animation: orbPulse 1.8s ease-in-out infinite;
}
.main-orb.is-recording {
  background: radial-gradient(circle at 30% 26%, #eab7a7, #b46a49 44%, #6d3927 100%);
  animation: orbRecording 1s ease-in-out infinite;
}
.main-orb.is-review {
  background: radial-gradient(circle at 32% 28%, #e9dcc3, #a47c49 44%, #5e4025 100%);
}
.main-orb.is-disabled {
  background: radial-gradient(circle at 32% 28%, #988b7b, #5f5349 44%, #342a24 100%);
  cursor: wait;
}
.orb-icon {
  font-size: 44px;
  line-height: 1;
}
.orb-text {
  font-size: 24px;
  font-weight: 700;
}
.orb-subtext {
  font-size: 13px;
  color: rgba(255,255,255,.82);
}
.processing-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 8, 6, .68);
  backdrop-filter: blur(12px);
}
.processing-dialog {
  width: min(92vw, 560px);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(42, 29, 22, .96), rgba(24, 17, 13, .97));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 30px 100px rgba(0,0,0,.38);
}
.processing-title {
  font-size: 22px;
  font-weight: 700;
  color: #f1dec0;
  margin-bottom: 10px;
}
.processing-current {
  font-size: 18px;
  font-weight: 700;
  color: #e5c18d;
  margin-bottom: 6px;
}
.processing-hint {
  color: rgba(233, 216, 190, .76);
  line-height: 1.7;
  margin-bottom: 12px;
}
.processing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(223, 205, 177, .68);
  font-size: 13px;
  margin-bottom: 14px;
}
.processing-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
  margin-bottom: 16px;
}
.processing-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d8c09a, #9d6f3b);
  transition: width .35s ease;
}
.processing-modal.is-success .processing-fill {
  background: linear-gradient(90deg, #7be0ad, #31b575);
}
.processing-modal.is-error .processing-fill {
  background: linear-gradient(90deg, #ff9b8d, #da5b4d);
}
.processing-steps {
  display: grid;
  gap: 10px;
}
.processing-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(113, 79, 48, .12);
  border: 1px solid rgba(255,255,255,.05);
}
.processing-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.24);
  margin-top: 7px;
  flex: 0 0 auto;
}
.processing-step-main {
  flex: 1;
}
.processing-step-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #f0dfc3;
  font-size: 14px;
}
.processing-step-state {
  color: rgba(255,241,226,.52);
  font-size: 12px;
  white-space: nowrap;
}
.processing-step-hint {
  margin-top: 5px;
  color: rgba(226, 210, 184, .62);
  font-size: 13px;
  line-height: 1.7;
}
.processing-step.is-active {
  background: rgba(163, 117, 64, .14);
  border-color: rgba(255, 216, 170, .14);
}
.processing-step.is-active .processing-step-dot {
  background: #d4b07b;
  box-shadow: 0 0 0 6px rgba(255,207,145,.10);
}
.processing-step.is-active .processing-step-state {
  color: #e4c797;
}
.processing-step.is-done .processing-step-dot {
  background: #b9945f;
}
.processing-step.is-done .processing-step-state {
  color: #dbbe8c;
}
.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(92vw, 420px);
  height: 100vh;
  padding: 18px;
  background: linear-gradient(180deg, rgba(29, 21, 17, .98), rgba(18, 13, 10, .98));
  border-left: 1px solid rgba(255,255,255,.08);
  box-shadow: -20px 0 60px rgba(0,0,0,.28);
  transform: translateX(100%);
  transition: transform .22s ease;
  overflow: auto;
}
.history-drawer.is-open {
  transform: translateX(0);
}
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .22s ease;
}
.drawer-mask.is-visible { opacity: 1; }
.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.drawer-title {
  font-size: 22px;
  font-weight: 700;
  color: #f1dfc0;
}
.drawer-subtitle {
  margin-top: 6px;
  color: rgba(226, 209, 184, .66);
  line-height: 1.7;
  font-size: 13px;
}
.history-list {
  display: grid;
  gap: 14px;
}
.history-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(108, 76, 47, .12);
  border: 1px solid rgba(255,255,255,.06);
}
.history-meta {
  color: rgba(226, 210, 184, .62);
  font-size: 12px;
  margin-bottom: 10px;
}
.history-label {
  color: #ddc095;
  font-size: 13px;
  margin-bottom: 8px;
}
.history-label-reply {
  margin-top: 10px;
}
.history-audio-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.history-preview {
  margin-top: 12px;
}
.history-preview-btn {
  border: 1px solid rgba(224,193,145,.14);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(118, 82, 47, .12);
  color: #ddc095;
  font-size: 13px;
  cursor: pointer;
}
.history-text-shell {
  margin-top: 0;
  padding: 0 14px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(154, 116, 73, .14), rgba(83, 57, 36, .10)),
    linear-gradient(90deg, rgba(244, 226, 193, .04), rgba(180, 137, 84, .03), rgba(244, 226, 193, .04));
  border: 1px solid rgba(224,193,145,.10);
  overflow: hidden;
  height: 0;
  opacity: 0;
  transform-origin: top center;
  transform: translateY(-8px) scaleY(.97);
  filter: blur(3px);
  transition:
    height .58s cubic-bezier(.22, 1, .36, 1),
    opacity .4s ease,
    transform .58s cubic-bezier(.22, 1, .36, 1),
    filter .4s ease,
    margin-top .58s cubic-bezier(.22, 1, .36, 1),
    padding-top .58s cubic-bezier(.22, 1, .36, 1),
    padding-bottom .58s cubic-bezier(.22, 1, .36, 1);
}
.history-text-shell.is-open {
  margin-top: 10px;
  padding-top: 14px;
  padding-bottom: 14px;
  opacity: 1;
  transform: translateY(0) scaleY(1);
  filter: blur(0);
}
.history-text-shell::before,
.history-text-shell::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, rgba(224,193,145,0), rgba(224,193,145,.42), rgba(224,193,145,0));
}
.history-text-shell::before {
  margin-bottom: 12px;
}
.history-text-shell::after {
  margin-top: 12px;
}
.history-text {
  color: rgba(236, 224, 201, .84);
  line-height: 1.9;
  white-space: pre-wrap;
}
.history-badge,
.empty-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,240,224,.7);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}
@keyframes orbPulse {
  0%, 100% { box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 0 rgba(255, 195, 117, .18), inset 0 1px 0 rgba(255,255,255,.26); }
  50% { box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 18px rgba(255, 195, 117, 0), inset 0 1px 0 rgba(255,255,255,.26); }
}
@keyframes orbRecording {
  0%, 100% { box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 0 rgba(255, 124, 111, .22), inset 0 1px 0 rgba(255,255,255,.20); }
  50% { box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 20px rgba(255, 124, 111, 0), inset 0 1px 0 rgba(255,255,255,.20); }
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.stack-form { display: grid; gap: 8px; }
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.admin-table th {
  color: var(--muted);
  font-weight: 600;
}
.compact-table { min-width: 700px; }
.cell-text {
  white-space: pre-wrap;
  word-break: break-word;
  min-width: 220px;
  line-height: 1.8;
}
@media (max-width: 640px) {
  .hero-copy {
  text-align: center;
  margin-bottom: 8px;
  position: relative;
}
.hero-copy::before,
.hero-copy::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, rgba(220,195,148,0), rgba(220,195,148,.6), rgba(220,195,148,0));
}
.hero-copy::before { left: -72px; }
.hero-copy::after { right: -72px; }
.hero-mark {
  font-size: 12px;
  letter-spacing: .45em;
  text-indent: .45em;
  color: rgba(226, 204, 164, .72);
  margin-bottom: 10px;
}
.hero-title {
  margin: 0;
  font-size: clamp(42px, 10vw, 68px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .18em;
  text-indent: .18em;
  color: #f3e3c8;
  text-shadow: 0 0 18px rgba(223,185,122,.08), 0 6px 24px rgba(0,0,0,.28);
}
.hero-subtitle {
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: .28em;
  text-indent: .28em;
  color: rgba(235, 220, 191, .78);
}
.history-fab {
    top: 14px;
    right: 14px;
  }
  .main-orb {
    min-width: 190px;
    min-height: 190px;
  }
  .processing-meta,
  .processing-step-line {
    flex-direction: column;
    align-items: flex-start;
  }
}


.processing-current {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.processing-steps {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}
.processing-step {
  padding: 11px 12px;
}
.processing-step-line {
  align-items: center;
}
.processing-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: rgba(255,239,223,.72);
  font-size: 12px;
}
.processing-step-title {
  flex: 1;
}
.processing-more {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(113, 79, 48, .12);
  color: rgba(226, 210, 184, .62);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 640px) {
  .processing-dialog {
    width: calc(100vw - 28px);
    max-height: min(82vh, 720px);
    padding: 18px 16px;
    border-radius: 22px;
  }
  .processing-current {
    font-size: 17px;
    line-height: 1.45;
  }
  .processing-hint {
    font-size: 14px;
  }
  .processing-step-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
  }
  .processing-step-hint {
    font-size: 12px;
    line-height: 1.65;
  }
}


.game-body {
  -webkit-tap-highlight-color: transparent;
}
.game-stage,
.prompt-text,
.main-orb,
.history-fab,
.drawer-head,
.voice-card-head,
.processing-dialog,
.processing-title,
.processing-current,
.processing-hint,
.processing-meta,
.processing-step,
.processing-more,
.icon-btn,
.tiny-btn,
button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}



.prompt-text {
  max-width: 26em;
  line-height: 1.9;
}
.history-fab,
.tiny-btn,
.icon-btn,
.main-orb,
.voice-card,
.processing-dialog,
.history-item {
  box-shadow: 0 14px 40px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04);
}
.history-fab {
  border-color: rgba(202, 171, 127, .18);
}
.voice-card,
.processing-dialog,
.history-item,
.history-drawer {
  backdrop-filter: blur(18px);
}
.processing-title,
.drawer-title,
.voice-card-title {
  letter-spacing: .08em;
}
@media (max-width: 640px) {
  .hero-copy::before,
  .hero-copy::after {
    display: none;
  }
  .hero-mark {
    font-size: 11px;
  }
  .hero-subtitle {
    font-size: 13px;
  }
}
