/* 登录页：一页纸、一支笔、几句旧诗 */

:root {
  --paper: #f7f2e8;
  --ink: #3f352b;
  --brown: #8b5e3c;
  --brown-dark: #6b4526;
  --muted: #8b7a66;
  --line: rgba(226, 214, 196, 0.9);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Georgia", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body {
  margin: 0;
  min-height: 100%;
  color-scheme: only light;
}

body {
  position: relative;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.9), transparent 45%),
    radial-gradient(circle at 84% 86%, rgba(240, 226, 203, 0.6), transparent 52%),
    linear-gradient(160deg, #f9f4ea, #f2e9d8);
  -webkit-tap-highlight-color: transparent;
}

/* 背后的纸张花纹：细横线 + 淡点阵 + 一枚大字水印 */
.login-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to bottom, rgba(139, 94, 60, 0.045) 0 1px, transparent 1px 34px),
    radial-gradient(rgba(139, 94, 60, 0.08) 1px, transparent 1.4px);
  background-size: auto, 26px 26px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 82%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 82%);
}

.login-pattern::after {
  content: "书";
  position: absolute;
  right: -4vw;
  bottom: -10vh;
  font-family: var(--serif);
  font-size: min(46vw, 620px);
  line-height: 1;
  color: rgba(139, 94, 60, 0.045);
}

.login-sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.login-leaves {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.login {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 20px;
}

.login-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
  width: min(1200px, 100%);
}

/* 左侧名言 */
.login-quotes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 18px;
  border-left: 2px solid rgba(139, 94, 60, 0.18);
  /* 竖线定长，不随内容多少变化 */
  min-height: 320px;
  justify-content: center;
}

.login-quotes__eyebrow {
  margin: 0 0 6px;
  font-size: 13.5px;
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  color: #b7a691;
}

.login-quote {
  margin: 0;
  max-width: 600px;
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.75;
  letter-spacing: 0.05em;
  color: #4a3a2c;
  transition: opacity 320ms ease;
}

.login-quote::before { content: "「"; color: rgba(139, 94, 60, 0.4); }
.login-quote::after { content: "」"; color: rgba(139, 94, 60, 0.4); }

.login-quote__author {
  font-size: 15px;
  letter-spacing: 0.22em;
  color: #a89279;
  font-style: normal;
  transition: opacity 320ms ease;
}

.login-quote__author::before { content: "—— "; }

.login-quotes__list {
  display: flex;
  gap: 7px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.login-quotes__list li {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: rgba(139, 94, 60, 0.16);
  transition: background 220ms ease, width 220ms ease;
}

.login-quotes__list li[data-active="true"] {
  width: 34px;
  background: rgba(139, 94, 60, 0.6);
}

.login-quote.is-fading { opacity: 0; }
.login-quote__author.is-fading { opacity: 0; }

/* 登录卡片 */
.login-card {
  position: relative;
  /* 登录 2 个字段 / 注册 3 个字段：留够注册的高度，切换时不跳 */
  min-height: 712px;
  display: flex;
  flex-direction: column;
  /* 顶部固定：切换登录/注册时标题和切换条不跟着上下动 */
  justify-content: flex-start;
  padding: 46px 30px 46px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 34px 80px -46px rgba(80, 56, 30, 0.6), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  text-align: center;
}

/* 四角小装饰 */
.login-card::before,
.login-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(139, 94, 60, 0.28);
  border-radius: 4px;
}

.login-card::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.login-card::after { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }

.login-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 14px;
  background: linear-gradient(150deg, #a97747, #8b5e3c);
  color: #fdf6e8;
  box-shadow: 0 12px 24px -14px rgba(139, 94, 60, 0.9);
}

.login-mark svg { width: 33px; height: 33px; }

.login-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 29px;
  letter-spacing: 0.04em;
  color: var(--brown-dark);
}

.login-sub {
  margin: 10px 0 28px;
  font-size: 15px;
  color: var(--muted);
}

.login-tabs {
  margin: 0 0 20px;
}

/* 让 RubberSegment 铺满整行 */
.login-tabs .rubber-segment {
  width: 100%;
}

.login-tab {
  flex: 1;
  padding: 11px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8b7a66;
  font-size: 16px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.login-tab.is-active {
  background: #fffdf8;
  color: var(--brown-dark);
  box-shadow: 0 2px 8px -4px rgba(90, 62, 34, 0.5);
}

.login-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr;
  /* 固定高度：两个面板都一样高，切换时下面的按钮纹丝不动 */
  height: 284px;
  contain: layout paint;
}

@media (max-width: 420px) {
  .login-panes { height: 300px; }
}

.login-form {
  grid-area: 1 / 1;
  min-width: 0;
  height: 100%;
  will-change: opacity;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

/* 隐藏时不 display:none，两个表单始终占同一格，容器高度恒定 */
.login-form[hidden] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* 登录 / 注册 左右切换 */
@keyframes paneInRight {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes paneInLeft {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 输入框依次「滚」上来 */
@keyframes fieldIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-form.pane-in-right .login-field,
.login-form.pane-in-left .login-field,
.login-form.pane-in-right .login-tip,
.login-form.pane-in-left .login-tip {
  animation: fieldIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-form.pane-in-right .login-field:nth-of-type(1),
.login-form.pane-in-left .login-field:nth-of-type(1) { animation-delay: 0ms; }

.login-form.pane-in-right .login-field:nth-of-type(2),
.login-form.pane-in-left .login-field:nth-of-type(2) { animation-delay: 70ms; }

.login-form.pane-in-right .login-field:nth-of-type(3),
.login-form.pane-in-left .login-field:nth-of-type(3) { animation-delay: 140ms; }

.login-form.pane-in-right .login-tip,
.login-form.pane-in-left .login-tip { animation-delay: 210ms; }

@media (prefers-reduced-motion: reduce) {
  .login-form .login-field,
  .login-form .login-tip { animation: none !important; }
}

.login-form.pane-in-right {
  animation: paneInRight 260ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.login-form.pane-in-left {
  animation: paneInLeft 260ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .login-form.pane-in-right,
  .login-form.pane-in-left { animation: none; }
}

.login-field { display: flex; flex-direction: column; gap: 7px; }

.login-field span {
  font-size: 13.5px;
  letter-spacing: 0.1em;
  color: #a8998a;
}

.login-field input {
  width: 100%;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-field input:focus,
.login-field input:focus-visible {
  outline: none;
  border-color: rgba(139, 94, 60, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.12);
}

/* 按钮和切换条不要浏览器默认的蓝框 */
.login-btn:focus,
.login-btn:focus-visible,
.login-tab:focus,
.login-tab:focus-visible,
.guest-login:focus,
.guest-login:focus-visible {
  outline: none;
}

.login-btn:focus-visible,
.login-tab:focus-visible,
.guest-login:focus-visible {
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.18);
}

.login-error {
  /* 改成浮动的 Toast，不再占卡片里的位置 */
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 10px);
  z-index: 80;
  margin: 0;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(168, 68, 58, 0.18);
  background: rgba(255, 248, 246, 0.97);
  box-shadow: 0 16px 34px rgba(120, 46, 38, 0.16);
  color: #a8443a;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.login-error.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.login-error[hidden] {
  display: block !important;
  opacity: 0;
  transform: translate(-50%, 10px);
}

.login-btn {
  margin-top: 0;
  padding: 15px 18px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #8b5e3c, #74492c);
  color: #fdf7ee;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease;
}

.login-btn:hover { filter: brightness(1.06); }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: 0.65; cursor: progress; }

.guest-login {
  font-weight: 600;
  margin-top: 18px;
  padding: 12px 16px;
  border: 0;
  border-radius: 11px;
  background: rgba(139, 94, 60, 0.05);
  color: #9a8771;
  font-size: 14.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.guest-login:hover {
  color: var(--brown);
  background: rgba(139, 94, 60, 0.06);
}

.login-hint {
  margin: 20px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: #a8998a;
}

.login-hint code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #f2e8d7;
  color: #7a5b3f;
  font-size: 12px;
}

.login-foot {
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.24em;
  color: rgba(139, 94, 60, 0.5);
}

@media (max-width: 880px) {
  .login-stage { grid-template-columns: minmax(0, 400px); }
  .login-quotes {
    order: 2;
    border-left: 0;
    padding-left: 0;
    text-align: center;
    align-items: center;
  }
  .login-quote { font-size: 21px; }
  .login-quotes__list { justify-content: center; }
}

@media (max-width: 480px) {
  .login-card { padding: 30px 22px 22px; border-radius: 16px; }
  .login-title { font-size: 20.5px; }
  .login-pattern::after { font-size: 70vw; opacity: 0.5; }
}


/* ---------------- 图书装饰 ---------------- */

.login-books {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-book {
  position: absolute;
  width: 96px;
  height: 132px;
  border-radius: 3px 9px 9px 3px;
  background: linear-gradient(145deg, rgba(139, 94, 60, 0.16), rgba(139, 94, 60, 0.05));
  border: 1px solid rgba(139, 94, 60, 0.16);
  box-shadow: 0 26px 50px -34px rgba(80, 56, 30, 0.6);
}

.login-book::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 253, 248, 0.6);
}

.login-book::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 16px;
  top: 26px;
  height: 2px;
  background: rgba(255, 253, 248, 0.45);
  box-shadow:
    0 16px 0 rgba(255, 253, 248, 0.34),
    0 32px 0 rgba(255, 253, 248, 0.26),
    0 48px 0 rgba(255, 253, 248, 0.2);
}

.login-book--a { left: 4%;  top: 12%;  transform: rotate(-13deg) scale(1.05); }
.login-book--b { left: 1.5%; top: 55%; transform: rotate(-4deg) scale(0.8); opacity: 0.6; }
.login-book--c { right: 5%; top: 9%;   transform: rotate(12deg) scale(0.95); }
.login-book--d { right: 12%; bottom: 12%; transform: rotate(-8deg) scale(1.12); opacity: 0.8; }
.login-book--e { left: 7%; bottom: 8%;  transform: rotate(9deg) scale(0.9); opacity: 0.7; }
.login-book--f { right: 26%; top: 6%;   transform: rotate(-18deg) scale(0.66); opacity: 0.5; }

/* 更多散落的书 */
.login-book--g { left: 19%; top: 5%;  transform: rotate(22deg) scale(0.6);  opacity: 0.45; }
.login-book--h { left: 15%; bottom: 30%; transform: rotate(-24deg) scale(0.5); opacity: 0.4; }
.login-book--i { right: 7%;  bottom: 33%; transform: rotate(16deg) scale(0.62); opacity: 0.45; }
.login-book--j { right: 20%; top: 30%; transform: rotate(-6deg) scale(0.46);  opacity: 0.32; }

/* 露出一截书签的那本 */
.login-book--ribbon::before {
  content: "";
  position: absolute;
  left: 58%;
  top: -26px;
  width: 14px;
  height: 40px;
  background: linear-gradient(180deg, #b4643c, #8b5e3c);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 6px 12px -6px rgba(80, 56, 30, 0.6);
  transform: rotate(3deg);
}

/* 左下角一摞横放的书 */
.login-stack {
  position: absolute;
  left: 3%;
  bottom: 6%;
  width: 210px;
  height: 78px;
  opacity: 0.55;
}

.login-stack::before,
.login-stack::after,
.login-stack {
  border-radius: 5px;
}

.login-stack {
  background: linear-gradient(180deg, rgba(139, 94, 60, 0.18), rgba(139, 94, 60, 0.1));
  border: 1px solid rgba(139, 94, 60, 0.18);
  box-shadow: 0 20px 40px -30px rgba(80, 56, 30, 0.6);
}

.login-stack::before,
.login-stack::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 14px;
  height: 18px;
  border: 1px solid rgba(139, 94, 60, 0.16);
  background: linear-gradient(180deg, rgba(139, 94, 60, 0.14), rgba(139, 94, 60, 0.07));
}

.login-stack::before { bottom: -22px; transform: rotate(1.5deg); }
.login-stack::after { bottom: -44px; right: 26px; transform: rotate(-2deg); }

/* 金色小星点 */
.login-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.7), rgba(201, 162, 39, 0) 70%);
  animation: sparkPulse 5.5s ease-in-out infinite;
}

.login-spark--1 { left: 24%; top: 18%; animation-delay: 0s; }
.login-spark--2 { left: 30%; bottom: 22%; animation-delay: 1.2s; }
.login-spark--3 { right: 30%; top: 14%; animation-delay: 2.4s; }
.login-spark--4 { right: 16%; bottom: 26%; animation-delay: 3.1s; }
.login-spark--5 { left: 8%;  top: 38%; animation-delay: 4.2s; }

@keyframes sparkPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

/* 飘起的纸页 */
.login-page {
  position: absolute;
  width: 46px;
  height: 60px;
  background: linear-gradient(160deg, rgba(255, 253, 248, 0.9), rgba(244, 234, 216, 0.5));
  border: 1px solid rgba(139, 94, 60, 0.14);
  border-radius: 2px 6px 6px 2px;
  box-shadow: 0 14px 26px -20px rgba(80, 56, 30, 0.6);
  opacity: 0.6;
  animation: pageFloat 9s ease-in-out infinite;
}

.login-page--1 { left: 34%; top: 8%; transform: rotate(-14deg); }
.login-page--2 { right: 34%; bottom: 9%; transform: rotate(11deg); animation-delay: 3s; }

@keyframes pageFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-spark, .login-page { animation: none; }
}

@media (max-width: 1100px) {
  .login-book { opacity: 0.35; transform: scale(0.7) rotate(-8deg); }
  .login-book--d, .login-book--f, .login-book--j,
  .login-stack, .login-page--2 { display: none; }
  .login-spark { opacity: 0.3; }
}


/* 共用的提交按钮：切换面板时只换文字，位置不动 */
.login-tip {
  /* 贴住面板底部：切换面板时，最后的元素始终落在同一条线上 */
  margin: 8px 0 0;
  margin-top: auto;
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px dashed rgba(139, 94, 60, 0.22);
  background: rgba(139, 94, 60, 0.045);
  font-family: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", serif;
  font-size: 15.5px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: #9c8163;
  text-shadow: 0 1px 0 rgba(255, 253, 248, 0.7);
}

.login-tip__label {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: #b08a63;
  opacity: 0.9;
}

.tip-link {
  cursor: pointer;
  border-bottom: 1px dashed rgba(139, 94, 60, 0.45);
  transition: color 150ms ease, border-color 150ms ease;
}

.tip-link:hover {
  color: #6b4526;
  border-bottom-color: #6b4526;
}

.login-tip strong {
  font-weight: 700;
  color: #8b5e3c;
  letter-spacing: 0.1em;
}

.submit-shared {
  margin-top: 20px;
  align-self: stretch;
  width: 100%;
  text-align: center;
}


/* 盖掉浏览器自动填充时那层淡蓝底 */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #fffdf9 inset;
  box-shadow: 0 0 0 1000px #fffdf9 inset;
  -webkit-text-fill-color: #3f352b;
  caret-color: #3f352b;
  transition: background-color 9999s ease-out 0s;
}


/* ---------------- 右上角：天气 + 时间 ---------------- */

.weather-panel {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 4;
  min-width: 196px;
  padding: 10px 12px 9px;
  border-radius: 14px;
  border: 1px solid rgba(139, 94, 60, 0.16);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 10px 26px rgba(84, 60, 36, 0.09);
  font-size: 13px;
  color: #7d6a55;
  text-align: left;
}

.weather-panel__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0 22px 0 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
}

.weather-panel__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.weather-panel__row--sub {
  font-size: 12px;
  color: #a2907a;
}

.weather-panel__place { font-weight: 600; color: #6b5340; }
.weather-panel__sep { opacity: 0.45; }
.weather-panel__time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #8a7457;
}
.weather-panel__temp { color: #8a7457; }
.weather-panel__date { margin-left: auto; }

.weather-panel__gear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #b7a693;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.weather-panel__gear:hover { background: rgba(139, 94, 60, 0.1); color: #8b6b4a; }

.weather-panel__pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 258px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(139, 94, 60, 0.18);
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 18px 40px rgba(84, 60, 36, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  text-align: left;
}

.weather-panel__pop-title {
  width: 100%;
  margin: 2px 0 1px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #b3a390;
}

.weather-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #8a7457;
  cursor: pointer;
}

.weather-opt input { accent-color: #8b5e3c; }

.weather-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
}

.weather-chip {
  padding: 4px 9px;
  border: 1px solid rgba(139, 94, 60, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 11.5px;
  color: #8a7457;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.weather-chip:hover { background: rgba(139, 94, 60, 0.08); }

.weather-chip.is-on {
  background: #8b5e3c;
  border-color: #8b5e3c;
  color: #fff9ef;
}

.weather-city {
  display: flex;
  gap: 6px;
  width: 100%;
}

.weather-city input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(139, 94, 60, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 12px;
  color: #6b5340;
}

.weather-city-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}

.weather-mini {
  padding: 5px 9px;
  border: 1px solid rgba(139, 94, 60, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 12px;
  color: #8a7457;
  cursor: pointer;
  white-space: nowrap;
}

.weather-mini:hover { background: rgba(139, 94, 60, 0.08); }

.weather-panel__foot {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.weather-apply {
  padding: 6px 18px;
  border-color: rgba(139, 94, 60, 0.4);
  background: #8b5e3c;
  color: #fff9ef;
  font-weight: 600;
}

.weather-apply:hover {
  background: #7a4f31;
}

.weather-panel__hint {
  width: 100%;
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #b3a390;
}

@media (max-width: 760px) {
  .weather-panel {
    top: 12px;
    right: 12px;
    min-width: 168px;
    font-size: 12px;
    padding: 8px 10px;
  }
  .weather-panel__pop { gap: 3px 9px; }
}


/* ---------------- 隐形按钮 + 身份选择 ---------------- */

.login-mark {
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 180ms ease;
}

.login-mark:active { transform: scale(0.96); }

.login-mark:focus-visible {
  outline: 2px solid rgba(139, 94, 60, 0.45);
  outline-offset: 4px;
}

.role-picker {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(300px, calc(100% - 40px));
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(139, 94, 60, 0.18);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 20px 44px rgba(84, 60, 36, 0.18);
  text-align: left;
}

.role-picker__title {
  margin: 2px 0 8px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: #b3a390;
}

.role-picker__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 6px;
  border: 1px solid rgba(139, 94, 60, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.role-picker__item:hover { background: rgba(139, 94, 60, 0.07); }

.role-picker__item.is-on {
  border-color: rgba(139, 94, 60, 0.5);
  background: rgba(139, 94, 60, 0.1);
}

.role-picker__item strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #6b4526;
}

.role-picker__item span {
  font-size: 11.5px;
  color: #a2907a;
}

.role-picker__hint {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #b3a390;
}

.role-picker__hint:empty { display: none; }


/* ---------------- 背景书本可拖，松手回原位 ---------------- */

.login-books > * {
  transition: translate 540ms cubic-bezier(0.22, 1, 0.36, 1);
  translate: 0px 0px;
}

.login-book,
.login-stack,
.login-page {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.login-books.is-dragging > * {
  transition: none;
}

.login-books.is-dragging .is-holding {
  cursor: grabbing;
}


/* ---------------- 鼓励语：从上方飘落 ---------------- */

.login-book--ribbon {
  pointer-events: auto;
  cursor: pointer;
}

.encourage-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.encourage {
  position: absolute;
  top: 0;
  left: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(139, 94, 60, 0.16);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 24px rgba(84, 60, 36, 0.1);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 15.5px;
  letter-spacing: 0.06em;
  color: #7d6a55;
  white-space: nowrap;
  /* 位置由 JS 用 transform 驱动（会飘、能拖、还会撞鼠标） */
  will-change: transform;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.encourage.is-dragging {
  cursor: grabbing;
  z-index: 5;
  box-shadow: 0 16px 34px rgba(84, 60, 36, 0.18);
}

@keyframes encourageFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(var(--tilt-from, -4deg));
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift, 0px), 118vh, 0) rotate(var(--tilt-to, 4deg));
    opacity: 0;
  }
}

/* ---------------- 文字不可选中（避免拖拽时出蓝框和复制工具条） ---------------- */

body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* ---------------- 让背景物件真正可点：内容层不吃掉点击 ---------------- */

.login {
  pointer-events: none;
}

/* 表单、天气条这些真正要交互的，单独放行 */
.login-card,
.weather-panel,
.login-modal,
.login-quotes,
.eraser-ball,
.quote-scratch {
  pointer-events: auto;
}

/* 鼓励语整层是纯展示，绝不能吃点击 */
.encourage-layer {
  pointer-events: none;
}

.login-card * {
  pointer-events: auto;
}


/* ---------------- 居中的登录模块 ---------------- */

.role-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(70, 50, 30, 0.18);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: roleFade 220ms ease both;
}

@keyframes roleFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.role-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(380px, calc(100vw - 40px));
  padding: 20px 22px 22px;
  border-radius: 18px;
  border: 1px solid rgba(232, 222, 206, 0.95);
  background: #fffdf8;
  box-shadow: 0 30px 70px rgba(70, 48, 26, 0.28);
  animation: roleFade 200ms ease both;
  pointer-events: auto;
}

.role-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.role-modal__head h2 {
  margin: 0;
  font-family: var(--serif, "STKaiti", "KaiTi", serif);
  font-size: 19px;
  color: #6b4526;
}

.role-modal__tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: #f3ead9;
}

.role-tab {
  flex: 1;
  padding: 8px 0;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: 14px;
  color: #8b7a66;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.role-tab.is-on {
  background: #fffdf8;
  color: #6b4526;
  font-weight: 600;
  box-shadow: 0 4px 12px -6px rgba(84, 60, 36, 0.5);
}

.role-modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-submit {
  margin-top: 4px;
  padding: 12px 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #8b5e3c, #7a4f31);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.2em;
  color: #fff9ef;
  cursor: pointer;
  transition: filter 160ms ease;
}

.role-submit:hover { filter: brightness(1.06); }
.role-submit:disabled { opacity: 0.7; cursor: default; }


/* ---------------- 天气小球 + 弹出面板 ---------------- */

.weather-ball {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 7;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(139, 94, 60, 0.2);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fffdf8, #f2e7d5 72%);
  box-shadow: 0 10px 24px rgba(84, 60, 36, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: grab;
  touch-action: none;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 180ms ease;
  pointer-events: auto;
}

.weather-ball:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 14px 30px rgba(84, 60, 36, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.weather-ball.is-dragging {
  cursor: grabbing;
  transform: scale(1.04);
  transition: none;
}

.weather-ball svg {
  width: 30px;
  height: 30px;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.weather-ball__sun { fill: #e2a95c; }

.weather-ball__rays {
  stroke: #d9984a;
  stroke-width: 1.2;
  stroke-linecap: round;
  fill: none;
  opacity: 0.9;
}

.weather-ball__cloud {
  fill: #fffdf8;
  stroke: #b08a63;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.weather-panel {
  position: fixed;
  z-index: 8;
  width: 268px;
  padding: 12px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(139, 94, 60, 0.18);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 24px 50px rgba(84, 60, 36, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: weatherPanelIn 180ms ease both;
}

@keyframes weatherPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* 关闭：整体往上飘、缩小、化开 */
.weather-panel.is-closing {
  animation: weatherPanelOut 300ms cubic-bezier(0.4, 0, 0.6, 1) forwards;
  pointer-events: none;
}

@keyframes weatherPanelOut {
  0% {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
  55% {
    opacity: 0.55;
    filter: blur(1px);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
    filter: blur(2.5px);
  }
}

.weather-panel__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.weather-panel__place { font-size: 13px; font-weight: 600; color: #6b5340; }

.weather-panel__row--sub {
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #a2907a;
}

.weather-panel__time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: #8a7457;
  font-size: 12px;
}

.weather-panel__pop {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(139, 94, 60, 0.2);
}

.weather-panel__sep { display: none; }


/* ---------------- 登录成功后离场幕布 ---------------- */

.login-curtain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 45%, #fbf6ec, #f7f2e8);
  transition: opacity 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

.login-curtain.is-on {
  opacity: 1;
}


/* ---------------- 进场：从离场幕布的颜色淡开 ---------------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, #fdf9f0, #f4ead8);
  animation: loginCurtainOut 460ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loginCurtainOut {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}


/* ---------------- 标题里会动的数字 ---------------- */

.dyn-digit {
  display: inline-block;
  will-change: transform;
  animation: digitBob 3.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes digitBob {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    text-shadow: 0 0 0 rgba(139, 94, 60, 0);
  }
  22% {
    transform: translateY(-3px) rotate(-1.2deg);
    text-shadow: 0 2px 8px rgba(139, 94, 60, 0.22);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  74% {
    transform: translateY(2px) rotate(1deg);
    text-shadow: 0 1px 5px rgba(139, 94, 60, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dyn-digit { animation: none; }
}


/* ---------------- 登录卡片里的古风元素 ---------------- */

.card-ink {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.card-ink svg {
  width: 100%;
  height: 100%;
  display: block;
}

.login-card > *:not(.card-ink) {
  position: relative;
  z-index: 1;
}

.card-ink__corner {
  fill: none;
  stroke: #b08a63;
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0.28;
}

.card-ink__clouds {
  fill: none;
  stroke: #b08a63;
  stroke-width: 1.1;
  stroke-linejoin: round;
  opacity: 0.22;
}

/* 云朵的漂移交给 login-clouds.js 逐帧处理，避免和 SVG 的 transform 属性打架 */

.card-ink__bamboo {
  /* 整丛随风轻摆，根部不动 */
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: bambooSway 6.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes bambooSway {
  0%, 100% { transform: rotate(-1.1deg); }
  50% { transform: rotate(1.5deg); }
}

.card-ink__bamboo .leaf {
  transform-box: fill-box;
  transform-origin: left center;
  animation: leafSway 4.4s ease-in-out infinite;
}

.card-ink__bamboo .leaf:nth-of-type(2) { animation-delay: -1.4s; }
.card-ink__bamboo .leaf:nth-of-type(3) { animation-delay: -2.6s; }
.card-ink__bamboo .leaf:nth-of-type(4) { animation-delay: -0.8s; }

@keyframes leafSway {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  50% { transform: rotate(3.5deg) translateY(-0.6px); }
}

@media (prefers-reduced-motion: reduce) {
  .card-ink__bamboo,
  .card-ink__bamboo .leaf { animation: none; }
}

.card-ink__bamboo .stem {
  fill: none;
  stroke: #6b6a4a;
  stroke-width: 2.6;
  stroke-linecap: round;
  opacity: 0.22;
}

.card-ink__bamboo .stem--thin {
  stroke-width: 1.8;
  opacity: 0.16;
}

.card-ink__bamboo .leaf {
  fill: #6f7a52;
  opacity: 0.16;
}

.card-ink__seal rect {
  fill: #b4462f;
  opacity: 0.62;
}

.card-ink__seal text {
  fill: #fff8ef;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 21px;
  text-anchor: middle;
  opacity: 0.9;
}


/* 弹窗和遮罩必须继续固定定位（避免被 .login-card 的层级规则改成 relative） */
.login-card > .role-backdrop,
.login-card > .role-modal,
.login > .role-backdrop,
.login > .role-modal {
  position: fixed;
}

.login-card > .role-modal,
.login > .role-modal {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* ---------------- 开卷问答 ---------------- */

.card-ink__btn {
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease;
}

.card-ink__btn:hover { opacity: 0.85; }
.card-ink__btn:active { transform: scale(0.97); }

.quiz-backdrop {
  position: fixed;
  inset: 0;
  z-index: 21;
  background: rgba(70, 50, 30, 0.18);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: roleFade 220ms ease both;
}

.quiz-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 22;
  width: min(400px, calc(100vw - 40px));
  padding: 20px 22px 22px;
  border-radius: 18px;
  border: 1px solid rgba(232, 222, 206, 0.95);
  background: #fffdf8;
  box-shadow: 0 30px 70px rgba(70, 48, 26, 0.28);
  animation: roleFade 200ms ease both;
}

.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quiz-head h2 {
  margin: 0;
  font-family: var(--serif, "STKaiti", "KaiTi", serif);
  font-size: 19px;
  color: #6b4526;
}

.quiz-progress {
  margin: 0 0 8px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: #b3a390;
}

.quiz-question {
  margin: 0 0 14px;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 17px;
  line-height: 1.6;
  color: #5a4632;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  padding: 10px 14px;
  border: 1px solid rgba(139, 94, 60, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 14px;
  color: #6b5340;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.quiz-option:hover { background: rgba(139, 94, 60, 0.07); }

.quiz-option.is-right {
  border-color: #7f9b6a;
  background: rgba(127, 155, 106, 0.14);
  color: #4f6b3d;
}

.quiz-option.is-wrong {
  border-color: #c07a6a;
  background: rgba(192, 122, 106, 0.14);
  color: #8f4a3a;
}

.quiz-option:disabled { cursor: default; }

.quiz-hint {
  margin: 10px 0 0;
  min-height: 1.4em;
  font-size: 12px;
  line-height: 1.6;
  color: #a2907a;
}

.quiz-done {
  text-align: center;
  padding: 6px 0 2px;
}

.quiz-done__line {
  margin: 0 0 6px;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 20px;
  letter-spacing: 0.12em;
  color: #6b4526;
}

.quiz-done__sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #a5896a;
}


/* 问答答完后的烟花层 */
.quiz-fx {
  position: fixed;
  inset: 0;
  z-index: 23;
  pointer-events: none;
}


/* ---------------- 班级简介（连点 2509 五次） ---------------- */

.intro-backdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(70, 50, 30, 0.18);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: roleFade 220ms ease both;
}

.intro-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  width: min(460px, calc(100vw - 40px));
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 20px 22px 18px;
  border-radius: 18px;
  border: 1px solid rgba(232, 222, 206, 0.95);
  background: #fffdf8;
  box-shadow: 0 30px 70px rgba(70, 48, 26, 0.28);
  animation: roleFade 200ms ease both;
}

.intro-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.intro-head h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: #6b4526;
}

.intro-sub {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #b3a390;
}

.intro-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intro-block h3 {
  margin: 0 0 5px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #8b5e3c;
}

.intro-block p {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid rgba(139, 94, 60, 0.22);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 14.5px;
  line-height: 1.85;
  color: #8a7457;
}

.intro-foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #c2b3a0;
}


/* 登录卡片不做任何拖拽交互 */
.login-card,
.login-card * {
  -webkit-user-drag: none;
  user-select: none;
}

.login-card input,
.login-card textarea {
  user-select: text;
}
/* ---------------- 手机端（覆盖旧的 480 规则） ---------------- */

@media (max-width: 480px) {
  .login {
    padding: 14px 12px 26px;
    gap: 14px;
  }

  .login-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    width: 100%;
  }

  .login-quotes {
    display: none;
  }

  .login-card {
    width: 100%;
    min-height: auto;
    padding: 30px 16px 28px;
    border-radius: 18px;
  }

  .login-mark { width: 52px; height: 52px; }

  .login-title { font-size: 25px; }

  .login-panes { height: 300px; }

  .login-tip { font-size: 14.5px; padding: 9px 13px; }

  .weather-ball { top: 10px; right: 10px; width: 44px; height: 44px; }
  .weather-ball svg { width: 26px; height: 26px; }
  .weather-panel { width: min(300px, calc(100vw - 24px)); }

  .role-modal,
  .quiz-modal,
  .intro-modal {
    width: calc(100vw - 24px);
    max-height: 82vh;
    overflow: auto;
    padding: 18px 18px 18px;
  }

  .card-ink__seal { transform: rotate(-7deg) scale(0.8); transform-origin: center; }
}
/* 手机端：彻底避免横向溢出，并让印章别压标题 */
@media (max-width: 480px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .login,
  .login-stage {
    width: 100%;
    max-width: 100%;
  }

  .login-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .login-panes,
  .login-form,
  .login-field,
  .login-tip,
  .submit-shared,
  .guest-login {
    max-width: 100%;
    box-sizing: border-box;
  }

  .card-ink__seal { display: none; }
}
/* 手机端强制定宽，彻底不溢出 */
@media (max-width: 480px) {
  .login {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .login-stage {
    display: block;
    width: 100%;
  }

  .login-card {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 auto;
  }

  .login-panes,
  .login-tip,
  .submit-shared,
  .guest-login,
  .login-tabs {
    width: 100%;
    max-width: 100%;
  }
}
/* 手机端：卡片内部强制换行，不再撑宽 */
@media (max-width: 480px) {
  .login-card {
    overflow-x: hidden;
  }

  .login-tip,
  .login-tip__label,
  .login-title,
  .login-sub {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .login-tip {
    width: 100%;
  }

  .login-panes {
    width: 100%;
  }
}
/* 手机端最后一道钳制：任何子元素都不许比卡片宽 */
@media (max-width: 480px) {
  .login,
  .login-stage,
  .login-card,
  .login-panes,
  .login-form,
  .login-field {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .login-field input,
  .login-tip,
  .submit-shared,
  .guest-login,
  .login-tabs,
  .login-tabs .rubber-segment {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .login-card {
    overflow: hidden;
  }
}

/* ---------------- 所有输入框：光标描深，处处可见 · Cursor 全局 ---------------- */

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
textarea,
select,
[contenteditable="true"] {
  cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2218%22%20height%3D%2224%22%20viewBox%3D%220%200%2018%2024%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23fffdf8%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M9%204v16M6.5%204h5M6.5%2020h5%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%233f2f1f%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M9%204v16M6.5%204h5M6.5%2020h5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 9 12, text;
  caret-color: #6b4526;
}


/* ---------------- 小球悬停详情 ---------------- */

.weather-hint {
  position: fixed;
  z-index: 65;   /* 高于橡皮球，鼠标移上去不会被挡 */
  top: 84px;
  right: 24px;
  width: 208px;
  padding: 11px 13px 10px;
  border-radius: 13px;
  border: 1px solid rgba(139, 94, 60, 0.18);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 18px 40px rgba(84, 60, 36, 0.18);
  pointer-events: none;
  animation: weatherHintIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: background 460ms ease, border-color 460ms ease, box-shadow 460ms ease;
}

/* 收起：卡片底子先化掉，每个字块朝各自随机方向散开 */
.weather-hint.is-out {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.weather-hint.is-out .weather-hint__title,
.weather-hint.is-out .weather-hint__list dt,
.weather-hint.is-out .weather-hint__list dd,
.weather-hint.is-out .weather-hint__tip {
  animation: hintScatter 460ms cubic-bezier(0.35, 0, 0.55, 1) var(--hd, 0ms) forwards;
}

@keyframes hintScatter {
  to {
    opacity: 0;
    transform: translate(var(--hx, 0px), var(--hy, -14px)) rotate(var(--hr, 0deg));
  }
}

@keyframes weatherHintIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.weather-hint__title {
  margin: 0 0 7px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #b3a390;
}

.weather-hint__list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 12.5px;
}

.weather-hint__list dt {
  color: #a2907a;
  white-space: nowrap;
}

.weather-hint__list dd {
  margin: 0;
  text-align: right;
  color: #6b5340;
}

.weather-hint__list dd.is-strong {
  font-weight: 600;
  color: #6b4526;
}

.weather-hint__tip {
  margin: 9px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(139, 94, 60, 0.18);
  font-size: 11px;
  color: #bda98f;
  text-align: center;
}


/* ---------------- 引言区：橡皮擦 ---------------- */

.login-quotes {
  position: relative;
}

.login-quotes__text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
}

.quote-scratch {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.quote-scratch__warm {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: stretch;
  padding: 0 0 0 18px;
  text-align: center;
  pointer-events: none;
}

.quote-scratch__line {
  margin: 0;
  align-self: center;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: var(--quote-size, 30px);
  line-height: 1.75;
  letter-spacing: 0.04em;
  color: #6b4526;
}

.quote-scratch__sub {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #b59775;
}

.quote-scratch__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  mix-blend-mode: normal;
  opacity: 0.985;
}

.quote-scratch__canvas.is-erasing { cursor: grabbing; }

.quote-scratch.is-done .quote-scratch__canvas {
  opacity: 0;
  filter: blur(3px);
  transform: scale(1.015);
  transition:
    opacity 1100ms cubic-bezier(0.4, 0, 0.5, 1),
    filter 1100ms ease,
    transform 1100ms ease;
  pointer-events: none;
}

.eraser-ball {
  position: fixed;
  right: 28px;
  bottom: 80px;
  /* 高于擦除遮罩，随时可以再点一下退出 */
  z-index: 60;
  width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(139, 94, 60, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fffdf8, #f1e6d3 74%);
  box-shadow: 0 8px 20px rgba(84, 60, 36, 0.16);
  cursor: grab;
  touch-action: none;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 180ms ease;
}

.eraser-ball:hover {
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 12px 26px rgba(84, 60, 36, 0.22);
}

.eraser-ball.is-dragging {
  cursor: grabbing;
  transform: scale(1.04);
  transition: none;
}

.eraser-ball.is-pushed {
  transform: translateX(150px) scale(0.86);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 300ms ease;
}

.eraser-ball.is-on {
  border-color: rgba(139, 94, 60, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.12), 0 8px 20px rgba(84, 60, 36, 0.18);
}

.eraser-ball svg {
  width: 28px;
  height: 28px;
  display: block;
  transform: translate(1px, -1px);
}

.eraser-glyph__body {
  fill: #f7ddc9;
  stroke: #b09b81;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.eraser-glyph__band {
  stroke: #cd9169;
  stroke-width: 3.4;
  stroke-linecap: butt;
  opacity: 0.85;
}

.eraser-glyph__shadow {
  stroke: #cbb9a1;
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.5;
}

/* 进入擦除模式时，原引言淡出 */
.login-quotes.is-erasing .login-quotes__text {
  opacity: 0;
  transition: opacity 900ms ease;
}

@media (max-width: 880px) {
  .quote-eraser { display: none; }
}


/* ---------------- 擦除模式：橡皮光标 + 逐字浮现 ---------------- */

.quote-scratch.is-brushing {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cg fill='none' stroke='%23fffdf8' stroke-width='6' stroke-linejoin='round'%3E%3Cpath d='M6 21 17 10a3.4 3.4 0 0 1 4.8 0l2 2a3.4 3.4 0 0 1 0 4.8L13 27H8z'/%3E%3C/g%3E%3Cg fill='none' stroke='%236b4526' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 21 17 10a3.4 3.4 0 0 1 4.8 0l2 2a3.4 3.4 0 0 1 0 4.8L13 27H8z'/%3E%3C/g%3E%3C/svg%3E") 6 22, crosshair;
}

.warm-char {
  display: inline-block;
  opacity: 0;
  filter: blur(7px);
  transform: translateY(4px);
  animation: charIn 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes charIn {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(4px);
  }
  55% {
    opacity: 0.55;
    filter: blur(2.5px);
    transform: translateY(1px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.quote-scratch__warm.is-leaving {
  animation: warmOut 420ms ease forwards;
}

@keyframes warmOut {
  to {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(-6px);
  }
}

/* ---------------- 橡皮跟随光标 ---------------- */

.login-quotes.is-brush,
.login-quotes.is-brush * {
  cursor: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAsElEQVR42mNgGAWjYBSMgqEK/v/98R8d093ybFc1OKabI7BZTjdH4LOc5o4gxnKaOQJm4NmJmXCMbBlNHYHsc2QHgDByDqCJI9ANR3cACH+/e5KgI6ga56Q6giwHEPIRNkdQLQSIiVOQj7E5gippgBjLYRifI8hOgLjiEd1ybFkTPXeQnfgIhQCh3EHVrIfNEYRyB80rHLoWvwNS9iM7YtWUCqphshwx6oBB0QYc1gAAndF6SFbo82cAAAAASUVORK5CYII=") 6 27, crosshair;
}

.eraser-follower {
  display: none;
}


/* 暖心句下方的小字：字号小一点，逐字浮现 */
.warm-char--sub {
  font-size: 1em;
  letter-spacing: 0.1em;
  color: #9c7b52;
  animation-duration: 560ms;
}

.quote-scratch__sub {
  margin-top: 8px;
  /* 小字没出现前就把位置留好，避免把大字往上顶 */
  min-height: 1.7em;
}

/* 擦除时铺一张全屏遮罩：光标变橡皮、挡住其它点击，但保留鼠标特效 */
.eraser-shield {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  touch-action: none;
  cursor: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAsElEQVR42mNgGAWjYBSMgqEK/v/98R8d093ybFc1OKabI7BZTjdH4LOc5o4gxnKaOQJm4NmJmXCMbBlNHYHsc2QHgDByDqCJI9ANR3cACH+/e5KgI6ga56Q6giwHEPIRNkdQLQSIiVOQj7E5gippgBjLYRifI8hOgLjiEd1ybFkTPXeQnfgIhQCh3EHVrIfNEYRyB80rHLoWvwNS9iM7YtWUCqphshwx6oBB0QYc1gAAndF6SFbo82cAAAAASUVORK5CYII=") 6 27, crosshair;
}

.eraser-shield.is-on {
  display: block;
}

body.is-erasing,
body.is-erasing * {
  cursor: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAsElEQVR42mNgGAWjYBSMgqEK/v/98R8d093ybFc1OKabI7BZTjdH4LOc5o4gxnKaOQJm4NmJmXCMbBlNHYHsc2QHgDByDqCJI9ANR3cACH+/e5KgI6ga56Q6giwHEPIRNkdQLQSIiVOQj7E5gippgBjLYRifI8hOgLjiEd1ybFkTPXeQnfgIhQCh3EHVrIfNEYRyB80rHLoWvwNS9iM7YtWUCqphshwx6oBB0QYc1gAAndF6SFbo82cAAAAASUVORK5CYII=") 6 27, crosshair !important;
}

/* 暖心句每行单独排，避免自动换行把标点丢到下一行 */
.warm-line {
  display: block;
  white-space: nowrap;
  text-align: center;
  max-width: 100%;
}


/* ---------------- 暖心句：套用引言的字形与装饰 ---------------- */

.warm-bracket {
  display: inline-block;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 0.92em;
  color: rgba(107, 69, 38, 0.42);
  transform: translateY(-0.06em);
}

.quote-scratch__eyebrow {
  margin: 0;
  align-self: start;
  justify-self: start;
  text-align: left;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 0.42em;
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  color: rgba(139, 94, 60, 0.5);
}

.quote-scratch__line {
  font-family: "STSong", "Songti SC", "SimSun", serif;
  letter-spacing: 0.04em;
  color: #6b4526;
}

.warm-line {
  display: block;
  white-space: nowrap;
  text-align: center;
  max-width: 100%;
}

.quote-scratch__sub {
  margin: 0 0 30px;
  align-self: end;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 0.62em;
  letter-spacing: 0.16em;
  color: #a5896a;
  min-height: 1.7em;
}

.quote-scratch__dots {
  position: absolute;
  left: 18px;
  bottom: 0;
  display: flex;
  justify-content: flex-start;
  gap: 7px;
}

.quote-scratch__dots i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: rgba(139, 94, 60, 0.22);
  transition: background 240ms ease, width 240ms ease;
}

.quote-scratch__dots i.is-on {
  width: 22px;
  background: rgba(139, 94, 60, 0.55);
}


/* ---------------- 登录问候 Toast ---------------- */

.login-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 14px);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(139, 94, 60, 0.16);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 18px 38px rgba(84, 60, 36, 0.16);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #6b5340;
  opacity: 0;
  transition:
    opacity 420ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.login-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.login-toast__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9924f;
  flex: 0 0 auto;
}

.login-toast__text {
  line-height: 1.5;
}

/* ---------------- 天气面板：勾选与选择动画 ---------------- */

.weather-opt input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1.4px solid rgba(139, 94, 60, 0.42);
  border-radius: 4px;
  background: #fffdf8;
  position: relative;
  cursor: pointer;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 180ms cubic-bezier(0.22, 1.4, 0.4, 1);
}

.weather-opt input[type="checkbox"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: no-repeat center/10px 10px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4 4.6 9 10 3.2' fill='none' stroke='%23fffdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  opacity: 0;
  transform: scale(0.3) rotate(-16deg);
  transition:
    opacity 150ms ease,
    transform 260ms cubic-bezier(0.22, 1.5, 0.36, 1);
}

.weather-opt input[type="checkbox"]:hover {
  border-color: rgba(139, 94, 60, 0.7);
}

.weather-opt input[type="checkbox"]:checked {
  background: #8b5e3c;
  border-color: #8b5e3c;
  animation: checkPop 340ms cubic-bezier(0.22, 1.4, 0.4, 1);
}

.weather-opt input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: none;
}

@keyframes checkPop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.weather-chip {
  transition:
    background 200ms ease,
    color 200ms ease,
    border-color 200ms ease,
    transform 180ms cubic-bezier(0.22, 1.4, 0.4, 1),
    box-shadow 200ms ease;
}

.weather-chip:hover {
  transform: translateY(-1px);
}

.weather-chip:active {
  transform: scale(0.94);
}

.weather-chip.is-pop {
  animation: chipPop 340ms cubic-bezier(0.22, 1.4, 0.4, 1);
  box-shadow: 0 6px 14px rgba(139, 94, 60, 0.18);
}

@keyframes chipPop {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}


/* 夜晚的鼠标聚光灯 */
.night-spot {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease;
  background: radial-gradient(
    circle 260px at var(--sx, -999px) var(--sy, -999px),
    rgba(255, 243, 214, 0.20) 0%,
    rgba(255, 240, 208, 0.10) 38%,
    rgba(255, 238, 204, 0.03) 62%,
    transparent 78%
  );
  mix-blend-mode: screen;
}


/* 登录页引言：加大加粗加深 */
.login-quote {
  font-size: clamp(26px, 2.9vw, 40px) !important;
  font-weight: 600;
  color: #4f3722;
  letter-spacing: 0.04em;
}

/* 身份浮层底部：登录 / 注册互相切换 */
.role-modal__foot {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: #9a8874;
}

.role-modal__foot a {
  color: #8b5e3c;
  text-decoration: none;
  border-bottom: 1px dashed rgba(139, 94, 60, 0.4);
}

.role-modal__foot a:hover { color: #6b4526; }

.role-modal {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* 注册老师时「管理员密码」留着占位但禁用，保证两个身份页面一样高 */
#role-adminkey:disabled {
  background: #f7f2e8;
  color: #b3a493;
  cursor: not-allowed;
}

/* 身份浮层里的小提示：登录不必挑身份 */
.role-modal__hint {
  margin: -2px 0 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #a2907a;
}

/* ================= 趣味问答：进出场 ================= */

.quiz-modal {
  animation: none;
  opacity: 0;
  transform: translate(-50%, -47%) scale(0.96);
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.22, 0.9, 0.28, 1);
}

.quiz-modal.is-in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 被擦掉：像纸被抹开一样缩一点、淡出去 */
.quiz-modal.is-out {
  opacity: 0;
  transform: translate(-50%, -52%) scale(0.94) rotate(-0.6deg);
  transition:
    opacity 240ms ease,
    transform 260ms cubic-bezier(0.4, 0, 0.6, 1);
}

.quiz-backdrop {
  animation: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.quiz-backdrop.is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .quiz-modal,
  .quiz-backdrop { transition: none; }
}


/* 下拉刷新交给页面自己做，禁用浏览器原生行为 */
html, body { overscroll-behavior-y: contain; }


/* 登录 ⇄ 注册切换：表单淡入上浮，配合高度变化 */
.role-modal__form.is-swap-in {
  animation: roleFormSwap 300ms cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

@keyframes roleFormSwap {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.role-modal {
  transition: height 260ms cubic-bezier(0.22, 0.9, 0.28, 1);
}
