/**
 * pricing.css - 套餐价格页专属样式
 * 依赖 common.css 提供的变量/reset/footer/toast
 * 引入顺序：common.css → pricing.css
 *
 * 页面结构：Hero(模块tab) → 套餐卡片 → 功能对比 → FAQ → 购买弹窗
 */

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.pricing-hero { padding: 80px 0 40px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); text-align: center; }
.pricing-hero h1 { font-size: 44px; font-weight: 800; margin-bottom: 16px; }
.pricing-hero p { font-size: 18px; color: var(--muted); max-width: 600px; margin: 0 auto 24px; }

/* ─── 模块 Tab（短链 / 活码） ────────────────────────────────────────────────── */
.module-tabs { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.module-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 28px; border: none; background: transparent; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; color: var(--text-light); transition: all .2s; }
.module-tabs button .tab-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.module-tabs button .tab-icon svg { width: 18px; height: 18px; }
.module-tabs button.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.25); }
.module-tabs button:hover:not(.active) { background: var(--bg); color: var(--text); }

/* ─── 模块区域 ──────────────────────────────────────────────────────────────── */
.pricing-sec { padding: 32px 0 64px; max-width: var(--site-max-width, 1200px); margin: 0 auto; padding-left: var(--site-side-pad, 24px); padding-right: var(--site-side-pad, 24px); }
.module-header { text-align: center; margin-bottom: 36px; }
.module-header .module-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; margin-bottom: 12px; }
.module-header .module-icon svg { width: 28px; height: 28px; }
.module-header .link-icon { background: #dbeafe; color: #2563eb; }
.module-header .live-icon { background: #ede9fe; color: #7c3aed; }
.module-header h2 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.module-header p { font-size: 15px; color: var(--muted); max-width: 500px; margin: 0 auto; }

/* ─── 套餐卡片 ──────────────────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 0 auto 48px; }
.pricing-card { background: #fff; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); border: 2px solid transparent; transition: all .3s; position: relative; }
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.featured { border-color: var(--primary); }
.pricing-card.featured::before { content: '推荐'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gradient); color: #fff; padding: 4px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pricing-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.pricing-desc { font-size: 14px; color: var(--muted); margin-bottom: 20px; min-height: 40px; }
.pricing-price { margin-bottom: 24px; }
.pricing-price .currency { font-size: 20px; color: var(--text); }
.pricing-price .amount { font-size: 42px; font-weight: 800; color: var(--text); }
.pricing-price .period { font-size: 14px; color: var(--muted); }
.pricing-price .yearly-tag { margin-top: 8px; font-size: 13px; color: var(--success); background: #f0fdf4; padding: 4px 10px; border-radius: 6px; display: inline-block; }
.pricing-features { list-style: none; margin-bottom: 24px; }
.pricing-features li { padding: 8px 0; font-size: 14px; color: var(--text-light); display: flex; align-items: center; gap: 8px; }
.pricing-features .feat-check { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; color: var(--success); }
.pricing-features .feat-check svg { width: 16px; height: 16px; }
.pricing-features li.feature-header { gap: 0; }
.feature-header-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary); background: #eef2ff; padding: 3px 10px; border-radius: 6px; }
.pricing-btn { width: 100%; padding: 12px; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; }
.pricing-btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.pricing-btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.pricing-btn-primary { background: var(--gradient); color: #fff; }
.pricing-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.3); }

/* ─── 功能对比表 ─────────────────────────────────────────────────────────────── */
.pricing-compare { margin: 0 auto; }
.pricing-compare h3 { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 24px; color: var(--text); }
.compare-table { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.compare-table table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 14px 20px; text-align: left; font-size: 14px; }
.compare-table th { background: var(--bg); font-weight: 600; color: var(--text); }
.compare-table th.highlight { background: var(--primary); color: #fff; }
.compare-table td { color: var(--text-light); }
.compare-table td.highlight { color: var(--primary); font-weight: 600; }
.compare-table tr:not(:last-child) td { border-bottom: 1px solid var(--border-light); }
.compare-category { background: var(--bg-soft) !important; font-weight: 600; color: var(--text) !important; }
.cmp-check { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--success); }
.cmp-check svg { width: 16px; height: 16px; }

/* ─── FAQ ──────────────────────────────────────────────────────────────────── */
.pricing-faq { max-width: 800px; margin: 48px auto 0; padding: 0 var(--site-side-pad, 24px); }
.pricing-faq h3 { text-align: center; font-size: 28px; font-weight: 700; margin-bottom: 32px; }
.faq-item { border-bottom: 1px solid var(--border-light); }
.faq-q { padding: 20px 0; font-size: 16px; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q:hover { color: var(--primary); }
.faq-icon { font-size: 24px; font-weight: 300; transition: transform .2s; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; color: var(--text-light); line-height: 1.6; transition: max-height .26s cubic-bezier(.4, 0, .2, 1); }
.faq-item.open .faq-a { max-height: none; }        /* 无 JS 时保证内容可见；有 JS 时由内联 max-height 精确控制 */
.faq-a-inner { padding-bottom: 20px; }             /* 内边距放在内层，避免展开时 padding 突变跳一下 */

/* ═════════════════════════════════════════════════════════════════════════════
   购买弹窗
   ═════════════════════════════════════════════════════════════════════════════ */

/* ─── 遮罩 + 弹窗容器 ────────────────────────────────────────────────────────── */
.purchase-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.purchase-overlay.show { opacity: 1; visibility: visible; }
.purchase-modal { background: #fff; border-radius: 16px; width: 920px; max-width: 95vw; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); transform: translateY(20px) scale(.96); transition: transform .25s; }
.purchase-overlay.show .purchase-modal { transform: translateY(0) scale(1); }

/* ─── 顶部用户信息栏 ────────────────────────────────────────────────────────── */
.purchase-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: #f9fafb; border-bottom: 1px solid var(--border-light); }
.purchase-user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-light); }
.pu-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #e5e7eb; color: #6b7280; }
.pu-avatar svg { width: 18px; height: 18px; }
.pu-divider { color: #d1d5db; }
.purchase-close { width: 32px; height: 32px; border: none; background: transparent; font-size: 22px; color: var(--text-light); cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.purchase-close:hover { background: #fee2e2; color: #dc2626; }

/* ─── 弹窗主体（左 + 右） ────────────────────────────────────────────────────── */
.purchase-body { display: flex; flex: 1; overflow: hidden; }

/* ─── 左侧：权益说明 ────────────────────────────────────────────────────────── */
.purchase-left { width: 280px; flex-shrink: 0; padding: 24px; background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%); border-right: 1px solid var(--border-light); overflow-y: auto; }
.pl-plan-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--gradient); color: #fff; border-radius: 8px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.pl-diamond { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; }
.pl-diamond svg { width: 12px; height: 12px; }
.pl-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.pl-features { list-style: none; margin: 0 0 20px; padding: 0; }
.pl-features .pf-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; color: var(--text-light); border-bottom: 1px dashed var(--border-light); }
.pl-features .pf-check { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex-shrink: 0; color: var(--primary); }
.pl-features .pf-check svg { width: 14px; height: 14px; }
.pl-features .pf-header { font-size: 12px; font-weight: 600; color: var(--primary); padding: 10px 0 4px; }
.pl-link { display: inline-block; font-size: 13px; color: #3b82f6; text-decoration: none; }
.pl-link:hover { text-decoration: underline; }

/* ─── 右侧：购买操作 ────────────────────────────────────────────────────────── */
.purchase-right { flex: 1; padding: 24px; overflow-y: auto; }
.pr-section { margin-bottom: 24px; }
.pr-section-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.pr-section-title svg { width: 18px; height: 18px; color: var(--text-light); }
.invoice-tip { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ─── 版本标签 ──────────────────────────────────────────────────────────────── */
.version-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.ver-tab { flex: 1; min-width: 120px; padding: 12px 14px; border: 1.5px solid var(--border); background: #fff; border-radius: 10px; cursor: pointer; text-align: left; transition: all .2s; }
.ver-tab:hover { border-color: #6366f1; }
.ver-tab.active { border-color: var(--primary); background: var(--bg-soft); box-shadow: 0 2px 8px rgba(79,70,229,.15); }
.ver-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ver-fire { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--primary); font-weight: 500; }
.ver-fire svg { width: 12px; height: 12px; }
.ver-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ─── 时长选择卡片 ──────────────────────────────────────────────────────────── */
.dur-cards { display: flex; gap: 12px; }
.dur-card { position: relative; flex: 1; padding: 16px; border: 1.5px solid var(--border); background: #fff; border-radius: 10px; cursor: pointer; text-align: center; transition: all .2s; }
.dur-card:hover { border-color: #6366f1; }
.dur-card.active { border-color: var(--primary); background: var(--bg-soft); box-shadow: 0 2px 8px rgba(79,70,229,.15); }
.dur-badge { position: absolute; top: -8px; right: 10px; padding: 2px 8px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; }
.dur-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.dur-price { font-size: 22px; font-weight: 800; color: var(--primary); }
.dur-unit { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dur-original { font-size: 12px; color: #9ca3af; text-decoration: line-through; margin-top: 2px; }

/* ─── 支付摘要 + 方式 ────────────────────────────────────────────────────────── */
.pay-summary { background: #f9fafb; border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.pay-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; color: var(--text-light); }
.pay-amount { font-size: 20px; font-weight: 800; color: var(--primary); }
.pay-methods { display: flex; gap: 10px; }
.pay-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1.5px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text); transition: all .2s; }
.pay-btn:hover { border-color: #6366f1; }
.pay-btn.active { border-color: var(--primary); background: var(--bg-soft); }
.pay-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.pay-icon svg { width: 24px; height: 24px; }
.pay-btn.active .pay-icon.pay-wechat { color: #07c160; }
.pay-btn.active .pay-icon.pay-alipay { color: #1677ff; }

/* ─── 底部确认 ──────────────────────────────────────────────────────────────── */
.pr-footer { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.confirm-btn { width: 100%; padding: 14px; border: none; border-radius: 10px; background: var(--gradient); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; transition: all .2s; }
.confirm-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(79,70,229,.35); }
.agree-text { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }
.agree-text a { color: #3b82f6; text-decoration: none; }
.agree-text a:hover { text-decoration: underline; }

/* ─── 响应式 ─────────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .pricing-hero h1 { font-size: 32px; }
  .module-header h2 { font-size: 24px; }
  /* 弹窗：左右改为上下 */
  .purchase-modal { width: 95vw; }
  .purchase-body { flex-direction: column; }
  .purchase-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border-light); padding: 16px 20px; }
  .purchase-right { padding: 16px 20px; }
}
@media (max-width: 640px) {
  .pricing-grid { grid-template-columns: 1fr; gap: 12px; }
  .pricing-hero { padding: 32px 0 24px; }
  .pricing-hero h1 { font-size: 24px; }
  .pricing-hero p { font-size: 14px; }
  .pricing-card { padding: 20px; }
  .pricing-price .amount { font-size: 32px; }
  .compare-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .faq-q { font-size: 14px; padding: 16px 0; }
  .faq-a { font-size: 13px; line-height: 1.6; }
  /* 模块 tab */
  .module-tabs button { padding: 8px 16px; font-size: 13px; }
  /* 弹窗内版本标签纵向 */
  .version-tabs { flex-direction: column; }
  .ver-tab { min-width: 100%; }
  .dur-cards { flex-direction: column; }
  .pay-methods { flex-direction: column; }
}
