/* ==========================================================================
   LomoType 帮助中心 - 移动端优先，视觉与 Android App 保持一致
   Design tokens 取自 android_ui_spec.md / LomoColors.kt（Material 3）
   ========================================================================== */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-variant: #eeeeee;
  --app-bg: #f5f5f5;
  --on-surface: #1a1a1a;
  --on-surface-variant: #6a6a6e;
  --primary: #1783ff;
  --on-primary: #ffffff;
  --primary-container: #e8f1fc;
  --outline: #c6c6ce;
  --outline-variant: #e0e0e0;
  --success: #4caf50;
  --success-container: #e8f5e9;
  --warning: #b45309;
  --warning-container: #fff8e1;
  --error: #e53935;
  --error-container: #ffebee;
  --code-surface: #f0f4f8;
  --divider: #ececec;
  --hero-accent: #0b6edb;
}

html[data-theme="dark"] {
  --bg: #111111;
  --surface: #1f1f1f;
  --surface-variant: #262626;
  --app-bg: #111111;
  --on-surface: #dbdbdb;
  --on-surface-variant: #8a8a8e;
  --primary: #1a89ff;
  --on-primary: #ffffff;
  --primary-container: #123258;
  --outline: #5e5e66;
  --outline-variant: #333333;
  --success: #66bb6a;
  --success-container: #1e4a2e;
  --warning: #ffd54f;
  --warning-container: #4a4420;
  --error: #ef5350;
  --error-container: #3d1f1f;
  --code-surface: #1e1e2e;
  --divider: #2a2a2a;
  --hero-accent: #4da3ff;
}

html {
  scroll-behavior: smooth;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--on-surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* ---------- icons ---------- */

.icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  flex: none;
  display: block;
}

/* ---------- layout ---------- */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* ---------- section headers (sectionTitle：14sp / onSurfaceVariant) ---------- */

.section-header {
  /*font-size: 14px;*/
  /*font-weight: 500;*/
  /*color: var(--on-surface-variant);*/
  margin: 24px 16px 8px;
  letter-spacing: 0.2px;
}

/* ---------- cards ---------- */

.card {
  /*background: var(--surface);*/
  padding: 16px;
  margin-bottom: 12px;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card:first-of-type {
  padding: 20px 16px;
}

.card:first-of-type h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 4px;
}

.card:first-of-type p {
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

/* ---------- download guide (H0001) ---------- */

.download-guide {
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 12px;
  text-align: center;
}

.download-guide .dg-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin: 0 auto 8px;
  display: block;
}

.download-guide .dg-hint {
  font-size: 14px;
  color: var(--on-surface-variant);
  margin: 0 0 2px;
}

.download-guide .dg-site {
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface);
  margin: 0 0 14px;
}

.download-guide .dg-copy {
  border: 0;
  border-radius: 999px;
  padding: 10px 24px;
  background: var(--primary-container);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.15s ease;
}

.download-guide .dg-copy:active {
  opacity: 0.7;
}

/* ---------- hero ---------- */

.hero {
  background: linear-gradient(160deg, var(--primary) 0%, var(--hero-accent) 100%);
  color: var(--on-primary);
  padding: 24px 20px;
  margin-bottom: 16px;
}

.hero .hero-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 12px;
  display: block;
}

.hero .hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--on-primary);
  margin-bottom: 12px;
}

.hero-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 8px;
}

.hero-desc {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0;
  opacity: 0.95;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--on-primary);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.hero-cta:hover {
  opacity: 0.92;
  text-decoration: none;
}

.hero-cta .icon {
  width: 18px;
  height: 18px;
}

/* ---------- search ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 0 16px;
  height: 48px;
  margin-bottom: 12px;
}

.search .icon {
  width: 20px;
  height: 20px;
  color: var(--on-surface-variant);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--on-surface);
  font-size: 15px;
  font-family: inherit;
}

.search input::placeholder {
  color: var(--on-surface-variant);
}

.search-empty {
  color: var(--on-surface-variant);
  font-size: 14px;
  text-align: center;
  padding: 20px 16px;
}

/* ---------- topic list (类似 App 设置列表项) ---------- */

.topic-list {
  display: block;
}

.topic {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--app-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  color: inherit;
  text-decoration: none;
}

.topic:hover {
  text-decoration: none;
  background: var(--surface-variant);
}

.topic:active {
  background: var(--surface-variant);
}

.topic-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-container);
  color: var(--primary);
}

.topic-icon .icon {
  width: 24px;
  height: 24px;
}

.topic-body {
  flex: 1;
  min-width: 0;
}

.topic-title {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--on-surface);
}

.topic-desc {
  display: block;
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-top: 2px;
  line-height: 1.45;
}

.topic .chev {
  width: 22px;
  height: 22px;
  color: var(--on-surface-variant);
}

/* ---------- steps (快速开始) ---------- */

ol.steps {
  list-style: none;
  counter-reset: step;
  margin: 4px 0 0;
  padding: 0;
}

ol.steps > li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 0 14px 0;
}

ol.steps > li:last-child {
  padding-bottom: 2px;
}

ol.steps > li::before {
  content: counter(step);
  counter-increment: step;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

ol.steps p {
  margin: 0;
}

/* ---------- table of contents ---------- */

.toc {
  background: var(--surface);
  padding: 8px 16px;
  margin-bottom: 12px;
}

.toc a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  color: var(--on-surface);
  font-size: 14.5px;
  text-decoration: none;
}

.toc a + a {
  border-top: 1px solid var(--divider);
}

.toc a:hover {
  color: var(--primary);
}

.toc a .icon {
  width: 18px;
  height: 18px;
  color: var(--on-surface-variant);
}

/* ---------- prose ---------- */

.article-section {
  scroll-margin-top: 16px;
}

h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 .icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 14px 0 4px;
}

p {
  margin: 6px 0;
  font-size: 14.5px;
  line-height: 1.7;
}

section > p,
.faq-body > p {
  text-indent: 2em;
}

ul,
ol {
  margin: 6px 0;
  padding-left: 2em;
}

li {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 3px 0;
}

strong {
  font-weight: 600;
}

.small {
  font-size: 12.5px;
  color: var(--on-surface-variant);
}

.muted {
  color: var(--on-surface-variant);
}

/* ---------- inline code / kbd chips ---------- */

code {
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Courier New",
    monospace;
  font-size: 0.9em;
  background: var(--code-surface);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--on-surface);
}

kbd {
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 500;
  background: var(--code-surface);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}

/* ---------- callouts ---------- */

.callout {
  display: flex;
  gap: 10px;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 13.5px;
  line-height: 1.65;
}

.callout .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.callout p {
  font-size: 13.5px;
  margin: 0;
}

.callout.info {
  background: var(--primary-container);
  color: var(--on-surface);
}

.callout.info .icon {
  color: var(--primary);
}

.callout.warn {
  background: var(--warning-container);
  color: var(--on-surface);
}

.callout.warn .icon {
  color: var(--warning);
}

.callout.ok {
  background: var(--success-container);
  color: var(--on-surface);
}

.callout.ok .icon {
  color: var(--success);
}

.callout.error {
  background: var(--error-container);
  color: var(--on-surface);
}

.callout.error .icon {
  color: var(--error);
}

/* ---------- settings-like rows ---------- */

.rows {
  margin-top: 6px;
  padding: 0 24px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 2px;
}

.row + .row {
  border-top: 1px solid var(--divider);
}

.row .icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
  margin-top: 1px;
}

.row strong {
  display: block;
  margin-bottom: 1px;
}

.row p {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--on-surface-variant);
  line-height: 1.6;
}

/* ---------- FAQ accordion ---------- */

details.faq-item {
  /*background: var(--surface);*/
  margin-bottom: 12px;
}

details.faq-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 15px 15px 30px;
  border-radius: 12px;
  background: var(--app-bg);
  color: var(--on-surface-variant);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "";
  margin-left: auto;
  flex: none;
  width: 22px;
  height: 22px;
  background: var(--on-surface-variant);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform 0.15s ease;
}

details.faq-item[open] summary::after {
  transform: rotate(90deg);
}

details.faq-item summary:active {
  background: var(--surface-variant);
}

details.faq-item .faq-body {
  padding: 0 0 14px;
  padding-top: 10px;
  margin-top: 2px;
}

details.faq-item .faq-body > :first-child {
  margin-top: 0;
}

details.faq-item .faq-body > :last-child {
  margin-bottom: 0;
}

/* ---------- divider ---------- */

.hr {
  height: 1px;
  background: var(--divider);
  border: 0;
  margin: 14px 0;
}

/* ---------- theme toggle ---------- */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 8px auto 32px;
  padding: 0;
  border: 1px solid var(--outline);
  border-radius: 50%;
  background: var(--surface);
  color: var(--on-surface-variant);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.hide {
  display: none;
}

.theme-toggle:active {
  background: var(--surface-variant);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
}

/* ---------- accessibility ---------- */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (min-width: 560px) {
  .container {
    padding-top: 20px;
  }

  .hero-title {
    font-size: 28px;
  }
}
