/* ==========================================================================
   阿瑶助手 手机网页站 —— 全站样式
   设计语言沿用参考站(粉色 Apple 风、640px 手机壳、毛玻璃、胶囊按钮)。
   字体刻意不用 Google Fonts(国内网络不可达会拖慢首屏),走系统字体栈。
   ========================================================================== */

/* ===== 1. 设计令牌 ===== */
:root {
  --color-primary: #fe9fa7;        /* 品牌粉 */
  --btn-pink-bg: #f0536c;          /* 主 CTA 高对比粉 */
  --btn-pink-bg-hover: #e04560;
  --bg-canvas: #fafafc;            /* 画布灰白 */
  --bg-surface: #ffffff;
  --bg-muted: #f3f3f6;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #b0b0b5;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 980px;
  --max-width: 640px;
  --color-success: #34c759;
  --color-danger: #ff3b30;
  --color-alipay: #1677ff;
  --color-wechat: #07c160;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== 2. 基础 ===== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* 手机壳:桌面访问时居中成一条 640px 宽的栏 */
.site-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
}

/* ===== 3. 顶栏 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -20px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(250, 250, 252, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  object-fit: cover;
}

.header-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  transition: background 0.2s var(--ease-out);
}

.header-back:active {
  background: var(--bg-muted);
}

.header-link {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
}

.header-link:active {
  background: var(--bg-muted);
}

/* ===== 4. 按钮 ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease-out), opacity 0.2s, background 0.2s;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  background: var(--btn-pink-bg);
  color: #fff;
  box-shadow: 0 8px 20px rgba(240, 83, 108, 0.28);
}

.btn-primary:hover {
  background: var(--btn-pink-bg-hover);
}

.btn-dark {
  background: var(--text-primary);
  color: #fff;
}

.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-sm {
  min-height: 42px;
  padding: 10px 16px;
  font-size: 14px;
  width: auto;
}

/* ===== 5. 首页 Hero ===== */
.hero {
  padding: 40px 0 28px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--btn-pink-bg);
  background: rgba(254, 159, 167, 0.16);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hero p {
  margin: 0 auto 24px;
  max-width: 460px;
  color: var(--text-secondary);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-meta {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ===== 6. 区块 / 卡片 ===== */
.section {
  margin: 40px 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 18px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(254, 159, 167, 0.18);
  color: var(--btn-pink-bg);
}

.feature-item h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
}

.feature-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ===== 7. 套餐卡片(购买页) ===== */
.plan-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.plan-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease-out);
}

.plan-card:active {
  transform: scale(0.99);
}

.plan-card.active {
  border-color: var(--btn-pink-bg);
  box-shadow: 0 0 0 3px rgba(240, 83, 108, 0.12), var(--shadow-sm);
}

.plan-card-main {
  min-width: 0;
}

.plan-card-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.plan-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--btn-pink-bg);
  background: rgba(254, 159, 167, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.plan-card-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.plan-card-price {
  text-align: right;
  white-space: nowrap;
}

.plan-card-price .currency {
  font-size: 14px;
  font-weight: 600;
  color: var(--btn-pink-bg);
}

.plan-card-price .amount {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--btn-pink-bg);
}

.plan-card-check {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 11px;
  color: var(--btn-pink-bg);
  opacity: 0;
  transition: opacity 0.2s;
}

.plan-card.active .plan-card-check {
  opacity: 1;
}

/* ===== 8. 支付方式 ===== */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.panel-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.method-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.method-option:last-child {
  margin-bottom: 0;
}

.method-option.active {
  border-color: var(--btn-pink-bg);
  background: rgba(254, 159, 167, 0.06);
}

.method-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.method-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.method-badge.alipay {
  background: var(--color-alipay);
}

.method-badge.wechat {
  background: var(--color-wechat);
}

.method-badge svg {
  width: 18px;
  height: 18px;
}

.method-name {
  font-size: 15px;
  font-weight: 500;
}

.method-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  position: relative;
  flex: 0 0 auto;
}

.method-option.active .method-radio {
  border-color: var(--btn-pink-bg);
}

.method-option.active .method-radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--btn-pink-bg);
}

/* ===== 9. 状态面板 / 卡密 ===== */
.status-panel {
  text-align: center;
  padding: 26px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.status-title {
  font-size: 17px;
  font-weight: 700;
  margin: 14px 0 6px;
}

.status-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.status-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon.success {
  background: rgba(52, 199, 89, 0.14);
  color: var(--color-success);
}

.status-icon.danger {
  background: rgba(255, 59, 48, 0.12);
  color: var(--color-danger);
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid rgba(240, 83, 108, 0.18);
  border-top-color: var(--btn-pink-bg);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.code-box {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--bg-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  margin: 16px 0;
  word-break: break-all;
  user-select: all;
}

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

.tip-line {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: center;
  margin: 10px 0 0;
  line-height: 1.6;
}

.link-btn {
  color: var(--btn-pink-bg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  padding: 4px;
}

.center {
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 10. FAQ ===== */
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.faq-q .arrow {
  transition: transform 0.25s var(--ease-out);
  color: var(--text-tertiary);
  flex: 0 0 auto;
}

.faq-item.open .faq-q .arrow {
  transform: rotate(180deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out);
}

.faq-item.open .faq-a {
  max-height: 400px;
}

.faq-a p {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ===== 11. 底部下载条 ===== */
.sticky-download {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(var(--max-width) - 40px, calc(100vw - 40px));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.sticky-download .sd-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  opacity: 0.9;
}

.sticky-download .sd-btn {
  flex: 0 0 auto;
  background: var(--btn-pink-bg);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
}

.page-with-sticky {
  padding-bottom: 96px;
}

/* ===== 12. 页脚 ===== */
.site-footer {
  margin: 44px 0 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.9;
}

.site-footer a {
  color: var(--text-secondary);
  margin: 0 6px;
}

/* ===== 13. Toast ===== */
#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  z-index: 200;
  max-width: 84vw;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== 14. 法务/联系页排版 ===== */
.legal h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 26px 0 8px;
}

.legal p,
.legal li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.legal ul {
  padding-left: 20px;
  margin: 8px 0;
}

.legal .highlight-card {
  background: rgba(254, 159, 167, 0.1);
  border: 1px solid rgba(240, 83, 108, 0.22);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 16px 0;
}

.legal .highlight-card p {
  margin: 0;
  color: var(--text-primary);
  font-size: 13.5px;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.contact-row .label {
  font-size: 14px;
  color: var(--text-secondary);
}

.contact-row .value {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  text-align: right;
}

/* ===== 15. 响应式 ===== */
@media (min-width: 700px) {
  body {
    background: linear-gradient(180deg, #fdfdfe 0%, var(--bg-canvas) 100%);
  }

  .site-container {
    background: var(--bg-canvas);
    box-shadow: 0 0 0 1px var(--border-subtle), 0 20px 60px rgba(0, 0, 0, 0.06);
    min-height: 100vh;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }

  .hero-actions .btn {
    width: auto;
    min-width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
