/* 主题与用户中心（被 index / watch / login 共用） */

/* ---------------- 亮色主题 ---------------- */
:root[data-theme="light"] {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: #e3e8f0;
  --text: #101828;
  --muted: #667085;
  --accent: #2f6bf7;
  --ok: #15803d;
  --warn: #b45309;
  --err: #d92d20;
}
:root[data-theme="light"] body { background: var(--bg); color: var(--text); }
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}
:root[data-theme="light"] code { background: #eef2f8 !important; color: #1d2939 !important; }
:root[data-theme="light"] .pill { background: #f2f5fa; }
:root[data-theme="light"] .uc-panel { box-shadow: 0 18px 50px rgba(16, 24, 40, .18); }

/* ---------------- 用户中心入口 ---------------- */
.user-slot { position: relative; z-index: 30; }
.uc-entry {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 99px; padding: 4px 12px 4px 4px; cursor: pointer;
  color: var(--text); font-size: 13px; line-height: 1;
  transition: border-color .15s ease, transform .1s ease;
}
.uc-entry:hover { border-color: var(--accent); }
.uc-entry:active { transform: scale(.98); }
.uc-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  background: var(--accent); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 600; overflow: hidden;
  flex: 0 0 auto;
}
.uc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uc-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.uc-login-link { font-size: 13px; color: var(--accent); text-decoration: none; }

/* ---------------- 面板 ---------------- */
.uc-mask {
  position: fixed; inset: 0; background: rgba(4, 7, 12, .55);
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 56px 16px 16px; z-index: 200; backdrop-filter: blur(2px);
}
.uc-panel {
  width: 100%; max-width: 380px; max-height: calc(100vh - 80px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; color: var(--text);
  animation: ucIn .16s ease-out;
}
@keyframes ucIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.uc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.uc-head .uc-avatar { width: 54px; height: 54px; font-size: 20px; position: relative; overflow: visible; }
.uc-head .uc-avatar img { border-radius: 50%; }
.uc-head .uc-avatar.big { cursor: pointer; }
.uc-head .uc-avatar.big::after {
  content: "换"; position: absolute; right: -2px; bottom: -2px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--panel);
}
.uc-meta { min-width: 0; }
.uc-meta .n { font-size: 15px; font-weight: 600; }
.uc-meta .e { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-label { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.uc-field { display: flex; gap: 8px; }
.uc-field input { flex: 1; width: auto !important; letter-spacing: normal !important; }
.uc-btn {
  font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
}
.uc-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.uc-btn.danger { color: var(--err); border-color: var(--err); }
.uc-seg { display: flex; gap: 6px; }
.uc-seg button {
  flex: 1; font: inherit; font-size: 12px; padding: 8px 0; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.uc-seg button.on { border-color: var(--accent); color: var(--accent); background: rgba(47, 107, 247, .08); font-weight: 600; }
.uc-links { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 2px; }
.uc-links a, .uc-links button.link {
  display: block; text-align: left; width: 100%; font: inherit; font-size: 13px;
  padding: 10px 4px; color: var(--text); text-decoration: none; background: none;
  border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.uc-links a:last-child, .uc-links button.link:last-child { border-bottom: 0; }
.uc-links .muted { color: var(--muted); font-size: 12px; margin-left: 6px; }
.uc-msg { font-size: 12px; margin-top: 10px; min-height: 16px; }
.uc-msg.ok { color: var(--ok); }
.uc-msg.err { color: var(--err); }
.uc-danger-zone { margin-top: 12px; }
.uc-close { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
