/* ============================================================
   HORing Help Pages — style.css v3
   Deep gradient dark · Progressive light themes
   Android WebView 5+ / iOS WKWebView 10+
   ============================================================ */

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

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  /* gradient stops for body background */
  --bg-from: #0d0e16;
  --bg-to: #09090f;

  /* surface layers */
  --surf: rgba(255, 255, 255, 0.04);
  --surf-open: rgba(255, 255, 255, 0.06);
  --surf-hover: rgba(255, 255, 255, 0.07);
  --surf-ans: rgba(0, 0, 0, 0.22);

  /* borders */
  --line: rgba(255, 255, 255, 0.08);
  --line-open: #6366f1;

  /* text */
  --txt: #94a3b8;
  --txt-dim: #475569;
  --txt-hi: #e2e8f0;

  /* accent — indigo/violet */
  --acct: #818cf8;
  --acct-mid: #6366f1;
  --acct-deep: #4f46e5;
  --acct-bg: rgba(99, 102, 241, 0.15);
  --acct-glow: rgba(99, 102, 241, 0.35);

  --r: 14px;
  --r-sm: 9px;
}

/* theme overrides ------------------------------------------------ */
body.type1 {
  --bg-from: #040507;
  --bg-to: #020304;
  --surf: rgba(255, 255, 255, 0.03);
  --surf-open: rgba(255, 255, 255, 0.05);
  --surf-hover: rgba(255, 255, 255, 0.055);
  --surf-ans: rgba(0, 0, 0, 0.3);
  --line: rgba(255, 255, 255, 0.055);
  --txt: #7d8697;
  --txt-dim: #363e52;
  --txt-hi: #b8c1d0;
}

body.type2 {
  --bg-from: #f5f3ff;
  --bg-to: #ede9fe;
  --surf: rgba(255, 255, 255, 0.85);
  --surf-open: #ffffff;
  --surf-hover: #ffffff;
  --surf-ans: rgba(99, 102, 241, 0.04);
  --line: rgba(99, 102, 241, 0.12);
  --line-open: #6366f1;
  --txt: #4b5563;
  --txt-dim: #9ca3af;
  --txt-hi: #1f2937;
  --acct: #6366f1;
  --acct-mid: #4f46e5;
  --acct-deep: #4338ca;
  --acct-bg: rgba(99, 102, 241, 0.1);
  --acct-glow: rgba(99, 102, 241, 0.18);
}

body.type3 {
  --bg-from: #f8fafc;
  --bg-to: #f1f5f9;
  --surf: rgba(255, 255, 255, 0.88);
  --surf-open: #ffffff;
  --surf-hover: #ffffff;
  --surf-ans: rgba(37, 99, 235, 0.04);
  --line: rgba(0, 0, 0, 0.08);
  --line-open: #2563eb;
  --txt: #374151;
  --txt-dim: #9ca3af;
  --txt-hi: #111827;
  --acct: #2563eb;
  --acct-mid: #1d4ed8;
  --acct-deep: #1e40af;
  --acct-bg: rgba(37, 99, 235, 0.09);
  --acct-glow: rgba(37, 99, 235, 0.18);
}

/* ── Base ───────────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-from) 0%, var(--bg-to) 100%);
  background-attachment: fixed;
  color: var(--txt);
  padding-bottom: 72px;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Page header ────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 55%, #24243e 100%);
  padding: 28px 16px 24px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

/* grid dots overlay */
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0 1px,
      transparent 1px 40px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0 1px,
      transparent 1px 40px
    );
  pointer-events: none;
}

/* accent radial glow */
.page-header::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 100px;
  right: -30px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  background: radial-gradient(
    ellipse,
    rgba(99, 102, 241, 0.45) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* light themes: replace header gradient */
body.type2 .page-header,
body.type3 .page-header {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #818cf8 100%);
}

.page-header-logo {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(129, 140, 248, 0.3),
    rgba(99, 102, 241, 0.2)
  );
  border: 1px solid rgba(129, 140, 248, 0.4);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  color: #a5b4fc;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.35);
}

.page-header-logo svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-header-text {
  position: relative;
  z-index: 1;
}

.page-header-text h1 {
  font-size: 19px;
  font-weight: 700;
  color: #e0e7ff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-header-text p {
  font-size: 11px;
  color: rgba(165, 180, 252, 0.65);
  margin-top: 3px;
  letter-spacing: 0.06em;
  /* text-transform: uppercase; */
}

/* ── FAQ list wrapper ───────────────────────────────────────── */
.faq-list {
  padding: 12px 12px 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 7px;
}

/* ── Category card ──────────────────────────────────────────── */
details.category {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  -webkit-transition:
    border-color 0.24s,
    box-shadow 0.24s;
  transition:
    border-color 0.24s,
    box-shadow 0.24s;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

details.category[open] {
  border-color: var(--line-open);
  background: var(--surf-open);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.12),
    0 6px 28px rgba(99, 102, 241, 0.1);
}

details.category > summary {
  list-style: none;
  cursor: pointer;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-transition: background 0.12s;
  transition: background 0.12s;
}

details.category > summary::-webkit-details-marker,
details.category > summary::marker {
  display: none;
}

details.category > summary:active,
details.category[open] > summary {
  background: var(--surf-hover);
}

/* Category icon badge */
.cat-ic {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--acct-bg);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  color: var(--acct);
  box-shadow: 0 0 12px var(--acct-glow);
}

.cat-ic svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* ensure explicit fill="currentColor" children show correctly */
.cat-ic svg [fill="currentColor"] {
  fill: currentColor;
}

.cat-title {
  -webkit-box-flex: 1;
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--txt-hi);
}

.chevron {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  stroke: var(--txt-dim);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  -webkit-transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.2s;
  transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.2s;
}

details.category[open] > summary .chevron {
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
  stroke: var(--acct);
}

/* Category body — CSS grid height animation ─────────────────── */
.category-body {
  display: grid;
  grid-template-rows: 0fr;
  -webkit-transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

details.category[open] > .category-body {
  grid-template-rows: 1fr;
}

.category-inner {
  overflow: hidden;
  border-top: 1px solid var(--line);
  position: relative;
}

/* left accent bar when open */
details.category[open] .category-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(
    180deg,
    var(--acct-mid) 0%,
    var(--acct-deep) 100%
  );
  border-radius: 0 2px 2px 0;
  z-index: 1;
}

/* note paragraph inside categories */
p.note {
  font-size: 12.5px;
  color: var(--txt-dim);
  padding: 10px 14px 11px 20px;
  line-height: 1.75;
  border-bottom: 1px solid var(--line);
}

/* ── FAQ item ───────────────────────────────────────────────── */
details.faq {
  border-bottom: 1px solid var(--line);
}
details.faq:last-child {
  border-bottom: none;
}

details.faq > summary {
  list-style: none;
  cursor: pointer;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: flex-start;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px 11px 20px;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-transition: background 0.12s;
  transition: background 0.12s;
}

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

details.faq > summary:active,
details.faq[open] > summary {
  background: var(--surf-hover);
}

/* Q badge */
.q-num {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--acct-bg);
  color: var(--acct);
  font-size: 10px;
  font-weight: 700;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  margin-top: 1px;
  -webkit-transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
  transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}

details.faq[open] .q-num {
  background: var(--acct-mid);
  color: #fff;
  box-shadow: 0 0 8px var(--acct-glow);
}

.q-text {
  font-size: 13.5px;
  color: var(--txt);
  line-height: 1.5;
}

details.faq[open] .q-text {
  color: var(--txt-hi);
}

/* FAQ answer — CSS grid height animation ───────────────────── */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  -webkit-transition: grid-template-rows 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  transition: grid-template-rows 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

details.faq[open] > .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
  padding: 8px 14px 14px 50px;
  font-size: 12.5px;
  color: var(--txt-dim);
  line-height: 1.9;
  background: var(--surf-ans);
}

.faq-answer-inner strong {
  color: var(--txt);
  font-weight: 600;
}

/* ── Video link ─────────────────────────────────────────────── */
a.video-link {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 6px;
  color: var(--acct);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--acct-bg);
  border: 1px solid rgba(99, 102, 241, 0.25);
  -webkit-tap-highlight-color: transparent;
}

a.video-link:active {
  opacity: 0.7;
}
