:root {
  --brand: #3370ff;
  --brand-dark: #245bdb;
  --text: #1f2329;
  --muted: #646a73;
  --subtle: #8f959e;
  --line: #dee0e3;
  --line-soft: #eff0f1;
  --field: #f7f8fa;
  --panel: #ffffff;
  --danger: #f54a45;
  --success: #0f9f6e;
  --shadow: 0 28px 80px rgba(31, 35, 41, .12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #f7fbff url("images/page-bg.svg") center / cover no-repeat fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .34), transparent 30%, transparent 70%, rgba(255, 255, 255, .38)),
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, .58), transparent 34%);
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding: clamp(18px, 4vw, 48px);
}

.auth-stage {
  align-self: center;
  width: min(100%, 620px);
}

.site-footer {
  align-self: end;
  margin-top: 24px;
  padding: 6px 12px;
  border: 1px solid rgba(222, 224, 227, .58);
  border-radius: 999px;
  color: var(--subtle);
  background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(12px);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
}

.login-stack {
  width: 100%;
  display: grid;
  grid-template-columns: calc(var(--login-card-width, 430px) * .25) minmax(0, 430px);
  align-items: stretch;
  gap: 0;
  filter: drop-shadow(0 26px 52px rgba(31, 35, 41, .08));
}

.system-gallery {
  width: 100%;
  height: calc(var(--login-card-height, 600px) * .9);
  min-height: 0;
  padding: 16px 12px;
  border: 1px solid rgba(222, 224, 227, .62);
  border-right: 0;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(248, 251, 255, .72));
  box-shadow: inset -1px 0 0 rgba(51, 112, 255, .05);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-self: center;
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gallery-track {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 0;
  min-height: 0;
  position: relative;
  overflow: visible;
  padding: 9px 0;
  touch-action: pan-x;
}

.gallery-track::before,
.gallery-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 62px;
  z-index: 2;
  pointer-events: none;
}

.gallery-track::before {
  top: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, 0));
}

.gallery-track::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, 0));
}

.system-card {
  min-width: 0;
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(222, 224, 227, .82);
  border-radius: 8px;
  color: #525866;
  background: rgba(250, 252, 255, .74);
  cursor: pointer;
  position: relative;
  text-align: left;
  opacity: .46;
  width: calc(100% + 34px);
  z-index: 1;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease;
}

.system-card + .system-card {
  margin-top: -4px;
}

.system-card strong,
.system-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-card strong {
  color: #2f3542;
  font-size: 14px;
  line-height: 1.2;
}

.system-card span {
  color: var(--subtle);
  font-size: 12px;
}

.system-card.is-active {
  border-color: rgba(51, 112, 255, .42);
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  box-shadow: 0 12px 28px rgba(51, 112, 255, .14);
  opacity: 1;
  min-height: 56px;
  padding-left: 18px;
  padding-right: 22px;
  width: calc(100% + 86px);
  transform: translateX(-2px) scale(1.04);
  z-index: 5;
}

.system-card.is-active strong {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.system-card.is-active::before,
.system-card.is-active::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 11px;
  height: 16px;
  border: 0;
  background: linear-gradient(180deg, #14b8ff 0%, #3370ff 58%, #245bdb 100%);
  transform: translateY(-50%);
  z-index: 6;
}

.system-card.is-active::before {
  left: 5px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.system-card.is-active::after {
  display: none;
}

.system-card.is-near {
  opacity: .86;
  z-index: 4;
}

.system-card.is-mid {
  opacity: .66;
  z-index: 3;
}

.system-card.is-far {
  opacity: .48;
  z-index: 2;
}

.system-card.is-edge {
  opacity: .24;
  z-index: 1;
}

.login-card {
  position: relative;
  z-index: 2;
}

.gallery-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--subtle);
  font-size: 12px;
}

.gallery-progress {
  width: 96px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ebef;
}

.gallery-progress span {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .18s ease;
}

.login-card {
  width: 100%;
  height: 602px;
  display: grid;
  border: 1px solid rgba(222, 224, 227, .64);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(251, 253, 255, .94));
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.card-inner {
  position: relative;
  height: 100%;
  padding: 34px 34px 30px;
}

.mode-switch {
  position: absolute;
  top: 0;
  right: 0;
  width: 92px;
  height: 92px;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}

.mode-switch[hidden] {
  display: none;
}

.mode-switch:hover {
  filter: brightness(1.04);
}

.mode-switch:active {
  transform: translateY(1px);
}

.mode-switch svg {
  position: absolute;
  top: 18px;
  right: 14px;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-switch::after {
  content: attr(title);
  position: absolute;
  top: 16px;
  right: 58px;
  min-width: 86px;
  padding: 8px 13px;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(51, 112, 255, .22);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity .16s ease, transform .16s ease;
}

.mode-switch::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 92px;
  height: 92px;
  background: #4b7dff;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  z-index: 0;
}

.mode-switch > svg,
.mode-switch::after {
  z-index: 1;
}

.mode-switch:hover::after,
.mode-switch:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.mode-switch .mode-icon-auth,
.mode-switch .mode-icon-account {
  display: none;
}

.login-card.is-account .mode-icon-auth,
.login-card.is-auth .mode-icon-account {
  display: block;
}

.card-title {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
}

.card-subtitle {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 12px;
  background: #f2f3f5;
}

.tab {
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.tab[aria-selected="true"] {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 35, 41, .08);
}

.panel[hidden] {
  display: none;
}

.field-group {
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #343840;
  font-size: 14px;
  font-weight: 700;
}

.required {
  color: var(--danger);
  margin-right: 4px;
}

.control {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.control:focus-within {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(51, 112, 255, .12);
}

.icon-box {
  display: grid;
  place-items: center;
  color: #8f959e;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
}

.control input {
  padding: 0 14px 0 0;
}

.control input::placeholder {
  color: #b4b8bf;
}

.captcha-row {
  display: block;
}

.captcha-image {
  width: 104px;
  min-height: 38px;
  margin: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f7f2;
  cursor: pointer;
  overflow: hidden;
}

.captcha-row .control {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.captcha-image svg {
  width: 100%;
  height: 100%;
  display: block;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 22px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.remember input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #c9cdd4;
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.remember input:checked {
  border-color: var(--brand);
  background: var(--brand);
}

.remember input:checked::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.text-link {
  border: 0;
  padding: 0;
  color: var(--brand);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.login-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 24px rgba(51, 112, 255, .22);
}

.login-button:hover {
  background: var(--brand-dark);
}

.login-button:active {
  transform: translateY(1px);
}

.login-button[disabled] {
  cursor: progress;
  opacity: .72;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}

.wecom-box {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0;
  text-align: center;
}

.wecom-mount {
  width: min(320px, 100%);
  height: 380px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  color: #8f959e;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
  overflow: hidden;
}

.wecom-mount.is-wechat-auth {
  height: 300px;
  gap: 16px;
  padding: 18px;
}

.wecom-auth-image {
  width: min(180px, 100%);
  border-radius: 14px;
  object-fit: cover;
}

.wecom-auth-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(51, 112, 255, .22);
}

.wecom-auth-button[disabled] {
  cursor: progress;
  opacity: .72;
}

.wecom-status {
  width: min(320px, 100%);
  min-height: 18px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-panel {
  display: grid;
  gap: 18px;
}

.workspace-panel[hidden] {
  display: none;
}

.shortcut-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.shortcut-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.enter-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(51, 112, 255, .22);
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.shortcut-grid::-webkit-scrollbar {
  width: 6px;
}

.shortcut-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d8dee8;
}

.shortcut-item {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.shortcut-item:hover,
.shortcut-item.is-current {
  border-color: rgba(51, 112, 255, .32);
  background: #f6f9ff;
  box-shadow: 0 8px 18px rgba(51, 112, 255, .08);
}

.shortcut-item:active,
.enter-button:active {
  transform: translateY(1px);
}

.shortcut-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: #eef4ff;
  font-size: 13px;
  font-weight: 800;
}

.shortcut-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.shortcut-empty {
  grid-column: 1 / -1;
  min-height: 88px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--subtle);
  background: #fbfcff;
  font-size: 13px;
}

.tab:focus-visible,
.login-button:focus-visible,
.enter-button:focus-visible,
.shortcut-item:focus-visible,
.captcha-image:focus-visible,
.remember input:focus-visible,
.text-link:focus-visible,
.system-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .page {
    padding: 22px 18px;
  }

  .auth-stage {
    width: min(100%, 620px);
  }

  .login-card {
    max-width: 430px;
    justify-self: center;
  }

  .login-stack {
    max-width: 620px;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .login-stack {
    width: 100%;
    display: grid;
    grid-template-columns: calc(var(--login-card-width, 280px) * .25) minmax(0, 1fr);
    align-items: stretch;
  }

  .system-gallery {
    width: 100%;
    height: calc(var(--login-card-height, 600px) * .9);
    min-height: 0;
    padding: 10px 8px;
    border-right: 0;
    border-radius: 18px 0 0 18px;
    align-self: center;
  }

  .login-card {
    height: 640px;
  }

  .card-inner {
    padding: 24px 18px 22px;
  }

  .mode-switch {
    top: 0;
    right: 0;
    width: 78px;
    height: 78px;
    padding: 0;
  }

  .mode-switch svg {
    top: 15px;
    right: 11px;
    width: 22px;
    height: 22px;
  }

  .mode-switch::after {
    top: 12px;
    right: 48px;
    min-width: 72px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 13px;
  }

  .mode-switch::before {
    top: 0;
    right: 0;
    width: 78px;
    height: 78px;
  }

  .gallery-track {
    grid-template-columns: 1fr;
  }

  .system-card {
    min-height: 44px;
    padding: 8px;
    border-radius: 7px;
    width: calc(100% + 6px);
  }

  .system-card + .system-card {
    margin-top: -3px;
  }

  .system-card.is-active {
    padding-left: 12px;
    padding-right: 14px;
    width: calc(100% + 16px);
    min-height: 54px;
    transform: translateX(-1px) scale(1.02);
  }

  .system-card.is-active::before {
    left: 3px;
    width: 9px;
    height: 14px;
  }

  .system-card.is-active::after {
    right: 4px;
    width: 9px;
    height: 14px;
  }

  .system-card span,
  .gallery-foot {
    font-size: 11px;
  }

  .system-card strong {
    font-size: 12px;
  }

  .system-card.is-active strong {
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }

  .gallery-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
  }

  .gallery-progress {
    width: 52px;
  }

  .card-title {
    font-size: 24px;
  }

  .captcha-row {
    display: block;
  }

  .captcha-image {
    width: 86px;
    min-height: 36px;
  }

  .workspace-panel {
    gap: 14px;
  }

  .shortcut-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 310px;
  }

  .shortcut-item {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
