/* 演书 · 用户头像弹出菜单 + 全局配色（白/绿/棕/黑）
   由 js/usermenu.js 构建 DOM；颜色用变量，兼容两套管件
   （style.css 用 --text/--brand，app.html 用 --ink/--accent），靠 fallback 兜底。 */

/* 透明遮罩：点击任意处关闭菜单 */
.um-overlay { position: fixed; inset: 0; z-index: 55; display: none; }
.um-overlay.open { display: block; }

.user-menu {
  position: fixed; top: 56px; right: 14px; z-index: 60;
  min-width: 236px; max-width: calc(100vw - 28px); padding: 12px;
  background: var(--panel, #fffdfa);
  color: var(--text, var(--ink, #2f2a24));
  border: 1px solid var(--line, #e9e0d5);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(20, 16, 10, .22);
  display: none; font-size: 13px;
  animation: umPop .16s cubic-bezier(.2, .8, .3, 1);
}
.user-menu.open { display: block; }
@keyframes umPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.um-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; padding: 2px 4px 10px;
  border-bottom: 1px solid var(--line, #e9e0d5); margin-bottom: 10px;
  color: var(--text, var(--ink, #2f2a24));
}
.um-theme-label { font-size: 12px; color: var(--muted, #9b8b7b); margin: 2px 4px 6px; }
.um-themes { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 8px; }
.um-chip {
  flex: 1 1 0; min-width: 0; padding: 7px 0;
  border: 1px solid var(--line, #e9e0d5); border-radius: 9px;
  background: var(--bg, #f3eee8);
  color: var(--text, var(--ink, #2f2a24));
  cursor: pointer; font-size: 13px; text-align: center; transition: .15s;
}
.um-chip:hover { border-color: var(--brand, var(--accent, #c89b5c)); }
.um-chip.active {
  background: var(--brand, var(--accent, #c89b5c)); color: #fff;
  border-color: var(--brand, var(--accent, #c89b5c));
}
.um-divider { height: 1px; background: var(--line, #e9e0d5); margin: 8px 0; }
.um-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent;
  color: var(--text, var(--ink, #2f2a24)); font-size: 13px; text-align: left; transition: .15s;
}
.um-item:hover { background: color-mix(in srgb, var(--brand, var(--accent, #c89b5c)) 12%, transparent); }
.um-item.danger:hover { background: rgba(214, 64, 64, .12); color: #d23b3b; }

/* 头像可点 */
.wb-user { cursor: pointer; user-select: none; }

/* 通知铃铛（插入在头像右侧，标题栏顺序：用户 · 通知 · API设置 · 手机界面） */
.wb-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: 0 2px; padding: 0;
  border: 1px solid var(--line, #e9e0d5); border-radius: 9px;
  background: var(--panel, #fffdfa); color: var(--text, var(--ink, #2f2a24));
  font-size: 16px; cursor: pointer; transition: .15s; vertical-align: middle;
}
.wb-bell:hover { border-color: var(--brand, var(--accent, #c89b5c)); }
.wb-bell-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 10px; background: #d23b3b; color: #fff; font-size: 11px; line-height: 17px;
  text-align: center; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* 通知面板 */
.notif-panel {
  position: fixed; top: 56px; right: 14px; z-index: 61;
  width: 340px; max-width: calc(100vw - 28px); max-height: 70vh;
  display: none; flex-direction: column;
  background: var(--panel, #fffdfa); color: var(--text, var(--ink, #2f2a24));
  border: 1px solid var(--line, #e9e0d5); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(20, 16, 10, .22);
  font-size: 13px; overflow: hidden;
  animation: umPop .16s cubic-bezier(.2, .8, .3, 1);
}
.notif-panel.open { display: flex; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line, #e9e0d5);
  font-weight: 600; color: var(--text, var(--ink, #2f2a24));
}
.notif-close {
  width: 26px; height: 26px; border: none; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--muted, #9b8b7b); font-size: 18px; line-height: 1;
}
.notif-close:hover { background: color-mix(in srgb, var(--brand, var(--accent, #c89b5c)) 12%, transparent); }
.notif-list { overflow-y: auto; padding: 6px; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--muted, #9b8b7b); }
.notif-item {
  padding: 10px 11px; border-radius: 10px; cursor: pointer; transition: .15s;
  border: 1px solid transparent; margin-bottom: 4px;
}
.notif-item:hover { background: color-mix(in srgb, var(--brand, var(--accent, #c89b5c)) 10%, transparent); }
.notif-item.read { opacity: .6; }
.notif-item.read .notif-title::before { content: ''; }
.notif-title { font-weight: 600; margin-bottom: 3px; color: var(--text, var(--ink, #2f2a24)); }
.notif-body { color: var(--muted, #9b8b7b); line-height: 1.5; }
.notif-time { margin-top: 5px; font-size: 11px; color: #b7a899; }
.notif-actions { margin-top: 8px; }
.notif-review-btn {
  padding: 6px 14px; border: 1px solid var(--brand, var(--accent, #c89b5c)); border-radius: 8px;
  background: var(--brand, var(--accent, #c89b5c)); color: #fff; cursor: pointer;
  font-size: 12px; font-weight: 600; transition: .15s;
}
.notif-review-btn:hover:not(:disabled) { filter: brightness(1.06); }
.notif-review-btn:disabled { background: transparent; color: var(--muted, #9b8b7b); border-color: var(--line, #e9e0d5); cursor: default; }
