/* 注册弹窗与注册页共用：横版两栏（左彩色插画 + 右表单），适合 16:9 课堂屏与普通桌面窗口；窄屏只留表单。 */
.reg-dialog { width: min(820px, calc(100vw - 40px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 24px; background: #fff; color: #1d3b4c; box-shadow: 0 40px 100px #0a1e3a66; overflow: auto; }
.reg-dialog::backdrop { background: #0d1c33b8; backdrop-filter: blur(4px); }
.reg-dialog[open] { animation: reg-pop .24s cubic-bezier(.2,.9,.3,1.15); }
@keyframes reg-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.reg-close { position: absolute; top: 14px; right: 14px; z-index: 3; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f1f4f9; color: #5b6b80; font-size: 24px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.reg-close:hover { background: #e3e9f3; color: #1d3b4c; }

.reg-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 500px; }

/* 左栏：蓝紫到青绿的渐变 + 原子轨道、波形插画，文字白色 */
.reg-art { position: relative; display: flex; flex-direction: column; padding: 30px 30px 28px; overflow: hidden; color: #fff;
  background: linear-gradient(155deg, #4c3cf0 0%, #3a63f2 42%, #12a7c4 78%, #19c39a 100%); }
.reg-art-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.reg-art > :not(svg) { position: relative; }
.reg-art-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; letter-spacing: .04em; }
.reg-art-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #fff; box-shadow: 0 6px 16px #1a1f6a40; }
.reg-art-copy { margin-top: 46px; }
.reg-art-copy h2 { margin: 0; font-size: 32px; line-height: 1.32; font-weight: 900; letter-spacing: .01em; text-shadow: 0 2px 12px #1a1f6a33; }
.reg-art-copy ul { display: grid; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; }
.reg-art-copy li { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 600; }
.reg-art-copy i { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: #ffffff26; color: var(--c); font-style: normal; font-size: 15px; box-shadow: inset 0 0 0 1px #ffffff40; }
.reg-art-tags { display: flex; gap: 8px; margin-top: auto; }
.reg-art-tags span { padding: 5px 13px; border-radius: 99px; background: #ffffff24; font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 1px #ffffff45; }

/* 右栏：表单 */
.reg-main { display: flex; flex-direction: column; justify-content: center; padding: 34px 40px 26px; }
.reg-main-title { margin: 0 0 18px; color: #16263d; font-size: 24px; font-weight: 900; }
.reg-intent { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: -4px 0 16px; padding: 10px 14px; border-radius: 12px; background: #fff4d6; color: #845a00; font-size: 14px; box-shadow: inset 0 0 0 1px #ffe2a1; }
.reg-intent[hidden] { display: none; }

.reg-form { display: grid; gap: 13px; margin: 0; }
.reg-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.reg-field { display: grid; gap: 6px; margin: 0; color: #33465c; font-size: 14px; font-weight: 700; }
.reg-field input { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 2px solid #e1e7f0; border-radius: 12px; background: #f6f8fc; color: #16263d; font-size: 16px; font-weight: 500; box-sizing: border-box; transition: border-color .15s, box-shadow .15s, background .15s; }
.reg-field input::placeholder { color: #a0acbc; font-weight: 400; }
.reg-field input:hover { border-color: #ccd6e4; }
.reg-field input:focus { outline: none; border-color: #4c5cf0; background: #fff; box-shadow: 0 0 0 4px #4c5cf022; }
.reg-field.has-error input, .reg-field.has-error input:focus { border-color: #e2554f; background: #fff7f6; box-shadow: 0 0 0 4px #e2554f1f; }
.reg-error { display: none; color: #c8352f; font-size: 13px; font-style: normal; font-weight: 600; }
.reg-field.has-error .reg-error { display: block; }

.reg-password { position: relative; display: block; }
.reg-password input { padding-right: 50px; }
.reg-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 36px; border: 0; border-radius: 9px; background: none; color: #7a889b; cursor: pointer; }
.reg-eye:hover, .reg-eye[aria-pressed="true"] { background: #eceffe; color: #4c5cf0; }
.reg-eye .eye-open, .reg-eye[aria-pressed="true"] .eye-closed { display: none; }
.reg-eye[aria-pressed="true"] .eye-open { display: block; }

.reg-challenge > label { margin: 0; }
.reg-challenge-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.reg-question { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px; background: linear-gradient(120deg, #fff1cf, #ffe1ee); color: #b03a1f; font: 900 21px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .08em; white-space: nowrap; box-shadow: inset 0 0 0 1px #ffd9b3; }
.reg-challenge-row input { text-align: center; font-size: 19px; font-weight: 700; }

.reg-status { margin: 0; color: #c8352f; font-size: 14px; font-weight: 600; }
.reg-status:empty { display: none; }
.reg-submit { height: 50px; margin-top: 6px; border: 0; border-radius: 13px; background: linear-gradient(110deg, #4c3cf0, #3a63f2 50%, #12a7c4); color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .1em; cursor: pointer; box-shadow: 0 10px 24px #3a63f245; transition: transform .12s, box-shadow .12s, filter .12s; }
.reg-submit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 12px 28px #3a63f25c; }
.reg-submit:disabled { cursor: progress; filter: saturate(.6); }
.reg-switch { margin: 16px 0 0; color: #7d8a9b; font-size: 14px; text-align: center; }
.reg-switch a { margin-left: 4px; color: #4c5cf0; font-weight: 800; }
.reg-dialog :focus-visible, .reg-card :focus-visible { outline: 3px solid #4c5cf0; outline-offset: 2px; }

/* 独立注册页（直接打开 /register 或无脚本时）：同一张横版卡片居中 */
.reg-page { padding: 36px 0; }
.reg-card { width: min(820px, 100%); margin: 0 auto; border-radius: 24px; background: #fff; box-shadow: 0 24px 60px #1b2c5a1f; overflow: hidden; }

@media (max-height: 640px) {
  .reg-shell { min-height: 0; }
  .reg-main { padding: 22px 36px 18px; }
  .reg-main-title { margin-bottom: 10px; font-size: 21px; }
  .reg-form { gap: 9px; }
  .reg-field input, .reg-question { height: 42px; }
  .reg-art-copy { margin-top: 26px; }
  .reg-art-copy h2 { font-size: 27px; }
}
@media (max-width: 760px) {
  .reg-dialog { width: min(440px, calc(100vw - 24px)); }
  .reg-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .reg-art { display: none; }
  .reg-main { padding: 30px 24px 22px; }
  .reg-card { width: min(440px, 100%); }
}
@media (prefers-reduced-motion: reduce) { .reg-dialog[open] { animation: none; } .reg-submit, .reg-field input { transition: none; } }

/* 登录 / 注册两栏切换：data-mode 决定显示哪一栏及左侧标题；两栏共享同一尺寸外框 */
[data-auth-shell][data-mode="login"] [data-pane="register"],
[data-auth-shell][data-mode="register"] [data-pane="login"],
[data-auth-shell][data-mode="login"] .reg-art [data-for="register"],
[data-auth-shell][data-mode="register"] .reg-art [data-for="login"] { display: none; }
.reg-pane[data-pane] { animation: reg-fade .2s ease; }
@keyframes reg-fade { from { opacity: 0; transform: translateX(8px); } }
.reg-note { margin: 14px 0 0; color: #8a96a6; font-size: 13px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .reg-pane[data-pane] { animation: none; } }
.reg-note + .reg-switch { margin-top: 8px; }
