/* ---------------------------------------------------------------------------
   RuoYi Plus Market 官网样式
   零依赖、单文件。品牌色与文档站（VitePress）保持一致。
   深色模式走 [data-theme="dark"]，由内联脚本在首帧前定好，避免白闪。
--------------------------------------------------------------------------- */

:root {
  --brand: #4f46e5;
  --brand-2: #4338ca;
  --brand-3: #6366f1;
  --brand-soft: rgba(99, 102, 241, 0.14);

  --bg: #ffffff;
  --bg-alt: #f7f7fb;
  --bg-soft: #f2f2f7;
  --text: #1f2233;
  --text-2: #4b5069;
  --text-3: #7d8399;
  --border: #e6e6ef;
  --code-bg: #f4f4f9;
  --shadow: 0 10px 30px rgba(79, 70, 229, 0.12);

  --wrap: 1152px;
  --radius: 12px;
  --radius-lg: 16px;
}

[data-theme='dark'] {
  --brand: #a5b4fc;
  --brand-2: #818cf8;
  --brand-3: #6366f1;
  --brand-soft: rgba(99, 102, 241, 0.2);

  --bg: #14161f;
  --bg-alt: #191c26;
  --bg-soft: #1e222d;
  --text: #e8eaf2;
  --text-2: #b4b9cc;
  --text-3: #838aa1;
  --border: #2a2f3d;
  --code-bg: #1b1f2a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--text);
  word-break: break-word;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.muted {
  color: var(--text-3);
  font-size: 0.85em;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
}

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.6) blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav a {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--text-2);
}

.nav a:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}

.nav a.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}

[data-theme='light'] .theme-toggle__sun,
[data-theme='dark'] .theme-toggle__moon {
  display: none;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--brand {
  background: var(--brand);
  color: #fff;
}

.btn--brand:hover {
  background: var(--brand-2);
}

.btn--plain {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text);
}

.btn--plain:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn--ghost {
  color: var(--text-2);
}

.btn--ghost:hover {
  color: var(--brand);
}

.btn--text {
  color: var(--brand);
  padding-left: 4px;
  padding-right: 4px;
}

.btn--text:hover {
  text-decoration: underline;
}

.btn--sm {
  padding: 6px 13px;
  font-size: 13.5px;
}

.btn--lg {
  padding: 12px 24px;
  font-size: 15.5px;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 84px 0 52px;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  inset: -45% 22% auto;
  height: 540px;
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.3), transparent 70%);
  filter: blur(24px);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--brand-soft);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.hero__title {
  margin: 22px 0 0;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero__title-accent {
  background: linear-gradient(100deg, #4f46e5 8%, #06b6d4 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__tagline {
  max-width: 720px;
  margin: 20px auto 0;
  font-size: 17px;
  color: var(--text-2);
}

.hero__actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.hero__code {
  margin: 34px auto 0;
  max-width: 720px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hero__code code {
  background: none;
  padding: 0;
  font-size: 13px;
  word-break: break-all;
}

.hero__code span {
  font-size: 12.5px;
  color: var(--text-3);
}

/* ---------------- 数字 ---------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding-bottom: 24px;
}

.stat {
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
}

.stat__value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--brand);
}

.stat__label {
  margin-top: 6px;
  font-weight: 600;
}

.stat__hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------------- 章节 ---------------- */
.section {
  padding: 60px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__head {
  margin-bottom: 32px;
}

.section__head--center {
  text-align: center;
}

.section__head h2,
.section__title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section__head p {
  margin: 14px auto 0;
  max-width: 760px;
  color: var(--text-2);
}

.section__more {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------- 网格与卡片 ---------------- */
.grid {
  display: grid;
  gap: 16px;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  display: block;
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.section--alt .card {
  background: var(--bg);
}

.card--link:hover {
  text-decoration: none;
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card__icon {
  font-size: 22px;
  line-height: 1;
}

.card h3 {
  margin: 12px 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--text-2);
}

.card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--text-2);
}

.card--good {
  border-color: rgba(16, 185, 129, 0.35);
}

.card--bad {
  border-color: rgba(245, 158, 11, 0.35);
}

/* ---------------- 应用卡片 ---------------- */
.app-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
  text-decoration: none;
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.app-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.app-card__name {
  font-size: 15.5px;
  font-weight: 700;
}

.app-card__version {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.app-card__summary {
  flex: 1;
  margin: 10px 0 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

.app-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--text-3);
}

.app-card__cat {
  color: var(--brand);
  font-weight: 600;
}

/* ---------------- 步骤 ---------------- */
.step {
  position: relative;
  padding: 24px 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.step__no {
  position: absolute;
  top: -13px;
  left: 20px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.step h3 {
  margin: 4px 0 12px;
  font-size: 15px;
}

.step pre {
  margin: 0;
}

/* ---------------- 代码 ---------------- */
pre {
  margin: 0;
  padding: 15px 16px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre;
  color: var(--text);
}

.code-block {
  margin-top: 8px;
}

/* ---------------- 读者分流 ---------------- */
.audience {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding-bottom: 72px;
}

.audience__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.audience__item:hover {
  text-decoration: none;
  border-color: var(--brand);
  transform: translateY(-2px);
}

.audience__item strong {
  font-size: 15px;
}

.audience__item span {
  font-size: 13px;
  color: var(--text-2);
}

/* ---------------- 页头（内页） ---------------- */
.page-head {
  padding: 56px 0 8px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  max-width: 800px;
  margin: 14px 0 0;
  color: var(--text-2);
}

.page-head__toc {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-head__toc a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-2);
}

.page-head__toc a:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

/* ---------------- 功能块 ---------------- */
.feature-block {
  padding: 44px 0;
  border-top: 1px solid var(--border);
}

.feature-block__inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
}

.feature-block__icon {
  font-size: 26px;
}

.feature-block__aside h2 {
  margin: 10px 0 10px;
  font-size: 1.35rem;
}

.feature-block__aside p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-2);
}

.feature-block__points {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text-2);
}

.feature-block__points li::marker {
  color: var(--brand);
}

/* ---------------- 表格 ---------------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

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

.table th,
.table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  font-weight: 600;
  background: var(--bg-alt);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table--compact td:first-child {
  width: 190px;
  font-weight: 600;
}

/* ---------------- 应用详情 ---------------- */
.app-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.app-detail {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.app-detail__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.app-detail__head h3 {
  margin: 0;
  font-size: 17px;
}

.app-detail__version {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 8px;
  border-radius: 999px;
}

.app-detail__summary {
  margin: 10px 0 14px;
  font-size: 13.5px;
  color: var(--text-2);
}

.app-detail__facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  margin: 0 0 12px;
  font-size: 13px;
}

.app-detail__facts div {
  display: flex;
  gap: 6px;
}

.app-detail__facts dt {
  color: var(--text-3);
  white-space: nowrap;
}

.app-detail__facts dd {
  margin: 0;
  color: var(--text);
}

.app-detail__menus {
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.app-detail__menus em {
  font-style: normal;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-2);
}

.app-detail__note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--brand-soft);
  font-size: 12.5px;
  color: var(--text-2);
}

.app-detail__src {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ---------------- 筛选 ---------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ---------------- 提示块 ---------------- */
.callout {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--brand);
  background: var(--bg-soft);
  font-size: 13.5px;
  color: var(--text-2);
}

.callout--warn {
  border-left-color: #f59e0b;
}

.callout--danger {
  border-left-color: #ef4444;
}

.prose {
  max-width: 820px;
  color: var(--text-2);
}

.limits {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 14.5px;
  color: var(--text-2);
}

/* ---------------- 流程 ---------------- */
.flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow__step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
}

.flow__step span {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.flow__step--hl {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.flow__step--hl span {
  background: var(--brand);
  color: #fff;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 40px 0 26px;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__brand strong {
  font-size: 15px;
}

.site-footer__brand p {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  max-width: 320px;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.site-footer__cols h4 {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text);
}

.site-footer__cols a {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  padding: 3px 0;
}

.site-footer__cols a:hover {
  color: var(--brand);
}

.site-footer__bottom {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 12.5px;
  color: var(--text-3);
}

.site-footer__beian em {
  font-style: normal;
  color: var(--brand);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
  .grid--4,
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3,
  .site-footer__inner,
  .app-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-block__inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 760px) {
  .nav {
    display: none;
  }

  .site-header__actions {
    margin-left: auto;
  }

  .grid--2,
  .grid--3,
  .grid--4,
  .stats,
  .audience,
  .app-details,
  .site-footer__cols,
  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 56px 0 36px;
  }

  .section {
    padding: 40px 0;
  }
}
