/* =========================================================================
   侧栏底部资源用量进度条 + 满额升级弹窗样式（2026-10-31）
   需求：「资源用量展示与订阅升级需求文档.md」§4.1 / §4.4 / §4.6
   配色按实测修正（v20261031b）：当前部署侧栏为**白底**（.pwc-menu 背景透明、
   console.css 深绿规则未生效于该容器状态），首版深底白字方案肉眼不可见。
   现按需求文档 §4.1 原始口径：底轨浅绿灰(--site-seam #e4e6e0)、
   填充品牌绿(--site-green #144b37)、≥80% 警示橙(#9a4b00)、100% 危险红(#b32a1c)。
   弹窗维持白卡 VideoQR v3 视觉。
   ========================================================================= */

/* ---------------- 侧栏进度条块 ---------------- */

html.vqr-theme-site .app-nav-bar .pwc-menu .vqr-quota-wrap {
  flex: 0 0 auto;
  margin-top: auto;           /* 父级 flex column 时贴底 */
  padding: 12px 16px 14px;
  border-top: 1px solid var(--site-seam, #e4e6e0);
}

html.vqr-theme-site .vqr-quota {
  color: #131a17;
  font-family: Inter, "Fira Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  user-select: none;
}

html.vqr-theme-site .vqr-quota__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

html.vqr-theme-site .vqr-quota__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a968e;
}

html.vqr-theme-site .vqr-quota__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

html.vqr-theme-site .vqr-quota__row {
  cursor: pointer;
}

html.vqr-theme-site .vqr-quota__row .vqr-quota__label,
html.vqr-theme-site .vqr-quota__row .vqr-quota__num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 4px;
}

html.vqr-theme-site .vqr-quota__row .vqr-quota__label {
  color: #5a6b60;
}

html.vqr-theme-site .vqr-quota__val {
  font-weight: 600;
  font-size: 12px;
  color: #131a17;
  font-style: normal;
}

html.vqr-theme-site .vqr-quota__val i {
  font-style: normal;
  font-weight: 400;
  color: #8a968e;
}

html.vqr-quota .vqr-quota__row.is-unlimited {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html.vqr-theme-site .vqr-quota__row.is-unlimited .vqr-quota__val {
  color: #3d4a42;
  font-weight: 500;
}

html.vqr-theme-site .vqr-quota__track {
  height: 5px;
  border-radius: 999px;
  background: var(--site-seam, #e4e6e0);
  overflow: hidden;
}

html.vqr-theme-site .vqr-quota__track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--site-green, #144b37);   /* 品牌绿（需求 §4.1） */
  transition: width .4s ease, background-color .2s ease;
}

html.vqr-theme-site .vqr-quota__row.is-warn .vqr-quota__track i { background: #d97b2b; }
html.vqr-theme-site .vqr-quota__row.is-full .vqr-quota__track i { background: #b32a1c; }
html.vqr-theme-site .vqr-quota__row.is-warn .vqr-quota__val { color: #9a4b00; }
html.vqr-theme-site .vqr-quota__row.is-full .vqr-quota__val { color: #b32a1c; }

/* 满额行内的「升级」小按钮（§4.1：免费档满额时附） */
html.vqr-theme-site .vqr-quota__up {
  flex: 0 0 auto;
  margin-left: 8px;
  height: 20px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: #f0b429;
  color: #24321f;
  font: 600 11px/20px Inter, "Fira Sans", system-ui, sans-serif;
  cursor: pointer;
}

html.vqr-theme-site .vqr-quota__up:hover { background: #ffc94d; }

/* ---------------- 侧栏收起态（§4.1：图标 + 角标 + 悬停浮层） ---------------- */

html.vqr-theme-site .sidebar-container--collapsed .app-nav-bar .vqr-quota-wrap {
  padding: 10px 8px;
  position: relative;
}

html.vqr-theme-site .sidebar-container--collapsed .vqr-quota .vqr-quota__rows {
  display: none;                            /* 收起态默认只显示精简图标行 */
}

html.vqr-theme-site .sidebar-container--collapsed .vqr-quota.vqr-quota--flat .vqr-quota__row .vqr-quota__label {
  display: none;
}

/* 收起态精简块：标题行换成 ⚡ 图标 + data-badge 角标 */
html.vqr-theme-site .sidebar-container--collapsed .vqr-quota__head {
  display: none;
}

html.vqr-theme-site .sidebar-container--collapsed .vqr-quota.is-collapsed-mini {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

html.vqr-theme-site .sidebar-container--collapsed .vqr-quota.is-collapsed-mini::after {
  content: '⚡ ' attr(data-badge);
  font-size: 11px;
  font-weight: 600;
  color: #144b37;
  white-space: nowrap;
}

html.vqr-theme-site .sidebar-container--collapsed .vqr-quota.is-collapsed-mini.is-badge-full::after {
  color: #b32a1c;
}

/* 收起态悬停浮层：完整两条进度条（白卡 + 阴影，与弹窗同风格） */
html.vqr-theme-site .sidebar-container--collapsed .vqr-quota-wrap:hover .vqr-quota__rows {
  display: flex;
  position: absolute;
  left: calc(100% + 6px);
  bottom: 0;
  width: 236px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--site-seam, #e4e6e0);
  box-shadow: 0 8px 28px rgba(15, 26, 21, 0.18);
  z-index: 60;
}

html.vqr-theme-site .sidebar-container--collapsed .vqr-quota-wrap:hover .vqr-quota__head {
  display: flex;
  position: absolute;
  left: calc(100% + 6px);
  bottom: 96px;
  width: 236px;
  padding: 0 14px 6px;
  z-index: 60;
}

/* ---------------- 满额升级弹窗（§4.4） ---------------- */

.vqr-quota-dlg__mask {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 26, 21, 0.55);
  animation: vqrQuotaFade .16s ease;
}

@keyframes vqrQuotaFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.vqr-quota-dlg {
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 26, 21, 0.35);
  padding: 24px 26px;
  font-family: Inter, "Fira Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #131a17;
  animation: vqrQuotaPop .18s ease;
}

@keyframes vqrQuotaPop {
  from { transform: translateY(10px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.vqr-quota-dlg--confirm {
  width: min(520px, calc(100vw - 48px));
}

.vqr-quota-dlg header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.vqr-quota-dlg h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #0f3d2c;
}

.vqr-quota-dlg header p {
  margin: 0;
  font-size: 13px;
  color: #5a6b60;
}

.vqr-quota-dlg__close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: #f2f5ef;
  color: #3d4a42;
  font-size: 18px;
  line-height: 30px;
  cursor: pointer;
}

.vqr-quota-dlg__close:hover { background: #e4e6e0; }

.vqr-quota-dlg__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.vqr-quota-dlg__card {
  border: 1px solid #e4e6e0;
  border-radius: 12px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  background: #fbfcf9;
}

.vqr-quota-dlg__card.is-current {
  border-color: #144b37;
  background: #f2f5ef;
}

.vqr-quota-dlg__card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #0f3d2c;
}

.vqr-quota-dlg__price {
  margin-bottom: 10px;
  font-size: 13px;
  color: #5a6b60;
}

.vqr-quota-dlg__price b {
  font-size: 20px;
  color: #131a17;
}

.vqr-quota-dlg__price i {
  font-style: normal;
  font-size: 12px;
  margin-left: 3px;
}

.vqr-quota-dlg__card ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  flex: 1;
}

.vqr-quota-dlg__card ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12.5px;
  border-top: 1px dashed #e4e6e0;
}

.vqr-quota-dlg__card ul li span { color: #5a6b60; }
.vqr-quota-dlg__card ul li b { font-weight: 600; }

.vqr-quota-dlg__btn {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  font: 600 13px/34px Inter, "Fira Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color .15s, color .15s, opacity .15s;
}

.vqr-quota-dlg__btn.is-up {
  background: #144b37;
  color: #fff;
}

.vqr-quota-dlg__btn.is-up:hover { background: #0f3d2c; }

.vqr-quota-dlg__btn.is-current {
  background: #e4e6e0;
  color: #7a877f;
  cursor: default;
}

.vqr-quota-dlg__btn.is-ghost {
  background: transparent;
  border: 1px solid #e4e6e0;
  color: #3d4a42;
}

.vqr-quota-dlg__btn.is-ghost:hover { background: #f2f5ef; }

.vqr-quota-dlg > footer {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 18px;
}

.vqr-quota-dlg__link {
  border: none;
  background: none;
  font: 500 13px Inter, "Fira Sans", system-ui, sans-serif;
  color: #144b37;
  cursor: pointer;
  padding: 6px 4px;
}

.vqr-quota-dlg__link:hover { text-decoration: underline; }

/* 确认弹窗的行 */
.vqr-quota-dlg__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 4px;
}

.vqr-quota-dlg__rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fbfcf9;
  font-size: 13px;
}

.vqr-quota-dlg__rows > div span { color: #5a6b60; flex: 0 0 auto; }
.vqr-quota-dlg__rows > div b { font-weight: 600; text-align: right; }
.vqr-quota-dlg__rows > div b.is-accent { color: #144b37; }

.vqr-quota-dlg--confirm footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

/* ---------------- Toast ---------------- */

.vqr-quota-toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 16px);
  z-index: 4100;
  padding: 10px 22px;
  border-radius: 999px;
  background: #0f3d2c;
  color: #fff;
  font: 500 13px/1.5 Inter, "Fira Sans", system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.vqr-quota-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.vqr-quota-toast.is-bad { background: #b32a1c; }
