:root {
  --brand: #ffe66f;
  --brand-deep: #e0c341;
  --ink: #111113;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.14);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-thick: rgba(255, 255, 255, 0.92);
  --danger: #d92d20;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
  font-family: "SF Pro SC", "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 230, 111, 0.28), transparent 34rem),
    radial-gradient(circle at 92% 82%, rgba(108, 165, 255, 0.18), transparent 38rem),
    linear-gradient(145deg, #f7f8fa 0%, #eef1f5 48%, #f4f5f7 100%);
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.55;
}

.ambient-yellow { top: -18rem; left: -12rem; background: rgba(255, 230, 111, 0.52); }
.ambient-blue { right: -18rem; bottom: -16rem; background: rgba(111, 175, 255, 0.3); }

.staff-header,
.staff-shell,
.staff-footer { position: relative; z-index: 1; }

.staff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
}

.staff-brand { display: inline-flex; align-items: center; gap: 12px; }

.staff-brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffef91, #f2ce39);
  box-shadow: inset 0 1px rgba(255,255,255,.8), 0 10px 24px rgba(147, 113, 0, 0.13);
}

.staff-brand-mark::before,
.staff-brand-mark::after,
.staff-brand-mark span {
  content: "";
  position: absolute;
  width: 6px;
  height: 25px;
  border: 2px solid #111;
  border-radius: 50%;
  transform: rotate(22deg);
}

.staff-brand-mark::after { transform: rotate(-22deg); }
.staff-brand-mark span { width: 10px; height: 10px; border-radius: 50%; transform: none; }

.staff-brand-copy { display: grid; line-height: 1.1; }
.staff-brand-copy strong { font-size: 18px; letter-spacing: 0.08em; }
.staff-brand-copy small { margin-top: 5px; color: var(--muted); font-size: 12px; }

.back-site {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 999px;
  color: #343438;
  background: rgba(255,255,255,.64);
  box-shadow: inset 0 1px rgba(255,255,255,.82), 0 8px 24px rgba(0,0,0,.05);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}

.back-site:active { transform: scale(.97); }

.staff-shell {
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(420px, 1fr);
  gap: clamp(28px, 5vw, 76px);
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 170px);
  margin: 0 auto;
  align-items: center;
  padding: 28px 0 56px;
}

.login-card,
.workbench-preview {
  border: 1px solid rgba(255,255,255,.78);
  background: var(--glass);
  box-shadow: inset 0 1px rgba(255,255,255,.82), 0 28px 80px rgba(25,28,35,.12);
  backdrop-filter: blur(32px) saturate(165%);
  -webkit-backdrop-filter: blur(32px) saturate(165%);
}

.login-card { padding: clamp(28px, 4vw, 48px); border-radius: 44px; }

.security-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(224,195,65,.48);
  border-radius: 999px;
  color: #675400;
  background: rgba(255,248,210,.8);
  font-size: 13px;
  font-weight: 650;
}

.security-badge i { width: 7px; height: 7px; border-radius: 50%; background: #17803a; box-shadow: 0 0 0 4px rgba(23,128,58,.1); }
.login-intro h1 { margin: 22px 0 8px; font-size: clamp(34px, 4vw, 48px); line-height: 1.04; letter-spacing: -.035em; }
.login-intro p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }

.security-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 26px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #535358;
  background: rgba(255,255,255,.56);
  font-size: 13px;
  line-height: 1.5;
}

.security-note svg { width: 20px; height: 20px; flex: 0 0 auto; fill: #17803a; }
.login-form { display: grid; gap: 18px; }
.field { display: grid; gap: 9px; font-size: 14px; font-weight: 650; }

.field-control {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgba(60,60,67,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 1px rgba(255,255,255,.85);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.field-control:focus-within { border-color: var(--brand-deep); background: #fff; box-shadow: 0 0 0 4px rgba(255,230,111,.28), inset 0 1px #fff; }
.field-control > svg { width: 21px; height: 21px; fill: none; stroke: #77777c; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.field input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.field input::placeholder { color: #9a9a9f; }

.password-toggle {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #707075;
  background: transparent;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 120ms ease;
}

.password-toggle:active { transform: scale(.92); }
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.form-status { min-height: 21px; margin: -3px 2px -2px; color: var(--danger); font-size: 13px; line-height: 1.55; }
.form-status[data-state="loading"] { color: var(--muted); }
.form-status[data-state="success"] { color: #168447; }

.login-button {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(199,168,34,.44);
  border-radius: 999px;
  color: #111;
  background: linear-gradient(180deg, #ffeb82 0%, #ffe15a 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.75), 0 12px 26px rgba(155,120,0,.18);
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), box-shadow 140ms ease, background-color 140ms ease;
}

.login-button:active { transform: scale(.97); box-shadow: inset 0 1px rgba(255,255,255,.62), 0 7px 18px rgba(155,120,0,.15); }
.login-button:disabled { cursor: not-allowed; opacity: .64; transform: none; }
.login-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-button.is-loading svg { display: none; }
.login-button.is-loading::after {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(17,17,17,.24);
  border-top-color: #111;
  border-radius: 50%;
  content: "";
  animation: staff-login-spin 680ms linear infinite;
}

@keyframes staff-login-spin { to { transform: rotate(360deg); } }

.login-divider {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 22px 0;
  color: #8e8e93;
  font-size: 12px;
}

.login-divider::before,
.login-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.wechat-login { display: grid; margin-top: 14px; }

.wechat-login-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  min-height: 68px;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(199, 168, 34, .34);
  border-radius: 999px;
  color: #141715;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,250,224,.9));
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 10px 24px rgba(155,120,0,.08);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), border-color 140ms ease, background-color 140ms ease;
}

.wechat-login-button:active { transform: scale(.98); }
.wechat-login-button > span { display: grid; gap: 3px; min-width: 0; }
.wechat-login-button strong { font-size: 15px; font-weight: 750; }
.wechat-login-button small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.wechat-logo { width: 42px; height: 42px; fill: #07c160; }
.wechat-eye { fill: #fff; }
.wechat-arrow { width: 20px; height: 20px; fill: none; stroke: #2f2f32; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms var(--ease-out); }
.wechat-login-button[aria-expanded="true"] .wechat-arrow { transform: rotate(90deg); }

.wechat-login-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 28px 24px 24px;
  border: 1px solid rgba(199,168,34,.28);
  border-radius: 30px;
  background: #fff;
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 18px 45px rgba(50,39,0,.09);
}

.wechat-login-panel[hidden] { display: none; }
.wechat-card-head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.wechat-card-head > strong { font-size: 22px; letter-spacing: -.02em; }
.wechat-card-head > p { max-width: 330px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.wechat-identity-badge { display: inline-flex; min-height: 28px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid rgba(7,193,96,.22); border-radius: 999px; color: #3e4340; background: #fff; font-size: 12px; font-weight: 650; }
.wechat-identity-badge i { width: 7px; height: 7px; border-radius: 50%; background: #07c160; box-shadow: 0 0 0 4px rgba(7,193,96,.1); }
.wechat-direct-login {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid rgba(7,193,96,.28);
  border-radius: 999px;
  color: #0c6838;
  background: rgba(235,250,242,.92);
  box-shadow: inset 0 1px rgba(255,255,255,.9);
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), border-color 140ms ease, background-color 140ms ease;
}
.wechat-direct-login:disabled { cursor: wait; opacity: .72; }
.wechat-direct-login svg { width: 28px; height: 28px; flex: 0 0 auto; fill: #07c160; }
.wechat-direct-login:active { transform: scale(.98); }
.wechat-direct-login:focus-visible { outline: 3px solid rgba(7,193,96,.24); outline-offset: 3px; }
.wechat-qr-stage { position: relative; display: grid; width: min(100%, 342px); min-height: 388px; place-items: center; overflow: hidden; border: 1px solid rgba(60,60,67,.12); border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 7px #fff7cb, 0 14px 34px rgba(0,0,0,.06); }
.wechat-qr-frame { display: block; width: 100%; height: 388px; border: 0; background: #fff; }
.wechat-qr-frame[hidden] { display: none; }
.wechat-qr-placeholder { position: relative; display: grid; width: 124px; height: 124px; place-items: center; color: #111; animation: wechat-pulse 1.2s ease-in-out infinite alternate; }
.wechat-qr-placeholder[hidden] { display: none; }
.wechat-qr-placeholder span { position: absolute; width: 34px; height: 34px; border: 5px solid currentColor; }
.wechat-qr-placeholder span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.wechat-qr-placeholder span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.wechat-qr-placeholder span:nth-child(3) { bottom: 0; left: 0; border-top: 0; border-right: 0; }
.wechat-qr-placeholder span:nth-child(4) { right: 0; bottom: 0; border-top: 0; border-left: 0; }
.wechat-qr-placeholder svg { width: 54px; height: 54px; fill: currentColor; }
.wechat-login-copy { display: grid; max-width: 350px; justify-items: center; gap: 7px; text-align: center; }
.wechat-login-copy strong { font-size: 15px; }
.wechat-login-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.wechat-retry { min-height: 38px; margin-top: 5px; padding: 0 17px; border: 1px solid rgba(199,168,34,.42); border-radius: 999px; color: #111; background: var(--brand); font-size: 12px; font-weight: 700; cursor: pointer; }
.wechat-provider-note { margin: -2px 0 0; color: #85858a; font-size: 11px; line-height: 1.55; text-align: center; }

@keyframes wechat-pulse { from { opacity: .46; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.login-help { display: flex; justify-content: center; gap: 6px; margin-top: 24px; color: var(--muted); font-size: 13px; }
.login-help a { color: #1f5da8; font-weight: 650; }

.workbench-preview { overflow: hidden; padding: clamp(26px, 4vw, 42px); border-radius: 50px; }
.preview-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.preview-heading > div { display: grid; gap: 5px; }
.preview-heading strong { font-size: 22px; letter-spacing: -.02em; }
.preview-heading small { color: var(--muted); font-size: 13px; }
.preview-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: var(--brand); box-shadow: inset 0 1px rgba(255,255,255,.72); font-weight: 750; }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.preview-grid article { display: grid; grid-template-columns: auto 1fr; gap: 7px 10px; min-height: 142px; align-content: center; padding: 24px; border: 1px solid rgba(255,255,255,.72); border-radius: 28px; background: rgba(255,255,255,.66); box-shadow: inset 0 1px rgba(255,255,255,.8), 0 8px 28px rgba(0,0,0,.045); }
.preview-grid strong { font-size: 16px; }
.preview-grid small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; line-height: 1.55; }
.preview-dot { width: 10px; height: 10px; align-self: center; border-radius: 50%; }
.preview-dot.green { background: #24a148; }
.preview-dot.red { background: #e5484d; }
.preview-dot.blue { background: #2f74d0; }
.preview-dot.yellow { background: #e3bd12; }

.staff-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 48px)); margin: -35px auto 0; padding: 0 0 calc(20px + env(safe-area-inset-bottom)); color: #77777c; font-size: 12px; }

@media (hover: hover) and (pointer: fine) {
  .back-site:hover { background: rgba(255,255,255,.84); transform: translateY(-1px); }
  .password-toggle:hover { background: rgba(60,60,67,.08); }
  .login-button:hover { box-shadow: inset 0 1px rgba(255,255,255,.78), 0 15px 32px rgba(155,120,0,.22); }
  .wechat-login-button:hover { border-color: rgba(199,168,34,.62); background: #fffdf4; }
  .wechat-direct-login:hover { border-color: rgba(7,193,96,.48); background: #e2f8ec; }
  .login-help a:hover { text-decoration: underline; }
}

@media (max-width: 920px) {
  .staff-shell { grid-template-columns: 1fr; width: min(620px, calc(100% - 40px)); padding-top: 30px; }
  .workbench-preview { order: 2; }
  .staff-footer { width: min(620px, calc(100% - 40px)); margin: 0 auto; padding-top: 20px; }
}

@media (max-width: 560px) {
  body { overflow-x: hidden; }
  .staff-header { width: calc(100% - 32px); min-height: 72px; }
  .staff-brand-mark { width: 38px; height: 38px; border-radius: 13px; }
  .staff-brand-copy strong { font-size: 16px; }
  .staff-brand-copy small { font-size: 11px; }
  .back-site { min-height: 38px; padding: 0 14px; font-size: 13px; }
  .staff-shell { width: 100%; gap: 18px; min-height: auto; padding: 18px 12px 38px; }
  .login-card { min-width: 0; padding: 26px 20px 24px; border-radius: 34px; }
  .login-intro h1 { margin-top: 18px; font-size: 34px; }
  .security-note { align-items: center; margin: 22px 0; }
  .wechat-login-panel { padding: 24px 14px 20px; gap: 16px; border-radius: 26px; }
  .wechat-card-head > strong { font-size: 20px; }
  .wechat-qr-stage { width: min(100%, 320px); min-height: 372px; border-radius: 22px; }
  .wechat-qr-frame { height: 372px; }
  .wechat-qr-placeholder { transform: scale(.9); }
  .workbench-preview { min-width: 0; padding: 24px 18px; border-radius: 34px; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-grid article { min-height: 112px; border-radius: 24px; }
  .staff-footer { display: grid; width: calc(100% - 32px); margin: 0 auto; text-align: center; }
}

.oauth-complete-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.oauth-complete-card { display: grid; width: min(100%, 420px); justify-items: center; gap: 12px; padding: 38px 28px; border: 1px solid rgba(199,168,34,.32); border-radius: 30px; background: #fff; box-shadow: 0 24px 70px rgba(25,28,35,.12); text-align: center; }
.oauth-complete-mark { display: grid; width: 52px; height: 52px; place-items: center; border: 2px solid #111; border-radius: 50%; background: var(--brand); font-size: 24px; font-weight: 800; }
.oauth-complete-card strong { font-size: 20px; }
.oauth-complete-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (prefers-contrast: more) {
  .login-card, .workbench-preview { background: #fff; border-color: #777; }
  .field-control { border-color: #666; }
}
