/* 左下角用户中心深色浮层：与侧栏同色系，浮于其上方，带指向小箭头 */
.up-anchor { position: relative; }

.up-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  width: min(300px, calc(100vw - 24px));
  max-height: min(460px, calc(100vh - 96px));
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #1b2038;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 17px;
  box-shadow: 0 22px 48px -12px rgba(8, 10, 24, .62), 0 4px 14px rgba(8, 10, 24, .4);
  overflow: hidden;
  animation: up-in .18s cubic-bezier(.2, .8, .25, 1);
}

/* 指向左下角触发器的小箭头 */
.up-popover::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -7px;
  width: 13px;
  height: 13px;
  background: #1b2038;
  border-right: 1px solid rgba(255, 255, 255, .09);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  transform: rotate(45deg);
}

@keyframes up-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.up-popover[hidden] { display: none; }

/* ---------- 顶部用户信息 ---------- */
.up-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 17px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.up-head-avatar {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  object-fit: cover;
  display: grid;
  place-items: center;
}

.up-head-fallback {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6d71f5, #8b5cf6);
}

.up-head-meta strong { display: block; font-size: 15.5px; font-weight: 800; color: #fff; }
.up-head-meta small { display: block; margin-top: 2px; font-size: 12px; color: #939bb8; }

/* ---------- 滚动区 ---------- */
.up-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.up-main { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0 10px; }

.up-section { padding: 11px 12px 4px; }
.up-section + .up-section { border-top: 1px solid rgba(255, 255, 255, .06); }

.up-section-title {
  margin: 0 0 7px 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #6b7299;
}

.up-list { display: flex; flex-direction: column; gap: 2px; }

/* ---------- 行 ---------- */
.up-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #d6dbee;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.up-row:hover { background: rgba(255, 255, 255, .07); color: #fff; }

/* 退出登录：危险操作红色调 */
.up-logout { color: #ff8f9a; margin-top: 4px; }
.up-logout .up-ic { color: #e0606e; }
.up-logout:hover { background: rgba(251, 91, 108, .14); color: #ffb3bb; }
.up-logout:hover .up-ic { color: #ff8f9a; }

.up-ic { width: 19px; height: 19px; flex: none; color: #9aa3c4; }
.up-row:hover .up-ic { color: #aab4ff; }

.up-row span { flex: 1; }

.up-row-go { width: 16px; height: 16px; flex: none; color: #59607e; }

/* ---------- 教材行 ---------- */
.up-book {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  transition: background .15s;
}
.up-book:hover { background: rgba(255, 255, 255, .05); }

.up-book-info { min-width: 0; }
.up-book-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: #e6e9f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-book-info small { display: block; margin-top: 2px; font-size: 11.5px; color: #8b93b5; }

.up-book-actions { display: flex; gap: 6px; flex: none; }

.up-mini {
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #c2c8e2;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.up-mini:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.up-mini.primary {
  color: #fff;
  background: #5b5ff0;
  border-color: #5b5ff0;
}
.up-mini.primary:hover { background: #484bd6; }

.up-empty { margin: 4px 6px 8px; font-size: 13px; color: #8b93b5; }

/* ---------- 编辑视图 ---------- */
.up-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.up-editor[hidden] { display: none; }

.up-editor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.up-editor-head strong { font-size: 15px; font-weight: 800; color: #fff; }

.up-back {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #aab1d0;
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
}
.up-back:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.up-back .up-ic { width: 17px; height: 17px; }

.up-editor-body { padding: 18px 17px 20px; overflow-y: auto; }

.up-field { display: block; margin-bottom: 15px; }
.up-field span { display: block; font-size: 12.5px; font-weight: 700; color: #aab1d0; margin-bottom: 7px; }

.up-field input {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  font: inherit;
  font-size: 14px;
  color: #eef1fb;
  background: rgba(255, 255, 255, .05);
  border: 1.5px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  outline: none;
}
.up-field input::placeholder { color: #6b7299; }
.up-field input:focus {
  border-color: #6d71f5;
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 4px rgba(109, 113, 245, .18);
}

.up-error {
  margin: 2px 0 14px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #ff9aa5;
  background: rgba(251, 91, 108, .13);
  border-radius: 10px;
}
.up-error[hidden] { display: none; }

.up-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 45px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: #5b5ff0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
}
.up-save:hover { background: #484bd6; }
.up-save .up-ic { width: 18px; height: 18px; color: #fff; }

/* 头像裁剪 */
.up-canvas {
  width: 200px;
  height: 200px;
  display: block;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
}
.up-zoom { width: 100%; margin-bottom: 16px; accent-color: #6d71f5; }

/* ---------- 自定义滚动条（深色适配） ---------- */
.up-main::-webkit-scrollbar, .up-editor-body::-webkit-scrollbar { width: 8px; }
.up-main::-webkit-scrollbar-thumb, .up-editor-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border-radius: 999px;
}
.up-main::-webkit-scrollbar-track, .up-editor-body::-webkit-scrollbar-track { background: transparent; }

/* ---------- 账号有效期块 ---------- */
.up-validity {
  margin: 12px 12px 2px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  min-width: 0;
}
.up-validity-label { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .62); flex: none; }
.up-validity strong {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.up-validity.is-perm {
  background: rgba(22, 163, 74, .14);
  border-color: rgba(22, 163, 74, .28);
}
.up-validity.is-perm strong { color: #4ade80; }
.up-validity.is-dated {
  background: rgba(99, 102, 241, .16);
  border-color: rgba(99, 102, 24, .3);
}
.up-validity.is-dated strong { color: #a5b4fc; }
.up-validity.is-trial {
  background: rgba(245, 158, 11, .16);
  border-color: rgba(245, 158, 11, .32);
}
.up-validity.is-trial strong { color: #fbbf24; }
.up-validity .up-countdown { font-variant-numeric: tabular-nums; color: #fde68a; }
.up-validity.is-lock {
  background: rgba(225, 29, 72, .14);
  border-color: rgba(225, 29, 72, .3);
}
.up-validity.is-lock strong { color: #fb7185; }

/* ===== 20261123 跨浏览器/分辨率适配：窄屏不溢出、内容可滚动、文本可换行 ===== */
.up-popover { width: min(300px, calc(100vw - 16px)); max-height: min(480px, calc(100dvh - 80px)); left: 0; right: auto; }
.up-head-meta { min-width: 0; }
.up-head-meta small { overflow-wrap: anywhere; line-height: 1.4; }
.up-main { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.up-row, .up-book { min-width: 0; }
.up-row span, .up-book-info { min-width: 0; }
.up-validity { flex-wrap: wrap; }
.up-validity strong { min-width: 0; overflow-wrap: anywhere; }
.up-editor-body { overflow-y: auto; overscroll-behavior: contain; }
.up-field input { min-width: 0; }
@media (max-width: 480px) {
  .up-popover { width: min(280px, calc(100vw - 16px)); }
  .up-section { padding-left: 8px; padding-right: 8px; }
}
