:root {
  --canvas: #F1EFEA;
  --surface: #FFFFFF;
  --paper: #F7F5F0;
  --ink: #121212;
  --ink-2: #55534E;
  --ink-3: #8E8B84;
  --line: #D8D4CB;
  --field: #CFCAC0;
  --yellow: #FFC522;
  --err: #C7321F;
  --err-bg: #FBF1EF;
  --sans: "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --grot: "Inter Tight", "Helvetica Neue", "Segoe UI Variable Display", Arial, sans-serif;
  --mono: "JetBrains Mono", "Sarasa Mono SC", "Cascadia Mono", Consolas, monospace;
  --px: clamp(28px, 4vw, 64px);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

mark {
  background: linear-gradient(transparent 56%, var(--yellow) 56%, var(--yellow) 92%, transparent 92%);
  color: inherit;
  padding: 0 0.05em;
}

.is-hidden {
  display: none !important;
}

.xs-split {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(460px, 1fr);
  min-height: 100vh;
}

/* ═══════════ 左侧：课程体系版面 ═══════════ */
.xs-side {
  background: var(--canvas);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 36px 0 0 var(--px);
  overflow: hidden;
  min-height: 640px;
}

.xs-login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  justify-self: start;
}

.xs-login-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex: none;
}

.xs-login-brand-text strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.xs-pitch {
  align-self: center;
  padding: 40px var(--px) 40px 0;
  max-width: 720px;
}

.xs-pitch-kicker {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  margin: 0 0 16px;
}

.xs-pitch h2 {
  font-size: clamp(40px, 4vw, 68px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0;
}

.xs-pitch p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-2);
  margin: 20px 0 0;
  max-width: 30em;
}

.xs-pitch p b {
  color: var(--ink);
}

/* 十二级台阶：白色台阶从画布升起，最高一级 S4 与右侧纸面相接 */
.xs-stairs {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  border-bottom: 2px solid var(--ink);
}

.xs-stair {
  background: var(--surface);
  border-top: 2px solid var(--ink);
  border-left: 1px solid var(--line);
  padding: 9px 0 0 10px;
  font-family: var(--grot);
  font-weight: 800;
  font-size: clamp(15px, 1.4vw, 22px);
  letter-spacing: -0.03em;
  line-height: 1;
}

.xs-stair:first-child {
  border-left: 2px solid var(--ink);
}

.xs-stair:nth-child(1) { height: 60px; }
.xs-stair:nth-child(2) { height: 76px; }
.xs-stair:nth-child(3) { height: 92px; }
.xs-stair:nth-child(4) { height: 108px; }
.xs-stair:nth-child(5) { height: 124px; }
.xs-stair:nth-child(6) { height: 140px; }
.xs-stair:nth-child(7) { height: 156px; }
.xs-stair:nth-child(8) { height: 172px; }
.xs-stair:nth-child(9) { height: 188px; }
.xs-stair:nth-child(10) { height: 204px; }
.xs-stair:nth-child(11) { height: 220px; }
.xs-stair:nth-child(12) { height: 236px; }

.xs-stair small {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
  margin-top: 6px;
}

.xs-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px var(--px) 28px 0;
  font-size: 13px;
  color: var(--ink-2);
}

.xs-groups b {
  color: var(--ink);
  font-weight: 800;
  margin-right: 8px;
}

/* ═══════════ 右侧：纸面表单区 ═══════════ */
.xs-desk {
  display: flex;
  flex-direction: column;
  padding: 32px var(--px) 28px clamp(36px, 5.5vw, 104px);
}

.xs-login-back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.xs-login-back-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.xs-form-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  padding: 40px 0;
}

.xs-login-kicker {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.xs-login-title {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.01em;
}

.xs-login-subtitle {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink-2);
  margin: 14px 0 0;
}

.xs-login-subtitle code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--ink);
  background: var(--paper);
  padding: 0.05em 0.35em;
  border: 1px solid #E8E4DB;
}

.xs-sso-pass {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.xs-sso-pass i {
  height: 0;
  border-top: 2px solid var(--ink);
}

.xs-sso-pass b {
  font-size: 11.5px;
  font-weight: 800;
  background: var(--ink);
  color: var(--yellow);
  padding: 2px 7px;
  letter-spacing: 0.06em;
}

#xs-login-form {
  margin-top: 28px;
}

.xs-login-alert {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 3px solid var(--err);
  background: var(--err-bg);
  font-size: 14px;
  line-height: 1.65;
  color: #7A2418;
  font-weight: 600;
}

.xs-field {
  margin-bottom: 18px;
}

.xs-field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 7px;
}

.xs-field label span {
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-3);
}

.xs-input-box {
  display: flex;
  align-items: center;
  height: 50px;
  border: 1.5px solid var(--field);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.xs-input-box:hover {
  border-color: var(--ink-2);
}

.xs-input-box:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--yellow);
}

#xs-login-form.has-error .xs-pwd-box {
  border-color: var(--err);
}

.xs-input {
  all: unset;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  font-size: 16px;
}

.xs-input::placeholder {
  color: #AAA59B;
}

.xs-pwd-toggle {
  all: unset;
  cursor: pointer;
  padding: 0 14px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  border-left: 1px solid #E8E4DB;
  white-space: nowrap;
}

.xs-pwd-toggle:hover {
  color: var(--ink);
}

.xs-pwd-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -4px;
}

.xs-remember-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 22px;
  font-size: 14px;
  gap: 10px;
}

.xs-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.xs-checkbox {
  appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.xs-checkbox::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--yellow);
  border-bottom: 2px solid var(--yellow);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}

.xs-checkbox:checked {
  background: var(--ink);
}

.xs-checkbox:checked::after {
  opacity: 1;
}

.xs-checkbox-label small {
  color: var(--ink-3);
  font-size: 12.5px;
  margin-left: 6px;
}

.xs-forgot-link {
  font-size: 14px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.xs-forgot-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.xs-reset-note {
  margin: -14px 0 22px;
  text-align: right;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.xs-submit-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 54px;
  border: 0;
  background: var(--ink);
  color: var(--canvas);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.xs-submit-btn i {
  font-style: normal;
  color: var(--yellow);
  letter-spacing: 0;
}

.xs-submit-btn:hover:not(:disabled) {
  background: #000000;
}

.xs-submit-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--yellow);
  outline: none;
}

.xs-submit-btn:disabled {
  cursor: progress;
  background: #2A2926;
}

body.xs-login-busy .xs-submit-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 36%;
  background: var(--yellow);
  animation: xsLoginRun 1.1s ease-in-out infinite;
}

body.xs-login-busy .xs-field,
body.xs-login-busy .xs-remember-row {
  opacity: 0.58;
  pointer-events: none;
}

@keyframes xsLoginRun {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  body.xs-login-busy .xs-submit-btn::after {
    animation: none;
    width: 100%;
    opacity: 0.6;
  }
}

.xs-after-note {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-3);
}

.xs-login-footer {
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.xs-login-footer a {
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

.xs-login-footer a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ═══════════ 响应式 ═══════════ */
@media (min-width: 901px) and (max-height: 820px) {
  .xs-desk {
    padding-top: 24px;
    padding-bottom: 20px;
  }
  .xs-form-wrap {
    padding: 20px 0;
  }
  .xs-login-kicker {
    margin-bottom: 6px;
  }
  .xs-login-title {
    font-size: 34px;
  }
  .xs-login-subtitle {
    margin-top: 10px;
  }
  .xs-sso-pass {
    margin-top: 12px;
  }
  #xs-login-form {
    margin-top: 20px;
  }
  .xs-login-alert {
    margin-bottom: 14px;
    padding: 8px 12px;
  }
  .xs-field {
    margin-bottom: 14px;
  }
  .xs-input-box {
    height: 46px;
  }
  .xs-remember-row {
    margin-bottom: 16px;
  }
  .xs-reset-note {
    margin: -10px 0 16px;
  }
  .xs-submit-btn {
    height: 50px;
  }
  .xs-after-note {
    margin-top: 12px;
  }
  .xs-pitch h2 {
    font-size: clamp(36px, 3.6vw, 60px);
  }
}

@media (max-width: 1180px) {
  .xs-split {
    grid-template-columns: minmax(0, 1fr) minmax(440px, 1fr);
  }
  .xs-stair small {
    display: none;
  }
}

@media (max-width: 900px) {
  .xs-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .xs-side {
    min-height: 0;
    padding: 18px 0 0 20px;
    grid-template-rows: auto auto;
  }
  .xs-login-brand-text strong {
    font-size: 16px;
  }
  .xs-login-logo {
    width: 32px;
    height: 32px;
  }
  .xs-pitch,
  .xs-groups {
    display: none;
  }
  .xs-stairs {
    margin-top: 14px;
  }
  .xs-stair {
    padding: 0;
    font-size: 0;
    border-top-width: 2px;
  }
  .xs-stair:nth-child(1) { height: 10px; }
  .xs-stair:nth-child(2) { height: 13px; }
  .xs-stair:nth-child(3) { height: 17px; }
  .xs-stair:nth-child(4) { height: 20px; }
  .xs-stair:nth-child(5) { height: 24px; }
  .xs-stair:nth-child(6) { height: 27px; }
  .xs-stair:nth-child(7) { height: 31px; }
  .xs-stair:nth-child(8) { height: 34px; }
  .xs-stair:nth-child(9) { height: 38px; }
  .xs-stair:nth-child(10) { height: 41px; }
  .xs-stair:nth-child(11) { height: 45px; }
  .xs-stair:nth-child(12) { height: 48px; }

  .xs-desk {
    padding: 20px 20px 24px;
  }
  .xs-form-wrap {
    padding: 24px 0 28px;
    max-width: none;
  }
  .xs-login-title {
    font-size: 32px;
  }
  .xs-sso-pass {
    font-size: 12.5px;
    gap: 8px;
  }
  .xs-remember-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .xs-reset-note {
    text-align: left;
    margin: -8px 0 18px;
  }
  .xs-login-footer {
    flex-direction: column;
    gap: 4px;
  }
}
