/* ============================================================
   auth.css — 认证页（登录/注册/未确认/403）
   浮动标签 + 渐变边框动画按钮 + 居中卡片
   ============================================================ */

:root {
  --auth-accent: #2d5a3d;
  --auth-gold: #c9b896;
  --auth-bg: #fafaf6;
  --auth-text: #1a1a1a;
  --auth-muted: #888;
  --auth-border: #e0ded8;
  --auth-radius: 8px;
}

/* ---- 语录海报背景层（左对齐，深色，花哨艺术字） ---- */
.auth-quote-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(4px, 1.5vh, 14px);
  padding: 2rem 28vw 2rem 5vw;
  pointer-events: none;
  user-select: none;
  background:
    radial-gradient(ellipse at 20% 25%, rgba(201,184,150,0.3) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 70%, rgba(160,110,50,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(45,90,61,0.15) 0%, transparent 55%),
    linear-gradient(165deg, #fdfaf5 0%, #f6efe0 40%, #fdf9f2 65%, #f3ede0 100%);
}

/* 所有语录行 — 交互式逐行动画容器 */
.text-line {
  z-index: 0;
  margin: 0;
  line-height: 1.15;
  pointer-events: auto;
  cursor: default;
  text-align: left;
  width: 100%;
  max-width: 600px;
  transition: opacity 0.4s ease;
  will-change: transform, opacity, filter;
}
/* 逐字 span */
.text-line .char {
  display: inline-block;
  will-change: transform, opacity;
}

/* Playfair Display — 7行断句，强调 + 长句缩小 */
.text-line[data-ql="1"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 400; font-style: italic;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  color: rgba(140,110,70,0.5);
}
.text-line[data-ql="2"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 900; font-style: italic;
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  color: rgba(185,130,55,0.62);
  letter-spacing: -0.03em;
}
.text-line[data-ql="3"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 400; font-style: italic;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  color: rgba(45,90,61,0.42);
}
.text-line[data-ql="4"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 500; font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: rgba(150,95,65,0.52);
}
.text-line[data-ql="5"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 400; font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  color: rgba(45,90,61,0.38);
  letter-spacing: 0.01em;
}
.text-line[data-ql="6"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 500; font-style: italic;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  color: rgba(120,90,55,0.48);
}
.text-line[data-ql="7"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 900; font-style: italic;
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  color: rgba(170,120,50,0.65);
  letter-spacing: -0.03em;
}

/* ---- Register 页 Alan Kay 语录（4行，更大号） ---- */
.auth-quote-bg.reg-bg .text-line[data-ql="1"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 400; font-style: italic;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  color: rgba(140,95,55,0.5);
}
.auth-quote-bg.reg-bg .text-line[data-ql="2"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 900; font-style: italic;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  color: rgba(180,120,45,0.6);
  letter-spacing: -0.03em;
}
.auth-quote-bg.reg-bg .text-line[data-ql="3"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 400; font-style: italic;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: rgba(45,90,61,0.42);
}
.auth-quote-bg.reg-bg .text-line[data-ql="4"] {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 900; font-style: italic;
  font-size: clamp(3rem, 8vw, 6.5rem);
  color: rgba(160,100,40,0.6);
  letter-spacing: -0.03em;
}

/* ---- 页面容器（卡片右移，露出左侧语录） ---- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: calc(100vh - 64px - 60px);
  padding: 2rem 2rem;
  position: relative;
  z-index: 1;
}

/* ---- 卡片（高透 + 大距离右移 + 缩小） ---- */
.auth-card {
  width: 100%;
  max-width: 340px;
  padding: 34px 30px;
  margin-right: -80px;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--auth-radius);
  border: 1px solid rgba(45,90,61,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  position: relative;
  overflow: visible;
  animation: cardFloatUp 0.9s 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes cardFloatUp {
  from {
    opacity: 0;
    transform: translateY(80px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 卡片顶部装饰条 */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--auth-accent), var(--auth-gold), var(--auth-accent), transparent);
  border-radius: 0 0 3px 3px;
  opacity: 0.5;
}

/* 标题 */
.auth-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--auth-text);
  text-align: center;
  margin: 8px 0 32px;
  letter-spacing: -0.01em;
}

/* ============================================================
   浮动标签输入框
   ============================================================ */
.auth-field {
  position: relative;
  margin-bottom: 28px;
}

.auth-field input {
  width: 100%;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--auth-text);
  border: none;
  border-bottom: 1px solid var(--auth-border);
  outline: none;
  background: transparent;
  transition: border-color 0.3s;
}

.auth-field input:focus {
  border-bottom-color: var(--auth-accent);
}

/* 浮动标签 */
.auth-field label {
  position: absolute;
  top: 10px;
  left: 0;
  font-size: 0.9rem;
  color: var(--auth-muted);
  pointer-events: none;
  transition: all 0.35s ease;
  letter-spacing: 0.02em;
}

.auth-field input:focus ~ label,
.auth-field input:not(:placeholder-shown) ~ label {
  top: -18px;
  left: 0;
  font-size: 0.72rem;
  color: var(--auth-accent);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* placeholder 必须为空才能触发 :placeholder-shown */
.auth-field input::placeholder {
  color: transparent;
}

/* 错误提示 */
.auth-error {
  font-size: 0.73rem;
  color: #c0392b;
  margin-top: 4px;
  display: block;
}

/* 复选框 */
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--auth-muted);
}

.auth-check input[type="checkbox"] {
  accent-color: var(--auth-accent);
  width: 16px; height: 16px;
}

/* ============================================================
   渐变边框动画按钮
   ============================================================ */
.auth-btn {
  position: relative;
  display: inline-block;
  width: 100%;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--auth-accent);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s ease;
  text-align: center;
  text-decoration: none;
}

.auth-btn:hover {
  background: #3d7a53;
  color: #fff;
}

/* 边框跑马灯动画（4条边线） */
.auth-btn-animated {
  background: var(--auth-accent);
  color: #fff;
}

.auth-btn-animated span {
  position: absolute;
  display: block;
}

/* 上边线 */
.auth-btn-animated span:nth-child(1) {
  top: 0; left: -100%;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--auth-gold));
  animation: auth-line1 2s linear infinite;
}
@keyframes auth-line1 {
  0%   { left: -100%; }
  50%  { left: 100%; }
  100% { left: 100%; }
}

/* 右边线 */
.auth-btn-animated span:nth-child(2) {
  top: -100%; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--auth-gold));
  animation: auth-line2 2s linear infinite;
  animation-delay: 0.5s;
}
@keyframes auth-line2 {
  0%   { top: -100%; }
  50%  { top: 100%; }
  100% { top: 100%; }
}

/* 下边线 */
.auth-btn-animated span:nth-child(3) {
  bottom: 0; right: -100%;
  width: 100%; height: 1px;
  background: linear-gradient(270deg, transparent, var(--auth-gold));
  animation: auth-line3 2s linear infinite;
  animation-delay: 1s;
}
@keyframes auth-line3 {
  0%   { right: -100%; }
  50%  { right: 100%; }
  100% { right: 100%; }
}

/* 左边线 */
.auth-btn-animated span:nth-child(4) {
  bottom: -100%; left: 0;
  width: 1px; height: 100%;
  background: linear-gradient(360deg, transparent, var(--auth-gold));
  animation: auth-line4 2s linear infinite;
  animation-delay: 1.5s;
}
@keyframes auth-line4 {
  0%   { bottom: -100%; }
  50%  { bottom: 100%; }
  100% { bottom: 100%; }
}

/* ---- 底部链接 ---- */
.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.84rem;
  color: var(--auth-muted);
}

.auth-footer a {
  color: var(--auth-accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s;
  border-bottom: 1px solid transparent;
}

.auth-footer a:hover {
  border-bottom-color: var(--auth-accent);
}

/* ============================================================
   未确认页面
   ============================================================ */
.auth-message {
  text-align: center;
  padding: 20px 0;
}

.auth-message .icon-envelope {
  font-size: 2.5rem;
  color: var(--auth-accent);
  opacity: 0.4;
  margin-bottom: 16px;
}

.auth-message h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--auth-text);
  margin-bottom: 10px;
}

.auth-message p {
  font-size: 0.88rem;
  color: var(--auth-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}

.auth-message .resend-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 22px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--auth-accent);
  border: 1px solid var(--auth-accent);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s;
}

.auth-message .resend-link:hover {
  background: var(--auth-accent);
  color: #fff;
}

/* ============================================================
   403 禁止访问
   ============================================================ */
.auth-error-page {
  text-align: center;
  padding: 60px 2rem;
}

.auth-error-page .error-code {
  font-size: 7rem;
  font-weight: 200;
  color: var(--auth-accent);
  opacity: 0.3;
  line-height: 1;
  letter-spacing: -0.04em;
}

.auth-error-page h2 {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--auth-text);
  margin: 16px 0 8px;
}

.auth-error-page p {
  color: var(--auth-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.auth-error-page .back-link {
  color: var(--auth-accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--auth-accent);
  padding-bottom: 2px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
  }
  .auth-error-page .error-code {
    font-size: 4.5rem;
  }
}
