:root {
  --brand: #008e69;
  --ink: #333333;
  --muted: #999999;
  --line: #dedede;
  --canvas: #f4f4f4;
  --panel: #ffffff;
  --shell: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: var(--canvas);
}

body {
  min-width: 1180px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgb(0 142 105 / 35%);
  outline-offset: 2px;
}

img {
  vertical-align: middle;
}

.site-shell {
  width: var(--shell);
  margin-right: auto;
  margin-left: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1100;
  translate: 0 -160%;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
}

.skip-link:focus {
  translate: 0;
}

/*
 * 旧站 PC 页头：固定 1100px 壳、126px Logo、原始 Layui 导航节奏和搜索框。
 * 菜单宽度保留线上第六项（当前暂缓的“百宝箱”）所占的纯布局空间，
 * 但 DOM 中不渲染空链接或占位模块。
 */
.site-header {
  --legacy-header-height: 60px;
  --legacy-header-menu-offset: 60px;
  --legacy-header-menu-width: 635px;
  --legacy-header-menu-gap: 38px;
  --legacy-header-search-width: 236px;
  --legacy-header-search-button-width: 39px;

  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 999;
  height: var(--legacy-header-height);
  background: #fff;
  box-shadow: 0 1px 5px rgb(0 0 0 / 6%);
}

.site-header-inner {
  display: flex;
  height: var(--legacy-header-height);
  align-items: center;
  justify-content: flex-start;
}

.site-logo {
  display: block;
  width: 126px;
  height: 36px;
  flex: 0 0 126px;
}

.site-logo img {
  display: block;
  width: 126px;
  height: auto;
}

.site-header-right,
.site-nav-list,
.header-search {
  display: flex;
  align-items: center;
}

.site-header-right {
  width: calc(
    var(--legacy-header-menu-width) + var(--legacy-header-menu-gap) +
      var(--legacy-header-search-width)
  );
  flex: 0 0 auto;
  gap: var(--legacy-header-menu-gap);
  margin-left: var(--legacy-header-menu-offset);
}

.site-primary-navigation {
  width: var(--legacy-header-menu-width);
  flex: 0 0 var(--legacy-header-menu-width);
}

.site-nav-list {
  width: 100%;
  height: var(--legacy-header-height);
  gap: 0;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}

.site-nav-list > li {
  flex: 0 0 auto;
  margin-right: 8px;
}

.site-nav-link {
  display: flex;
  height: var(--legacy-header-height);
  align-items: center;
  border-bottom: 3px solid transparent;
  color: #666;
  margin: 0 20px;
  padding-top: 3px;
  font-family: Arial, Helvetica, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav-link:hover,
.site-nav-link.is-active {
  border-bottom-color: var(--brand);
  color: var(--brand);
}

.site-nav-link.is-active {
  color: #333;
}

.site-nav-with-arrow {
  gap: 5px;
}

.site-nav-arrow {
  width: 6px;
  height: 6px;
  border-right: 1px solid currentcolor;
  border-bottom: 1px solid currentcolor;
  margin-right: 3px;
  translate: 0 -2px;
  rotate: 45deg;
}

.header-search {
  width: var(--legacy-header-search-width);
  height: 40px;
  flex: 0 0 var(--legacy-header-search-width);
}

.header-search input {
  width: calc(
    var(--legacy-header-search-width) - var(--legacy-header-search-button-width)
  );
  height: 40px;
  border: 0;
  border-radius: 4px 0 0 4px;
  background: #efefef;
  color: #333;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
}

.header-search button {
  display: flex;
  width: var(--legacy-header-search-button-width);
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
  cursor: pointer;
  padding: 0;
}

.site-main {
  min-height: calc(100vh - 270px);
  padding-top: 84px;
}

.home-search-panel {
  width: 726px;
  margin-bottom: 17px;
  border-radius: 4px;
  background: #fff;
  padding: 15px 18px;
}

.home-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.home-search-form input,
.home-search-form button {
  height: 38px;
  border-radius: 4px;
  font: inherit;
}

.home-search-form input {
  border: 1px solid #dedede;
  background: #f7f7f7;
  color: #333;
  padding: 0 12px;
}

.home-search-form button {
  border: 0;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

/* 旧站正文是固定的 66% 主栏 + 351px 侧栏。 */
.legacy-two-column {
  display: grid;
  grid-template-columns: 726px 351px;
  gap: 23px;
  align-items: start;
}

.legacy-two-column.legacy-single-column {
  grid-template-columns: minmax(0, 1fr);
}

.legacy-left-column {
  min-width: 0;
}

.category-nav {
  display: flex;
  min-height: 52px;
  align-items: stretch;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
}

.category-nav-label {
  display: flex;
  width: 54px;
  flex: 0 0 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px 0 0 4px;
  background: var(--brand);
  color: #fff;
  line-height: 1;
}

.category-nav-label img {
  width: 20px;
  height: 20px;
  margin-bottom: 4px;
}

.category-nav-label span {
  font-size: 10px;
  letter-spacing: 1px;
}

.category-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 7px 3px;
  list-style: none;
}

.category-nav li {
  display: flex;
  align-items: center;
}

.category-nav a {
  display: block;
  color: #666;
  padding: 7px 10px;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.category-nav a:hover,
.category-nav a.is-active {
  color: var(--brand);
  font-weight: 600;
}

.legacy-list-panel {
  margin-top: 17px;
  border-radius: 4px;
  background: #fff;
  padding: 37px 37px 26px;
}

.legacy-two-column > .legacy-list-panel,
.legacy-two-column > .article-detail {
  margin-top: 0;
}

.article-list {
  padding: 0;
}

.article-card {
  display: grid;
  min-height: 124px;
  grid-template-columns: 174px minmax(0, 1fr);
  gap: 19px;
  border-bottom: 1px solid rgb(222 222 222 / 60%);
  padding: 25px 0;
}

.article-card:first-child {
  padding-top: 0;
}

.article-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.article-card-cover {
  position: relative;
  display: block;
  width: 174px;
  height: 124px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f0;
}

.article-card-media {
  position: relative;
  width: 174px;
  height: 124px;
}

.article-cover-image,
.article-card-cover .content-image-placeholder {
  display: block;
  width: 174px;
  height: 124px;
  background: #edf2f0;
  object-fit: cover;
}

.article-category-badge,
.sidebar-article-cover > span {
  position: absolute;
  top: 5px;
  left: 6px;
  display: flex;
  max-width: calc(100% - 12px);
  min-width: 48px;
  height: 24px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
  background: rgb(0 0 0 / 60%);
  color: #fff;
  padding: 0 7px;
  font-size: 12px;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-category-badge:hover,
.article-category-badge:focus-visible {
  color: #fff;
  background: rgb(0 142 105 / 88%);
}

.article-card-content {
  position: relative;
  min-width: 0;
  min-height: 124px;
}

.article-card h2 {
  display: -webkit-box;
  height: 46px;
  margin: 0;
  overflow: hidden;
  color: #333;
  font-size: 16px;
  font-weight: 400;
  line-height: 23px;
  letter-spacing: 0.4px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-summary {
  display: -webkit-box;
  height: 32px;
  margin: 6px 0 0;
  overflow: hidden;
  color: #999;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.8px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card-tags {
  position: absolute;
  right: 0;
  bottom: 25px;
  left: 0;
  display: flex;
  height: 17px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  gap: 8px;
  list-style: none;
  white-space: nowrap;
}

.article-card-tags a {
  color: #7b928b;
  font-size: 11px;
  line-height: 17px;
}

.article-card-tags a::before {
  content: "#";
}

.article-card-tags a:hover {
  color: var(--brand);
}

.article-meta,
.article-detail-meta {
  display: flex;
  align-items: center;
  margin: 0;
  color: #999;
  font-size: 12px;
}

.article-meta {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  gap: 23px;
}

.article-meta div,
.article-detail-meta div {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.article-meta dt,
.article-meta dd,
.article-detail-meta dt,
.article-detail-meta dd {
  margin: 0;
}

.article-meta dt {
  display: flex;
  align-items: center;
}

.article-meta a,
.article-detail-meta a {
  color: #999;
}

.article-meta a:hover,
.article-detail-meta a:hover {
  color: var(--brand);
}

.legacy-more-link {
  margin-top: 34px;
  text-align: center;
}

.legacy-more-link a {
  display: inline-block;
  width: 91px;
  height: 38px;
  border-radius: 19px;
  background: var(--brand);
  box-shadow: 3px 6px 13px rgb(0 142 105 / 18%);
  color: #fff;
  font-size: 12px;
  line-height: 38px;
  letter-spacing: 2px;
}

.home-author-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-author-list li + li {
  border-top: 1px solid #eee;
}

.home-author-list a {
  display: flex;
  padding: 11px 0;
  align-items: center;
  gap: 12px;
}

.home-author-avatar,
.author-profile-avatar {
  display: grid;
  overflow: hidden;
  border-radius: 50%;
  place-items: center;
  background: #edf2f0;
}

.home-author-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.home-author-avatar img,
.author-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-avatar-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: #dcebe6;
  color: var(--brand);
  font-weight: 600;
}

.home-author-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.home-author-copy strong {
  overflow: hidden;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-author-copy small {
  color: #999;
  margin-top: 3px;
  font-size: 11px;
}

.empty-state {
  margin: 0;
  color: #999;
  padding: 55px 0;
  text-align: center;
}

/* 删除课程、广告、渠道等未确认模块后，只用文章和标签自然补位。 */
.legacy-sidebar {
  width: 351px;
}

.sidebar-panel {
  margin-bottom: 20px;
  border-radius: 4px;
  background: #fff;
  padding: 21px;
}

.sidebar-panel > h2 {
  margin: 0 0 22px;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.sidebar-tags ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px -10px 0;
  padding: 0;
  list-style: none;
}

.sidebar-tags li {
  margin: 0 10px 10px 0;
}

.sidebar-tags a {
  display: block;
  border-radius: 4px;
  background: #eaeaea;
  color: #666;
  padding: 7px 10px;
  font-size: 14px;
  line-height: 20px;
}

.sidebar-tags a:hover {
  color: var(--brand);
}

.sidebar-article {
  display: grid;
  min-height: 85px;
  grid-template-columns: 115px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid rgb(222 222 222 / 60%);
  padding: 20px 0;
}

.sidebar-article:first-child {
  padding-top: 0;
}

.sidebar-article:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.sidebar-article-cover {
  position: relative;
  display: block;
  width: 115px;
  height: 85px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f0;
}

.sidebar-cover-image,
.sidebar-article-cover .content-image-placeholder {
  display: block;
  width: 115px;
  height: 85px;
  object-fit: cover;
}

.sidebar-article-cover > span {
  top: 4px;
  height: 22px;
  min-width: 42px;
  font-size: 11px;
  line-height: 22px;
}

.sidebar-article-copy {
  position: relative;
  min-width: 0;
  min-height: 85px;
}

.sidebar-article h3 {
  display: -webkit-box;
  max-height: 60px;
  margin: 0;
  overflow: hidden;
  color: #333;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.sidebar-article-copy > p {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: #999;
  font-size: 11px;
}

.sidebar-article-copy > p > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sidebar-article-copy > p a {
  max-width: 58px;
  overflow: hidden;
  color: #999;
  text-overflow: ellipsis;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  border-top: 1px solid rgb(222 222 222 / 60%);
  padding-top: 25px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 32px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 2px;
  background: #fff;
  color: #666;
  padding: 0 9px;
  font-size: 12px;
}

.pagination a:hover,
.pagination a.is-current {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.pagination span[aria-disabled="true"] {
  color: #bbb;
}

.breadcrumbs {
  margin: 0;
  color: #999;
  font-size: 12px;
}

.breadcrumbs ol {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs li:not(:last-child)::after {
  margin: 0 8px;
  color: #bbb;
  content: ">";
}

.breadcrumbs li:last-child {
  max-width: 265px;
}

.legacy-page-heading {
  display: flex;
  min-height: 52px;
  align-items: center;
  margin-bottom: 19px;
  border-radius: 4px;
  background: #fff;
  color: #999;
  padding: 15px 20px;
  font-size: 16px;
}

.legacy-page-heading > span {
  display: inline-block;
  width: 3px;
  height: 14px;
  flex: 0 0 3px;
  margin-right: 5px;
  background: var(--brand);
}

.legacy-page-heading h1 {
  margin: 0;
  color: #999;
  font-size: 16px;
  font-weight: 400;
}

.legacy-page-heading strong {
  color: #333;
  font-weight: 600;
}

.legacy-page-heading p {
  margin: 0 0 0 auto;
  color: #999;
  font-size: 12px;
}

.author-heading {
  padding: 14px 20px;
}

.author-heading > .author-profile-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  margin-right: 14px;
  background: #edf2f0;
}

.author-heading > div {
  min-width: 0;
}

.author-heading > div > p {
  margin: 7px 0 0;
}

/* 文章详情沿用旧站 22px 内边距与紧凑正文。 */
.article-page {
  width: 1100px;
}

.article-detail {
  min-width: 0;
  border-radius: 4px;
  background: #fff;
  padding: 22px;
}

.article-detail-header {
  padding-bottom: 22px;
}

.article-detail h1 {
  display: -webkit-box;
  margin: 25px 0 22px;
  overflow: hidden;
  color: #333;
  font-size: 20px;
  font-weight: 600;
  line-height: 30px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-detail-meta {
  gap: 23px;
}

.article-detail-meta dt {
  display: flex;
  align-items: center;
}

.article-body {
  overflow-wrap: anywhere;
  padding: 6px 0 28px;
  color: #333;
  font-size: 14px;
  line-height: 20px;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.5em 0 0.7em;
  color: #222;
  font-weight: 600;
  line-height: 1.55;
}

.article-body h2 {
  font-size: 20px;
}

.article-body h3 {
  font-size: 17px;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body table {
  margin: 0 0 1.2em;
}

.article-body p,
.article-body li {
  font-size: 14px;
  line-height: 20px;
}

.article-body ul,
.article-body ol {
  padding-left: 2em;
}

.article-body a {
  color: var(--brand);
  text-decoration: underline;
}

.article-body img,
.article-body video,
.article-body iframe {
  max-width: 100%;
  height: auto;
}

.article-body img {
  display: block;
  aspect-ratio: auto 16 / 9;
  background: #f4f4f4;
  margin: 20px auto;
  object-fit: contain;
}

.article-body blockquote {
  border-left: 3px solid #ccc;
  background: #f5f5f5;
  color: #666;
  padding: 12px 16px;
}

.article-body pre {
  overflow-x: auto;
  background: #f5f5f5;
  padding: 14px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
}

.article-body th,
.article-body td {
  border: 1px solid #ddd;
  padding: 8px 10px;
}

.article-source {
  margin: 0 0 28px;
  border-radius: 4px;
  background: #eaeaea;
  color: #666;
  padding: 22px;
  font-size: 14px;
  line-height: 1.5;
}

.article-source h2 {
  margin: 0;
  color: #666;
  font-size: 14px;
  font-weight: 600;
}

.article-source-line {
  margin: 12px 0;
}

.article-source-notice {
  margin: 0;
}

.article-source a {
  color: #666;
}

.article-tags {
  margin: 0;
}

.article-tags ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px -10px 0;
  padding: 0;
  list-style: none;
}

.article-tags li {
  margin: 0 10px 10px 0;
}

.article-tags a {
  display: block;
  border-radius: 4px;
  background: #eaeaea;
  color: #666;
  padding: 7px 10px;
}

/* 搜索页没有可靠的同名新版模块，仅继承旧站外壳与表单密度。 */
.search-panel {
  margin-top: 0;
}

.search-panel .legacy-page-heading {
  min-height: 0;
  margin: -22px -22px 20px;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  padding: 15px 0;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 8px;
  width: 100%;
  align-items: end;
}

.search-form-filters {
  grid-template-columns: minmax(220px, 1fr) 145px 105px 64px;
}

.search-form label {
  display: block;
  margin-bottom: 5px;
  color: #666;
  font-size: 12px;
}

.search-form input,
.search-form select {
  width: 100%;
  height: 38px;
  border: 1px solid #dedede;
  border-radius: 4px;
  background: #fff;
  color: #333;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
}

.search-form button {
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
}

.search-start-state,
.search-results > header {
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.search-start-state h2,
.search-results h2 {
  margin: 0 0 8px;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.search-start-state p {
  margin: 0;
  color: #999;
  font-size: 12px;
}

.search-results .article-list {
  margin-top: 24px;
}

.author-articles,
.tag-articles {
  margin-top: 0;
}

.content-image-placeholder {
  background: #edf2f0;
}

.state-page {
  min-height: calc(100vh - 210px);
  padding: 150px 120px 80px;
  text-align: center;
}

.state-code {
  margin: 0;
  color: var(--brand);
  font-family: Arial, sans-serif;
  font-size: 70px;
  font-weight: 700;
  line-height: 1;
}

.state-page h1 {
  margin: 20px 0 8px;
  font-size: 24px;
}

.state-page > p:not(.state-code) {
  color: #777;
}

.state-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 25px;
}

.primary-link,
.primary-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  padding: 8px 18px;
  font: inherit;
}

.primary-link:hover,
.primary-button:hover {
  color: #fff;
}

/* 首页保留旧站关于我们骨架，其余页面使用旧式紧凑版权栏。 */
.site-footer {
  width: 100%;
  background: #333;
  color: #bbb;
}

.site-footer-home {
  margin-top: 40px;
  padding-top: 40px;
}

.site-footer-content {
  display: flex;
}

.site-footer-home h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
}

.footer-about {
  width: 620px;
}

.footer-about p {
  margin: 0;
  color: #bbb;
  font-size: 14px;
  line-height: 20px;
}

.footer-divider {
  width: 1100px;
  height: 1px;
  margin: 36px auto 12px;
  background: rgb(222 222 222 / 45%);
}

.site-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 15px;
  font-size: 14px;
  line-height: 20px;
}

.site-footer-bottom p {
  margin: 0;
}

.site-footer-bottom a {
  color: #dc2030;
}

.site-footer-compact {
  margin-top: 45px;
}

.site-footer-compact-inner {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  color: #bbb;
  font-size: 14px;
  line-height: 20px;
}

.site-footer-compact-inner p {
  margin: 0;
}

.site-footer-compact-inner a {
  color: #dc2030;
}
