/* ============================================================
   登录 / 注册 / 我的档案 / 侧栏用户区
   与 style.css 共用同一套设计令牌，不引新变量
   ============================================================ */

/* ---------------- 全屏认证页 ---------------- */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
  background:
    radial-gradient(900px 520px at 12% -10%, var(--brand-ring), transparent 62%),
    radial-gradient(700px 420px at 108% 108%, rgba(180, 97, 31, .10), transparent 60%),
    var(--bg);
}

/* 关键：上面的 display:flex 会盖掉 [hidden] 的 UA 默认样式，
   不写这条登录成功后整页会被这块空容器遮住。 */
.auth-screen[hidden] { display: none !important; }

.auth-wrap {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  width: 100%;
  max-width: 940px;
  min-height: 560px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-2);
  overflow: hidden;
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 44px 40px;
  background: var(--band);
  color: var(--band-ink);
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(242, 237, 227, .16);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 40px;
}

.auth-logo .mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(242, 237, 227, .14);
}
.auth-logo .mark .brand-logo { width: 24px; height: 24px; }

.auth-logo .nm {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: .01em;
}

.auth-logo .sub {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .62;
  margin-top: 2px;
}

.auth-brand h2 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -.01em;
  margin: 0 0 14px;
}

.auth-brand p {
  font-size: 13px;
  line-height: 1.95;
  opacity: .78;
  margin: 0;
  max-width: 30em;
}

.auth-points {
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.auth-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.7;
  opacity: .84;
}

.auth-points li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: .62em;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  padding: 44px 44px 34px;
  min-width: 0;
}

.auth-panel h1 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 6px;
  color: var(--ink);
}

.auth-panel .lead {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 22px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.auth-tabs button {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .14s;
}

.auth-tabs button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.auth-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
}

.auth-field label .opt {
  font-weight: 400;
  color: var(--faint);
  margin-left: 5px;
  font-size: 10.5px;
}

.auth-field input,
.auth-field select,
.auth-field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .14s, box-shadow .14s;
}

.auth-field textarea { resize: vertical; min-height: 76px; line-height: 1.8; }

.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.auth-field input::placeholder,
.auth-field textarea::placeholder { color: var(--faint); }

.auth-err {
  display: none;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.65;
}

.auth-err.show { display: block; }

.auth-submit {
  height: 42px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s, transform .15s;
}

.auth-submit:hover:not(:disabled) { background: var(--brand-2); transform: translateY(-1px); }
.auth-submit:disabled { opacity: .6; cursor: default; }

.auth-foot {
  margin-top: auto;
  padding-top: 20px;
  font-size: 11px;
  line-height: 1.9;
  color: var(--faint);
}

.auth-foot code {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink-2);
}

/* ---------------- 侧栏用户区 ---------------- */
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background .14s;
}

.side-user:hover { background: var(--surface-2); }

.side-user .nm {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.4;
}

.side-user .rl {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.side-user .out {
  margin-left: auto;
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.side-user .out:hover { background: var(--red-soft); color: var(--red); }

.role-pill {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--brand-soft);
  color: var(--brand-2);
}

[data-theme="dark"] .role-pill { color: var(--brand); }

/* ---------------- 我的档案 ---------------- */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.profile-card-preview {
  position: sticky;
  top: 0;
}

.pv-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.pv-name { font-size: 15px; font-weight: 650; color: var(--ink); line-height: 1.4; }
.pv-role { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.pv-body { padding: 18px 20px; }

.pv-line {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-2);
  padding: 5px 0;
}

.pv-line b {
  flex: none;
  width: 52px;
  font-weight: 500;
  color: var(--faint);
}

.pv-empty {
  padding: 26px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.9;
}

.field-hint {
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1.7;
  margin-top: 2px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-picker .chip {
  height: 27px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11.5px;
  cursor: pointer;
  transition: .14s;
}

.tag-picker .chip:hover { border-color: var(--brand); color: var(--ink-2); }
.tag-picker .chip.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-2);
  font-weight: 600;
}

[data-theme="dark"] .tag-picker .chip.on { color: var(--brand); }

.profile-edited {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.7;
}

.profile-edited .btn { margin-left: auto; }

.profile-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 4px;
}

.profile-actions .save-state {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
}

.profile-actions .save-state.ok { color: var(--ok); }
.profile-actions .save-state.bad { color: var(--red); }

@media (max-width: 980px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card-preview { position: static; }
}

@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; min-height: 0; max-width: 460px; }
  .auth-brand { padding: 26px 26px 24px; }
  .auth-brand h2 { font-size: 20px; }
  .auth-brand p, .auth-points { display: none; }
  .auth-logo { margin-bottom: 0; }
  .auth-panel { padding: 26px 24px 22px; }
  .auth-row { grid-template-columns: 1fr; }
  .auth-screen { align-items: flex-start; padding: 20px 14px; }
}

/* 登录页里长得像链接的按钮（忘记密码 / 返回登录） */
.auth-link {
  display: block;
  margin: 4px auto 0;
  padding: 6px 2px;
  background: none;
  border: 0;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link:hover { opacity: .78; }
