:root {
  --eazo-safe-area-top: max(56px, env(safe-area-inset-top, 0px));
  --eazo-safe-area-bottom: max(34px, env(safe-area-inset-bottom, 0px));
  --gold: #f4d36b;
  --cream: #fff4cc;
  --blue-dark: #071632;
  --blue-mid: #102c59;
  /* 画面字体层级：全站只用这 3 级 */
  --fs-title: 20px;   /* L1 主标题 */
  --fs-body: 13px;    /* L2 正文 / 提示 / 交互控件 */
  --fs-caption: 11px; /* L3 辅助小字 */
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #071632;
  color: #fff4cc;
  -webkit-font-smoothing: antialiased;
}
body {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", serif;
}
button, input, select { font-family: inherit; }

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(circle at 50% 18%, #102c59 0%, #071632 58%, #030814 100%);
}
.sketch {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
}
canvas {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100vw;
  max-height: 100dvh;
  touch-action: none;
  cursor: grab;
}
canvas:active { cursor: grabbing; }

.topbar {
  position: absolute;
  top: var(--eazo-safe-area-top);
  left: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  text-shadow: 0 0 16px rgba(244, 211, 107, .22);
}
.seal {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 211, 107, .62);
  color: var(--gold);
  background: rgba(7, 22, 50, .24);
  backdrop-filter: blur(6px);
  font-size: var(--fs-body);
}
.brand-text { display: grid; gap: 4px; min-width: 0; }
.brand-title {
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: var(--fs-title);
  letter-spacing: .16em;
  color: rgba(255, 244, 204, .92);
  white-space: nowrap;
}
.brand-sub {
  font-size: var(--fs-caption);
  letter-spacing: .13em;
  color: rgba(255, 244, 204, .58);
  white-space: nowrap;
}
.lang {
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 244, 204, .22);
  border-radius: 999px;
  background: rgba(5, 13, 31, .36);
  color: rgba(255, 244, 204, .8);
  min-height: 32px;
  padding: 6px 12px;
  font-size: var(--fs-body);
  backdrop-filter: blur(8px);
}
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sound-toggle {
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 244, 204, .22);
  border-radius: 999px;
  background: rgba(5, 13, 31, .36);
  color: rgba(255, 244, 204, .8);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease;
}
.sound-toggle .ic {
  width: 17px;
  height: 17px;
}
.sound-toggle .ic-off { display: none; }
body.sound-off .sound-toggle {
  color: rgba(255, 244, 204, .42);
  border-color: rgba(255, 244, 204, .14);
}
body.sound-off .sound-toggle .ic-on { display: none; }
body.sound-off .sound-toggle .ic-off { display: block; }
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--eazo-safe-area-bottom) + 22px);
  transform: translateX(-50%);
  z-index: 3;
  width: min(84vw, 440px);
  padding: 14px 16px;
  border: 1px solid rgba(255, 244, 204, .14);
  border-radius: 18px;
  background: rgba(3, 8, 20, .24);
  color: rgba(255, 244, 204, .78);
  text-align: center;
  line-height: 1.65;
  letter-spacing: .05em;
  font-size: var(--fs-body);
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity .8s ease;
}
.hint p { margin: 0; }
.app.activated .hint { opacity: .26; }

@media (max-width: 520px) {
  :root {
    --fs-title: 17px;
    --fs-body: 12px;
    --fs-caption: 10px;
  }
  .topbar { left: 14px; right: 14px; }
  .brand-sub { max-width: 56vw; overflow: hidden; text-overflow: ellipsis; }
  .hint { bottom: calc(var(--eazo-safe-area-bottom) + 12px); }
}
