/* 服务订阅弹窗（参考豆包订阅结构，品牌色） */
.modal-mask.subscribe-layer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 16px;
}
.modal-mask.subscribe-layer.show {
  display: flex;
}

.subscribe-shell {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: min(840px, 96vw);
  height: auto;
  max-height: min(90vh, 680px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8eaed;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.subscribe-modal {
  flex: 1 1 54%;
  min-width: 0;
  height: auto;
  overflow: auto;
  background: #fff;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid #eef0f3;
}

.subscribe-status {
  flex: 0 0 300px;
  width: 300px;
  height: auto;
  overflow: auto;
  background: #f7f8fa;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subscribe-status-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  flex-shrink: 0;
}
.subscribe-status-total {
  font-size: 13px;
  color: #6b7280;
  padding: 0 2px;
  flex-shrink: 0;
}
.subscribe-status-total strong {
  color: #e75907;
  font-size: 18px;
  font-weight: 700;
  margin: 0 2px;
}
#subscribe-status-body {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subscribe-status-stack {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subscribe-status-card {
  flex: 0 0 auto;
  min-height: 0;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.subscribe-status-card.is-empty {
  background: #fff;
}
.subscribe-status-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.subscribe-status-card-title em {
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  color: #e75907;
  background: #fff5ec;
  border-radius: 999px;
  padding: 1px 7px;
}
.subscribe-status-card-body {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
}
.subscribe-status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.35;
}
.subscribe-status-label { color: #9ca3af; flex-shrink: 0; }
.subscribe-status-value {
  color: #111;
  text-align: right;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.subscribe-status-empty {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}
.subscribe-status-note {
  margin: 4px 0 0;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
}

.subscribe-top {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
}
.subscribe-top h2 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #111;
}
.subscribe-back {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}
.subscribe-back:hover { background: #f3f4f6; color: #111; }
.subscribe-top-spacer { width: 32px; height: 32px; }

.subscribe-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.subscribe-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  font-family: inherit;
}
.subscribe-tab.is-active {
  background: #fff;
  color: #111;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.subscribe-body { display: flex; flex-direction: column; gap: 12px; }
#subscribe-panel-package {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#subscribe-panel-recharge { display: block; }
#subscribe-panel-package.hidden,
#subscribe-panel-recharge.hidden { display: none !important; }
.subscribe-recharge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.subscribe-recharge-validity {
  margin: 0 0 10px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.subscribe-card {
  position: relative;
  text-align: left;
  border: 1px solid transparent;
  background: #f5f6f7;
  border-radius: 12px;
  padding: 14px 12px 12px;
  cursor: pointer;
  font-family: inherit;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subscribe-card.is-active {
  background: #fff5ec;
  border-color: #fe740f;
}
.subscribe-card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #c4c7cc;
  background: #fff;
}
.subscribe-card.is-active .subscribe-card-check {
  border-color: #fe740f;
  background: #fe740f;
  box-shadow: inset 0 0 0 3px #fff;
}
.subscribe-card-name {
  margin-top: 10px;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}
.subscribe-card-points {
  font-size: 12px;
  color: #9ca3af;
}
.subscribe-card-price {
  margin-top: auto;
  font-size: 20px;
  font-weight: 700;
  color: #111;
  font-variant-numeric: tabular-nums;
}
.subscribe-card.is-active .subscribe-card-price { color: #e75907; }

.subscribe-custom {
  grid-column: 1 / -1;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
}
.subscribe-custom.is-active {
  border-color: #fe740f;
  background: #fff5ec;
}
.subscribe-custom-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}
.subscribe-custom-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.subscribe-custom-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.subscribe-custom-points {
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
}
.subscribe-custom-points strong {
  color: #e75907;
  font-size: 16px;
}
.subscribe-custom-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.45;
}

.subscribe-submit {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #fe740f;
  cursor: pointer;
  font-family: inherit;
}
.subscribe-submit:hover { opacity: 0.94; }

.subscribe-cancel-hint {
  margin: -4px 0 0;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.45;
}

.subscribe-agree {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  cursor: pointer;
}
.subscribe-agree input {
  margin-top: 2px;
  flex-shrink: 0;
}
.subscribe-agree a {
  color: #e75907;
  text-decoration: none;
}

.subscribe-dialog {
  width: min(360px, 90vw);
  background: #fff;
  border-radius: 14px;
  padding: 22px 20px 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}
.subscribe-dialog h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #111;
}
.subscribe-dialog p {
  margin: 0 0 18px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}
.subscribe-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.subscribe-btn-ghost,
.subscribe-btn-primary {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.subscribe-btn-ghost {
  background: #f3f4f6;
  color: #374151;
}
.subscribe-btn-primary {
  background: #fe740f;
  color: #fff;
  font-weight: 600;
}

.subscribe-pay-modal {
  position: relative;
  width: min(360px, 90vw);
  background: #fff;
  border-radius: 16px;
  padding: 28px 22px 22px;
  text-align: center;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.16);
}
.subscribe-pay-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 8px;
}
.subscribe-pay-close:hover { background: #f3f4f6; color: #111; }
.subscribe-pay-modal h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #111;
}
.subscribe-pay-amount {
  font-size: 36px;
  font-weight: 700;
  color: #111;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
.subscribe-qr-box {
  width: 200px;
  height: 200px;
  margin: 0 auto 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(45deg, #f3f4f6 25%, transparent 25%) -8px 0 / 16px 16px,
    linear-gradient(-45deg, #f3f4f6 25%, transparent 25%) -8px 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, #f3f4f6 75%) -8px 0 / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #f3f4f6 75%) -8px 0 / 16px 16px,
    #fff;
}
.subscribe-qr-placeholder {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
}
.subscribe-qr-placeholder span {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}
.subscribe-qr-placeholder small {
  font-size: 11px;
  color: #9ca3af;
}
.subscribe-pay-tip {
  margin: 0 0 14px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}
.subscribe-pay-modal .subscribe-btn-primary {
  width: 100%;
  border-radius: 999px;
  padding: 12px 16px;
}

#token-stats.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#token-stats.is-clickable:hover {
  border-color: #fdba8c;
  box-shadow: 0 0 0 2px rgba(254, 116, 15, 0.08);
}
#token-stats .token-stat-value.is-points {
  color: #e75907;
}

@media (max-width: 720px) {
  .subscribe-shell {
    flex-direction: column;
    width: min(440px, 96vw);
    height: auto;
    max-height: min(92vh, 860px);
  }
  .subscribe-modal {
    border-right: none;
    border-bottom: 1px solid #eef0f3;
    flex: 1 1 auto;
    height: auto;
    max-height: 52vh;
  }
  .subscribe-status {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    max-height: 40vh;
    overflow: auto;
  }
  .subscribe-status-stack {
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .subscribe-modal { padding: 14px 14px 16px; }
  .subscribe-card-price { font-size: 18px; }
}
