@charset "utf-8";

:root {
  --color-primary: #07c160;
  --color-primary-hover: #06ad56;
  --color-text: #333;
  --color-text-secondary: #888;
  --color-border: #e5e5e5;
  --color-bg: #fff;
  --color-bg-gray: #f7f7f7;
  --color-bg-hover: #f0f0f0;
  --color-bg-active: #e8f8ef;
  --sidebar-width: 280px;
  --topbar-height: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑", sans-serif;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Top bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 100%;
  padding: 0 24px;
  gap: 24px;
}

.site-title {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.site-title:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-wrap input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg-gray);
  border: 1px solid transparent;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.search-wrap input::placeholder {
  color: #bbb;
}

.search-wrap input:focus {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.search-icon::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border: 1.5px solid #bbb;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 5px;
  height: 1.5px;
  background: #bbb;
  transform: rotate(45deg);
  transform-origin: right bottom;
}

/* Layout */
.layout {
  display: flex;
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}

.mobile-nav {
  display: none;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  padding: 12px 0 24px;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group-title {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text);
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
}

.nav-group-title:hover {
  background: var(--color-bg-hover);
}

.nav-group-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #999;
  transition: transform 0.2s;
}

.nav-group.is-collapsed .nav-group-chevron {
  transform: rotate(-90deg);
}

.nav-group.is-collapsed .nav-group-list {
  display: none;
}

.nav-group-list {
  list-style: none;
}

.nav-item {
  display: block;
  padding: 8px 16px 8px 36px;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.5;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-item:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
  text-decoration: none;
}

.nav-item.is-active {
  color: var(--color-primary);
  font-weight: 500;
  background: var(--color-bg-active);
  border-left-color: var(--color-primary);
}

.nav-item.is-hidden {
  display: none;
}

.nav-group.is-empty {
  display: none;
}

/* Content */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px 40px 48px;
  max-width: 900px;
  min-height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
}

.content-placeholder {
  padding: 80px 0;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.content-placeholder.is-hidden,
.content-article.is-hidden,
.content-empty.is-hidden {
  display: none;
}

.content-empty {
  padding: 80px 0;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.breadcrumb {
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.breadcrumb a {
  color: var(--color-text-secondary);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb span {
  margin: 0 6px;
  color: #ccc;
}

.article-title {
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

/* 问题描述区（较大字号 + 可选配图） */
.article-desc {
  margin-bottom: 28px;
  border-radius: 6px;
}

.article-desc-label {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.article-desc-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}

.article-desc-figure {
  margin: 16px 0 0;
  /* border: 1px solid var(--color-border); */
  /* border-radius: 4px; */
  overflow: hidden;
  background: var(--color-bg);
}

.article-desc-figure img {
  display: block;
  /* width: 100%; */
  max-width: 100%;
  height: auto;
}

.article-desc-figure figcaption {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-bg-gray);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

/* 无 introLabel 时的普通简介（较小字号） */
.article-intro {
  margin-bottom: 24px;
  font-size: 14px;
  color: #555;
}

.article-steps-label {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.article-steps {
  list-style: none;
  counter-reset: step;
}

.article-step {
  counter-increment: step;
  margin-bottom: 28px;
}

.article-step-text {
  position: relative;
  padding-left: 32px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--color-text);
  white-space: pre-line;
}

.article-step-text::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-bg-active);
  border-radius: 50%;
}

.article-figure {
  margin: 0;
  /* border: 1px solid var(--color-border); */
  /* border-radius: 4px; */
  overflow: hidden;
  /* background: var(--color-bg-gray); */
}

.article-figure img {
  display: block;
  /* width: 100%; */
  max-width: 100%;
  height: auto;
}

.article-figure figcaption {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-bg-gray);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.article-tip {
  margin-top: 28px;
  padding: 14px 16px;
  font-size: 13px;
  color: #555;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 4px;
}

.article-tip strong {
  color: #d48806;
  font-weight: 600;
}

.content-footer {
  margin-top: 40px;
  padding-top: 20px;
  font-size: 12px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
}

.content-bottom-note {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: 12px;
}

.content-bottom-about,
.content-bottom-company {
  color: var(--color-text);
}

.content-bottom-copy {
  margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    padding-top: 61px;
  }

  .mobile-nav {
    display: block;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    z-index: 90;
    width: 100%;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-gray);
    color: var(--color-text);
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
  }

  .mobile-nav-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #999;
    border-bottom: 1.5px solid #999;
    transform: rotate(45deg);
    transition: transform 0.2s;
  }

  body.is-mobile-nav-open .mobile-nav-toggle::after {
    transform: rotate(-135deg);
    margin-top: 4px;
  }

  .sidebar {
    width: 100%;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 90vh;
    display: none;
  }

  body.is-mobile-nav-open .sidebar {
    display: block;
  }

  .content {
    margin-left: 0;
    padding: 20px 16px 40px;
  }

  body.is-mobile-nav-open .content {
    display: none;
  }

  .top-bar-inner {
    flex-wrap: wrap;
    padding: 8px 16px;
    height: auto;
    min-height: var(--topbar-height);
  }

  .search-wrap {
    max-width: none;
    width: 100%;
    order: 3;
    margin-bottom: 4px;
  }
}
