:root {
  color-scheme: light;
  --ink: #25372f;
  --muted: #6d7f72;
  --line: rgba(71, 96, 80, 0.18);
  --paper: #fbf7e8;
  --paper-strong: #fffdf3;
  --green: #7fb59a;
  --gold: #cfb66f;
  --rose: #d98fa5;
  --shadow: 0 24px 80px rgba(27, 45, 35, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #10201a;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 18%, rgba(127, 181, 154, 0.18), transparent 28%),
    linear-gradient(115deg, #fffaf0, #edf3e8);
}

.global-storage-notice {
  position: fixed;
  z-index: 2000;
  top: 14px;
  left: 50%;
  width: min(520px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid #d7a766;
  border-radius: 6px;
  background: #fff8e8;
  box-shadow: 0 8px 24px rgba(35, 43, 38, 0.16);
  color: #6f4617;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.global-storage-notice.is-error {
  border-color: #d78d8d;
  background: #fff0f0;
  color: #8a2929;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

#app {
  min-height: 100vh;
}

.standalone-phone-shell {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(127, 181, 154, 0.2), transparent 34%),
    linear-gradient(145deg, #10201a, #0c1512);
}

.standalone-return-button {
  position: fixed;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  padding: 7px 12px 7px 9px;
  color: #f6fbf8;
  background: rgba(22, 43, 34, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
}

.standalone-return-button > span {
  font-size: 24px;
  line-height: 0.7;
}

@media (max-width: 520px) {
  .standalone-return-button {
    min-width: 40px;
    padding: 7px 9px;
    font-size: 0;
  }

  .standalone-return-button > span {
    font-size: 25px;
  }
}

.standalone-phone-shell .os-caption {
  display: none;
}

.standalone-phone-shell .phone-frame {
  width: min(375px, calc((100dvh - 48px) * 0.462), calc(100vw - 40px));
}

@media (display-mode: standalone) {
  .standalone-phone-shell {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}

.studio-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 500px) 1fr;
}

.builder-pane {
  min-height: 100vh;
  padding: 28px;
  background: rgba(255, 252, 240, 0.78);
  border-right: 1px solid rgba(86, 112, 94, 0.18);
  backdrop-filter: blur(22px);
  overflow-y: auto;
}

.preview-pane {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 70% 18%, rgba(207, 182, 111, 0.22), transparent 28%),
    radial-gradient(circle at 26% 76%, rgba(127, 181, 154, 0.28), transparent 32%),
    linear-gradient(145deg, #10201a 0%, #182820 54%, #0c1512 100%);
}

.studio-header {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #587461;
  font-size: 13px;
  letter-spacing: 0;
}

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

.studio-header h1 {
  max-width: 420px;
  margin-bottom: 10px;
  font-family: "Noto Serif SC", serif;
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: 0;
}

.studio-header p:last-child {
  max-width: 420px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 980px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .builder-pane {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-pane {
    position: static;
    order: -1;
    height: auto;
    min-height: 100dvh;
    padding: 26px 16px 38px;
  }
}

@media (max-width: 520px) {
  .builder-pane {
    padding: 20px 16px;
  }

  .studio-header h1 {
    font-size: 28px;
  }
}
