:root {
  --primary: #1565C0;
  --primary-light: #E3F2FD;
  --primary-dark: #0D47A1;
  --surface: #FFFFFF;
  --bg: #F5F7FA;
  --text: #212121;
  --text-secondary: #616161;
  --border: #E0E0E0;
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --warning: #E65100;
  --warning-light: #FFF3E0;
  --info: #0277BD;
  --info-light: #E1F5FE;
  --purple: #6A1B9A;
  --purple-light: #F3E5F5;
  --radius: 12px;
  --indent: 2.75rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

html:lang(zh) body,
html:lang(zh-CN) body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans SC', 'Segoe UI', Roboto, sans-serif;
  line-height: 1.85;
}

a { color: var(--primary); }

/* ---------- Header ---------- */

.header {
  background: var(--primary);
  color: white;
  padding: 1.5rem 1rem;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
}
.header h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
.header p { opacity: 0.9; margin-top: 0.25rem; }

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.breadcrumb { font-size: 0.85rem; opacity: 0.85; }
.breadcrumb a { color: white; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.lang-switch {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.2rem;
}
.lang-switch a {
  color: white;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  line-height: 1.5;
  white-space: nowrap;
}
.lang-switch a:hover { background: rgba(255, 255, 255, 0.18); }
.lang-switch a[aria-current='true'] { background: white; color: var(--primary); }

/* ---------- Layout ---------- */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
.container--narrow { max-width: 800px; }

/* ---------- Hub (index) ---------- */

.hub-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.hub-intro strong { color: var(--text); }

.section { margin-bottom: 2.5rem; }
.section:last-child { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}
.section-head h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.section-head .section-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.section-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: var(--primary);
}
.card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 10px;
}
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--primary);
  line-height: 1.4;
}
.card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; }

/* ---------- Guide steps ---------- */

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.step-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.step-header h2 { font-size: 1.15rem; font-weight: 600; line-height: 1.4; }

.step-body { margin-left: var(--indent); font-size: 0.95rem; }
.step-body > * + * { margin-top: 0.75rem; }
.step-body ul,
.step-body ol { padding-left: 1.25rem; }
.step-body li { margin-bottom: 0.35rem; }
.step-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.25rem;
}

.step-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Phone screenshots: shown at their own size, never blown up to the column. */
.step-img--phone {
  width: 300px;
  margin-inline: auto;
}

.step--tips { background: var(--primary-light); border-color: var(--primary); }
.step--tips .step-header h2 { color: var(--primary); }
.step--tips .step-body { margin-left: 0; }

/* ---------- Callouts ---------- */

.callout {
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout-tip { background: var(--success-light); border-left: 3px solid var(--success); }
.callout-warn { background: var(--warning-light); border-left: 3px solid var(--warning); }
.callout-info { background: var(--info-light); border-left: 3px solid var(--info); }
.callout-purple { background: var(--purple-light); border-left: 3px solid var(--purple); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.field-table th,
.field-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.field-table th {
  background: var(--bg);
  font-weight: 600;
  white-space: nowrap;
}
.field-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-required { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }
.badge-optional { background: #F5F5F5; color: #757575; border: 1px solid var(--border); }
.badge-kit { background: var(--purple-light); color: var(--purple); border: 1px solid var(--purple); }

/* ---------- Misc content ---------- */

.key-flow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.key-flow .arrow { color: var(--text-secondary); }

kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}

.layout-diagram {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.layout-box {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.layout-box h3 { font-size: 0.95rem; margin: 0 0 0.35rem; }

.part-divider {
  text-align: center;
  margin: 2rem 0 1.25rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Bottom nav & footer ---------- */

.nav-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s;
}
.nav-btn:hover { background: var(--primary-light); }
.nav-btn--next { margin-left: auto; }

.footer {
  text-align: center;
  padding: 2rem 1rem 6rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.footer a { color: var(--primary); text-decoration: none; }

/* ---------- WhatsApp ---------- */

.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}
.whatsapp-float svg { width: 32px; height: 32px; }

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  :root { --indent: 0rem; }
  .header h1 { font-size: 1.4rem; }
  .header-top { flex-direction: column; gap: 0.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .step { padding: 1.25rem 1rem; }
  .layout-diagram { grid-template-columns: 1fr; }
  .whatsapp-float { bottom: 20px; right: 20px; width: 55px; height: 55px; }
  .nav-bottom { flex-direction: column; }
  .nav-btn--next { margin-left: 0; }
}

@media print {
  .whatsapp-float, .lang-switch, .nav-bottom { display: none; }
  body { background: white; }
  .step { break-inside: avoid; }
}
