:root {
  color-scheme: light;
  --paper: #f4f0e6;
  --card: #fcfaf4;
  --ink: #20332a;
  --muted: #5a675a;
  --green: #22372e;
  --green-deep: #1a2b24;
  --yellow: #f5d274;
  --edge: #dcd9cc;
  --body: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --heading: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--paper); color: var(--ink); margin: 0; font: 16px/1.55 var(--body); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, label[for="file-input"], .primary, .secondary { -webkit-tap-highlight-color: transparent; }
button, label[for="file-input"], .primary { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
:focus-visible { outline: 3px solid #528563; outline-offset: 4px; }
.top {
  min-height: 75px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(22px, calc((100vw - 1224px) / 2)); border-bottom: 1px solid var(--edge);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .045em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; background: var(--green); width: 34px; aspect-ratio: 1; border-radius: 8px; }
.brand-mark i { display: block; width: 12px; height: 15px; background: var(--yellow); clip-path: polygon(0 0, 100% 50%, 0 100%); margin-left: 2px; }
.account { display: flex; align-items: center; gap: 8px; }
.quiet, .secondary {
  color: var(--ink); border: 1px solid var(--edge); background: transparent; border-radius: 9px;
  padding: 9px 13px; min-height: 44px;
}
.quiet:hover, .secondary:hover { background: #e8e8da; }
main { width: min(1224px, calc(100% - 44px)); margin: 0 auto; }
.intro { margin: clamp(32px, 6.1vw, 79px) 0 clamp(28px, 4.4vw, 53px); }
h1, h2, p { margin: 0; }
h1 { font-family: var(--heading); font-size: clamp(43px, 6vw, 74px); line-height: 1.12; letter-spacing: -.055em; font-weight: 800; }
.intro p, .login-form p { color: var(--muted); margin-top: 12px; font-size: clamp(16px, 2vw, 19px); }
.studio-grid { display: grid; grid-template-columns: 1.13fr 1fr; align-items: start; gap: clamp(24px, 4vw, 56px); padding-bottom: 38px; }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 30px; }
.section-bar h2 { font-size: 20px; line-height: 1.2; letter-spacing: .015em; }
.section-bar > span { color: var(--muted); font-size: 14px; text-align: right; }
.preview {
  position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 248px; overflow: hidden;
  border-radius: 15px; background: var(--green-deep); border: 1px solid #344a40;
}
.empty-preview { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 13px; }
.empty-preview p { color: #d3ded0; font-size: 14px; }
.leader-art {
  position: relative; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid #828a61; color: var(--yellow); height: 54%; width: 69%;
  background: repeating-linear-gradient(0deg, transparent 0 15px, #ccd2a114 16px 17px),
              repeating-linear-gradient(90deg, transparent 0 15px, #ccd2a114 16px 17px);
}
.leader-art::before, .leader-art::after {
  content: ""; position: absolute; left: 5%; right: 5%; height: 5%;
  background: repeating-linear-gradient(90deg, #c5ae65 0 4%, transparent 4% 8%);
  opacity: .8;
}
.leader-art::before { top: 8%; }
.leader-art::after { bottom: 8%; }
.leader-art span {
  display: grid; place-items: center; width: 23%; aspect-ratio: 1; border-radius: 50%;
  background: var(--green); border: 1px solid #b8a259; box-shadow: 0 0 0 11px #f5d27415;
}
.leader-art span::before {
  content: ""; display: block; margin-left: 10%; width: 34%; height: 45%;
  background: var(--yellow); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.small-art { width: clamp(110px, 15vw, 180px); aspect-ratio: 1.95; height: auto; margin: 0 0 3px; transform: rotate(-7deg); }
.primary {
  display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  border: 1px solid transparent; min-height: 48px; border-radius: 9px;
  font-weight: 700; padding: 10px 16px; background: var(--yellow); color: #282818; white-space: nowrap;
}
.primary:hover { background: #ffe09b; }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.file-input, .sr-only { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.preview-pane:has(.file-input:focus-visible) label[for="file-input"] { outline: 3px solid white; outline-offset: 4px; }
.edit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.edit-actions .primary { margin-left: auto; }
.assets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.asset {
  text-overflow: ellipsis; max-width: 190px; white-space: nowrap; overflow: hidden;
  color: var(--ink); border: 1px solid var(--edge); border-radius: 7px; background: var(--card); min-height: 39px; padding: 6px 10px;
}
.asset[aria-pressed="true"] { border-color: #4c7358; background: #e9eee2; }
.upload-status { display: flex; align-items: center; gap: 11px; margin-top: 12px; }
progress { width: min(180px, 45%); accent-color: #496650; }
.chat-card { display: flex; flex-direction: column; border: 1px solid var(--edge); background: var(--card); border-radius: 15px; padding: 16px; }
.messages { min-height: 217px; max-height: 425px; overflow-y: auto; padding: 0 1px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.message {
  max-width: 93%; padding: 10px 13px; border-radius: 12px 12px 12px 3px;
  white-space: pre-wrap; overflow-wrap: anywhere; background: #ebeee4; color: #24372a;
}
.message.user { align-self: flex-end; color: #fff9e5; background: var(--green); border-radius: 12px 12px 3px 12px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.suggestions button {
  background: transparent; color: var(--ink); border: 1px solid var(--edge); border-radius: 24px;
  min-height: 38px; padding: 5px 11px; font-size: 14px; text-align: left;
}
.suggestions button:hover { background: #eeefdf; }
.composer { display: flex; gap: 9px; align-items: flex-end; margin-top: 11px; }
textarea, .login-form input {
  display: block; width: 100%; color: var(--ink); border: 1px solid #c7cebf; background: #fffefa;
  border-radius: 9px; padding: 10px 11px; min-height: 48px;
}
textarea { min-width: 0; resize: vertical; }
textarea::placeholder { color: #677061; }
.error { color: #9b3323; margin: 10px 0 0; }
.error:empty { display: none; }
.recent { background: var(--card); margin-top: 20px; padding: 16px; border: 1px solid var(--edge); border-radius: 13px; }
.recent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--edge); }
.recent-row button { border: 0; background: transparent; color: var(--ink); padding: 8px 4px; min-height: 44px; text-align: left; }
.recent-row button:first-child { overflow: hidden; text-overflow: ellipsis; }
.recent-row .remove { color: #9b3323; flex: none; }
.login-view { display: grid; grid-template-columns: 1.05fr 1fr; margin: clamp(27px, 10vh, 98px) auto 25px; max-width: 1000px; border: 1px solid var(--edge); border-radius: 17px; overflow: hidden; background: var(--card); }
.login-side { min-height: 380px; background: var(--green-deep); display: grid; place-items: center; }
.login-side .leader-art { transform: rotate(-9deg); }
.login-form { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(25px, 6vw, 56px); }
.login-form h1 { font-size: clamp(37px, 5vw, 56px); }
.login-form label { margin: 23px 0 7px; font-weight: 700; }
.login-form input { margin-bottom: 13px; }
.privacy { color: var(--muted); margin-top: 16px; }
.startup { padding: 45px 0; color: var(--muted); }
@media (max-width: 780px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); gap: 27px; }
  .intro { margin: 31px 0 29px; }
  .messages { min-height: 108px; max-height: 320px; }
  .preview { min-height: 216px; }
  .section-bar { margin-bottom: 10px; }
}
@media (max-width: 560px) {
  .top { padding-inline: 16px; min-height: 62px; }
  main { width: calc(100% - 32px); }
  .account { gap: 4px; }
  .quiet, .secondary { padding-inline: 9px; }
  .chat-card { padding: 12px; }
  .login-view { grid-template-columns: 1fr; }
  .login-side { min-height: 146px; }
  .login-side .leader-art { height: 54%; width: 42%; }
  .login-form { padding: 24px 20px 28px; }
}
