/* TWINKLE / 星点 — 使用帮助页样式
   依赖 site.css 的 CSS 变量（--brand-*）
*/

/* ---------- Help Hero ---------- */
.help-hero {
  padding: 140px 32px 60px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(214, 72, 0, 0.06), transparent 55%),
    var(--brand-bg);
  text-align: center;
}
.help-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.help-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.help-hero h1 em {
  font-style: italic; color: var(--brand-primary);
}
.help-hero p {
  font-size: 17px;
  color: var(--brand-ink-muted);
  margin-bottom: 36px;
  line-height: 1.7;
}

/* ---------- Search Box ---------- */
.help-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.help-search input {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  padding: 16px 50px 16px 22px;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: var(--brand-card);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.help-search input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--brand-primary-soft);
}
.help-search-icon {
  position: absolute;
  right: 22px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--brand-ink-soft);
  pointer-events: none;
}
.help-search-clear {
  position: absolute;
  right: 16px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-ink-muted);
  color: #fff; font-size: 14px;
  border: 0; cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  line-height: 1;
}
.help-search.has-value .help-search-clear { display: flex; }
.help-search.has-value .help-search-icon { display: none; }

.help-search-counter {
  margin-top: 16px;
  font-size: 13px; color: var(--brand-ink-soft);
  letter-spacing: 0.05em;
  min-height: 18px;
}

/* ---------- Layout: sidebar + content ---------- */
.help-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 60px;
}

/* ---------- Sidebar ---------- */
.help-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.help-sidebar h4 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-ink-soft);
  font-weight: 600;
  margin-bottom: 12px;
  padding: 0 12px;
}
.help-sidebar ul {
  list-style: none;
  margin-bottom: 28px;
}
.help-sidebar li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--brand-ink-muted);
  transition: background 0.15s, color 0.15s;
  line-height: 1.3;
}
.help-sidebar li a:hover {
  background: var(--brand-primary-soft);
  color: var(--brand-ink);
  opacity: 1;
}
.help-sidebar li a.active {
  background: var(--brand-primary);
  color: #fff;
}
.help-sidebar li a.active .help-side-num {
  color: rgba(255, 255, 255, 0.6);
}
.help-side-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--brand-primary);
  width: 18px; flex-shrink: 0;
  text-align: center;
}

/* ---------- Content ---------- */
.help-content {
  min-width: 0;
}
.help-section {
  display: none;
  margin-bottom: 40px;
  animation: helpFadeIn 0.25s ease;
}
.help-section.is-active {
  display: block;
}
/* 搜索模式：显示所有未被搜索隐藏的 section */
body.is-searching .help-section:not([hidden]) {
  display: block;
  margin-bottom: 60px;
}
@keyframes helpFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.help-section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-primary);
  font-weight: 600;
  margin-bottom: 12px;
}
.help-section h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.help-section-lead {
  font-size: 16px;
  color: var(--brand-ink-muted);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 640px;
}

/* ---------- Cards ---------- */
.help-card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 32px;
}
.help-card {
  background: var(--brand-card);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  padding: 22px 22px 20px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.help-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -16px rgba(9, 9, 11, 0.12);
  border-color: var(--brand-primary-soft);
}
.help-card-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--brand-primary);
  margin-bottom: 10px;
  line-height: 1;
}
.help-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}
.help-card p {
  font-size: 14px;
  color: var(--brand-ink-muted);
  line-height: 1.65;
}
.help-card p + p { margin-top: 10px; }
.help-card ul {
  margin-top: 10px;
  padding-left: 18px;
  font-size: 14px;
  color: var(--brand-ink-muted);
  line-height: 1.7;
}

/* ---------- Spec Table ---------- */
.help-spec {
  background: var(--brand-card);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.help-spec-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  padding: 16px 22px;
  border-bottom: 1px solid var(--brand-line);
  font-size: 14px;
}
.help-spec-row:last-child { border-bottom: 0; }
.help-spec-key {
  color: var(--brand-ink-soft);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.help-spec-val {
  color: var(--brand-ink);
  line-height: 1.65;
}
.help-spec-val strong {
  color: var(--brand-primary);
  font-weight: 600;
}

/* ---------- Chip ---------- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-bg-alt);
  color: var(--brand-ink);
  border: 1px solid var(--brand-line);
}
.chip.chip-primary {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

/* ---------- Steps ---------- */
.help-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
}
.help-steps li {
  position: relative;
  padding: 14px 0 14px 56px;
  font-size: 15px;
  color: var(--brand-ink);
  border-bottom: 1px dashed var(--brand-line);
  line-height: 1.65;
}
.help-steps li:last-child { border-bottom: 0; }
.help-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.help-steps li small {
  display: block;
  color: var(--brand-ink-soft);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------- FAQ Accordion ---------- */
.help-faq {
  margin-bottom: 24px;
}
.help-faq-item {
  border-bottom: 1px solid var(--brand-line);
}
.help-faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 18px 36px 18px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--brand-ink);
  cursor: pointer;
  font-family: inherit;
  position: relative;
  line-height: 1.55;
}
.help-faq-q::after {
  content: "+";
  position: absolute;
  right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 22px;
  color: var(--brand-primary);
  font-weight: 400;
  transition: transform 0.2s;
  line-height: 1;
}
.help-faq-item.open .help-faq-q::after {
  content: "−";
  transform: translateY(-50%) rotate(0deg);
}
.help-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  font-size: 14px;
  color: var(--brand-ink-muted);
  line-height: 1.75;
}
.help-faq-item.open .help-faq-a {
  max-height: 600px;
}
.help-faq-a-inner {
  padding: 0 0 20px;
}
.help-faq-a code {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 12.5px;
  background: var(--brand-bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--brand-ink);
}

/* ---------- Search highlight ---------- */
mark.help-mark {
  background: rgba(214, 72, 0, 0.22);
  color: var(--brand-ink);
  padding: 0 2px;
  border-radius: 2px;
}
.help-section[hidden] { display: none !important; }
.help-faq-item[hidden] { display: none !important; }
.help-card[hidden] { display: none !important; }

/* ---------- No results ---------- */
.help-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--brand-ink-soft);
  font-size: 15px;
  display: none;
}
.help-empty.show { display: block; }
.help-empty strong {
  color: var(--brand-ink);
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

/* ---------- Feedback section ---------- */
.help-feedback {
  background: var(--brand-bg);
  padding: 80px 32px 60px;
  border-top: 1px solid var(--brand-line);
}
.help-feedback-inner {
  max-width: 960px;
  margin: 0 auto;
}
.help-feedback-head {
  text-align: center;
  margin-bottom: 40px;
}
.help-feedback-head .help-section-eyebrow {
  margin-bottom: 16px;
}
.help-feedback-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 400;
  margin-bottom: 12px;
  line-height: 1.2;
}
.help-feedback-head h2 em {
  font-style: italic;
  color: var(--brand-primary);
}
.help-feedback-head p {
  font-size: 15px;
  color: var(--brand-ink-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}
.help-feedback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.help-feedback-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px 20px 20px;
  background: var(--brand-card);
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  transition: all 0.22s ease;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  border-left-width: 1px;
}
.help-feedback-card:hover {
  border-color: var(--brand-primary);
  border-left-width: 3px;
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -20px rgba(214, 72, 0, 0.25);
  opacity: 1;
  padding-left: 18px;
}
.help-feedback-card .fb-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.help-feedback-card .fb-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-ink);
  line-height: 1.3;
}
.help-feedback-card .fb-desc {
  font-size: 12.5px;
  color: var(--brand-ink-soft);
  line-height: 1.55;
}
.help-feedback-mailto {
  text-align: center;
}
.help-feedback-mailto p {
  font-size: 13px;
  color: var(--brand-ink-soft);
  margin-top: 6px;
}
.help-feedback-mailto code {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 13px;
  background: var(--brand-bg-alt);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ---------- Contact section ---------- */
.help-contact {
  background: var(--brand-bg-alt);
  padding: 80px 32px;
  text-align: center;
}
.help-contact-inner {
  max-width: 720px;
  margin: 0 auto;
}
.help-contact h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.8vw, 40px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 14px;
}
.help-contact h2 em {
  font-style: italic; color: var(--brand-primary);
}
.help-contact p {
  font-size: 16px;
  color: var(--brand-ink-muted);
  margin-bottom: 28px;
  line-height: 1.7;
}
.help-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  text-align: left;
}
.help-contact-item {
  background: var(--brand-card);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, transform 0.2s;
}
.help-contact-item:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}
.help-contact-item strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 6px;
  font-weight: 600;
}
.help-contact-item span {
  color: var(--brand-ink);
}
.help-contact-item small {
  display: block;
  color: var(--brand-ink-soft);
  margin-top: 4px;
  font-size: 12.5px;
}

/* ---------- Section footer nav (prev/next) ---------- */
.help-section-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--brand-line);
}
.help-section-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  background: var(--brand-card);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  min-width: 0;
}
.help-section-nav a:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  opacity: 1;
}
.help-section-nav a.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.help-section-nav .nav-dir {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-ink-soft);
  font-weight: 600;
}
.help-section-nav .nav-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--brand-ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.help-section-nav .nav-next {
  text-align: right;
}
.help-section-nav .nav-next .nav-title::after {
  content: " →";
  color: var(--brand-primary);
}
.help-section-nav .nav-prev .nav-title::before {
  content: "← ";
  color: var(--brand-primary);
}

/* ---------- Back to top button ---------- */
.help-back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-ink);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, background 0.2s;
  z-index: 50;
  box-shadow: 0 6px 18px -8px rgba(9, 9, 11, 0.4);
}
.help-back-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.help-back-top:hover {
  background: var(--brand-primary);
}

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  .help-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0 60px;
  }
  /* 侧栏改为顶部 sticky 横向滚动条 */
  .help-sidebar {
    position: sticky;
    top: 60px;
    z-index: 30;
    max-height: none;
    overflow: hidden;
    background: rgba(250, 250, 247, 0.95);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--brand-line);
    border-bottom: 1px solid var(--brand-line);
    padding: 10px 0;
    margin: 0 -20px 0;
  }
  .help-sidebar h4 {
    display: none;
  }
  .help-sidebar ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 20px;
    margin-bottom: 0;
  }
  .help-sidebar ul::-webkit-scrollbar { display: none; }
  .help-sidebar li {
    flex-shrink: 0;
  }
  .help-sidebar li a {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 999px;
    background: var(--brand-bg-alt);
    white-space: nowrap;
    border: 1px solid transparent;
  }
  .help-sidebar li a:hover {
    background: var(--brand-bg-alt);
  }
  .help-sidebar li a.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
  }
  .help-side-num {
    display: none;
  }
  .help-content {
    padding: 0 20px;
  }
  .help-section { margin-bottom: 40px; }
  body.is-searching .help-section:not([hidden]) {
    margin-bottom: 48px;
  }
  .help-spec-row {
    grid-template-columns: 1fr;
    padding: 14px 18px;
    gap: 4px;
  }
  .help-spec-key {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  .help-hero { padding: 110px 20px 40px; }
  .help-contact { padding: 60px 20px; }
  .help-section-nav {
    flex-direction: column;
    margin-top: 36px;
    padding-top: 24px;
  }
  .help-section-nav .nav-next { text-align: left; }
  .help-back-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}
