/* =============================================================
   gate.css —— 用量 / 限流 / 封禁 的前端呈现
   跟随站点主题（浅色 / 深色都适配），全部用既有 CSS 变量。
   ============================================================= */

/* ---------------- 配额条 ---------------- */
.gate-quota {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(99, 102, 241, .07), rgba(6, 182, 212, .06) 70%, transparent),
    var(--surface);
  font-size: .82rem;
  color: var(--text-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}

.gate-quota .gq-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  color: var(--brand-1);
  background: var(--brand-soft);
}

.gate-quota .gq-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.gate-quota .gq-main b {
  color: var(--text);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.gate-quota .gq-main small {
  color: var(--muted);
  font-size: .74rem;
}

.gate-quota .gq-track {
  flex: 0 0 108px;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.gate-quota .gq-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-grad);
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

.gate-quota.is-low {
  border-color: rgba(239, 68, 68, .35);
  background:
    linear-gradient(120deg, rgba(239, 68, 68, .09), transparent 70%),
    var(--surface);
}

.gate-quota.is-low .gq-icon {
  color: var(--bad);
  background: rgba(239, 68, 68, .12);
}

.gate-quota.is-low .gq-track i {
  background: var(--bad);
}

/* ---------------- 按钮倒计时态 ---------------- */
#btnSynth.is-limited {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  border: 1px dashed var(--border-strong) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 1 !important;
}

#btnSynth.is-limited span,
#btnSynth.is-limited {
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* ---------------- 长时封禁：整块替换 ---------------- */
.gate-block {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, .28);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 12% 0%, rgba(239, 68, 68, .14), transparent 55%),
    radial-gradient(90% 90% at 100% 100%, rgba(99, 102, 241, .12), transparent 60%),
    var(--surface);
  padding: 40px 32px 34px;
  text-align: center;
}

.gate-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: .35;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 12%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 40%, #000 12%, transparent 72%);
  pointer-events: none;
}

.gate-block .gb-card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.gate-block .gb-badge {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(140deg, #ef4444, #b91c1c);
  box-shadow: 0 10px 28px -12px rgba(239, 68, 68, .85);
}

.gate-block h3 {
  margin: 0 0 10px;
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.gate-block .gb-reason {
  margin: 0 auto 22px;
  max-width: 470px;
  color: var(--text-2);
  font-size: .92rem;
  line-height: 1.7;
}

.gate-block .gb-clock {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.gate-block .gb-clock-label {
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-block .gb-clock-num {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--bad);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.gate-block .gb-friend {
  margin: 0 auto 22px;
  max-width: 470px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.72;
}

.gate-block .gb-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

html.is-gate-blocked .studio-note { display: none; }

@media (max-width: 640px) {
  .gate-quota {
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .gate-quota .gq-track { flex: 1 1 100%; }
  .gate-block { padding: 30px 18px 26px; }
  .gate-block .gb-clock-num { font-size: 1.7rem; }
}
