/* 登录 / 注册 — Ink & Sand */
:root {
  --lg-bg: #F3EDE4;
  --lg-surface: #FDFAF5;
  --lg-ink: #0F0E0C;
  --lg-accent: #B85C38;
  --lg-sage: #4A6B5D;
  --lg-gold: #C4A574;
  --lg-muted: #8A8178;
  --lg-line: rgba(15, 14, 12, 0.08);
  --lg-serif: "Noto Serif SC", "Songti SC", serif;
  --lg-sans: "PingFang SC", -apple-system, sans-serif;
  --lg-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lg-r: 18px;
  --lg-field-h: 50px;
}

html {
  min-height: 100%;
  min-height: 100dvh;
  background: var(--lg-bg);
  font-family: var(--lg-sans);
  -webkit-tap-highlight-color: transparent;
}

body.lg-page {
  margin: 0;
  min-height: 100dvh;
  color: var(--lg-ink);
  background: var(--lg-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.lg-shell {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.lg-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 45% at 50% -5%, rgba(184, 92, 56, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 30%, rgba(196, 165, 116, 0.07), transparent 50%);
}

.lg-enter { opacity: 0; }
.lg-enter.is-ready {
  opacity: 1;
  transition: opacity 0.5s var(--lg-ease);
}

/* ── 品牌区 ── */
.lg-brand {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 16px 0 20px;
  flex-shrink: 0;
}

.lg-brand .brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  line-height: 1;
}
.lg-brand .brand-wordmark__yue {
  font-family: var(--lg-serif);
  font-size: clamp(36px, 10vw, 44px);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--lg-ink);
}
.lg-brand .brand-wordmark__zhuan {
  font-family: var(--lg-serif);
  font-size: clamp(36px, 10vw, 44px);
  font-weight: 600;
  letter-spacing: 0.1em;
  background: linear-gradient(165deg, #9E4529 0%, #C4A574 50%, #B85C38 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lg-brand .brand-wordmark:active { opacity: 0.82; }

.lg-brand__sub {
  margin: 12px 0 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--lg-muted);
  line-height: 1.5;
}

/* ── 主卡片 ── */
.lg-card {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--lg-r);
  padding: 20px 18px 18px;
  background: var(--lg-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 20px 48px rgba(15, 14, 12, 0.08);
}

.lg-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 999px;
  background: var(--lg-bg);
}
.lg-tabs__btn {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--lg-muted);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.25s, color 0.25s;
}
.lg-tabs__btn.is-on {
  color: #F3EDE4;
  background: var(--lg-ink);
  box-shadow: 0 4px 12px rgba(15, 14, 12, 0.12);
}

.lg-msg, .tg-msg {
  min-height: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--lg-accent);
  margin: 0 0 12px;
  text-align: center;
  line-height: 1.45;
}
.lg-msg.ok, .tg-msg.ok { color: var(--lg-sage); }

.lg-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lg-stack--after-terms { margin-top: 12px; gap: 10px; }
.lg-stack--register { gap: 12px; }

.lg-field {
  display: flex;
  align-items: center;
  min-height: var(--lg-field-h);
  border-radius: 12px;
  padding: 0 6px 0 8px;
  background: var(--lg-bg);
  border: 1px solid var(--lg-line);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.lg-field:focus-within {
  border-color: rgba(184, 92, 56, 0.4);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.1);
}

.lg-ico {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lg-muted);
}
.lg-ico svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.lg-inp {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--lg-ink);
  padding: 0 10px 0 4px;
  font-family: inherit;
  height: var(--lg-field-h);
}
.lg-inp::placeholder { color: rgba(138, 129, 120, 0.75); font-weight: 400; }

.lg-pwd-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.lg-eye {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lg-muted);
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  border-radius: 8px;
}
.lg-eye:active { color: var(--lg-accent); }

/* 验证码 */
.lg-captcha-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.lg-captcha-wrap .lg-ico { align-self: center; }

.tg-captcha-row { margin: 0; }
.tg-captcha-combo {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--lg-line);
  background: var(--lg-bg);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.tg-captcha-combo:focus-within {
  border-color: rgba(184, 92, 56, 0.4);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.1);
}
.tg-captcha-combo-main {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  min-height: var(--lg-field-h);
}
.tg-captcha-combo .tg-captcha-input {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  margin: 0;
  background: transparent;
  height: 42px;
  font-size: 15px;
  font-weight: 500;
  color: var(--lg-ink);
  outline: none;
  font-family: inherit;
}
.tg-captcha-combo .tg-captcha-input::placeholder { color: rgba(138, 129, 120, 0.75); }
.tg-captcha-img-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}
.tg-captcha-img-actions img {
  display: block;
  width: clamp(120px, 32vw, 148px);
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--lg-line);
  background: #fff;
  cursor: pointer;
}
.tg-captcha-refresh {
  border: 0;
  background: none;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--lg-accent);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.lg-row-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}
.lg-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--lg-muted);
  cursor: pointer;
}
.lg-remember input { accent-color: var(--lg-accent); width: 16px; height: 16px; }

.tg-terms, .lg-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}
.tg-terms input, .lg-terms input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--lg-accent);
}
.tg-terms label, .lg-terms label {
  font-size: 11px;
  line-height: 1.55;
  color: var(--lg-muted);
  text-align: left;
}
.tg-terms a, .lg-terms a {
  color: var(--lg-accent);
  text-decoration: none;
  font-weight: 600;
}

.lg-btn-primary, .tg-btn-login {
  width: 100%;
  border: none;
  border-radius: 999px;
  min-height: var(--lg-field-h);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #F3EDE4;
  cursor: pointer;
  font-family: inherit;
  background: var(--lg-ink);
  box-shadow: 0 10px 28px rgba(15, 14, 12, 0.16);
  transition: transform 0.2s, opacity 0.2s;
}
.lg-btn-primary:active, .tg-btn-login:active { transform: scale(0.98); opacity: 0.9; }
.lg-btn-primary:disabled, .tg-btn-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.lg-foot-links {
  text-align: center;
  font-size: 13px;
  color: var(--lg-muted);
}
.lg-foot-links a {
  color: var(--lg-accent);
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
}

.lg-subhint, .tg-subhint {
  text-align: center;
  font-size: 11px;
  color: var(--lg-muted);
  margin-top: 14px;
  line-height: 1.45;
}

.hidden { display: none !important; }
#registerForm.tg-panel-reg { margin: 0; padding: 0; border: none; }

.lg-foot {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-top: 20px;
  padding-top: 4px;
}

.lg-copy {
  text-align: center;
  font-size: 10px;
  color: var(--lg-muted);
  margin-top: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* 滑块弹窗 */
.tg-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 14, 12, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tg-modal.hidden { display: none !important; }
.tg-modal-card {
  width: 100%;
  max-width: 340px;
  border-radius: var(--lg-r);
  padding: 22px 20px 18px;
  background: var(--lg-surface);
  box-shadow: 0 24px 56px rgba(15, 14, 12, 0.2);
}
.tg-modal-title {
  text-align: center;
  font-family: var(--lg-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--lg-ink);
  margin-bottom: 16px;
}
.tg-slider-track {
  width: 100%;
  height: 48px;
  background: var(--lg-bg);
  border-radius: 12px;
  position: relative;
  margin-bottom: 14px;
  border: 1px solid var(--lg-line);
}
#modal-slider-handle {
  width: 52px;
  height: 44px;
  background: var(--lg-surface);
  border: 1px solid var(--lg-line);
  border-radius: 10px;
  position: absolute;
  top: 2px;
  left: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 14, 12, 0.08);
  z-index: 2;
}
#modal-slider-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: var(--lg-muted);
  pointer-events: none;
  white-space: nowrap;
}
.tg-modal-cancel {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--lg-line);
  background: var(--lg-bg);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--lg-muted);
  cursor: pointer;
  font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .lg-enter.is-ready { transition: none; }
}
