/* ================================================================
   国家选择抽屉
   ================================================================ */
.ai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 768px) {
  .ai-overlay {
    align-items: center;
  }
}
.ai-overlay-bg {
  position: absolute;
  inset: 0;
}
.ai-drawer {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.ai-drawer.show {
  transform: translateY(0);
}
@media (min-width: 768px) {
  .ai-drawer {
    border-radius: 24px;
    max-height: 80vh;
    transform: translateY(0) scale(0.95);
    opacity: 0;
    transition: all 0.25s ease;
  }
  .ai-drawer.show {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.ai-drawer-handle {
  width: 40px;
  height: 4px;
  background: #D1D5DB;
  border-radius: 2px;
  margin: 0 auto 12px;
}
@media (min-width: 768px) {
  .ai-drawer-handle { display: none; }
}
.ai-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ai-drawer-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.ai-drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 18px;
  color: #9CA3AF;
  cursor: pointer;
  border-radius: 50%;
}
.ai-drawer-close:hover {
  background: #F3F4F6;
}
.ai-drawer-close--abs {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* 国家分组 */
.ai-country-group + .ai-country-group {
  margin-top: 20px;
}
.ai-country-group-label {
  font-size: 12px;
  font-weight: 600;
  color: #9CA3AF;
  margin: 0 0 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-country-group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 768px) {
  .ai-country-group-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.ai-country-btn {
  padding: 10px 6px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  background: #F9FAFB;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.15s ease;
}
.ai-country-btn:hover {
  border-color: var(--primary, #0D9488);
  background: var(--primary-lighter, #F0FDFA);
}
.ai-country-btn--active {
  border-color: var(--primary, #0D9488);
  background: var(--primary-light, #CCFBF1);
  color: var(--primary, #0D9488);
  font-weight: 600;
}

/* ================================================================
   PRO 场景转化弹窗
   ================================================================ */
.ai-pro-modal-inner {
  text-align: center;
  padding-top: 16px;
}
.ai-pro-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light, #CCFBF1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.ai-pro-icon i {
  font-size: 20px;
  color: var(--primary, #0D9488);
}
.ai-pro-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}
.ai-pro-desc {
  font-size: 13px;
  color: #6B7280;
  margin: 0 0 16px;
}
.ai-pro-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}
.ai-pro-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  padding: 5px 0;
}
.ai-pro-benefits li i {
  color: var(--primary, #0D9488);
  margin-top: 2px;
  flex-shrink: 0;
}
.ai-pro-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F9FAFB;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.ai-pro-offer-name {
  font-weight: 700;
  font-size: 14px;
}
.ai-pro-offer-sub {
  font-size: 11px;
  color: #9CA3AF;
}
.ai-pro-offer-amount {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary, #0D9488);
}
.ai-pro-offer-period {
  font-size: 13px;
  font-weight: 400;
  color: #6B7280;
}
.ai-pro-offer-total {
  font-size: 11px;
  color: #9CA3AF;
  text-align: right;
}
.ai-pro-cta {
  width: 100%;
  padding: 14px;
  background: var(--primary, #0D9488);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  min-height: 48px;
}
.ai-pro-cta:hover {
  background: var(--primary-hover, #0F766E);
}
.ai-pro-cta:active {
  transform: scale(0.98);
}
.ai-pro-cta-secondary {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  background: transparent;
  color: var(--text-secondary, #64748B);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s;
}
.ai-pro-cta-secondary:hover {
  background: var(--bg-secondary, #F8FAFC);
  border-color: #CBD5E1;
}
.ai-pro-link-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  background: none;
  border: none;
  color: var(--primary, #0D9488);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.ai-pro-link-btn:hover {
  text-decoration: underline;
}
#aiProModal[data-mode="quota"] .ai-pro-icon {
  background: #FEF3C7;
  color: #B45309;
}
.ai-chat-pro-upsell {
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px dashed rgba(13, 148, 136, 0.2);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 0 0 14px 14px;
}
.ai-chat-pro-upsell-text {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #64748B);
}
.ai-chat-pro-upsell-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border) 65%);
  background: var(--primary-lighter, #F0FDFA);
  color: var(--primary, #0D9488);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  max-width: 100%;
}
.ai-chat-message--ai .ai-chat-bubble:has(+ .ai-chat-pro-upsell),
.ai-chat-message--ai .ai-chat-message-body:has(.ai-chat-pro-upsell) .ai-chat-bubble {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.ai-feature-btn--highlight {
  border-color: var(--primary, #0D9488);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
  animation: aiFeaturePulse 1.2s ease-in-out 3;
}
@keyframes aiFeaturePulse {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 40%, transparent); }
}
.ai-pro-note {
  font-size: 11px;
  color: #9CA3AF;
  margin: 12px 0 0;
}

/* ================================================================
   完整会员弹窗
   ================================================================ */
.ai-full-modal-inner {
  padding-top: 8px;
}
.ai-full-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  text-align: center;
}
.ai-full-desc {
  font-size: 13px;
  color: #6B7280;
  margin: 0 0 16px;
  text-align: center;
}
.ai-full-toggle {
  display: flex;
  background: #F3F4F6;
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 16px;
  gap: 0;
}
.ai-full-toggle .ai-toggle-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  color: #6B7280;
  transition: all 0.15s;
}
.ai-full-toggle .ai-toggle-btn--active {
  background: #fff;
  color: var(--text-primary, #1E293B);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.ai-full-plans {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.ai-full-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  position: relative;
}
.ai-full-plan--disabled {
  opacity: 0.7;
}
.ai-full-plan--featured {
  border: 2px solid var(--primary, #0D9488);
}
.ai-full-plan-badge {
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--primary, #0D9488);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.ai-full-plan-name {
  font-weight: 600;
  font-size: 14px;
}
.ai-full-plan-sub {
  font-size: 11px;
  color: #9CA3AF;
}
.ai-full-plan-price {
  text-align: right;
}
.ai-full-amount {
  font-weight: 700;
  font-size: 16px;
}
.ai-full-amount-sub {
  font-size: 11px;
  color: #9CA3AF;
}
.ai-full-period {
  font-size: 13px;
  font-weight: 400;
  color: #6B7280;
}
.ai-full-cta {
  width: 100%;
  padding: 14px;
  background: var(--primary, #0D9488);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  min-height: 48px;
}
.ai-full-cta:hover {
  background: var(--primary-hover, #0F766E);
}
.ai-full-note {
  font-size: 11px;
  color: #9CA3AF;
  margin: 12px 0 0;
  text-align: center;
}
.ai-full-benefits {
  border-top: 1px solid #E5E7EB;
  margin-top: 16px;
  padding-top: 12px;
}
.ai-full-benefits-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}
.ai-full-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ai-full-benefits li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6B7280;
  padding: 4px 0;
}
.ai-full-benefits li i {
  color: var(--primary, #0D9488);
  font-size: 12px;
}

/* ================================================================
   定价页面
   ================================================================ */
.ai-profile-page {
  padding: 24px 16px 60px;
  max-width: 900px;
  margin: 0 auto;
}
#aiPage[data-view="pricing"] .ai-profile-page {
  min-height: calc(100dvh - 48px - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--safe-top, 0px) + var(--mobile-chrome-row, 48px) + 16px);
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1025px) {
  #aiPage[data-view="pricing"] .ai-profile-page {
    padding-top: 24px;
  }
}
#aiPage[data-view="pricing"] #aiQuotaMeter,
#aiPage[data-view="pricing"] #aiQuotaMeterUnlimited {
  display: none !important;
}
#aiPage[data-view="pricing"] main.ai-chat-container.is-hidden {
  display: none !important;
}
.ai-pricing-header {
  text-align: center;
  margin-bottom: 32px;
}
.ai-pricing-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
}
.ai-pricing-desc {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 20px;
}
.ai-pricing-toggle {
  display: inline-flex;
  background: #F3F4F6;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.ai-toggle-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  color: #6B7280;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-toggle-btn--active {
  background: var(--primary, #0D9488);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.ai-toggle-badge {
  font-size: 11px;
  opacity: 0.9;
}
.ai-toggle-btn--active .ai-toggle-badge {
  opacity: 0.9;
}

.ai-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.ai-plan-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid #E5E7EB;
  position: relative;
  transition: all 0.2s ease;
}
.ai-plan-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.ai-plan-card--featured {
  border: 2px solid var(--primary, #0D9488);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.08);
  padding-top: 36px;
  margin-top: 14px;
}
.ai-plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary, #0D9488);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 1;
}
.ai-plan-price {
  margin-bottom: 16px;
  min-height: 44px;
}
.ai-plan-price .ai-plan-amount {
  display: inline;
}
.ai-plan-price .ai-plan-period {
  display: inline;
  margin-left: 2px;
}
.ai-plan-subprice {
  display: block;
  font-size: 13px;
  color: #9CA3AF;
  margin: 4px 0 0;
}
.ai-plan-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 2px;
}
.ai-plan-sub {
  font-size: 13px;
  color: #9CA3AF;
  margin: 0 0 12px;
}
.ai-plan-amount {
  font-size: 32px;
  font-weight: 800;
}
.ai-plan-period {
  font-size: 14px;
  color: #6B7280;
}
@media (min-width: 768px) {
  .ai-plan-card--featured {
    transform: translateY(-4px);
  }
}
.ai-plan-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  margin-bottom: 20px;
  min-height: 44px;
  border: 1px solid #D1D5DB;
  background: #fff;
  color: #6B7280;
}
.ai-plan-btn:active {
  transform: scale(0.98);
}
.ai-plan-btn--primary {
  background: var(--primary, #0D9488);
  color: #fff;
  border: none;
}
.ai-plan-btn--primary:hover {
  background: var(--primary-hover, #0F766E);
}
.ai-plan-btn--outline {
  border: 1px solid var(--primary, #0D9488);
  color: var(--primary, #0D9488);
  background: transparent;
}
.ai-plan-btn--outline:hover {
  background: var(--primary-lighter, #F0FDFA);
}
.ai-plan-btn--disabled {
  cursor: default;
  opacity: 0.7;
}
.ai-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}
.ai-plan-feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  padding: 5px 0;
  color: #374151;
}
.ai-plan-feature--inc i {
  color: var(--primary, #0D9488);
  margin-top: 2px;
  flex-shrink: 0;
}
.ai-plan-feature--exc {
  color: #9CA3AF;
}
.ai-plan-feature--exc i {
  color: #D1D5DB;
  margin-top: 2px;
  flex-shrink: 0;
}
.ai-payment-note {
  text-align: center;
  font-size: 13px;
  color: #9CA3AF;
}

/* FAQ — 折叠手风琴 */
.ai-faq-section {
  max-width: 700px;
  margin: 32px auto 0;
  padding-bottom: 8px;
}
.ai-faq-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 16px;
}
.ai-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-faq-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #E5E7EB;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-faq-item.is-open {
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.06);
}
.ai-faq-trigger {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.ai-faq-trigger:focus-visible {
  outline: 2px solid var(--primary, #0D9488);
  outline-offset: 2px;
  border-radius: 6px;
}
.ai-faq-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  line-height: 1.45;
  flex: 1;
}
.ai-faq-item.is-open .ai-faq-q {
  color: var(--primary, #0D9488);
}
.ai-faq-chevron {
  font-size: 12px;
  color: #9CA3AF;
  transition: transform 0.2s ease, color 0.15s ease;
  flex-shrink: 0;
  margin-top: 3px;
}
.ai-faq-item.is-open .ai-faq-chevron {
  transform: rotate(180deg);
  color: var(--primary, #0D9488);
}
.ai-faq-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.2s ease;
}
.ai-faq-item.is-open .ai-faq-panel {
  max-height: 320px;
  opacity: 1;
  margin-top: 10px;
}
.ai-faq-panel[hidden] {
  display: block;
}
.ai-faq-panel p {
  font-size: 13px;
  color: #6B7280;
  margin: 0;
  line-height: 1.55;
}
.ai-faq-footnote {
  text-align: center;
  font-size: 11px;
  color: #9CA3AF;
  margin: 14px 0 0;
  line-height: 1.5;
}

/* ================================================================
   欢迎卡片中的 suggestions（chip 行）
   ================================================================ */
.ai-chat-empty .ai-chat-suggestions {
  margin-top: 6px;
}

/* ================================================================