/* =====================================================
   OpenClaw 申请激活码页面 — 深色主题
   ===================================================== */

.header__nav-link.is-active {
  color: var(--color-brand-blue);
  font-weight: 600;
}

/* ---------- Hero ---------- */
.apply-hero {
  padding: 180px 0 48px;
  text-align: center;
}

.apply-hero__title {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-heading);
}

.apply-hero__subtitle {
  margin-top: 12px;
  font-size: 16px;
  color: var(--color-text-regular);
}

/* ---------- 两种方式 ---------- */
.apply-ways {
  padding-bottom: 96px;
}

.apply-ways__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  align-items: stretch;
}

@media (max-width: 860px) {
  .apply-ways__inner {
    grid-template-columns: 1fr;
  }
}

.way-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s var(--ease-in-out);
}

.way-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.way-card__head {
  margin-bottom: var(--spacing-sm);
}

.way-card__badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--gradient-primary);
  margin-bottom: 10px;
}

.way-card__title {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text-heading);
}

.way-card__desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.way-card__note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.45);
  color: #25D366;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.way-card__note::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.2);
  color: #25D366;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.buy-perks {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #25D366;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: 999px;
}

/* ---------- 购买 ---------- */
.buy-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.buy-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-regular);
  margin: 18px 0 8px;
}

.buy-label:first-of-type {
  margin-top: 0;
}

.pay-channels {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.pay-channel input {
  display: none;
}

.pay-channel__box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-bg-section);
  cursor: pointer;
  transition: all 0.2s var(--ease-in-out);
}

.pay-channel input:checked + .pay-channel__box {
  border-color: var(--color-brand-blue);
  background: rgba(38, 165, 228, 0.08);
}

.pay-channel__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.pay-channel__alipay .pay-channel__icon {
  background: #1677ff;
}

.pay-channel__wechat .pay-channel__icon {
  background: #07c160;
}

.pay-channel__name {
  font-size: 14px;
  color: var(--color-text-primary);
}

.btn--pay {
  width: 100%;
  height: 48px;
  font-size: 16px;
  margin-top: auto;
  margin-bottom: 22px;
}

.btn--pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- 抖音领取 ---------- */
.douyin-body {
  text-align: center;
  padding: 12px 0 8px;
}

.douyin-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  background: linear-gradient(135deg, #25F4EE 0%, #FE2C55 50%, #FFC20E 100%);
  box-shadow: 0 8px 24px rgba(254, 44, 85, 0.35);
}

.douyin-hint {
  font-size: 14px;
  color: var(--color-text-regular);
  margin-bottom: 10px;
}

.douyin-id {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.douyin-id__text {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-text-heading);
  font-family: "Courier New", Consolas, monospace;
}

.btn--copy {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  color: var(--color-text-primary);
  background: var(--color-bg-section);
  cursor: pointer;
  transition: all 0.2s var(--ease-in-out);
}

.btn--copy:hover {
  border-color: var(--color-brand-blue);
  color: var(--color-brand-blue);
}

.douyin-desc {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ---------- 邀请码 ---------- */
.invite-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 0 8px;
}

.invite-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
}

.invite-input-row input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-bg-section);
  color: var(--color-text-primary);
  font-size: 15px;
  font-family: "Courier New", Consolas, monospace;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.2s var(--ease-in-out);
  text-transform: uppercase;
}

.invite-input-row input:focus {
  border-color: var(--color-brand-blue);
}

.btn--invite {
  height: 48px;
  padding: 0 20px;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn--invite:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.invite-desc {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ---------- 弹窗 ---------- */
.apply-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 16px;
}

.apply-modal__box {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-card-hover);
}

.apply-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.apply-modal__close:hover {
  color: var(--color-text-heading);
  background: var(--color-bg-section);
}

.apply-modal__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-heading);
}

.qr-wrap {
  margin: 18px auto;
  width: 260px;
  height: 260px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qr-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.apply-modal__amount {
  font-size: 14px;
  color: var(--color-text-regular);
}

.apply-modal__amount strong {
  font-size: 20px;
  color: var(--color-brand-blue);
}

.apply-modal__tip {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-primary);
}

.apply-modal__tip span {
  font-weight: 600;
  color: var(--color-brand-blue);
}

.pay-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-text-regular);
}

.pay-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-brand-blue);
  animation: pulse 1.2s infinite;
}

.pay-status-dot.paid {
  background: #22c55e;
  animation: none;
}

.pay-status-dot.failed {
  background: #ef4444;
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.apply-modal__hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.apply-modal__order {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
  word-break: break-all;
  text-align: center;
}

.result-order {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
  word-break: break-all;
}

.order-lookup {
  margin-top: 10px;
  font-size: 12px;
  text-align: center;
}

.order-lookup a {
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s var(--ease-in-out, ease);
}

.order-lookup a:hover,
.order-lookup a:focus-visible {
  color: var(--color-brand-blue);
}

.lookup-input {
  width: 100%;
  box-sizing: border-box;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #d8dee9);
  border-radius: 8px;
  background: var(--color-bg-page, #f7f8fa);
  color: var(--color-text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s var(--ease-in-out, ease);
}

.lookup-input:focus {
  border-color: var(--color-brand-blue);
}

.lookup-error {
  min-height: 0;
  margin: 0;
  font-size: 13px;
  color: #ef4444;
  text-align: center;
}

.lookup-error:not(:empty) {
  min-height: 18px;
  margin: 10px 0 12px;
}

.lookup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 0;
}

.btn--lookup {
  height: 40px;
  padding: 0 22px;
  font-size: 14px;
  border-radius: var(--radius-button);
}

.btn--lookup-cancel {
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  background: var(--color-bg-section);
}

.btn--lookup-cancel:hover {
  border-color: var(--color-brand-blue);
  color: var(--color-brand-blue);
}

.btn--lookup:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- 支付成功 ---------- */
.result-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-regular);
}

.result-codes {
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
}

.result-code__idx {
  font-size: 12px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.result-code__val {
  flex: 1;
  text-align: left;
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
  color: var(--color-text-heading);
  word-break: break-all;
}

.btn--result-copy {
  width: 100%;
  height: 44px;
}

.result-tip {
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.result-tip--warn {
  color: #f59e0b;
  font-weight: 600;
}

/* ========== 通用 Message Toast ========== */
.message-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 10px;
  background: var(--color-bg-card, #252530);
  border: 1px solid var(--color-border, #27272A);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  color: var(--color-text-primary, #E4E4E7);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 32px);
}

.message--in {
  opacity: 1;
  transform: translateY(0);
}

.message--out {
  opacity: 0;
  transform: translateY(-12px);
}

.message__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.message--success .message__icon { background: #22c55e; }
.message--error .message__icon { background: #ef4444; }
.message--warning .message__icon { background: #f59e0b; }
.message--info .message__icon { background: #26A5E4; }

.message--success { border-color: rgba(34, 197, 94, 0.35); }
.message--error { border-color: rgba(239, 68, 68, 0.35); }
.message--warning { border-color: rgba(245, 158, 11, 0.35); }
.message--info { border-color: rgba(38, 165, 228, 0.35); }
