/* ============================================================
   个人影音播放厅 · 登录页
   ============================================================ */

:root {
  --bg: #0a0c10;
  --panel: #131922;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8edf7;
  --text-dim: #93a0b6;
  --accent: #5b7cfa;
  --accent-2: #8b5cf6;
  --danger: #ff6b6b;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 12% -6%, rgba(91, 124, 250, 0.22), transparent 62%),
    radial-gradient(760px 420px at 100% 10%, rgba(139, 92, 246, 0.16), transparent 58%),
    radial-gradient(680px 380px at 45% 110%, rgba(63, 185, 163, 0.08), transparent 60%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 20px 28px;
}

/* ---------- 顶部 ---------- */

.login-top {
  width: min(440px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(91, 124, 250, 0.35);
}

.brand__mark svg { width: 17px; height: 17px; fill: #fff; }
.brand__text { font-size: 16px; }
.brand__text b { font-weight: 700; color: #fff; }

.login-back { font-size: 12.5px; color: var(--text-dim); transition: color 0.15s ease; }
.login-back:hover { color: #fff; }

/* ---------- 卡片 ---------- */

.login-card {
  width: min(440px, 100%);
  padding: 30px 30px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.login-head { text-align: center; margin-bottom: 22px; }

.login-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2.4px;
  color: #b9c8ff;
  border: 1px solid rgba(91, 124, 250, 0.42);
  background: rgba(91, 124, 250, 0.12);
  border-radius: 999px;
  padding: 5px 11px;
  margin-bottom: 14px;
}

.login-head h1 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.login-head p {
  margin: 0 auto;
  max-width: 320px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8d99ad;
}

/* 未登录被播放页拦截时的提示 */
.guard-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffd9a6;
  background: rgba(242, 193, 78, 0.1);
  border: 1px solid rgba(242, 193, 78, 0.3);
  border-radius: 9px;
}

.guard-notice[hidden] { display: none; }

.guard-notice__icon { width: 15px; height: 15px; fill: #f2c14e; flex: none; }

/* 目标影片预览 */
.movie-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.movie-preview[hidden] { display: none; }

.movie-preview__cover {
  flex: none;
  width: 112px;
  height: 63px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #1b2740, #0b1019);
}

.movie-preview__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.movie-preview__meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.movie-preview__eyebrow { font-size: 10.5px; letter-spacing: 1.2px; color: #7d8a9f; }

.movie-preview__meta strong {
  font-size: 15px;
  color: #f2f6ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-preview__meta small {
  font-size: 11.5px;
  color: #8794a8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 表单 ---------- */

.login-form { display: grid; gap: 14px; }

.field { display: grid; gap: 7px; }

.field label { font-size: 12px; color: #9aa7bc; letter-spacing: 0.4px; }

.field__box {
  position: relative;
  display: flex;
  align-items: center;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 15, 0.72);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input::placeholder { color: #5f6b80; }

.field input:focus {
  border-color: rgba(91, 124, 250, 0.75);
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.16);
}

.field input[aria-invalid="true"] {
  border-color: rgba(255, 107, 107, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.14);
}

/* 账号框不需要右侧留白（只有密码框有眼睛按钮） */
.field:first-child input { padding-right: 14px; }

.pwd-toggle {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #93a0b6;
  transition: background 0.15s ease, color 0.15s ease;
}

.pwd-toggle:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.pwd-toggle svg { width: 19px; height: 19px; fill: currentColor; }
.pwd-toggle .icon--eye-off { display: none; }
.pwd-toggle[aria-pressed="true"] .icon--eye { display: none; }
.pwd-toggle[aria-pressed="true"] .icon--eye-off { display: block; }

.form-error {
  margin: 0;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffc2c2;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.32);
  border-radius: 9px;
}

.form-error[hidden] { display: none; }

.submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 12px 30px rgba(91, 124, 250, 0.32);
  transition: filter 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.submit:hover:not(:disabled) { filter: brightness(1.08); }
.submit:active:not(:disabled) { transform: translateY(1px); }

.submit:disabled { opacity: 0.72; cursor: progress; }

.submit__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: login-spin 0.8s linear infinite;
}

.submit__spinner[hidden] { display: none; }

@keyframes login-spin { to { transform: rotate(360deg); } }

/* ---------- 底部说明 ---------- */

.demo-line {
  margin: 18px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #6d7a8e;
}

.demo-line code {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  padding: 1px 6px;
  color: #b9c8ff;
  font-size: 11.5px;
}

.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #7d8a9f;
  text-align: center;
}

.login-foot__icon { width: 14px; height: 14px; fill: #7d8a9f; flex: none; }

.login-copy {
  margin-top: auto;
  padding-top: 22px;
  font-size: 11px;
  color: #5a6578;
  text-align: center;
}

/* ---------- 响应式 ---------- */

@media (max-width: 480px) {
  .login-wrap { padding: 18px 14px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .login-card { padding: 24px 20px 20px; border-radius: 16px; }
  .login-head h1 { font-size: 22px; }
  .login-head p { font-size: 12px; }
  .movie-preview__cover { width: 92px; height: 52px; }
  .field input { height: 44px; }
  .submit { height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
