:root {
  color-scheme: light;
  --canvas: #eeeae3;
  --paper: #fffdf9;
  --ink: #20211f;
  --muted: #696a65;
  --line: #d8d4cd;
  --structure: #202321;
  --structure-soft: #2b2f2c;
  --structure-text: #f6f2eb;
  --coral: #c94735;
  --coral-dark: #a93628;
  --focus: #187a70;
  --error: #b83a31;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 1040px;
  min-height: 100%;
  background: var(--canvas);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body {
  display: flow-root;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(480px, 0.92fr);
  width: min(1320px, calc(100% - 64px));
  min-height: min(820px, calc(100vh - 64px));
  margin: 32px auto;
  overflow: hidden;
  border: 1px solid #cbc6be;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 48px rgba(40, 37, 32, 0.12);
}

.studio-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 32px;
  color: var(--structure-text);
  background: var(--structure);
}

.product-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid #555b56;
  border-radius: 6px;
  color: #191b19;
  background: var(--coral);
  font-size: 18px;
  font-weight: 800;
}

.product-kicker,
.section-label {
  margin: 0 0 5px;
  color: #aeb3ae;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.product-header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.studio-preview {
  position: relative;
  flex: 1;
  min-height: 420px;
  margin: 42px 0 30px;
  overflow: hidden;
  border: 1px solid #454a46;
  border-radius: 6px;
  background: #171917;
}

.studio-preview img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: center;
  opacity: 0.88;
}

.preview-meta {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(20, 22, 20, 0.92);
}

.preview-meta span {
  padding: 4px 8px;
  border-left: 2px solid var(--coral);
  color: #e5e3dd;
  font-size: 12px;
}

.studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #bfc3be;
  font-size: 12px;
}

.studio-footer p {
  margin: 0;
}

.system-state {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.system-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5fc18c;
}

.access-panel {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 52px 70px;
  background: var(--paper);
}

.access-inner {
  width: min(100%, 430px);
}

.access-header {
  margin-bottom: 28px;
}

.access-header .section-label {
  color: var(--coral-dark);
}

.access-header h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.25;
}

.access-header p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 42px;
  margin-bottom: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f0ea;
}

.auth-tab {
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.auth-tab.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 4px rgba(43, 39, 34, 0.12);
}

.form-message {
  min-height: 22px;
  margin-bottom: 4px;
  color: var(--error);
  font-size: 13px;
  line-height: 1.45;
}

.form-message:empty {
  visibility: hidden;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-form[hidden] {
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.form-field label {
  color: #353633;
  font-size: 13px;
  font-weight: 700;
}

.form-field input {
  width: 100%;
  height: 42px;
  border: 1px solid #c9c5bd;
  border-radius: 5px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffefa;
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.form-field input:hover {
  border-color: #99968f;
}

.form-field input:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(24, 122, 112, 0.18);
}

.field-hint {
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.primary-action {
  position: relative;
  display: grid;
  width: 100%;
  height: 42px;
  margin-top: 4px;
  place-items: center;
  border: 1px solid var(--coral-dark);
  border-radius: 5px;
  color: #fff;
  background: var(--coral);
  font-weight: 800;
  transition: background-color 140ms ease, transform 140ms ease;
}

.primary-action:hover:not(:disabled) {
  background: var(--coral-dark);
}

.primary-action:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-action:focus-visible,
.auth-tab:focus-visible {
  outline: 3px solid rgba(24, 122, 112, 0.28);
  outline-offset: 2px;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-progress {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-action.is-loading > span:first-child {
  display: none;
}

.primary-action.is-loading .button-progress {
  display: block;
}

.access-note {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid #e2ded7;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-height: 820px) {
  .auth-shell {
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .studio-preview {
    margin-top: 28px;
    margin-bottom: 22px;
  }

  .access-panel {
    padding-top: 34px;
    padding-bottom: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
