:root {
  color-scheme: light;
  --paper: #fff8ec;
  --panel: #fffdf7;
  --ink: #38281f;
  --soft: #705a4a;
  --line: #e2ceba;
  --red: #ad392e;
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 18% 4%, #f8dfc5 0%, transparent 43%),
    var(--paper);
  font: 16px/1.55 var(--body);
}
button, textarea, input { font: inherit; }
button, a, textarea, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.shell { width: min(950px, calc(100% - 44px)); margin-inline: auto; }
.masthead {
  height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.brand small {
  display: inline-block;
  margin-left: 6px;
  color: var(--soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .12em;
}
.language {
  max-width: 44vw;
  min-height: 44px;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  font: 650 14px/1.4 var(--body);
  cursor: pointer;
}
.intro { margin: 35px 0 27px; }
.kicker { color: var(--red); font-weight: 750; font-size: 12px; letter-spacing: .13em; }
.intro h1 { font: 700 clamp(37px, 6.1vw, 70px)/1.04 var(--serif); margin: 8px 0 13px; }
.intro p { margin: 0; }
.intro p:last-child { color: var(--soft); }
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.preview, .editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 7px 0 #e2ceba66;
}
.preview { padding: 17px; }
.preview-head, .preview-foot, .caption-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.preview-head { margin: 0 3px 11px; }
.preview-head h2 { font-size: 13px; margin: 0; }
.play, .link-button { border: 0; background: none; color: var(--red); padding: 5px 0; font-size: 13px; }
.play { min-height: 32px; }
.canvas-wrap {
  border-radius: 15px;
  overflow: hidden;
  max-width: 420px;
  margin-inline: auto;
  background: #fce0cc;
}
canvas { display: block; width: 100%; height: auto; }
.preview-foot { color: var(--soft); font-size: 12px; margin: 12px 3px 0; }
.editor { padding: 24px; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
legend, .caption-control label { padding: 0; font-weight: 750; }
.step { margin-right: 9px; font: 700 13px/1 var(--serif); color: var(--red); }
.poses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 11px 0 24px; }
.poses label { position: relative; }
.poses input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.poses span {
  display: grid;
  place-items: center;
  min-height: 47px;
  text-align: center;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.poses input:checked + span { border-color: var(--red); background: #fce3d8; color: #8a2923; }
.poses input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
textarea, #manual-link {
  width: 100%;
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  margin-top: 10px;
  padding: 11px 12px;
}
textarea { min-height: 80px; resize: vertical; }
.caption-meta { font-size: 12px; color: var(--soft); margin: 4px 0 16px; }
.export { display: grid; gap: 8px; }
.result { display: grid; gap: 8px; }
.primary, .secondary {
  display: grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
  padding: 8px;
}
.primary { background: var(--red); border: 1px solid var(--red); color: white; }
.primary:hover:not(:disabled) { background: #8e2924; }
.secondary { background: #fff4e5; border: 1px solid var(--line); color: var(--ink); }
.secondary:hover { border-color: var(--red); }
.status { min-height: 1.5em; color: var(--soft); font-size: 12px; margin: 0; }
footer { margin: 25px 0 38px; display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--soft); font-size: 12px; }
footer a { color: var(--red); text-underline-offset: 3px; }
@media (max-width: 720px) {
  .shell { width: min(490px, calc(100% - 28px)); }
  .masthead { height: 58px; }
  .intro { margin: 20px 0 18px; }
  .intro h1 { margin-block: 6px 9px; }
  .intro p:last-child { font-size: 14px; }
  .studio { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .preview { padding: 12px; }
  .canvas-wrap { max-width: 345px; }
  .editor { padding: 18px; }
}
@media (max-width: 355px) {
  .brand small { display: none; }
  .language { max-width: 50vw; }
}
