/* =========================================================
   XP33A 刷机接待网站 · 爱发电风格极简卡片版
   白底极简 / 模块化卡片网格 / 浅灰底圆角卡 / 单一主题色
   ========================================================= */

:root {
  --primary: #1f3a5f;          /* 深蓝主题色 */
  --primary-strong: #18304f;
  --primary-soft: #eef3fa;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --card-bg: #ffffff;
  --card-bg-soft: #f6f7f9;
  --border: #e8eaee;
  --text: #1a1d23;
  --text-soft: #6b7280;
  --text-faint: #9ca3af;
  --success: #2e9e6b;
  --danger: #d64545;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(24,48,79,.04), 0 1px 3px rgba(24,48,79,.06);
  --shadow-md: 0 6px 20px rgba(24,48,79,.08);
  --maxw: 1080px;
  --topbar-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ===== 顶部导航 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .5px;
  color: #fff;
  background: var(--primary);
  padding: 6px 10px;
  border-radius: 8px;
}

.brand-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-soft);
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav .nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-soft);
  transition: color .15s, background .15s;
}

.main-nav .nav-link:hover { color: var(--text); background: var(--bg-soft); }
.main-nav .nav-link.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }

.nav-cta { margin-left: 8px; }

/* 汉堡菜单（移动端） */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}

.hamburger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(31,58,95,.22);
}
.btn-primary:hover { background: var(--primary-strong); box-shadow: 0 6px 18px rgba(31,58,95,.28); }

.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: #d3d8e0; background: #eef0f3; }

.btn-block { width: 100%; }

/* ===== 主容器 ===== */
main { min-height: 60vh; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.container.narrow { max-width: 640px; }

.page { display: none; }
.page.active { display: block; animation: fadeUp .35s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 首页 Hero ===== */
.hero {
  text-align: center;
  padding: 88px 20px 72px;
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 42px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== 分区标题 ===== */
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.section-head p { color: var(--text-soft); font-size: 15px; margin-top: 8px; }

.block-title {
  font-size: 17px;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.card-grid.two   { grid-template-columns: repeat(2, 1fr); }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }

.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.card h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.card p  { font-size: 14px; color: var(--text-soft); }

/* 特性卡（首页） */
.feature-card { background: var(--card-bg-soft); border-color: transparent; }

/* 档位卡（价格） */
.plan-card { background: var(--card-bg-soft); border-color: transparent; display: flex; flex-direction: column; }
.plan-card.highlight {
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-md);
  position: relative;
}
.plan-card.highlight::before {
  content: "推荐";
  position: absolute;
  top: -13px;
  left: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 3px 12px;
  border-radius: 999px;
}

.plan-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.plan-top h4 { font-size: 17px; margin: 0; }

.price {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
}

.plan-list { list-style: none; margin: 6px 0 16px; }
.plan-list li {
  font-size: 14px;
  color: var(--text);
  padding: 5px 0 5px 22px;
  position: relative;
}
.plan-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.plan-fit { font-size: 13px; color: var(--text-faint); margin-top: auto; }

/* 增值卡 */
.addon-card { text-align: center; background: var(--card-bg-soft); border-color: transparent; }
.addon-card .price { display: block; margin: 4px 0 8px; font-size: 22px; }
.addon-card p { font-size: 13px; }

/* 系统卡 */
.sys-card { position: relative; background: var(--card-bg-soft); border-color: transparent; }
.sys-badge {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.sys-meta { font-size: 12px; color: var(--text-faint); margin-bottom: 8px; }
.sys-fit { font-size: 13px; color: var(--text-faint); margin-top: 10px; }

/* 列表 */
.plain-list { list-style: none; margin: 0; }
.plain-list li {
  font-size: 14px;
  color: var(--text);
  padding: 6px 0 6px 22px;
  position: relative;
}
.plain-list li::before {
  content: "·";
  position: absolute;
  left: 8px;
  font-weight: 800;
  color: var(--primary);
}

.note { font-size: 13px; color: var(--text-faint); margin-top: 8px; }

.note-card { background: var(--primary-soft); border-color: transparent; }
.note-card p { color: var(--text); }

/* 首页 CTA */
.cta-card {
  text-align: center;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  border: none;
  color: #fff;
  margin-top: 8px;
}
.cta-card .cta-q { color: #fff; font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.cta-card .btn-primary { background: #fff; color: var(--primary); box-shadow: none; margin-bottom: 14px; }
.cta-card .btn-primary:hover { background: #eef2f8; }
.cta-card .cta-note { color: rgba(255,255,255,.85); font-size: 13px; margin-top: 4px; }

/* ===== 效果展示 ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item { margin: 0; }
.gallery-item .placeholder {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--card-bg-soft);
  border: 1px dashed #d5dae2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
  font-family: ui-monospace, Consolas, monospace;
}
.gallery-item figcaption {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 8px;
  text-align: center;
}

/* ===== 流程步骤 ===== */
.steps { list-style: none; margin-bottom: 8px; }

.step {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-num {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.step h4 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.step p { font-size: 14px; color: var(--text-soft); }

/* ===== 折叠面板 ===== */
details.card { padding: 16px 20px; margin-bottom: 12px; }
details.card summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after {
  content: "＋";
  float: right;
  color: var(--text-faint);
  font-weight: 400;
  transition: transform .2s;
}
details.card[open] summary::after { transform: rotate(45deg); }
details.card p { font-size: 14px; color: var(--text-soft); margin-top: 10px; }

/* ===== FAQ ===== */
.faq-list { max-width: 760px; margin: 0 auto; }

/* ===== 表单 ===== */
.form-card { padding: 28px; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.field-error { display: block; min-height: 18px; font-size: 12px; color: var(--danger); margin-top: 4px; }

/* 选择卡片（设备 / 服务 / 交接模式） */
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-group-label { font-size: 12px; font-weight: 600; color: var(--text-faint); margin: 2px 0 0; }
.opt-group-label span { color: var(--primary); }
.field .opt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field .opt-card:hover { border-color: #cdd3dc; background: #fafbfc; }
.field .opt-card input { accent-color: var(--primary); width: 16px; height: 16px; flex: 0 0 auto; }
.field .opt-card .opt-title { display: block; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; }
.field .opt-card .opt-title em { font-style: normal; color: var(--primary); font-weight: 700; margin-left: 2px; }
.field .opt-card .opt-desc { display: block; font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.field .opt-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary);
}
.opt-required { color: var(--danger); font-size: 12px; font-weight: 600; margin-left: 2px; }

.agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  margin: 6px 0 18px;
  cursor: pointer;
}

.agree input { margin-top: 3px; accent-color: var(--primary); }

.form-tip { font-size: 12px; color: var(--text-faint); margin-top: 12px; }

.form-success { text-align: center; padding: 40px 28px; }
.form-success h3 { font-size: 22px; margin-bottom: 10px; }
.form-success p { color: var(--text-soft); margin-bottom: 8px; }
.form-success .btn { margin-top: 14px; }

/* ===== 首次访问确认弹窗 ===== */
.gate-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(24,48,79,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: 0 20px 60px rgba(24,48,79,.25);
  animation: fadeUp .3s ease;
}

.gate-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.gate-sub { font-size: 13px; color: var(--text-soft); margin-bottom: 20px; }

.gate-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.gate-check:hover { border-color: #cdd3dc; background: #fafbfc; }
.gate-check input { accent-color: var(--primary); width: 16px; height: 16px; }

.gate-error { min-height: 18px; font-size: 12px; color: var(--danger); margin: 2px 0 8px; }

.gate-btn { width: 100%; }
.gate-btn:disabled {
  background: #e3e6eb;
  color: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
}

.gate-note { font-size: 12px; color: var(--text-faint); text-align: center; margin-top: 12px; }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  text-align: center;
  padding: 36px 20px 48px;
}

.footer p { font-size: 13px; color: var(--text-soft); margin: 3px 0; }
.footer strong { color: var(--text); }
.footer-note { font-size: 12px; color: var(--text-faint); margin-top: 10px; }

/* ===== 客服对话框 ===== */
.chat-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(31,58,95,.32);
  transition: transform .15s;
}

.chat-fab:hover { transform: translateY(-2px); }

.chat-panel:not([hidden]) {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 90;
  width: 320px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeUp .2s ease;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}

.chat-close { background: none; border: none; color: #fff; font-size: 20px; line-height: 1; padding: 0 4px; }

.chat-messages {
  flex: 1;
  min-height: 160px;
  max-height: 260px;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-soft);
}

.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg p { margin: 0; }

.chat-msg-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  color: var(--text);
}

.chat-msg-user {
  align-self: flex-end;
  background: var(--primary);
  border-top-right-radius: 4px;
  color: #fff;
}

.chat-quick {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.chat-quick-link {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 6px 8px;
  transition: background .15s, color .15s;
}

.chat-quick-link:hover { background: var(--primary); color: #fff; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  background: #fff;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  background: var(--bg-soft);
  outline: none;
  transition: border-color .15s;
}

.chat-input:focus { border-color: var(--primary); }

.chat-send {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  flex-shrink: 0;
}

/* ===== 滚动显示 ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .card-grid.three { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .hamburger { display: flex; }

  .main-nav {
    position: absolute;
    top: var(--topbar-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 18px;
    display: none;
    box-shadow: var(--shadow-md);
  }

  .main-nav.open { display: flex; }
  .main-nav .nav-link { padding: 12px 10px; border-radius: var(--radius-sm); }
  .nav-cta { margin: 10px 0 0; }

  .hero { padding: 64px 20px 56px; }
  .hero-title { font-size: 30px; }
  .hero-sub { font-size: 15px; }

  .container { padding: 36px 16px 48px; }
  .card-grid.two,
  .card-grid.three { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }

  .chat-panel { width: calc(100vw - 40px); max-width: 320px; }
}
