/* ============================================================
   CAD 工作台 订阅页样式（基于 style.css 设计体系扩展）
   套餐卡片 / 权益对比表 / 开通弹窗
   ============================================================ */

/* ============ Hero 变体 ============ */
.hero-compact { padding: 138px 24px 72px; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--accent-deep);
  background: var(--accent-tint);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}
.price-em { color: var(--accent); font-family: var(--font-head); font-weight: 500; }

/* ============ 按钮：主蓝 ============ */
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}
.btn-accent:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.34);
}

/* ============ 套餐卡片 ============ */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: stretch;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid rgba(24, 28, 40, 0.06);
  border-radius: 12px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.plan-card.featured {
  border-color: rgba(37, 99, 235, 0.38);
  background: linear-gradient(180deg, #f2f7ff 0%, #ffffff 46%);
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.13);
}
.plan-card.featured:hover { box-shadow: 0 18px 48px rgba(37, 99, 235, 0.18); }
.plan-pop {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 2px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}
.feat-tag-hot { background: rgba(37, 99, 235, 0.1); color: var(--accent-deep); }
.plan-name { font-size: 17px; color: var(--ink); }
.plan-for { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin: 20px 0 2px;
}
.price-cur { font-family: var(--font-head); font-size: 17px; color: var(--ink); }
.price-num {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
}
.price-per { font-size: 13px; color: var(--muted); }
.price-orig { font-size: 13px; color: var(--faint); }
.price-note { min-height: 19px; font-size: 12.5px; color: var(--accent-deep); }
.plan-cta { width: 100%; margin: 16px 0 18px; }
.plan-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.plan-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--body);
}
.plan-list svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
}
.plans-note {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ============ 权益对比表 ============ */
.cmp-scroll {
  max-width: 980px;
  margin: 0 auto;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid rgba(24, 28, 40, 0.05);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.cmp { width: 100%; min-width: 660px; border-collapse: collapse; }
.cmp th, .cmp td {
  padding: 13px 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--body);
  border-bottom: 1px solid var(--line);
}
.cmp thead th {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg-alt);
  white-space: nowrap;
}
.cmp tbody tr:last-child td { border-bottom: none; }
.cmp td:first-child, .cmp th:first-child {
  text-align: left;
  color: var(--muted);
  white-space: nowrap;
}
.cmp .hl { background: rgba(37, 99, 235, 0.055); }
.cmp thead th.hl { color: var(--accent-deep); }
.cmp .yes svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  vertical-align: middle;
}
.cmp .row-price { font-family: var(--font-head); font-weight: 500; color: var(--ink); }

/* ============ 如何开通 ============ */
.buy-card {
  max-width: 880px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid rgba(24, 28, 40, 0.05);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 34px 36px 26px;
}
.buy-flow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  align-items: start;
}
.buy-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}
.buy-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 40px;
}
.buy-steps li:last-child { padding-bottom: 4px; }
.buy-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
}
.buy-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 29px;
  bottom: 3px;
  width: 1px;
  background: var(--line);
}
.buy-steps strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 500;
}
.buy-steps span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}
.buy-qr { text-align: center; }
.buy-qr img,
.qr-fallback {
  width: 196px;
  height: 196px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.qr-fallback {
  border: 1.5px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--faint);
  font-size: 12.5px;
  padding: 16px;
  text-align: center;
}
.qr-fallback svg { width: 34px; height: 34px; }
.buy-qr-caption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--faint);
}
.buy-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
}

#buy [hidden] { display: none !important; }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .plans-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-card.featured { order: -1; }
}
@media (max-width: 720px) {
  .hero-compact { padding-top: 112px; }
  .buy-card { padding: 26px 22px 22px; }
  .buy-flow { grid-template-columns: 1fr; gap: 26px; }
  .buy-qr { order: -1; }
}
@media (max-width: 640px) {
  .plans-grid { grid-template-columns: 1fr; }
}

/* Tier backgrounds retain the original card layout and typography. */
.plan-card.plan-trial {
  background: linear-gradient(145deg, #ffffff 0%, #f1f4f8 100%);
  border-color: #e2e8f0;
}
.plan-card.plan-monthly {
  background: radial-gradient(ellipse at 100% 0%, #dceeff 0%, transparent 65%),
              linear-gradient(150deg, #f6fbff 0%, #eaf3ff 100%);
  border-color: #ccdef5;
}
.plan-card.plan-annual {
  background: radial-gradient(ellipse at 100% 0%, #dddfff 0%, transparent 60%),
              linear-gradient(145deg, #eef4ff 0%, #e9edff 100%);
  border-color: rgba(37, 99, 235, 0.38);
}
.plan-card.plan-lifetime {
  background: radial-gradient(ellipse at 100% 0%, #f2e7d6 0%, transparent 65%),
              linear-gradient(145deg, #fffdf8 0%, #f6f0e6 100%);
  border-color: #e6dac7;
}

/* Decorative geometry sits behind content and never intercepts input. */
.plan-card { isolation: isolate; }
.plan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.plan-trial::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20500%22%20fill%3D%22none%22%3E%3Cg%20stroke%3D%22%2394a3b8%22%20stroke-width%3D%221%22%3E%3Ccircle%20cx%3D%22282%22%20cy%3D%2235%22%20r%3D%2275%22/%3E%3Ccircle%20cx%3D%22282%22%20cy%3D%2235%22%20r%3D%22100%22/%3E%3Ccircle%20cx%3D%22282%22%20cy%3D%2235%22%20r%3D%22126%22/%3E%3Cpath%20d%3D%22M0%20430L70%20500M0%20458L42%20500%22/%3E%3C/g%3E%3Ccircle%20cx%3D%22224%22%20cy%3D%2298%22%20r%3D%224%22%20fill%3D%22%2394a3b8%22/%3E%3C/svg%3E"); opacity: .2; }
.plan-monthly::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20500%22%20fill%3D%22none%22%3E%3Cdefs%3E%3Cpattern%20id%3D%22grid%22%20width%3D%2228%22%20height%3D%2228%22%20patternUnits%3D%22userSpaceOnUse%22%3E%3Cpath%20d%3D%22M28%200H0V28%22%20stroke%3D%22%236091ca%22%20stroke-width%3D%22.6%22/%3E%3Ccircle%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221.6%22%20fill%3D%22%236091ca%22/%3E%3C/pattern%3E%3ClinearGradient%20id%3D%22fade%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22white%22/%3E%3Cstop%20offset%3D%22.52%22%20stop-color%3D%22black%22/%3E%3C/linearGradient%3E%3Cmask%20id%3D%22m%22%3E%3Crect%20width%3D%22300%22%20height%3D%22500%22%20fill%3D%22url%28%23fade%29%22/%3E%3C/mask%3E%3C/defs%3E%3Crect%20x%3D%22115%22%20width%3D%22185%22%20height%3D%22320%22%20fill%3D%22url%28%23grid%29%22%20mask%3D%22url%28%23m%29%22/%3E%3Cpath%20d%3D%22M160%20455L240%20410L300%20445M180%20500L260%20455L300%20480%22%20stroke%3D%22%236091ca%22%20stroke-width%3D%221%22/%3E%3C/svg%3E"); opacity: .2; }
.plan-annual::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20500%22%20fill%3D%22none%22%3E%3Cg%20stroke%3D%22%236b70d6%22%20stroke-width%3D%221%22%3E%3Cellipse%20cx%3D%22270%22%20cy%3D%2268%22%20rx%3D%22105%22%20ry%3D%2246%22%20transform%3D%22rotate%28-38%20270%2068%29%22/%3E%3Cellipse%20cx%3D%22270%22%20cy%3D%2268%22%20rx%3D%22135%22%20ry%3D%2262%22%20transform%3D%22rotate%28-38%20270%2068%29%22/%3E%3Cellipse%20cx%3D%22270%22%20cy%3D%2268%22%20rx%3D%22167%22%20ry%3D%2278%22%20transform%3D%22rotate%28-38%20270%2068%29%22/%3E%3Cpath%20d%3D%22M0%20445Q140%20355%20300%20490M0%20475Q140%20385%20270%20500%22/%3E%3C/g%3E%3Ccircle%20cx%3D%22185%22%20cy%3D%22111%22%20r%3D%224%22%20fill%3D%22%236b70d6%22/%3E%3Cpath%20d%3D%22M255%20163h10m-5-5v10%22%20stroke%3D%22%236b70d6%22/%3E%3C/svg%3E"); opacity: .2; }
.plan-lifetime::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20500%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M182%200L300%2085V195L182%200Z%22%20fill%3D%22%23947b50%22%20fill-opacity%3D%22.12%22/%3E%3Cpath%20d%3D%22M182%200L300%2085V195L155%20115L182%200Z%22%20stroke%3D%22%23947b50%22%20stroke-width%3D%221%22/%3E%3Cpath%20d%3D%22M155%20115L300%2085M155%20115L300%20195M182%200L230%20126%22%20stroke%3D%22%23947b50%22%20stroke-width%3D%22.8%22/%3E%3Cpath%20d%3D%22M0%20414L85%20366L177%20423L125%20500H0V414Z%22%20fill%3D%22%23947b50%22%20fill-opacity%3D%22.08%22/%3E%3Cpath%20d%3D%22M0%20414L85%20366L177%20423L125%20500M0%20460L177%20423M85%20366L125%20500%22%20stroke%3D%22%23947b50%22%20stroke-width%3D%221%22/%3E%3C/svg%3E"); opacity: .22; }

.plan-lifetime .plan-cta {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 1px solid #d6c6ad;
  box-shadow: none;
}
.plan-lifetime .plan-cta:hover { background: #ffffff; }

/* Small-screen subscription layout and full-width comparison. */
@media (max-width: 720px) {
  .hero-compact { padding: 144px 16px 48px; }
  .plans-grid { gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-card { min-width: 0; }
  .plan-price { gap: 4px; }
  .price-per, .price-orig { white-space: nowrap; }
  .plan-cta { min-height: 44px; white-space: nowrap; }
  .buy-card { padding: 24px 20px; }
  .buy-flow { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .buy-qr { display: flex; flex-direction: column; align-items: center; min-width: 0; }
  .buy-qr img, .qr-fallback { max-width: 100%; height: auto; aspect-ratio: 1; flex-shrink: 0; }
  .buy-steps li { padding-left: 36px; }
  .buy-steps span { overflow-wrap: anywhere; }
  .cmp-scroll { max-width: 100%; }
  .cmp { min-width: 0; width: 100%; table-layout: fixed; }
  .cmp th, .cmp td { padding: 12px 4px; font-size: 12px; overflow-wrap: anywhere; }
  .cmp th:first-child, .cmp td:first-child { width: 32%; white-space: normal; }
  .cmp thead th { white-space: normal; }
  .cmp .yes svg { width: 16px; height: 16px; }
}
@media (max-width: 640px) {
  .plans-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-card { padding: 24px; }
  .plan-card.featured { order: 0; }
  .plan-cta { margin: 16px 0; }
  .plan-list { gap: 12px; }
  .plans-note { line-height: 1.7; }
}
