/* ============ 登录页 · 罗德岛身份验证 ============ */
:root {
  --accent: #e8414b;
  --accent-rgb: 232, 65, 75;
  --text: #f2f3f5;
  --muted: #a3a8b1;
  --dim: #6c717b;
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.24);
  --yellow: #ffd23f;
  --font-en: "Oswald", "Bahnschrift", "DIN Alternate", "Arial Narrow", sans-serif;
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --pad: clamp(18px, 4vw, 64px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #07080b; color: var(--text); font-family: var(--font-cn); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; display: flex; flex-direction: column; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: rgba(var(--accent-rgb), 0.45); }

/* 背景层 */
.lg-bg { position: fixed; inset: -3%; background: #0b0c10 center/cover no-repeat; filter: saturate(1.05) brightness(0.62); animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
.lg-shade { position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 72% 40%, rgba(var(--accent-rgb), 0.12), transparent 55%),
    linear-gradient(90deg, rgba(6, 7, 10, 0.2) 0%, rgba(6, 7, 10, 0.35) 45%, rgba(6, 7, 10, 0.88) 100%),
    linear-gradient(0deg, rgba(6, 7, 10, 0.9) 0%, transparent 35%),
    linear-gradient(180deg, rgba(6, 7, 10, 0.7) 0%, transparent 20%); }
.lg-grid { position: fixed; inset: 0; pointer-events: none; opacity: 0.5;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 80px 80px;
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent); }
.lg-art { position: fixed; left: clamp(-80px, 18vw, 22vw); bottom: -4vh; height: 104vh; max-width: none; pointer-events: none; user-select: none;
  filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.55)); opacity: 0; animation: artIn 1.2s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes artIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 0.96; transform: none; } }
.lg-sweep { position: fixed; top: 0; bottom: 0; width: 30vw; left: -40vw; pointer-events: none; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.16), rgba(255, 255, 255, 0.08), transparent);
  animation: sweep 1.4s 0.35s cubic-bezier(0.55, 0.05, 0.3, 1) forwards; }
@keyframes sweep { to { left: 120vw; } }

/* 顶栏 */
.lg-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 18px) var(--pad) 0; animation: fadeDown 0.6s ease both; }
.lg-brand { display: flex; align-items: center; gap: 12px; font: 600 15px/1 var(--font-en); letter-spacing: 0.36em; }
.lg-brand i { width: 14px; height: 14px; background: var(--accent); transform: rotate(45deg); box-shadow: 0 0 12px var(--accent); }
.lg-brand span { font: 400 12px/1 var(--font-cn); letter-spacing: 0.2em; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line-2); }
.lg-meta { display: flex; align-items: center; gap: 12px; font: 400 12px/1 var(--font-en); letter-spacing: 0.2em; color: var(--muted); }
.lg-meta .sep { width: 1px; height: 12px; background: var(--line-2); }
#lgClock { font-size: 16px; color: #fff; letter-spacing: 0.08em; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } }

/* 主体 */
.lg-main { position: relative; z-index: 2; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  align-items: center; gap: clamp(24px, 5vw, 96px); padding: 32px var(--pad); max-width: 1680px; width: 100%; margin: 0 auto; }
.lg-hero { align-self: end; padding-bottom: 6vh; max-width: 520px; justify-self: start; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
  animation: fadeUp 0.8s 0.2s ease both; }
.lg-kicker { font: 500 12px/1 var(--font-en); letter-spacing: 0.42em; color: var(--accent); }
.lg-hero h1 { margin: 16px 0 14px; font-size: clamp(34px, 4.2vw, 60px); line-height: 1.12; font-weight: 800; letter-spacing: 0.04em; }
.lg-hero h1 em { font-style: normal; color: var(--accent); }
.lg-hero p { margin: 0; font-size: 14px; line-height: 1.9; color: rgba(255, 255, 255, 0.78); }
.lg-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.lg-points li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.lg-points b { font: 500 12px/1 var(--font-en); color: var(--yellow); letter-spacing: 0.1em; padding: 4px 6px; border: 1px solid rgba(255, 210, 63, 0.45); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

/* 登录卡片 */
.lg-card { position: relative; justify-self: end; width: 100%; padding: 28px 28px 22px;
  background: linear-gradient(160deg, rgba(20, 22, 28, 0.86), rgba(10, 11, 14, 0.92));
  border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); animation: cardIn 0.7s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lg-card::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--accent), transparent 80%); }
.lg-card::after { content: ""; position: absolute; right: 0; top: 0; width: 90px; height: 3px; background: var(--accent); }
@keyframes cardIn { from { opacity: 0; transform: translateX(26px); } }
.lg-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.lg-card-title { font-size: 20px; font-weight: 700; letter-spacing: 0.06em; }
.lg-card-title span { display: block; font: 500 11px/1 var(--font-en); letter-spacing: 0.4em; color: var(--accent); margin-bottom: 8px; }
.lg-tabs { display: flex; border: 1px solid var(--line-2); }
.lg-tabs button { padding: 7px 16px; font-size: 13px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.lg-tabs button.on { background: #fff; color: #111; font-weight: 600; }
.lg-tabs button:not(.on):hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.lg-field { display: block; margin-bottom: 16px; }
.lg-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; letter-spacing: 0.08em; }
.lg-input { position: relative; display: flex; align-items: center; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.lg-input:focus-within { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.06); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14); }
.lg-input > svg { width: 18px; height: 18px; margin: 0 4px 0 13px; color: var(--dim); flex: none; transition: color 0.2s; }
.lg-input:focus-within > svg { color: var(--accent); }
.lg-input input { flex: 1; min-width: 0; height: 46px; padding: 0 12px 0 8px; background: transparent; border: 0; outline: none; font-size: 15px; }
.lg-input input::placeholder { color: var(--dim); }
.lg-input input:-webkit-autofill { -webkit-text-fill-color: var(--text); transition: background-color 9999s; }
.lg-eye { width: 42px; height: 46px; display: grid; place-items: center; color: var(--dim); }
.lg-eye svg { width: 18px; height: 18px; }
.lg-eye:hover, .lg-eye.on { color: #fff; }

.lg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.lg-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.lg-check input { position: absolute; opacity: 0; pointer-events: none; }
.lg-check i { width: 16px; height: 16px; border: 1px solid var(--line-2); display: grid; place-items: center; transition: all 0.15s; }
.lg-check input:checked + i { background: var(--accent); border-color: var(--accent); }
.lg-check input:checked + i::after { content: ""; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.lg-check input:focus-visible + i { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.3); }
.lg-hint { color: var(--dim); }

.lg-error { margin: -4px 0 14px; padding: 9px 12px; font-size: 13px; color: #ffc4c4; background: rgba(255, 93, 93, 0.1);
  border-left: 3px solid #ff5d5d; animation: shake 0.35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.lg-submit { position: relative; width: 100%; height: 50px; display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 0.3em; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); transition: filter 0.2s, transform 0.1s; }
.lg-submit::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.6s; }
.lg-submit:hover::before { transform: translateX(100%); }
.lg-submit:hover { filter: brightness(1.08); }
.lg-submit:active { transform: translateY(1px); }
.lg-submit[disabled] { filter: grayscale(0.4) brightness(0.8); cursor: wait; }
.lg-arrow { width: 22px; height: 2px; background: #fff; position: relative; }
.lg-arrow::after { content: ""; position: absolute; right: 0; top: -4px; width: 8px; height: 8px; border: solid #fff; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.lg-submit.busy .lg-arrow { animation: busy 0.8s ease-in-out infinite alternate; }
@keyframes busy { to { transform: translateX(8px); } }
.lg-closed { margin: 14px 0 0; font-size: 12px; color: var(--yellow); }

.lg-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--dim); letter-spacing: 0.06em; }
.lg-card-foot i { width: 6px; height: 6px; border-radius: 50%; background: #46d483; box-shadow: 0 0 8px #46d483; }

.lg-foot { position: relative; z-index: 2; padding: 0 var(--pad) calc(env(safe-area-inset-bottom) + 16px); font-size: 11px; color: var(--dim); text-align: right; }

/* 中等屏幕：人物往左收 */
@media (max-width: 1180px) {
  .lg-art { left: -10vw; opacity: 0.8; }
  .lg-hero { max-width: 420px; }
}
/* 窄屏 / 手机：单列，人物退到背景 */
@media (max-width: 860px) {
  .lg-main { grid-template-columns: 1fr; align-content: center; padding-top: 12px; }
  .lg-hero { align-self: auto; padding: 0; text-align: left; }
  .lg-hero h1 { font-size: 30px; margin: 10px 0 8px; }
  .lg-hero p, .lg-points { display: none; }
  .lg-card { justify-self: stretch; max-width: 460px; margin: 0 auto; padding: 22px 20px 18px; }
  .lg-art { left: 50%; transform: translateX(-30%); height: 82vh; bottom: 0; animation: none; opacity: 0.32; }
  .lg-meta span:not(#lgClock), .lg-meta .sep { display: none; }
  .lg-foot { text-align: center; }
}
@media (max-width: 420px) {
  .lg-brand { font-size: 13px; letter-spacing: 0.24em; }
  .lg-brand span { display: none; }
  .lg-card-head { flex-direction: column; align-items: stretch; }
  .lg-tabs button { flex: 1; }
}
/* 横屏手机：高度很小 */
@media (max-height: 520px) and (min-width: 600px) {
  .lg-main { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); padding-top: 8px; padding-bottom: 8px; }
  .lg-hero p, .lg-points, .lg-foot { display: none; }
  .lg-card { padding: 16px 20px 12px; }
  .lg-card-head { margin-bottom: 12px; }
  .lg-field { margin-bottom: 10px; }
  .lg-input input { height: 40px; }
  .lg-card-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .lg-art { opacity: 0.96; }
}
