/* ===========================================================
   REEL · 登录与账号界面
   =========================================================== */

/* 默认游客进入：登录只是一个浮层，页面内容始终在下面可见 */
body.auth-open { overflow: hidden; }

.auth-gate {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center; padding: 24px;
  background: rgba(8,9,12,.42);
  backdrop-filter: blur(5px) saturate(.95);
  -webkit-backdrop-filter: blur(5px) saturate(.95);
  overflow-y: auto;
  animation: gateFade .24s ease both;
}
@keyframes gateFade { from { opacity: 0; } to { opacity: 1; } }
.auth-gate[hidden] { display: none !important; }
.auth-panel {
  position: relative;
  width: min(430px, 100%); padding: 34px 34px 30px;
  background: #15171c; border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: panelIn .26s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes panelIn { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.auth-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; display: grid; place-items: center;
  padding: 0; border-radius: 50%; background: rgba(255,255,255,.05);
  border: 1px solid var(--line); color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer; transition: all .2s;
}
.auth-close:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.1); }
.auth-reason {
  margin: 14px 0 0; padding: 9px 12px;
  font-size: 11.5px; line-height: 1.65; color: var(--gold-soft);
  background: rgba(216,172,106,.09); border-left: 2px solid var(--gold-deep);
  border-radius: 0 6px 6px 0;
}
.auth-reason[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .auth-gate, .auth-panel { animation: none; }
}
.auth-kicker { margin: 0 0 12px; font-family: var(--serif); font-size: 11px; letter-spacing: .26em; color: var(--gold-deep); }
.auth-panel h2 { margin: 0; font-size: 23px; font-weight: 600; }
.auth-lead { margin: 12px 0 24px; font-size: 12px; line-height: 1.9; color: var(--text-dim); }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 3px; background: #101216; border: 1px solid var(--line); border-radius: 9px; }
.auth-tabs button { flex: 1; padding: 8px 6px; background: none; border: 0; border-radius: 6px; color: var(--muted); font-size: 12px; transition: all .2s; }
.auth-tabs button.active { background: #2a2b30; color: var(--gold-soft); font-weight: 600; }
.auth-field { display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: var(--muted); }
.auth-field input, .auth-code-row input {
  width: 100%; padding: 10px 12px; background: #1c1e23;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: 13px; outline: none;
}
.auth-field input:focus, .auth-code-row input:focus { border-color: var(--gold-deep); }
.auth-field input::placeholder, .auth-code-row input::placeholder { color: #63656c; }
.auth-code-row { display: flex; gap: 9px; margin-top: 12px; }
.auth-code-row input { flex: 1; min-width: 0; }
.auth-code-row .btn { flex: none; padding: 0 14px; }
.auth-code-row .btn:disabled { opacity: .5; cursor: default; }
.auth-msg { min-height: 18px; margin: 12px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.auth-msg.error { color: #e9a097; }
.auth-msg.ok { color: var(--gold-soft); }
.auth-submit { width: 100%; margin-top: 6px; padding: 11px; font-size: 13px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; font-size: 11px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-oauth { width: 100%; margin-top: 8px; padding: 10px; text-align: center; }
.auth-note { margin: 16px 0 0; font-size: 10px; line-height: 1.7; color: var(--muted); }
.auth-guest-row { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.auth-guest-btn {
  align-self: flex-start; padding: 6px 14px; background: none;
  border: 1px solid var(--line-strong); border-radius: 20px;
  color: var(--text-dim); font-size: 12px; transition: all .2s;
}
.auth-guest-btn:hover { color: var(--gold-soft); border-color: var(--gold-deep); }
.auth-guest-row span { font-size: 10px; line-height: 1.7; color: var(--muted); }
.auth-offline { margin-top: 18px; width: 100%; }
.auth-status {
  position: fixed; right: 18px; bottom: 18px; z-index: 10001;
  padding: 8px 14px; border-radius: 20px; font-size: 11px;
  background: #23252a; border: 1px solid var(--line-strong); color: var(--text-dim);
}
.auth-status.error { border-color: #8a4a42; color: #e9a097; }

/* ---------- 顶栏用户区 ---------- */
.user-box { display: flex; align-items: center; gap: 9px; flex: none; }
.user-avatar {
  width: 28px; height: 28px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--gold-deep); color: #fff;
  font-family: var(--serif); font-size: 12px; line-height: 1;
  cursor: pointer; transition: box-shadow .2s, transform .2s;
}
.user-avatar:hover { transform: translateY(-1px); box-shadow: 0 0 0 3px rgba(216,172,106,.18); }
.user-avatar:focus-visible, .user-center:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.user-avatar.has-image { color: transparent; }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-dim); }
.user-center {
  padding: 3px 10px; background: none; border: 1px solid var(--line-strong);
  border-radius: 20px; color: var(--muted); font-size: 11px; white-space: nowrap;
}
.user-center:hover { color: var(--gold-soft); border-color: var(--gold-deep); }
.user-logout { padding: 3px 10px; background: none; border: 1px solid var(--line-strong); border-radius: 20px; color: var(--muted); font-size: 11px; }
.user-logout:hover { color: var(--gold-soft); border-color: var(--gold-deep); }
.sync-state { font-size: 10px; color: var(--muted); white-space: nowrap; }
.sync-state.error { color: #e9a097; }
.guest-box { gap: 10px; }
.guest-hint { font-size: 10px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.guest-login {
  padding: 4px 12px; background: none; border: 1px solid var(--gold-deep);
  border-radius: 20px; color: var(--gold-soft); font-size: 11px; white-space: nowrap;
}
.guest-login:hover { background: rgba(216,172,106,.12); }

/* ---------- 个人中心 ---------- */
.profile-layer {
  position: fixed; inset: 0; z-index: 10050;
  display: grid; place-items: center; padding: 22px;
  background: rgba(6,7,9,.82); backdrop-filter: blur(10px);
  overflow-y: auto;
}
.profile-layer[hidden] { display: none !important; }
.profile-panel {
  width: min(520px, 100%); max-height: calc(100vh - 44px);
  display: flex; flex-direction: column;
  background: #15171c; border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: profileIn .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes profileIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.profile-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 26px 18px; border-bottom: 1px solid var(--line);
}
.profile-kicker { margin: 0 0 8px; font-family: var(--serif); font-size: 10px; letter-spacing: .26em; color: var(--gold-deep); }
.profile-head h2 { margin: 0; font-size: 21px; font-weight: 600; }
.profile-close {
  width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 50%;
  background: none; color: var(--muted); font-size: 18px; line-height: 1;
}
.profile-close:hover { color: var(--gold-soft); border-color: var(--gold-deep); }
.profile-body { padding: 22px 26px 10px; overflow-y: auto; }
.profile-identity { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.profile-preview {
  flex: none; width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  border: 2px solid var(--gold-deep); color: #fff;
  font-family: var(--serif); font-size: 27px; line-height: 1;
}
.profile-preview.has-image { color: transparent; }
.profile-identity-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-identity-text strong { font-size: 17px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity-text span { font-family: var(--serif); font-size: 13px; color: var(--gold); }
.profile-identity-text em { font-style: normal; font-size: 10px; color: var(--muted); line-height: 1.7; }

.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.profile-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.profile-field > span { font-size: 11px; color: var(--text-dim); }
.profile-field small, .profile-label small { display: block; font-size: 10px; line-height: 1.6; color: var(--muted); }
.profile-field input, .profile-id-row input {
  width: 100%; padding: 9px 11px; background: #1c1e23; border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); font-size: 13px; outline: none;
}
.profile-field input:focus, .profile-id-row:focus-within { border-color: var(--gold-deep); }
.profile-field input::placeholder { color: #63656c; }
.profile-id-row { display: flex; align-items: center; gap: 0; background: #1c1e23; border: 1px solid var(--line); border-radius: 8px; }
.profile-id-row i { flex: none; padding: 0 0 0 11px; font-style: normal; font-family: var(--serif); font-size: 14px; color: var(--gold); }
.profile-id-row input { border: 0; background: none; padding-left: 4px; }
.profile-id-row input:focus { outline: none; }

.profile-avatar-section { margin-bottom: 20px; }
.profile-label { margin: 0 0 10px; font-size: 11px; color: var(--text-dim); }
.profile-label small { display: inline; }
.profile-presets { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }
.preset-dot {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 2px solid transparent; display: grid; place-items: center;
  color: #fff; font-family: var(--serif); font-size: 15px;
  transition: transform .18s, box-shadow .18s;
}
.preset-dot:hover { transform: scale(1.09); }
.preset-dot.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,172,106,.18); }
.profile-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.profile-upload { display: inline-block; cursor: pointer; }
.profile-file-name { min-width: 0; flex: 1 1 120px; font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-meta { padding: 14px 0 4px; border-top: 1px solid var(--line); }
.profile-meta > span { font-size: 10px; color: var(--muted); }
.profile-uid-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.profile-uid-row code {
  flex: 1; min-width: 0; padding: 7px 10px; background: #101216;
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-uid-row .btn { flex: none; padding: 6px 12px; }
.profile-msg { min-height: 18px; margin: 12px 0 4px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.profile-msg.error { color: #e9a097; }
.profile-msg.ok { color: var(--gold-soft); }
.profile-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 26px 20px; border-top: 1px solid var(--line);
}
.profile-foot .btn { padding: 9px 20px; }

@media (max-width: 640px) {
  .auth-panel { padding: 26px 22px 24px; }
  .user-name, .user-center, .sync-state, .guest-hint { display: none; }
  /* 站点移动端把 .btn 撑成 100%，个人中心内要恢复自然宽度 */
  .profile-layer .btn { width: auto; }
  .profile-layer { padding: 12px; }
  .profile-panel { max-height: calc(100vh - 24px); }
  .profile-head { padding: 20px 18px 14px; }
  .profile-body { padding: 18px 18px 8px; }
  .profile-foot { padding: 14px 18px 16px; }
  .profile-fields { grid-template-columns: 1fr; }
  .profile-preview { width: 56px; height: 56px; font-size: 22px; }
  .profile-presets { gap: 7px; }
  .preset-dot { width: 32px; height: 32px; font-size: 13px; }
  .profile-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-panel { animation: none; }
}


/* ---------- 用户名 + 密码登录表单 ---------- */
.auth-panel .auth-field + .auth-field { margin-top: 14px; }
.auth-pass-row {
  display: flex; align-items: center; gap: 4px;
  padding: 0 6px 0 0; background: #1c1e23;
  border: 1px solid var(--line); border-radius: 8px;
}
.auth-pass-row:focus-within { border-color: var(--gold-deep); }
.auth-pass-row input {
  flex: 1; min-width: 0; padding-left: 12px;
  border: 0 !important; background: none !important;
}
.auth-pass-row input:focus { outline: none; }
.auth-eye {
  flex: none; padding: 5px 8px; background: none; border: 0;
  color: var(--muted); font-size: 11px;
}
.auth-eye:hover { color: var(--gold-soft); }
.auth-account-list {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 16px 0 0; font-size: 11px; color: var(--muted);
}
.auth-account-list[hidden] { display: none !important; }
.auth-account-chip {
  padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 20px;
  background: none; color: var(--text-dim); font-size: 11px; font-family: var(--num);
}
.auth-account-chip:hover { border-color: var(--gold-deep); color: var(--gold-soft); }

/* ---------- 个人中心：修改密码 ---------- */
.profile-security { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.profile-security > span { font-size: 11px; color: var(--text-dim); }
.profile-pass-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.profile-pass-grid input {
  width: 100%; padding: 8px 10px; background: #1c1e23;
  border: 1px solid var(--line); border-radius: 7px;
  color: var(--text); font-size: 12px; outline: none;
}
.profile-pass-grid input:focus { border-color: var(--gold-deep); }
.profile-pass-grid input::placeholder { color: #63656c; }
.profile-security-note { margin: 10px 0 0; font-size: 10px; line-height: 1.7; color: var(--muted); }

@media (max-width: 640px) {
  .profile-pass-grid { grid-template-columns: 1fr; }
}
