:root {
  --theme-color: #1f4e79;
}

@font-face {
  font-family: 'JFZSKSeal';
  src: url('fonts/JFZSKSealScript.ttf') format('truetype');
  font-display: swap;
}

/* ---------- 贯穿式顶部标题栏 ---------- */
.site-title {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px 0 118px;
  background: #1f3a5f;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 2px;
  z-index: 140;
}

/* ---------- 返回首页按钮 ---------- */
.back-home {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(135, 206, 235, .78);
  border: 1px solid rgba(135, 206, 235, .9);
  color: #083a57;
  font-size: .8rem;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  transition: background .2s ease;
}

.back-home:hover {
  background: rgba(135, 206, 235, .95);
  color: #04293d;
}

/* ---------- 搜索框（已移除） ---------- */
.sidebar .search {
  display: none;
}

.sidebar .search .input-wrap {
  margin: 0;
}

.sidebar .search input {
  width: 100%;
  height: 38px;
  padding: 0 16px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  font-size: .88rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.sidebar .search input:focus {
  border-color: var(--theme-color);
  outline: none;
}

.sidebar .search .results-panel {
  position: fixed;
  top: 58px;
  right: 24px;
  width: 300px;
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
  z-index: 301;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 280px;
  top: 60px;
  padding-top: 0;
  border-right: 1px solid #e8ebef;
}

.content {
  top: 60px;
  left: 280px;
  padding-top: 0;
}

.sidebar .app-name {
  display: none;
  margin: 0;
  padding: 10px 16px 12px;
  background: rgba(135, 206, 235, .40);
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  letter-spacing: 2px;
}

.sidebar .app-name a {
  display: inline-block;
  padding: 5px 8px;
  color: #c0392b;
  font-family: 'JFZSKSeal', 'STKaiti', 'KaiTi', serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 1px;
  text-align: center;
  border: 2px solid #c0392b;
  border-radius: 2px;
  position: relative;
  transform: none;
  background: rgba(255, 255, 255, .05);
}

.sidebar .app-name a::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid #c0392b;
  pointer-events: none;
}

.sidebar-nav {
  padding: 16px 0 40px;
}

/* 分类下的文章列表默认收起，避免渲染时闪烁 */
.sidebar-nav li > ul {
  display: none;
}

/* ---------- 侧边栏分类折叠 ---------- */
.sidebar-nav .cat-toggle {
  position: relative;
  padding-right: 22px;
  cursor: pointer;
  user-select: none;
}

.sidebar-nav .cat-toggle::after {
  content: '▸';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .8rem;
  color: #9aa6b2;
}

.sidebar-nav li:not(.collapsed) .cat-toggle::after {
  content: '▾';
}

.sidebar ul li a {
  padding: 4px 0;
}

/* ---------- 正文 ---------- */
.markdown-section {
  max-width: 100%;
  padding: 36px 48px 90px;
}

.markdown-section h1 {
  font-size: 1.7rem;
  text-align: center;
  border-bottom: 1px solid #eef1f4;
  padding-bottom: .45em;
  margin: 30px auto 36px;
}

.markdown-section h2 {
  font-size: 1.5rem;
  margin-top: 2.2rem;
}

.markdown-section p,
.markdown-section li {
  line-height: 1.85;
}

.markdown-section blockquote {
  border-left: 3px solid var(--theme-color);
  background: #f5f8fb;
  margin: 1.6em 0;
  padding: .7em 1.1em;
  color: #4a5a6a;
}

.markdown-section code {
  background: #f4f6f8;
  color: #c92c2c;
}

.markdown-section pre {
  background: #f7f9fb;
  border-radius: 6px;
}

.markdown-section pre > code {
  color: #3a4a5a;
}

/* ---------- 表格 ---------- */
.markdown-section table {
  display: table;
  width: 100%;
}

.markdown-section th {
  background: #f5f8fb;
}

/* ---------- 详情页 ---------- */
body.no-title .content {
  top: 60px;
}

body.no-title .markdown-section {
  padding-top: 0;
}

body.no-title .markdown-section h1 {
  min-height: 22vh;
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #eef1f4;
  padding-bottom: 0;
}

/* ---------- 移动端 ---------- */
@media screen and (max-width: 768px) {
  .site-title {
    height: 52px;
    padding: 0 16px 0 104px;
    font-size: .88rem;
    letter-spacing: 1px;
  }

  .content {
    left: 0 !important;
    top: 52px !important;
    padding-top: 12px;
  }

  .sidebar {
    width: 260px;
    top: 52px;
  }

  .back-home {
    top: 11px;
    left: 10px;
    font-size: .68rem;
    padding: 5px 10px;
    z-index: 400;
  }

  .markdown-section {
    padding: 12px 16px 70px;
  }

  body.no-title .markdown-section h1 {
    min-height: 16vh;
    font-size: 1.15rem;
    margin: 0 0 18px;
  }
}
