/* ============================================================
   MathViz · 账号与作品库 UI
   ============================================================ */

/* ---- 顶栏账号区 ---- */
#accountArea { display: inline-flex; align-items: center; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 20px;
  padding: 3px 11px 3px 4px; color: var(--tx); transition: .16s;
  background: var(--panel);
}
.acct-chip:hover { border-color: var(--blue-soft); background: var(--panel-3); }
.acct-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

/* ---- 通用按钮微调 ---- */
.btn-primary.full { width: 100%; margin-top: 4px; }
.btn-ghost.xs { padding: 4px 10px; font-size: 11px; }
.btn-ghost.xs.danger { color: var(--red); border-color: rgba(255,92,122,.3); }
.btn-ghost.xs.danger:hover { background: rgba(255,92,122,.12); }
.btn-primary.sm { padding: 6px 13px; font-size: 12px; }

/* ---- 登录 / 注册弹窗 ---- */
.mv-modal-overlay, .mv-works-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 9, 17, .62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: mvFade .2s ease;
}
@keyframes mvFade { from { opacity: 0 } to { opacity: 1 } }
.mv-modal {
  width: min(380px, 92vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; box-shadow: var(--shadow);
  animation: mvPop .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes mvPop { from { transform: translateY(10px) scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }
.mv-modal h3 { font-size: 18px; margin-bottom: 16px; font-weight: 700; }
.mv-input {
  width: 100%; background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 13px; color: var(--tx);
  font-size: 13px; margin-bottom: 11px; transition: .15s;
}
.mv-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,124,255,.18); }
.mv-err { color: var(--red); font-size: 12px; min-height: 16px; margin-bottom: 6px; }
.mv-switch { font-size: 12px; color: var(--tx-2); margin-top: 12px; text-align: center; }
.mv-link { color: var(--blue); cursor: pointer; margin-left: 4px; }
.mv-link:hover { text-decoration: underline; }
.mv-note { font-size: 11px; color: var(--tx-3); margin-top: 16px; line-height: 1.6; }

/* ---- 我的作品库面板 ---- */
.mv-works-overlay { justify-content: flex-end; align-items: stretch; }
.mv-works {
  width: min(420px, 94vw); height: 100%;
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
  animation: mvSlide .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes mvSlide { from { transform: translateX(30px); opacity: .4 } to { transform: none; opacity: 1 } }
.mv-works-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.mv-works-head h3 { font-size: 16px; font-weight: 700; }
.mv-x { font-size: 22px; color: var(--tx-2); width: 30px; height: 30px; border-radius: 8px; }
.mv-x:hover { background: var(--panel-3); color: var(--tx); }
.mv-works-list { flex: 1; overflow-y: auto; padding: 12px 14px; }
.mv-empty { color: var(--tx-3); font-size: 12.5px; text-align: center; padding: 40px 16px; line-height: 1.7; }
.mv-work {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 12px; border: 1px solid var(--line-soft);
  border-radius: var(--r); margin-bottom: 9px; background: var(--bg-1); transition: .15s;
}
.mv-work:hover { border-color: var(--blue-soft); background: var(--panel-2); }
.mv-work-info { min-width: 0; }
.mv-work-title { font-size: 13px; font-weight: 600; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-work-meta { font-size: 11px; color: var(--tx-3); margin-top: 3px; }
.mv-work-acts { display: flex; gap: 6px; flex-shrink: 0; }
.mv-works-foot {
  display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.mv-works-foot .btn-primary.sm { flex: 1; min-width: 130px; }
.mv-works-foot .btn-ghost.sm { flex: 1; min-width: 110px; text-align: center; }
