:root {
  color-scheme: dark; color: #f6e8cb; background: #102c29;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.workshop { position: relative; isolation: isolate; width: 100%; height: 100svh; min-height: 490px; overflow: hidden; background: #102d2a; }
.atelier { position: absolute; inset: 0 auto auto 0; width: 100%; height: 100%; object-fit: cover; max-width: none; pointer-events: none; user-select: none; }
.instrument { position: absolute; inset: 0 auto auto 0; }
#optic-render { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.contact-shadow {
  position: absolute; width: 73%; height: 8%; left: 15%; transform: translateY(-62%) rotate(-1deg);
  border-radius: 50%; background: radial-gradient(ellipse closest-side,#1b130bf2 0%,#2c1b1294 54%,transparent 100%);
  filter: blur(3px); pointer-events: none;
}
.brand {
  position: absolute; z-index: 1; pointer-events: none; display: grid; justify-items: center;
  top: clamp(22px,6vh,74px); left: clamp(36px,6vw,116px); width: min(36vw,55vh,620px);
  transform-origin: top left; transition: opacity .3s, transform .45s;
}
.brand img { width: 100%; height: auto; display: block; }
.system-name {
  display: flex; align-items: center; gap: .9em; margin-top: .42em;
  font: 600 clamp(16px,1.55vw,27px)/1.36 "STZhongsong","Songti SC",SimSun,serif;
  letter-spacing: .24em; text-indent: .24em; color: #fff1cb; text-shadow: 0 1px 4px #142c28;
}
.system-name::before, .system-name::after { content: ""; width: 2em; height: 1px; background: #b29969; }
.workshop:not([data-pose="front"]) .brand { opacity: 0; transform: scale(.88); }
#open-instrument {
  position: absolute; inset: 3% 5% 0; width: 90%; height: 97%; border: 0; padding: 0;
  color: #fff1cc; background: transparent; border-radius: 25%;
}
#open-instrument:disabled { visibility: hidden; }
.turn-prompt, #return-front {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 42px;
  padding: 8px 18px; white-space: nowrap; color: #fff2cd; border: 1px solid #bc995f; border-radius: 22px;
  background: linear-gradient(180deg,#29433a,#182f28); box-shadow: inset 0 1px #e4cc9d2e,0 3px 10px #1a120c7a;
  font-size: 15px; font-weight: 600; letter-spacing: .04em;
}
.turn-prompt { position: absolute; left: 50%; top: 98%; transform: translateX(-50%); }
.turn-prompt span, #return-front span { color: #efd291; font: 22px/1 Georgia,serif; }
#open-instrument:focus-visible, #login-title:focus { outline: none; }
#open-instrument:focus-visible .turn-prompt, #return-front:focus-visible,
.terminal :focus-visible, .roles input:focus-visible + span { outline: 2px solid #ffe2a3; outline-offset: 2px; }
#open-instrument:hover .turn-prompt, #return-front:hover { border-color: #f5d591; }
.terminal { position: absolute; container-type: inline-size; display: grid; place-items: center; color: #f8ead0; }
.engraving { width: min(93%,385px); }
.engraving h2 { display: flex; justify-content: center; margin-bottom: clamp(6px,2.6cqw,15px); }
.engraving h2 img { display: block; width: min(54%,197px); height: auto; filter: drop-shadow(0 1px 1px #12291bd9); }
.engraving form { display: grid; gap: clamp(5px,1.9cqw,11px); }
.roles { display: flex; min-width: 0; padding: 2px; margin: 0; border: 1px solid #b8a77d8c; border-radius: 4px; background: #132a23ce; }
.roles label { flex: 1; position: relative; cursor: pointer; }
.roles input, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.roles span { display: flex; gap: 6px; align-items: center; justify-content: center; min-height: clamp(29px,8cqw,36px); font-size: 13px; color: #d5d7c3; border-radius: 2px; }
.roles input:checked + span { color: #fff0c4; font-weight: 650; background: #415447; box-shadow: inset 0 0 0 1px #c4b58480; }
.roles input:checked + span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f8d994; box-shadow: 0 0 4px #e9b75c88; }
.recess { overflow: hidden; border: 1px solid #a89e799c; border-radius: 4px; background: #112a23dc; }
.field { display: flex; align-items: center; padding: 0 0 0 clamp(8px,3.3cqw,15px); height: clamp(38px,10.4cqw,48px); }
.field + .field { border-top: 1px solid #888d7669; }
.field:focus-within { box-shadow: inset 2px 0 #e5c284; }
.field label { flex: none; font-size: 13px; font-weight: 650; color: #ecddbb; }
.field input { min-width: 0; flex: 1; width: 100%; height: 100%; padding: 0 8px 0 12px; color: #fff6e0; border: 0; outline: none !important; background: transparent; font-size: 16px; }
.field input::placeholder { color: #b3c0ad; font-size: 14px; }
#toggle-password { background: transparent; border: none; padding: 0; width: 40px; height: 100%; display: grid; place-items: center; color: #c7cfb6; }
.eye { position: relative; width: 17px; height: 12px; border: 1.5px solid currentColor; border-radius: 75% 20%; transform: rotate(35deg); }
.eye::before { content: ""; position: absolute; inset: 2px auto auto 5px; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; }
#toggle-password[aria-pressed="true"] .eye::after { content: ""; position: absolute; left: 7px; top: -4px; width: 1px; height: 18px; background: currentColor; }
.submit {
  position: relative; min-height: clamp(38px,10.4cqw,46px); border: 1px solid #efd498; border-radius: 4px;
  font-size: 16px; font-weight: 700; letter-spacing: .14em; text-indent: .14em; color: #2c3222;
  background: linear-gradient(175deg,#ecd29a,#c6a56e); box-shadow: inset 0 1px #fff2c7,0 2px 3px #101d1680;
}
.submit span { position: absolute; right: 13px; font-size: 17px; }
#register { justify-self: center; border: 0; background: none; color: #f2dfb7; font-size: 13px; min-height: 27px; padding: 2px 10px; text-decoration: underline; text-underline-offset: 3px; }
.scene-actions { position: absolute; z-index: 2; left: 50%; bottom: max(11px,env(safe-area-inset-bottom),2.6vh); transform: translateX(-50%); display: grid; justify-items: center; gap: 7px; width: max-content; max-width: 95%; pointer-events: none; }
.scene-actions button { pointer-events: auto; }
#feedback:not(:empty), noscript { margin: 0; padding: 5px 12px; border-radius: 4px; color: #fff3d5; background: #19312bf2; font-size: 13px; text-align: center; }
noscript { position: absolute; bottom: 2rem; }
@media (max-width: 720px), (orientation: portrait) and (max-width: 1050px) {
  .brand { top: max(23px,env(safe-area-inset-top),5vh); left: 50%; width: min(70vw,35vh,340px); transform: translateX(-50%); transform-origin: top center; }
  .system-name { font-size: clamp(14px,3.4vw,18px); margin-top: 5px; gap: .6em; }
  .system-name::before, .system-name::after { width: 1.5em; }
  .workshop:not([data-pose="front"]) .brand { opacity: 0; transform: translateX(-50%) scale(.88); }
}
@media (orientation: portrait) and (min-height: 700px) and (max-width: 1050px) {
  .workshop[data-pose="back"] .brand { opacity: .86; transform: translateX(-50%) scale(.7); }
}
@media (max-height: 580px) and (orientation: landscape) {
  .brand { width: min(27vw,235px); top: 16px; left: 24px; }
}
@media (prefers-reduced-motion: reduce) { .brand { transition: none; } }

.scene-actions { bottom: calc(var(--scene-legal-height,27px) + max(5px,1.2vh)); }
.scene-actions nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px 12px; }
.scene-actions nav button:not(#return-front) {
  min-height: 38px; padding: 6px 16px; color: #fff1cb; background: #19362ef2;
  border: 1px solid #ad9267; border-radius: 22px; font-size: 14px;
}
.scene-legal-links { background: #172b24e8; color: #efdfc1; }
.scene-actions button:focus-visible { outline: 2px solid #ffe2a3; outline-offset: 2px; }
#login-form[aria-busy="true"], button:disabled { cursor: wait; }
#login-form[aria-busy="true"] .submit { opacity: .75; }
.workbench-dialog, .account-reason-dialog {
  color-scheme: light; color: #303e34; background: #fbf4e7;
  border: 1px solid #bc9f70; border-radius: 14px;
  box-shadow: 0 18px 70px #071b14a8; font: 16px/1.5 "Microsoft YaHei UI","PingFang SC",sans-serif;
}
.workbench-dialog {
  width: min(430px,calc(100% - 28px)); max-height: calc(100dvh - 28px);
  overflow: auto; padding: clamp(18px,4.5vw,28px);
}
.workbench-dialog::backdrop, .account-reason-dialog::backdrop { background: #0b201bbd; backdrop-filter: blur(4px); }
.workbench-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.workbench-dialog h2, .account-reason-dialog h2 { font-size: 21px; }
.workbench-dialog header button, .account-reason-dialog [aria-label="取消申请"] {
  align-self: flex-start; min-width: 40px; min-height: 40px; padding: 1px 8px;
  font-size: 24px; line-height: 1; color: #394d3f; background: transparent; border: 1px solid #c4bcaa; border-radius: 7px;
}
.workbench-dialog form { display: grid; gap: 6px; }
.workbench-dialog form > p { margin-bottom: 8px; color: #596558; font-size: 14px; }
.workbench-dialog label { font-weight: 600; }
.workbench-dialog input, .account-reason-dialog input:not([type="checkbox"]), .account-reason-dialog textarea {
  min-width: 0; width: 100%; padding: 9px 12px; border: 1px solid #a7af9f; border-radius: 7px;
  color: #28392e; background: #fffcf5; font: inherit;
}
.workbench-dialog input { min-height: 44px; margin-bottom: 6px; }
.workbench-dialog .dialog-submit, .account-reason-dialog [type="submit"] {
  min-height: 44px; margin-top: 6px; border: 1px solid #355546; border-radius: 7px;
  background: #2d5142; color: #fff7e6; font-weight: 650;
}
.workbench-dialog :focus-visible, .account-reason-dialog :focus-visible { outline: 2px solid #38684f; outline-offset: 2px; }
.workbench-dialog #registration-status:not(:empty) { margin-top: 12px; color: #77482e; }
.workbench-dialog button:disabled, .account-reason-dialog button:disabled { opacity: .64; }
.workshop[data-fallback="true"] .instrument { inset: 0; width: 100% !important; height: 100% !important; transform: none !important; }
.workshop[data-fallback="true"] :is(#optic-render,.contact-shadow,#open-instrument) { display: none; }
.workshop[data-fallback="true"] .terminal {
  inset: 44% auto auto 50% !important; width: min(90%,395px) !important; height: auto !important; padding: 22px 10px;
  transform: translate(-50%,-36%); background: #233c32f7; border: 1px solid #c1aa77; border-radius: 9px;
}
@media (max-height: 500px) {
  .workshop { min-height: 435px; }
  .scene-actions { bottom: calc(var(--scene-legal-height,27px) + 3px); gap: 2px; }
  #return-front { min-height: 32px; padding-block: 3px; }
}
