/* 资料 · 博客列表 */

.brand-yc {
  background: linear-gradient(145deg, #ff8f00, #ffb300) !important;
  color: #1a1200 !important;
  box-shadow: 0 8px 20px rgba(255, 143, 0, 0.35) !important;
}

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-meta-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.blog-meta-bar h2 {
  margin: 0;
  font-size: 20px;
}

.blog-count {
  color: var(--muted);
  font-size: 15px;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-item {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: inherit;
  padding: 20px 4px;
  cursor: pointer;
  transition: background 0.15s;
  font: inherit;
}

.blog-item:first-child {
  border-top: none;
}

.blog-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.blog-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}

.blog-item-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  overflow-x: auto;
}

.blog-cat {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 160, 234, 0.15);
  color: #7ecbff;
  border: 1px solid rgba(0, 160, 234, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.blog-cat.hk {
  background: rgba(200, 16, 46, 0.15);
  color: #ff8a9a;
  border-color: rgba(200, 16, 46, 0.35);
}

.blog-period {
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

.blog-date {
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.blog-item-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  word-break: normal;
  overflow-wrap: anywhere;
}

.blog-item:hover .blog-item-title {
  color: #9adfff;
}

.blog-item-summary {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-tag {
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #b8c4e0;
}

.blog-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

/* Pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pager-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.page-btn:hover {
  border-color: var(--accent);
}

.page-btn.active {
  background: linear-gradient(180deg, #2488e8, #1367c4);
  border-color: transparent;
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager-info {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
}

/* Article overlay */
.article-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 10, 20, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}

.article-overlay[hidden] {
  display: none !important;
}

.article-sheet {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  margin: auto 0;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 24px 32px;
}

.article-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.article-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.article-cat {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  padding-right: 40px;
}

.article-title {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.35;
  padding-right: 28px;
}

.article-meta {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 12px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.article-body {
  font-size: 18px;
  line-height: 1.85;
  color: #dce4f8;
  /* 纯文本保留换行；HTML 块级标签自带间距 */
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.article-body:has(p, div, ul, ol, h1, h2, h3, table, blockquote) {
  white-space: normal;
}

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

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 0.6em 0 0.4em;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.article-body h1 { font-size: 1.35em; }
.article-body h2 { font-size: 1.2em; }
.article-body h3 { font-size: 1.1em; }

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

.article-body li {
  margin: 0.25em 0;
}

.article-body a {
  color: #64b5f6;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: #90caf9;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0.6em 0;
  display: block;
}

.article-body blockquote {
  margin: 0.6em 0;
  padding: 8px 14px;
  border-left: 3px solid rgba(255, 82, 82, 0.55);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6em 0;
  font-size: 0.95em;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}

.article-body pre,
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.article-body pre {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  overflow-x: auto;
  white-space: pre-wrap;
}

/* 文章着重文字 */
.article-body .article-em,
.article-em {
  color: #ff5252;
  font-weight: 800;
  font-style: normal;
  background: rgba(255, 82, 82, 0.14);
  padding: 0 3px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* 配色 span 内联样式由作者指定；补一点内边距更易读 */
.article-body span[style*="color"],
.article-body span[style*="background-color"] {
  border-radius: 3px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html[data-theme="light"] .article-body .article-em,
html[data-theme="light"] .article-em {
  color: #c62828;
  background: rgba(198, 40, 40, 0.1);
}

@media (max-width: 720px) {
  /* 移动端：筛选 + 写文章/登录/注册 同一行 */
  .blog-toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 10px;
  }

  .blog-filters {
    display: flex;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .blog-filters .chip {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
  }

  .blog-toolbar .form-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto !important;
    width: auto;
    flex: 0 0 auto;
  }

  .blog-toolbar .form-actions .btn,
  .blog-toolbar .form-actions a.btn {
    width: auto;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .blog-item {
    padding: 16px 2px;
  }

  .blog-item-top {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .blog-item-title {
    font-size: 17px;
    line-height: 1.4;
  }

  .blog-item-summary {
    font-size: 14px;
    -webkit-line-clamp: 3;
  }

  .blog-date {
    margin-left: 0;
    width: 100%;
    font-size: 12px;
  }

  .article-overlay {
    padding: 0;
    align-items: stretch;
  }

  .article-sheet {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    margin: auto 0 0;
    padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  }

  .article-title {
    font-size: 20px;
    padding-right: 32px;
  }

  .article-body {
    font-size: 16px;
  }

  .pager {
    gap: 6px;
  }

  .page-btn {
    min-width: 36px;
    height: 36px;
  }
}

