:root {
  color: #f3f2ef;
  background: #0b0e16;
  font-family:
    Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-width: 960px;
  height: 100%;
  min-height: 640px;
  margin: 0;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111522;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 58px;
  padding: 0 22px;
  color: rgb(245 241 234 / 88%);
  background: rgb(11 14 22 / 86%);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  backdrop-filter: blur(18px);
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-family: "Noto Serif SC", "Songti SC", serif;
  letter-spacing: 0.08em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #e5b7a5;
  border: 1px solid rgb(229 183 165 / 48%);
  border-radius: 50%;
}

.scene-label {
  color: rgb(244 239 232 / 62%);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.top-actions {
  justify-content: flex-end;
}

.top-actions button,
.suggestions button {
  cursor: pointer;
  background: transparent;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 999px;
}

.top-actions button {
  padding: 7px 13px;
  color: rgb(245 241 234 / 72%);
}

.stage {
  position: relative;
  height: calc(100% - 58px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgb(12 17 31 / 4%), rgb(8 11 19 / 88%)),
    linear-gradient(115deg, #18283c 0%, #26364b 46%, #111722 100%);
}

.stage::before,
.stage::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.stage::before {
  inset: 0;
  opacity: 0.35;
  background:
    repeating-linear-gradient(
      104deg,
      transparent 0 28px,
      rgb(210 230 244 / 16%) 29px,
      transparent 31px 52px
    );
  transform: translateY(-15%);
}

.stage::after {
  right: -10%;
  bottom: 31%;
  width: 64%;
  height: 28%;
  background: linear-gradient(90deg, transparent, rgb(233 172 124 / 20%));
  filter: blur(40px);
}

.stage-sky {
  position: absolute;
  inset: 0 0 44%;
  background:
    radial-gradient(circle at 68% 30%, rgb(247 194 145 / 18%), transparent 24%),
    linear-gradient(180deg, #15243b, transparent);
}

.station-sign {
  position: absolute;
  top: 16%;
  left: 10%;
  padding: 14px 24px;
  color: rgb(229 220 204 / 65%);
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  letter-spacing: 0.35em;
  background: rgb(26 31 40 / 70%);
  border: 1px solid rgb(255 255 255 / 12%);
  transform: rotate(-1deg);
}

.character {
  position: absolute;
  right: 16%;
  bottom: 22%;
  width: 280px;
  height: 510px;
  filter: drop-shadow(0 34px 36px rgb(0 0 0 / 40%));
}

.character-hair,
.character-face,
.character-coat {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.character-hair {
  top: 20px;
  width: 204px;
  height: 250px;
  background: #28242d;
  border-radius: 52% 48% 44% 48% / 36% 40% 60% 64%;
  box-shadow:
    -42px 80px 0 -25px #28242d,
    48px 90px 0 -28px #211f27;
}

.character-face {
  top: 62px;
  z-index: 2;
  width: 142px;
  height: 176px;
  background: linear-gradient(145deg, #f4d5c4, #dfb39f);
  border-radius: 48% 48% 46% 46% / 40% 42% 58% 60%;
}

.eye,
.mouth {
  position: absolute;
  display: block;
  background: #4c3838;
}

.eye {
  top: 82px;
  width: 18px;
  height: 9px;
  border-radius: 50%;
}

.eye--left {
  left: 31px;
}

.eye--right {
  right: 31px;
}

.mouth {
  bottom: 35px;
  left: 50%;
  width: 24px;
  height: 7px;
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
}

.character-coat {
  bottom: 0;
  z-index: 1;
  width: 260px;
  height: 320px;
  background: linear-gradient(115deg, #c9baa6, #817a72);
  border-radius: 46% 46% 7% 7% / 20% 20% 5% 5%;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}

.chapter-chip {
  position: absolute;
  top: 7%;
  left: 50%;
  padding: 6px 14px;
  color: rgb(245 239 231 / 62%);
  font-family: "Noto Serif SC", serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 999px;
  transform: translateX(-50%);
}

.dialogue-panel {
  position: absolute;
  right: 7%;
  bottom: 116px;
  left: 7%;
  z-index: 10;
  min-height: 126px;
  padding: 20px 26px;
  background: linear-gradient(100deg, rgb(13 17 27 / 94%), rgb(24 26 34 / 84%));
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 14px;
  box-shadow: 0 22px 56px rgb(0 0 0 / 38%);
  backdrop-filter: blur(18px);
}

.speaker-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.speaker-row strong {
  color: #f0c4b2;
  font-family: "Noto Serif SC", serif;
  font-size: 19px;
}

.speaker-row span {
  color: rgb(241 237 231 / 40%);
  font-size: 12px;
}

.dialogue-panel p {
  max-width: 72ch;
  margin: 14px 0 0;
  color: rgb(250 247 242 / 90%);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
  line-height: 1.75;
}

.suggestions {
  position: absolute;
  right: 8%;
  bottom: 255px;
  z-index: 12;
  display: flex;
  gap: 10px;
}

.suggestions button {
  padding: 8px 13px;
  color: rgb(245 241 234 / 72%);
  background: rgb(15 19 29 / 64%);
  backdrop-filter: blur(12px);
}

.composer {
  position: absolute;
  right: 7%;
  bottom: 42px;
  left: 7%;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
}

.composer textarea {
  min-height: 58px;
  padding: 13px 16px;
  resize: none;
  color: rgb(250 247 242 / 92%);
  outline: none;
  background: rgb(12 15 24 / 86%);
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 12px;
}

.composer button {
  min-width: 72px;
  cursor: pointer;
  border-radius: 12px;
}

.continue-button {
  color: rgb(245 241 234 / 75%);
  background: rgb(24 28 39 / 88%);
  border: 1px solid rgb(255 255 255 / 13%);
}

.send-button {
  color: #201918;
  background: #e7b8a4;
  border: 0;
}

.send-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.statusline {
  position: absolute;
  right: 8%;
  bottom: 15px;
  left: 8%;
  z-index: 12;
  display: flex;
  justify-content: space-between;
  color: rgb(242 238 231 / 28%);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.state-screen {
  display: grid;
  width: 100%;
  height: calc(100% - 58px);
  place-content: center;
  gap: 8px;
  color: rgb(245 241 234 / 70%);
}

.state-screen--error {
  color: #f1b5ad;
}
