/* ==========================================================================
   授权中心 & 激活码管理 —— 页面专属样式
   （独立文件，符合 CSP style-src 'self'）
   ========================================================================== */

/* ---------------------------------------------------------- 登录/注册页 */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.auth-brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .2px;
  margin-bottom: 4px;
}
.auth-brand em { font-style: normal; color: var(--green); }
.auth-desc {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color .12s, border-color .12s;
}
.auth-tabs a:hover { color: var(--ink-2); text-decoration: none; }
.auth-tabs a.on {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 500;
}
.auth-field { margin-bottom: 16px; }
.auth-row { display: flex; gap: 8px; }
.auth-row input { flex: 1; }
.auth-row button {
  white-space: nowrap;
  font-size: 13px;
  padding: 9px 14px;
}
.auth-submit {
  width: 100%;
  padding: 11px;
  margin-top: 4px;
  font-size: 14px;
}
.auth-hint {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.9;
}
.auth-hint b {
  display: block;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.auth-msg {
  margin-bottom: 16px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
  line-height: 1.6;
}
.auth-msg.ok {
  display: block;
  background: var(--green-soft);
  border: 1px solid #d8e8de;
  color: var(--green-dark);
}
.auth-msg.err {
  display: block;
  background: var(--red-soft);
  border: 1px solid #f0dbd9;
  color: var(--red);
}

/* ---------------------------------------------------------- 我的设备页 */
.acct-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-3);
}
.acct-nav a { color: var(--ink-2); }
.acct-nav a:hover { color: var(--green); text-decoration: none; }

.redeem-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.redeem-row input { flex: 1; min-width: 200px; }
.redeem-row input.pair-input { max-width: 210px; }

.net-hint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.net-hint code {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 12px;
  color: var(--ink-2);
}

.pair {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--amber);
}

.redeem-msg {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
  line-height: 1.6;
}
.redeem-msg.ok {
  display: block;
  background: var(--green-soft);
  border: 1px solid #d8e8de;
  color: var(--green-dark);
}
.redeem-msg.err {
  display: block;
  background: var(--red-soft);
  border: 1px solid #f0dbd9;
  color: var(--red);
}

.btn-pick { font-size: 12px; padding: 5px 11px; }

/* ---------------------------------------------------------- 激活码管理页 */
.gen-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.gen-row .num { width: 96px; }
.gen-row .note { flex: 1; min-width: 200px; }

.gen-result {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  border: 1px solid #d8e8de;
  display: none;
}
.gen-result .ttl {
  font-size: 12.5px;
  color: var(--green-dark);
  font-weight: 600;
  margin-bottom: 10px;
}
.gen-result .codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gen-result .codes span {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13.5px;
  letter-spacing: .5px;
  background: #fff;
  border: 1px solid #d8e8de;
  border-radius: 4px;
  padding: 5px 11px;
  color: var(--green-dark);
  font-weight: 600;
}

.code-cell {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  letter-spacing: .5px;
  font-weight: 600;
  color: var(--ink);
}

.op-msg {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
  line-height: 1.6;
}
.op-msg.ok {
  display: block;
  background: var(--green-soft);
  border: 1px solid #d8e8de;
  color: var(--green-dark);
}
.op-msg.err {
  display: block;
  background: var(--red-soft);
  border: 1px solid #f0dbd9;
  color: var(--red);
}

.btn-xs { font-size: 12px; padding: 4px 10px; }


/* ============ 客户端下载 ============ */
.dl-grid {
  display: grid;
  /* minmax(0, 1fr) 而非 minmax(300px, 1fr)：
     后者在窄屏会强制 300px 撑破容器 */
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 14px;
  margin: 4px 0 18px;
  /* 桌面端两块并排，窄屏自动单列 */
  max-width: 100%;
}

/* 宽度 ≥ 620px 时两列，否则一列 */
@media (min-width: 620px) {
  .dl-grid { grid-template-columns: 1fr 1fr; }
}

.dl-card {
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  /* 关键：允许收缩，防止内容撑破 grid 轨道 */
  min-width: 0;
  max-width: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color .16s, box-shadow .16s;
}

.dl-card:hover {
  border-color: var(--green);
  box-shadow: 0 3px 10px rgba(45, 106, 79, .1);
}

.dl-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green);
  border-radius: var(--radius);
}

.dl-icon svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.dl-body {
  flex: 1 1 auto;
  /* min-width:0 让 flex 子项可以窄于内容宽度 */
  min-width: 0;
  overflow: hidden;
}

.dl-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.dl-tag {
  display: inline-block;
  flex: 0 0 auto;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 9px;
  white-space: nowrap;
}

.dl-desc {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  opacity: .62;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-meta {
  margin-top: 6px;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  opacity: .5;
  /* 允许多行，不再 nowrap 撑破 */
  line-height: 1.5;
  word-break: break-all;
}

.dl-sep {
  opacity: .45;
  margin: 0 2px;
}

.dl-action {
  flex: 0 0 auto;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--green);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background .16s;
}

.dl-card:hover .dl-action {
  background: var(--green-dark);
}

/* ---- 安装提示 ---- */
.dl-tips {
  box-sizing: border-box;
  max-width: 100%;
  padding: 14px 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
}

.dl-tips b {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.dl-tips ul {
  margin: 0;
  padding-left: 18px;
  opacity: .72;
}

.dl-tips li + li {
  margin-top: 2px;
}

/* ============ 窄屏适配 ============ */
@media (max-width: 560px) {
  /* 容器内边距收窄，给卡片留空间 */
  .auth-wrap {
    padding: 14px;
  }

  main {
    padding-left: 0;
    padding-right: 0;
  }

  .section {
    padding-left: 14px;
    padding-right: 14px;
    box-sizing: border-box;
  }

  .dl-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .dl-card {
    padding: 12px 13px;
    gap: 10px;
  }

  .dl-icon {
    width: 42px;
    height: 42px;
  }

  .dl-icon svg {
    width: 23px;
    height: 23px;
  }

  .dl-title {
    font-size: 14px;
    gap: 3px 6px;
  }

  .dl-tag {
    font-size: 10px;
    padding: 1px 6px;
  }

  .dl-desc {
    font-size: 12px;
    white-space: normal;
  }

  .dl-meta {
    font-size: 11px;
    line-height: 1.45;
  }

  /* 手机上「下载」按钮改小，避免挤占文本区 */
  .dl-action {
    padding: 6px 12px;
    font-size: 12px;
  }

  .dl-tips {
    padding: 11px 13px;
    font-size: 12.5px;
  }

  .dl-tips ul {
    padding-left: 15px;
  }

  /* 修复已有的激活输入框在手机上溢出 */
  .redeem-row input {
    min-width: 0;
    flex: 1 1 100%;
  }

  .redeem-row input.pair-input,
  .redeem-row input.name-input {
    max-width: none;
  }

  .redeem-row button {
    flex: 1 1 100%;
  }
}

/* ============ 超窄屏（≤360px）======= */
@media (max-width: 360px) {
  .dl-card {
    flex-wrap: wrap;
  }

  .dl-body {
    flex: 1 1 100%;
    padding-left: 0;
  }

  .dl-action {
    flex: 1 1 100%;
    text-align: center;
  }
}


/* ============ 设备信息展示 ============ */
.dev-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.dev-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 3px;
}

.spec-item {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 3px;
  white-space: nowrap;
}

.spec-item.quiet {
  color: var(--ink);
  background: transparent;
  opacity: .5;
  padding-left: 0;
  padding-right: 0;
}

.spec-item.quiet + .spec-item.quiet:before {
  content: "·";
  margin-right: 4px;
  opacity: .6;
}

.dev-vid {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ink);
  opacity: .38;
  letter-spacing: .2px;
}

/* ---- 播放计数 ---- */
.cnt-today {
  font-weight: 600;
  color: var(--green);
}

.cnt-sep {
  margin: 0 2px;
  opacity: .35;
}

.cnt-total {
  opacity: .5;
}

/* ---- 手机上压缩表格 ---- */
@media (max-width: 720px) {
  .dev-spec {
    gap: 3px 5px;
  }

  .spec-item {
    font-size: 10px;
    padding: 1px 5px;
  }

  .dev-vid {
    display: none;
  }
}

/* 设备页小字补充 */
.muted.small {
  font-size: 11.5px;
  line-height: 1.7;
  margin-top: 2px;
}

.muted.small strong {
  font-weight: 600;
}

/* ============ 解析额度 ============ */
.quota-box {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quota-bar {
  height: 10px;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--green);
  border-radius: 5px;
  transition: width .3s ease;
}

.quota-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--ink);
  opacity: .75;
}

.quota-meta b {
  font-weight: 600;
  font-size: 13.5px;
}

.quota-remain {
  color: var(--green);
}

.quota-remain.quota-low {
  color: var(--red);
}

.quota-remain.quota-low b {
  color: var(--red);
}

@media (max-width: 560px) {
  .quota-box {
    padding: 11px 13px;
  }

  .quota-meta {
    font-size: 12px;
  }

  .quota-meta b {
    font-size: 13px;
  }
}

/* ============ 一键复制按钮 ============ */
.gen-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.gen-result-actions {
  display: flex;
  gap: 8px;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}

.btn-copy:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn-copy.ghost {
  color: var(--green);
  background: transparent;
  border-color: var(--line-strong);
}

.btn-copy.ghost:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.btn-copy svg {
  flex: 0 0 auto;
}

/* ============ 配额管理页 ============ */
.quota-email {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

.quota-input {
  width: 74px;
  padding: 4px 7px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: right;
}

.quota-input:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
  border-color: var(--green);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.switch input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}

.btn-save.has-change {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
  font-weight: 600;
}

/* ---- toast ---- */
.quota-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  padding: 9px 20px;
  font-size: 13.5px;
  color: #fff;
  background: var(--green);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(31, 36, 32, .22);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  max-width: 88vw;
  text-align: center;
}

.quota-toast.err {
  background: var(--red);
}

.quota-toast.show,
.quota-toast {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.quota-toast.out {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

@media (max-width: 720px) {
  .gen-result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .gen-result-actions {
    width: 100%;
  }

  .btn-copy {
    flex: 1;
    justify-content: center;
  }

  .quota-input {
    width: 64px;
  }
}

/* ============ 设备额度提示 ============ */
.quota-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(45, 106, 79, .18);
  border-radius: var(--radius-sm);
}

.quota-hint svg {
  flex: 0 0 auto;
}

.quota-hint b {
  font-weight: 600;
}

.quota-hint.used {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(180, 83, 9, .2);
}

/* ============ 用户管理页 ============ */
.quota-badge {
  display: inline-block;
  min-width: 26px;
  padding: 1px 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  border-radius: 10px;
}

.quota-badge.ok {
  color: var(--green);
  background: var(--green-soft);
}

.quota-badge.zero {
  color: var(--ink);
  background: var(--line);
  opacity: .6;
}

.btn-add {
  min-width: 34px;
  padding: 5px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(45, 106, 79, .2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}

.btn-add:hover {
  background: var(--green);
  color: #fff;
}

.btn-reset-used {
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(180, 83, 9, .2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}

.btn-reset-used:hover {
  background: var(--amber);
  color: #fff;
}

@media (max-width: 560px) {
  .quota-hint {
    font-size: 12.5px;
    padding: 8px 11px;
  }

  .btn-add,
  .btn-reset-used {
    font-size: 12px;
    padding: 4px 8px;
  }
}

/* 已用 / 总额度 分隔 */
.quota-sep {
  margin: 0 3px;
  opacity: .35;
}

.quota-total {
  opacity: .55;
}

.btn-set-total {
  padding: 5px 9px;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}

.btn-set-total:hover {
  background: var(--line);
}

/* 表头小字提示 */
.th-hint {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 400;
  opacity: .45;
  white-space: nowrap;
}

/* 设备总数拆分标签 */
.dev-total {
  font-weight: 600;
}

.dev-breakdown {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}

.tag-code,
.tag-quota {
  display: inline-block;
  padding: 0 5px;
  font-size: 10px;
  line-height: 1.7;
  border-radius: 3px;
  white-space: nowrap;
}

.tag-code {
  color: var(--ink);
  background: var(--line);
  opacity: .75;
}

.tag-quota {
  color: var(--green);
  background: var(--green-soft);
}

@media (max-width: 720px) {
  .th-hint {
    display: none;
  }

  .dev-breakdown {
    flex-direction: column;
    gap: 2px;
  }
}

/* ============ PC 兼容版授权页 ============ */
.pc-auth-card {
  max-width: 520px;
}

.pc-alert {
  margin: 14px 0 18px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.6;
}

.pc-alert b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 3px;
}

.pc-alert p {
  margin: 0;
  opacity: .78;
}

.pc-alert.ok {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(45, 106, 79, .2);
}

.pc-alert.warn {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(180, 83, 9, .2);
}

.pc-alert.err {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(179, 44, 44, .2);
}

.pc-field {
  margin-bottom: 16px;
}

.pc-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  opacity: .72;
}

.pc-copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.pc-copy-row code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: .4px;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  word-break: break-all;
  line-height: 1.5;
}

.pc-copy {
  flex: 0 0 auto;
  padding: 0 16px;
  font-size: 13px;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.pc-copy:hover {
  background: var(--green-dark);
}

.pc-hint {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink);
  opacity: .48;
}

.pc-status {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
}

.pc-status.ok {
  color: var(--green);
  background: var(--green-soft);
}

.pc-status.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.pc-activate-btn {
  display: block;
  width: 100%;
  padding: 11px;
  margin-top: 20px;
  text-align: center;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  box-sizing: border-box;
}

.pc-meta {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  opacity: .4;
}

@media (max-width: 560px) {
  .pc-auth-card {
    padding: 20px 16px;
  }

  .pc-copy-row code {
    font-size: 12.5px;
    padding: 8px 10px;
  }

  .pc-copy {
    padding: 0 12px;
    font-size: 12.5px;
  }
}
/* ==================== QQ 交流群入口 + 弹窗 ==================== */
/* 注意：本文件是外部样式表，不受 CSP style-src 'self' 限制。
   所有 QQ 群相关样式必须写在这里，不能写进模板的 <style> 标签。 */

.heading-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---- 顶部触发器按钮 ---- */
.qq-group-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, #12b7f5 0%, #0a84ff 100%);
  box-shadow: 0 2px 8px rgba(18, 183, 245, .32);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.qq-group-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(18, 183, 245, .42);
  filter: brightness(1.06);
}
.qq-group-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 5px rgba(18, 183, 245, .3);
}
.qq-group-btn:focus-visible {
  outline: 2px solid #0a84ff;
  outline-offset: 2px;
}

/* SVG 图标与文字垂直居中：display:block 消除 inline 基线间隙 */
.qq-group-btn svg {
  flex: 0 0 auto;
  display: block;
  width: 18px;
  height: 18px;
}

/* 文字部分：line-height:1 避免中文行高把基线抬高 */
.qq-group-btn span {
  display: block;
  line-height: 1;
}

/* ---- 弹窗容器 ---- */
.qq-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qq-modal[hidden] {
  display: none;
}

/* 遮罩 */
.qq-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .64);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: qqFadeIn .18s ease;
}

/* 卡片 */
.qq-modal-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
  padding: 20px 20px 14px;
  animation: qqPopIn .22s cubic-bezier(.22, 1.2, .36, 1);
}

/* 关闭按钮 */
.qq-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.qq-modal-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* 头部 */
.qq-modal-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding-right: 28px;
}
.qq-modal-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #12b7f5 0%, #0a84ff 100%);
}
.qq-modal-icon svg {
  display: block;
}
.qq-modal-titles h3 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}
.qq-modal-titles p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.3;
}

/* 二维码区域 */
.qq-modal-body {
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.qq-modal-qr {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 8px;
  user-select: none;
  -webkit-user-select: none;
}

/* 底部提示 */
.qq-modal-foot {
  margin-top: 11px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

/* 动画 */
@keyframes qqFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes qqPopIn {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 弹窗打开时锁背景滚动 */
body.qq-modal-open {
  overflow: hidden;
}

/* ---- 移动端 ---- */
@media (max-width: 640px) {
  .heading-right {
    gap: 10px;
  }
  .qq-group-btn {
    height: 32px;
    padding: 0 13px;
    font-size: 13px;
  }
  .qq-group-btn svg {
    width: 16px;
    height: 16px;
  }
  .qq-modal-card {
    max-width: 300px;
    padding: 16px 16px 12px;
  }
  .qq-modal-qr {
    max-width: 240px;
  }
  .qq-modal-head {
    margin-bottom: 12px;
  }
  .qq-modal-icon {
    width: 36px;
    height: 36px;
  }
  .qq-modal-titles h3 {
    font-size: 15px;
  }
}

/* 无障碍：减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .qq-modal-mask,
  .qq-modal-card,
  .qq-group-btn {
    animation: none !important;
    transition: none !important;
  }
}
