/* 学习中心（服务端渲染）样式：基于 front/studycenter 原型迁移 */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #303133;
  background: #eef1f6;
}

a {
  color: #1c82fd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* —— 顶栏 —— */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-header__inner {
  max-width: 1400px;
  width: 92%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.site-brand__logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-brand__logo {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.site-brand__page-link {
  font-size: 15px;
  color: #303133;
  font-weight: 600;
}

.site-brand__page-link:hover {
  color: #1c82fd;
  text-decoration: none;
}

.site-header__link {
  font-size: 14px;
  color: #606266;
}

.site-header__link:hover {
  color: #1c82fd;
}

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn--primary {
  background: #1c82fd;
  color: #fff;
}

.btn--primary:hover {
  background: #1670e0;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(28, 130, 253, 0.3);
}

.btn--ghost {
  background: #fff;
  color: #1c82fd;
  border: 1px solid rgba(28, 130, 253, 0.45);
}

.btn--ghost:hover {
  background: rgba(28, 130, 253, 0.06);
  text-decoration: none;
}

/* —— 论坛式首页 —— */
.forum-home {
  max-width: 960px;
  width: 92%;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.forum-home__banner {
  padding: 28px 24px 32px;
  margin-bottom: 24px;
  text-align: center;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.forum-home__banner h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
}

.forum-home__banner p {
  margin: 10px 0 0;
  font-size: 15px;
  color: #606266;
}

.forum-board {
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.forum-board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(90deg, rgba(28, 130, 253, 0.08) 0%, rgba(28, 130, 253, 0.02) 100%);
  border-bottom: 1px solid #ebeef5;
}

.forum-board__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #303133;
}

.forum-board__title a {
  color: inherit;
}

.forum-board__title a:hover {
  color: #1c82fd;
}

.forum-board__more {
  font-size: 14px;
  font-weight: 500;
  color: #1c82fd;
  white-space: nowrap;
}

.forum-board__more:hover {
  text-decoration: none;
  opacity: 0.85;
}

.forum-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.forum-post-list > li {
  border-bottom: 1px solid #f0f2f5;
}

.forum-post-list > li:last-child {
  border-bottom: 0;
}

.forum-post {
  display: block;
  padding: 16px 20px;
  color: inherit;
  transition: background 0.15s;
}

.forum-post:hover {
  background: #f8fafc;
  text-decoration: none;
}

.forum-post__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.forum-post__title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: #303133;
  line-height: 1.45;
}

.forum-post:hover .forum-post__title {
  color: #1c82fd;
}

.forum-post__date {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 400;
  color: #909399;
  white-space: nowrap;
  line-height: 1.45;
  margin-top: 2px;
}

.forum-post__excerpt {
  margin: 0;
  font-size: 13px;
  color: #606266;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.forum-post__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 500;
  color: #909399;
  vertical-align: middle;
  border: 1px solid #dcdfe6;
  border-radius: 3px;
}

/* —— 通用内页容器 —— */
.page-inner {
  max-width: 960px;
  width: 92%;
  margin: 0 auto;
  padding: 20px 0 48px;
}

.page-inner--article {
  max-width: 720px;
}

/* —— 文章页：左栏板块 + 右侧正文 —— */
.article-page {
  max-width: 1180px;
}

/* 使用 flex + nowrap，避免在 900px 以下媒体查询里误单列；窄屏再堆叠 */
.article-page__grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 28px;
  width: 100%;
}

.article-sidebar {
  flex: 0 0 280px;
  width: 280px;
  min-width: 240px;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

.article-sidebar__inner {
  padding: 16px 14px 20px;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.article-sidebar__home {
  display: block;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebeef5;
  font-size: 13px;
  font-weight: 500;
  color: #606266;
}

.article-sidebar__home:hover {
  color: #1c82fd;
  text-decoration: none;
}

.sidebar-board {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f5;
}

.sidebar-board:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.sidebar-board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sidebar-board__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #303133;
  line-height: 1.35;
}

.sidebar-board__title a {
  color: inherit;
}

.sidebar-board__title a:hover {
  color: #1c82fd;
}

.sidebar-board__more {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: #1c82fd;
}

.sidebar-board__more:hover {
  text-decoration: none;
  opacity: 0.85;
}

.sidebar-board__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-board__list li {
  margin: 0;
  border-bottom: 1px solid #f5f7fa;
}

.sidebar-board__list li:last-child {
  border-bottom: 0;
}

.sidebar-board__list a {
  display: block;
  padding: 8px 6px 8px 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #606266;
  border-radius: 4px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.sidebar-board__list a:hover {
  background: #f5f9ff;
  color: #1c82fd;
  text-decoration: none;
}

.sidebar-board__list a.is-active {
  font-weight: 600;
  color: #1c82fd;
  background: rgba(28, 130, 253, 0.08);
  border-left-color: #1c82fd;
}

.sidebar-board__empty {
  display: block;
  padding: 8px 6px;
  font-size: 12px;
  color: #c0c4cc;
}

.article-page__main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .article-page__grid {
    flex-direction: column;
    flex-wrap: wrap;
  }

  .article-sidebar {
    flex: none;
    width: 100%;
    min-width: 0;
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* —— 列表页标题区 —— */
.list-page-head {
  margin-bottom: 20px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
}

.list-page-head h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}

.list-page-head p {
  margin: 0;
  font-size: 14px;
  color: #909399;
}

.list-page-head .back-link {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 14px;
}

/* —— 面包屑 —— */
.breadcrumb {
  margin-bottom: 20px;
  font-size: 13px;
  color: #909399;
}

.breadcrumb a {
  color: #606266;
}

.breadcrumb a:hover {
  color: #1c82fd;
}

.breadcrumb__sep {
  margin: 0 6px;
  color: #c0c4cc;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #ebeef5;
}

/* Thymeleaf Spring Data Dialect：sd:pagination 生成的 Bootstrap 式结构 */
.list-page-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #ebeef5;
}

.list-pagination-summary {
  margin: 0 0 16px;
  text-align: center;
  font-size: 14px;
  color: #606266;
}

.list-pagination-nav .pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-pagination-nav .pagination > li {
  display: inline-block;
  margin: 0;
}

.list-pagination-nav .pagination > li > a,
.list-pagination-nav .pagination > li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  color: #606266;
  background: #fff;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  text-decoration: none;
  box-sizing: border-box;
}

.list-pagination-nav .pagination > li.active > a,
.list-pagination-nav .pagination > li.active > span {
  color: #fff;
  background: #1c82fd;
  border-color: #1c82fd;
  font-weight: 600;
}

.list-pagination-nav .pagination > li.disabled > span,
.list-pagination-nav .pagination > li.disabled > a {
  color: #c0c4cc;
  background: #f5f7fa;
  pointer-events: none;
}

.list-pagination-nav .pagination > li:not(.disabled):not(.active) > a:hover {
  color: #1c82fd;
  border-color: rgba(28, 130, 253, 0.45);
  text-decoration: none;
}

/* —— 文章详情 —— */
.article-detail {
  padding: 28px 32px 36px;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.article-detail__title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.35;
}

.article-detail__meta {
  margin: 0 0 24px;
  padding-bottom: 20px;
  font-size: 13px;
  color: #909399;
  border-bottom: 1px solid #ebeef5;
}

.article-body {
  display: flow-root;
  font-size: 15px;
  line-height: 1.85;
  color: #303133;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.article-body p {
  margin: 0 0 1em;
}

.article-body h2 {
  margin: 1.4em 0 0.6em;
  font-size: 18px;
  font-weight: 700;
  color: #303133;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.article-body li {
  margin-bottom: 0.35em;
}

.forum-board--list {
  margin-top: 0;
}

/* —— 页脚 —— */
.site-footer {
  margin-top: 0;
  padding: 28px 20px 36px;
  text-align: center;
  font-size: 13px;
  color: #909399;
  background: #fff;
  border-top: 1px solid #e4e7ed;
}

.site-footer__line {
  margin: 0;
}

.site-footer__line--gap {
  margin-top: 8px;
}

.site-footer a {
  color: #606266;
}

.site-footer a:hover {
  color: #1c82fd;
}

