/* Roleva 帮助中心静态样式：无框架依赖，延续 Ink & Velvet 品牌（Fraunces 标题 + Albert Sans 正文 + ec 色板）。 */

@font-face {
  font-family: "Albert Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/albert-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Albert Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/albert-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/fraunces-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --hp-sans: "Albert Sans Variable", "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --hp-display: "Fraunces Variable", "Songti SC", "Noto Serif SC", Georgia, serif;
  --hp-bg: #f5f7f8;
  --hp-card: #ffffff;
  --hp-text: #11161c;
  --hp-muted: #76818f;
  --hp-link: #0d5a94;
  --hp-border: #dfe3e8;
  --hp-border-strong: #c5cbd3;
  --hp-accent: #0d69ad;
  --hp-accent-soft: #eff6fb;
  --hp-code-bg: #ebeef0;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --hp-bg: #0c0f13;
    --hp-card: #1b2128;
    --hp-text: #eef1f4;
    --hp-muted: #9aa4b0;
    --hp-link: #6cbbeb;
    --hp-border: #2c343e;
    --hp-border-strong: #3e4754;
    --hp-accent: #45a0da;
    --hp-accent-soft: #113c5c;
    --hp-code-bg: #29303a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--hp-bg);
  color: var(--hp-text);
  font-family: var(--hp-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2 {
  font-family: var(--hp-display);
  font-weight: 560;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.hp-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.hp-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--hp-card);
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 10;
}

.hp-skip:focus {
  left: 0;
}

/* 顶栏 */
.hp-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--hp-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hp-border);
}

.hp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}

.hp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hp-text);
  font-family: var(--hp-display);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.hp-brand img {
  border-radius: 7px;
}

.hp-header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.hp-lang[aria-current="true"] {
  color: var(--hp-text);
  font-weight: 650;
}

.hp-menu {
  display: none;
}

.hp-app {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--hp-accent);
  color: #fff;
  font-weight: 600;
}

.hp-app:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

/* 主体两栏 */
.hp-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 40px;
  padding-top: 32px;
  padding-bottom: 64px;
}

.hp-nav {
  order: -1;
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 14px;
}

.hp-nav-group {
  margin-bottom: 20px;
}

.hp-nav-group > p {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hp-muted);
}

.hp-nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hp-nav-group a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--hp-text);
}

.hp-nav-group a:hover {
  background: var(--hp-accent-soft);
  text-decoration: none;
}

.hp-nav-group a[aria-current="page"] {
  background: var(--hp-accent-soft);
  color: var(--hp-link);
  font-weight: 650;
}

/* 文章 */
.hp-article-head h1 {
  margin: 8px 0 12px;
  font-size: 34px;
}

.hp-crumb {
  margin: 0;
  font-size: 13px;
  color: var(--hp-muted);
}

.hp-lead {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--hp-muted);
}

.hp-article-meta {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--hp-muted);
}

.hp-toc {
  margin: 0 0 28px;
  padding: 14px 18px;
  border: 1px solid var(--hp-border);
  border-radius: 12px;
  background: var(--hp-card);
  font-size: 14px;
}

.hp-toc ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* 正文排版 */
.hp-prose {
  font-size: 16px;
}

.hp-prose h2 {
  margin: 36px 0 12px;
  font-size: 24px;
  padding-top: 8px;
}

.hp-prose h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.hp-prose p,
.hp-prose ul,
.hp-prose ol {
  margin: 12px 0;
}

.hp-prose li {
  margin: 4px 0;
}

.hp-prose code {
  background: var(--hp-code-bg);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
}

.hp-prose pre {
  background: var(--hp-code-bg);
  padding: 14px 16px;
  border-radius: 12px;
  overflow-x: auto;
}

.hp-prose pre code {
  background: none;
  padding: 0;
}

.hp-prose blockquote {
  margin: 16px 0;
  padding: 4px 16px;
  border-left: 3px solid var(--hp-border-strong);
  color: var(--hp-muted);
}

.hp-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.hp-prose th,
.hp-prose td {
  border: 1px solid var(--hp-border);
  padding: 8px 12px;
  text-align: left;
}

.hp-prose img {
  max-width: 100%;
  border-radius: 12px;
}

/* 首页卡片 */
.hp-home-section h2 {
  margin: 36px 0 14px;
  font-size: 22px;
}

.hp-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.hp-card-list a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--hp-border);
  border-radius: 14px;
  background: var(--hp-card);
  color: var(--hp-text);
}

.hp-card-list a:hover {
  text-decoration: none;
  border-color: var(--hp-border-strong);
  box-shadow: 0 8px 22px -14px rgba(14, 18, 22, 0.4);
}

.hp-card-list strong {
  font-size: 15px;
}

.hp-card-list span {
  font-size: 13px;
  color: var(--hp-muted);
}

/* 页脚 */
.hp-footer {
  border-top: 1px solid var(--hp-border);
  background: var(--hp-card);
}

.hp-footer-inner {
  padding-top: 28px;
  padding-bottom: 36px;
  font-size: 14px;
  color: var(--hp-muted);
}

.hp-footer-inner p {
  margin: 6px 0;
  max-width: 560px;
}

/* 404 */
.hp-notfound {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px;
}

.hp-notfound h1 {
  font-size: 34px;
  margin: 0 0 8px;
}

/* 移动端：侧栏折到正文之后，顶部提供锚点跳转 */
@media (max-width: 860px) {
  .hp-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hp-nav {
    order: 1;
    position: static;
    max-height: none;
    border-top: 1px solid var(--hp-border);
    padding-top: 20px;
  }

  .hp-menu {
    display: inline;
  }

  .hp-article-head h1 {
    font-size: 28px;
  }
}
