/* ==========================================================================
   授权中心 & 激活码管理 —— 页面专属样式
   （独立文件，符合 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 {
  /* 2026-11-29 改为 flex：卡片数不是列数整数倍时（如 5 张），
     最后一行自动居中，不会留空洞。
     grid 做不到「不满行居中」，只能靠 justify 或占位元素。 */
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 4px 0 18px;
  justify-content: center;
  max-width: 100%;
}

/* 卡片自适应宽度：
   · 最小 300px（低于此值换行）
   · 最大 400px（防止只有一张时拉满整行）
   · flex-grow:1 让同行卡片等宽铺满
   1440px 宽屏 → 3 列（3+2，第二行居中）
   800px 中屏   → 2 列（2+2+1，最后居中）
   窄屏         → 1 列 */
.dl-card {
  flex: 1 1 300px;
  min-width: 0;
  max-width: 400px;
}

.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;
  }
}

/* ==================== 默认清晰度下拉框 ==================== */
.quality-select {
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  background: #fff;
  cursor: pointer;
  min-width: 110px;
  transition: border-color .15s, box-shadow .15s;
}
.quality-select:hover { border-color: #94a3b8; }
.quality-select:focus {
  outline: none;
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10,132,255,.12);
}
.quality-select:disabled { opacity: .55; cursor: wait; }

/* ==================== 用户页：修改密码表单 ==================== */
.pwd-form {
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pwd-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pwd-row label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.pwd-row input {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pwd-row input:focus {
  outline: none;
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10,132,255,.12);
}
.pwd-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pwd-msg {
  font-size: 13px;
  line-height: 1.5;
}
.pwd-msg.ok { color: #15803d; }
.pwd-msg.err { color: #b91c1c; }

/* ==================== 登录页：忘记密码链接 ==================== */
.auth-links {
  margin-top: 12px;
  text-align: right;
  font-size: 13px;
}
.auth-links a {
  color: #0a84ff;
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }

/* ==================== 顶部：修改密码按钮 ==================== */
.acct-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.acct-btn {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.acct-btn:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .45);
}
.acct-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .35);
}

/* ==================== 密码弹窗微调 ==================== */
.qq-modal-card-pwd {
  max-width: 400px;
  text-align: left;
}
.qq-modal-card-pwd .qq-modal-body {
  padding-top: 4px;
}

/* 2026-12-02：独占一行的下载卡片（哔哩哔哩·手机）
   .dl-grid 是 flex-wrap，flex-basis:100% 会强制占满整行并换行。
   max-width 覆盖 .dl-card 的 400px 限制，让它真的横跨整行。 */
.dl-card.dl-card-full {
  flex: 1 1 100%;
  max-width: 100%;
}

/* 2026-12-04：两张卡片各占一半（哔哩哔哩手机 + 云视听小电视 TV）。
   .dl-grid 是 flex-wrap，用 calc(50% - gap/2) 让一行正好放下两张。
   gap 是 14px，所以各减 7px。 */
.dl-card.dl-card-half {
  flex: 1 1 calc(50% - 7px);
  max-width: calc(50% - 7px);
}

/* 小屏（<640px）恢复独占一行，避免卡片过窄挤成一团 */
@media (max-width: 640px) {
  .dl-card.dl-card-half {
    flex: 1 1 100%;
    max-width: 100%;
  }
}


/* ===== 贡献会员（2026-12-03，从模板迁入）===== */
.contrib-alert-bar { display:flex; gap:12px; align-items:flex-start;
  background:#fff4e5; border:1px solid #ffb74d; border-left:4px solid #f57c00;
  border-radius:10px; padding:14px 16px; margin:0 0 16px; }
.contrib-alert-icon { color:#f57c00; flex:0 0 auto; margin-top:2px; }
.contrib-alert-body { flex:1 1 auto; min-width:0; }
.contrib-alert-title { font-weight:600; color:#b45309; font-size:14px; margin-bottom:4px; }
.contrib-alert-text { font-size:13px; color:#7c4a03; line-height:1.7; }
.contrib-alert-note { margin-top:6px; color:#92700a; font-size:12px; }
.contrib-alert-btn { flex:0 0 auto; padding:7px 14px; background:#f57c00; color:#fff;
  border:none; border-radius:8px; font-size:13px; cursor:pointer; white-space:nowrap; }
.contrib-alert-btn:hover { filter:brightness(1.06); }

.contrib-card { max-width: 500px; width: calc(100vw - 32px); padding: 0;
  border-radius: 16px; overflow: hidden; }

.contrib-head { display: flex; gap: 14px; align-items: center;
  padding: 22px 24px 16px; background: linear-gradient(135deg,#fff7ed,#fff1e6);
  border-bottom: 1px solid #f5e0c8; }
.contrib-head-icon { flex: 0 0 auto; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#ff9a3c,#ff6b35); color: #fff;
  border-radius: 12px; box-shadow: 0 4px 12px rgba(255,107,53,.28); }
.contrib-head-text h3 { margin: 0 0 4px; font-size: 17px; color: #1f2937;
  font-weight: 700; }
.contrib-head-text p { margin: 0; font-size: 13px; color: #8a6a4a; line-height: 1.5; }
.contrib-head-text p b { color: #ff6b35; font-size: 15px; }

.contrib-quota { margin: 16px 24px 0; padding: 10px 14px;
  background: #f8fafc; border: 1px solid #e8eef4; border-radius: 10px;
  font-size: 13px; color: #475569; line-height: 1.6; }
.contrib-quota b { color: #0f766e; font-size: 15px; }

.contrib-step-label { margin: 18px 24px 10px; font-size: 13px;
  font-weight: 600; color: #64748b; letter-spacing: .3px; }


.contrib-tabs { display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 0 24px; }
.contrib-tab { position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 5px; padding: 14px 8px 12px;
  background: #fff; border: 2px solid #e5e9f0; border-radius: 12px;
  cursor: pointer; transition: all .18s ease; font-family: inherit;
  color: #64748b; }
.contrib-tab:hover { border-color: #ffc89b; background: #fffaf5;
  transform: translateY(-1px); }
.contrib-tab .ct-ico { color: #94a3b8; transition: color .18s; display: flex; }
.contrib-tab .ct-name { font-size: 13.5px; font-weight: 600; color: #374151;
  line-height: 1.2; }
.contrib-tab .ct-sub { font-size: 11.5px; color: #9aa5b1; line-height: 1.2; }
.contrib-tab .ct-tick { position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%; background: #ff6b35;
  color: #fff; display: none; align-items: center; justify-content: center; }


.contrib-tab.active { border-color: #ff6b35; background: #fff4ec;
  box-shadow: 0 0 0 3px rgba(255,107,53,.12); }
.contrib-tab.active .ct-ico { color: #ff6b35; }
.contrib-tab.active .ct-name { color: #d94f14; }
.contrib-tab.active .ct-sub { color: #e8834a; }
.contrib-tab.active .ct-tick { display: flex; }

.contrib-require { margin: 14px 24px 0; padding: 10px 14px;
  background: #fff8e6; border-left: 3px solid #f5b942; border-radius: 6px;
  font-size: 12.5px; color: #7c5a1a; line-height: 1.6; }
.contrib-require b { color: #b45309; }

.contrib-stage { padding: 18px 24px 0; }
.contrib-qr-box { display: flex; align-items: center; justify-content: center;
  min-height: 200px; padding: 14px; background: #fafbfc;
  border: 1.5px dashed #d8e0e8; border-radius: 12px; }
.contrib-qr-box img { width: 180px; height: 180px; object-fit: contain;
  border-radius: 8px; background: #fff; }
.contrib-qr-ph { display: flex; flex-direction: column; align-items: center;
  gap: 10px; color: #b0bcc9; font-size: 13px; }
.contrib-qr-ph svg { color: #cbd5e1; }

.contrib-actions { display: flex; gap: 10px; padding: 16px 24px 0;
  flex-wrap: wrap; }
.contrib-btn-main { flex: 1 1 auto; min-width: 130px; padding: 11px 18px;
  background: linear-gradient(135deg,#ff9a3c,#ff6b35); color: #fff;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 3px 10px rgba(255,107,53,.28);
  transition: filter .15s, transform .15s; }
.contrib-btn-main:hover:not(:disabled) { filter: brightness(1.05);
  transform: translateY(-1px); }
.contrib-btn-main:disabled { opacity: .6; cursor: default; }
.contrib-btn-ghost { padding: 11px 18px; background: #fff;
  border: 1px solid #d8e0e8; border-radius: 10px; font-size: 14px;
  color: #64748b; cursor: pointer; font-family: inherit; }
.contrib-btn-ghost:hover { background: #f8fafc; border-color: #c3ced9; }

.contrib-result { margin: 12px 24px 0; font-size: 13px; line-height: 1.6;
  min-height: 0; }
.contrib-result:not(:empty) { padding: 10px 14px; border-radius: 8px;
  background: #f8fafc; }
.contrib-result .contrib-ok { color: #0a7d34; font-weight: 600; }
.contrib-result .contrib-err { color: #c62828; font-weight: 600; }

.contrib-foot-note { margin-top: 18px; padding: 12px 24px;
  background: #f8fafc; border-top: 1px solid #eef2f6;
  font-size: 12px; color: #94a3b8; line-height: 1.6; text-align: center; }

@media (max-width: 420px) {
  .contrib-head { padding: 18px 18px 14px; }
  .contrib-quota, .contrib-step-label, .contrib-tabs, .contrib-require,
  .contrib-stage, .contrib-actions, .contrib-result { margin-left: 18px;
    margin-right: 18px; padding-left: 0; padding-right: 0; }
  .contrib-tabs { padding: 0; gap: 8px; }
  .contrib-tab { padding: 12px 4px 10px; }
  .contrib-tab .ct-name { font-size: 12.5px; }
}
