/* ============================================================
   左下角头像菜单（唯一源）
   ------------------------------------------------------------
   工作台侧栏（/css/yq-sidebar.css 顶部 @import 本文件）与
   频道页侧栏（wb-shell 的 .wb-drawer，脚本自动注入本文件）共用同一份样式；
   行为见 /js/yq-sidebar.js（同一份源）。
   ============================================================ */
/* ============================================================
   左下角：头像 → 账号 / 会员弹出面板（2026-10-27）
   登录、注册、退出、会员、公告、主题统一收在这里
   ============================================================ */
.rail-user { position: relative; }

.rail-user .ru-ava {
  position: relative; flex: none; width: 38px; height: 38px; padding: 0; border: none;
  border-radius: 50%; background: linear-gradient(135deg, #6b7dff, #4b3bd8);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(239, 228, 203, .22);
  transition: box-shadow .15s, transform .15s;
}
.rail-user .ru-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.rail-user .ru-ava .ru-fb { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.rail-user .ru-ava .ru-fb[hidden] { display: none !important; }
.rail-user .ru-ava:hover { box-shadow: 0 0 0 2px var(--yq-accent); transform: translateY(-1px); }
.rail-user .ru-vip {
  position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border-radius: 50%;
  background: linear-gradient(135deg, #f7e6b4, #e2bd5a); color: #4a3808;
  font-size: 9px; font-weight: 800; font-style: normal; display: grid; place-items: center;
  border: 1.5px solid var(--drawer-bg);
}

/* ---------- 弹出面板 ---------- */
.rail-user .ru-pop {
  position: absolute; left: 12px; bottom: calc(100% + 8px); width: 252px;
  max-width: calc(100vw - 24px); max-height: calc(100vh - 96px); overflow: auto;
  background: #fff; color: #2b2f2b; border-radius: 14px; padding: 8px; z-index: 80;
  box-shadow: 0 18px 50px rgba(20, 30, 20, .28), 0 0 0 1px rgba(20, 30, 20, .06);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.5; text-align: left;
}
.rail-user .ru-pop[hidden] { display: none !important; }
.rp-head { display: flex; align-items: center; gap: 9px; padding: 7px 7px 9px; }
.rp-ava-wrap { position: relative; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; background: linear-gradient(135deg, #6b7dff, #4b3bd8); }
.rp-ava-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-ava-wrap .rp-fb { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.rp-ava-wrap .rp-fb[hidden] { display: none !important; }
.rp-ava-wrap img[hidden] { display: none !important; }
.rp-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.rp-id b { font-size: 13.5px; font-weight: 700; color: #1f241f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-id span { font-size: 11px; color: #8b918b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: #f1f2ee; color: #7a817a; white-space: nowrap; flex: none; }
.rp-badge.is-vip { background: linear-gradient(135deg, #f7e6b4, #e2bd5a); color: #4a3808; font-weight: 700; }
.rp-list { display: flex; flex-direction: column; }
.rp-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: none; background: none; border-radius: 9px; cursor: pointer;
  font-size: 13px; color: #333a33; text-align: left; font-family: inherit; line-height: 1.4;
}
.rp-item:hover { background: #f4f5f1; }
.rp-ico { display: inline-flex; color: #4a514a; flex: none; }
.rp-label { flex: 1 1 auto; }
.rp-pill { font-size: 11px; color: #8b918b; background: #f2f3ef; padding: 1px 7px; border-radius: 999px; }
.rp-val { font-size: 11px; color: #8b918b; }
.rp-new { font-size: 9px; color: #fff; background: #e05252; border-radius: 999px; padding: 1px 5px; font-style: normal; }
.rp-item.is-danger, .rp-item.is-danger .rp-ico { color: #c0392b; }
.rp-sep { height: 1px; background: #eef0ea; margin: 6px 8px; }
.rp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: #f7f8f4;
  font-size: 11.5px; color: #6d746d;
}
.rp-points b { color: #1f241f; font-size: 13px; }
.rp-up {
  border: none; background: linear-gradient(135deg, #2f4031, #3d523f); color: #f0e6c8;
  font-size: 11px; padding: 5px 9px; border-radius: 7px; cursor: pointer;
  white-space: nowrap; font-family: inherit;
}
.rp-up:hover { filter: brightness(1.1); }

/* ---------- 通用弹层（会员中心 / 公告） ---------- */
.yq-modal { position: fixed; inset: 0; z-index: 99998; display: flex; align-items: center; justify-content: center; padding: 18px; }
.yq-modal[hidden] { display: none !important; }
.yq-mask { position: absolute; inset: 0; background: rgba(18, 26, 18, .52); }
.ym-sheet, .yn-sheet {
  position: relative; background: #fff; color: #242a24; border-radius: 16px; width: 100%;
  max-width: 400px; max-height: 88vh; overflow: auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; line-height: 1.5;
}
.yq-x {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; padding: 0;
  border: none; background: rgba(255, 255, 255, .18); color: inherit; border-radius: 8px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; z-index: 2;
}
.yq-x:hover { background: rgba(255, 255, 255, .3); }
.ym-sheet > .yq-x { color: #efe4cb; background: rgba(255, 255, 255, .16); }
.ym-sheet > .yq-x:hover { background: rgba(255, 255, 255, .3); }
.ym-sheet .ym-hero-row { padding-right: 32px; }

/* 会员卡 */
.ym-hero {
  position: relative; overflow: hidden; padding: 20px 20px 18px;
  background: linear-gradient(135deg, #2b3a2c, #1f2a20 55%, #3a4a34);
  color: #efe4cb; border-radius: 16px 16px 0 0;
}
.ym-hero::after {
  content: ""; position: absolute; right: -50px; top: -70px; width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 76, .35), transparent 65%);
}
.ym-hero-row { position: relative; display: flex; align-items: center; gap: 7px; font-size: 11.5px; letter-spacing: .06em; color: #d9c898; }
.ym-crown { display: inline-flex; color: #e8cd82; }
.ym-hero-t { flex: 1 1 auto; }
.ym-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #efe4cb; }
.ym-badge.is-vip { background: linear-gradient(135deg, #f7e6b4, #e2bd5a); color: #4a3808; font-weight: 700; }
.ym-hero-name { position: relative; font-size: 21px; font-weight: 800; margin-top: 10px; letter-spacing: .02em; }
.ym-hero-sub { position: relative; font-size: 11.5px; color: rgba(239, 228, 203, .72); margin-top: 4px; }
.ym-body { padding: 16px 18px 18px; }
.ym-sec-t { font-size: 12px; font-weight: 700; color: #3a423a; letter-spacing: .06em; margin-bottom: 8px; }
.ym-perks { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.ym-perks li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #4c544c; line-height: 1.55; }
.ym-perks svg { color: #3f8a4f; flex: none; margin-top: 1px; }
.ym-buy {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid #e9e3d2; background: #fbf7ec; border-radius: 12px;
}
.ym-price { display: flex; align-items: baseline; gap: 4px; }
.ym-price b { font-size: 22px; color: #8a6b18; font-weight: 800; }
.ym-price span { font-size: 11.5px; color: #9a927e; }
.ym-btn {
  border: none; background: linear-gradient(135deg, #2f4031, #41583f); color: #f4ebd2;
  font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: 9px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.ym-btn:hover { filter: brightness(1.1); }
.ym-btn:disabled { opacity: .6; cursor: default; }
.ym-paybox { margin-top: 12px; padding: 12px; border: 1px dashed #d9d2bd; border-radius: 12px; background: #fcfbf6; text-align: center; }
.ym-pay-t { font-size: 12.5px; font-weight: 700; color: #3a423a; margin-bottom: 8px; }
.ym-qr { width: 170px; height: 170px; border-radius: 8px; background: #fff; display: block; margin: 0 auto; }
.ym-pay-n { font-size: 11.5px; color: #5a625a; margin-top: 6px; word-break: break-all; }
.ym-pay-hint { font-size: 11px; color: #9a927e; margin-top: 6px; line-height: 1.6; }
.ym-ghost { margin-top: 8px; border: 1px solid #cfc7ae; background: #fff; color: #5a4a17; font-size: 12px; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.ym-points { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #f5f6f1; }
.ym-points-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: #5a625a; }
.ym-points-row b { font-size: 18px; color: #2f3a2f; }
.ym-points-note { font-size: 10.5px; color: #98a098; margin-top: 4px; line-height: 1.6; }

/* 公告 */
.yn-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; font-size: 15px; }
.yn-head .yq-x { position: static; background: #f2f3ef; color: #5a625a; }
.yn-list { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.yn-item { border-top: 1px solid #eef0ea; padding-top: 12px; }
.yn-meta { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: #9aa29a; }
.yn-tag { background: #f1f5ed; color: #3f6b45; padding: 1px 7px; border-radius: 999px; }
.yn-item h4 { margin: 6px 0 4px; font-size: 13.5px; color: #2a312a; }
.yn-item p { margin: 0; font-size: 12px; line-height: 1.7; color: #5d655d; }
.yn-loading { font-size: 12px; color: #9aa29a; padding: 14px 0; text-align: center; }

/* 轻提示 */
.yq-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 12px);
  background: rgba(30, 38, 30, .94); color: #f2ecd9; font-size: 12.5px;
  padding: 9px 16px; border-radius: 10px; z-index: 100002; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.yq-toast.show { opacity: 1; transform: translate(-50%, 0); }
body.yq-skin-paper .rail-user .ru-ava { box-shadow: 0 0 0 1px rgba(47, 58, 47, .16); }
@media (max-width: 900px) {
  .rail-user .ru-pop { left: 8px; width: 244px; }
  .ym-sheet, .yn-sheet { max-width: 100%; }
}

/* ---------- 频道页侧栏（wb-shell .wb-drawer）适配 ---------- */
.rail-user { position: relative; }
.wb-drawer .wb-user > .wb-ru-ico { display: none; }
.wb-drawer .ru-pop { left: 8px; }
body.yq-skin-paper .wb-drawer { background: linear-gradient(180deg, #fbf7ec, #f2ecdd); }
body.yq-skin-paper .wb-drawer .wb-nav,
body.yq-skin-paper .wb-drawer .wb-user { color: #2f3a2f; }

/* ---------- 自建深色侧栏（真题详情页等）底部头像 ---------- */
.sidebar > .rail-user.rail-inline {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .08);
}
.rail-inline .ru-ava { width: 36px; height: 36px; }
.rail-inline .ru-pop { left: 10px; bottom: calc(100% + 10px); width: 232px; }
.rail-inline::after { content: "账号 · 会员"; font-size: 11.5px; letter-spacing: .04em;
  color: rgba(255, 255, 255, .42); }

/* 接管的侧栏：隐藏页面自带的登录/注册按钮组（面板里已有） */
.rail-user #ruAuth { display: none !important; }
