/* 认证弹窗内消息（与首页风格一致） */
.register-code-msg,
.register-submit-msg,
.login-code-msg,
.login-submit-msg {
  min-height: 18px;
  font-size: 12px;
  line-height: 1.5;
}
.register-code-msg--success,
.register-submit-msg--success,
.login-code-msg--success,
.login-submit-msg--success {
  color: #16a34a;
}
.register-code-msg--error,
.register-submit-msg--error,
.login-code-msg--error,
.login-submit-msg--error {
  color: #dc2626;
}
/**
 * 文章内容页
 * 左侧：文章卡片（标题、元信息、封面图、正文、文中图片、返回列表）
 * 文中图片占位为内联 SVG（data URL），由 JS/模板统一设置
 */

 .page-article .content-two-col-left {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0; /* flex 子项可被压缩，避免宽图撑破主栏 */
  }
  
  /* 文章卡片 */
  .article-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    flex: 1;
    min-width: 0;
  }
  
  .article-header {
    padding: 1.5rem 1.75rem 0;
  }
  
  .article-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.75rem;
    line-height: 1.35;
  }
  
  .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
  }
  
  .article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  
  .article-meta-item i {
    opacity: 0.85;
  }
  
  /* 封面图 */
  .article-featured-img-wrap {
    margin-top: 1rem;
    margin-left: 1.75rem;
    margin-right: 1.75rem;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
  }
  
  .article-featured-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: cover;
    vertical-align: middle;
  }
  
  /* 正文区：富文本排版，防止图片/表格撑破布局 */
  .article-content {
    padding: 1.5rem 1.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.75;
    color: #333;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .article-content.article-body > *:first-child {
    margin-top: 0;
  }
  .article-content.article-body > *:last-child {
    margin-bottom: 0;
  }
  
  .article-content p {
    margin: 0 0 1rem;
  }
  
  .article-content p:last-child {
    margin-bottom: 0;
  }

  /* 正文图片、视频：不超出内容区宽度；与上下文字留出间距 */
  .article-content img,
  .article-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f5f5f5;
    vertical-align: middle;
    display: block;
    margin: 0.875rem 0;
  }
  .article-content p img,
  .article-content figure img {
    display: block;
    max-width: 100%;
    height: auto;
  }
  .article-content figure {
    margin: 1.25rem 0;
    max-width: 100%;
  }
  /* figure 已有外边距，内部图片不再叠加上下边距 */
  .article-content figure img {
    margin-top: 0;
    margin-bottom: 0;
  }
  .article-content iframe {
    max-width: 100%;
    border-radius: 8px;
  }

  /* 表格：过宽时由 .article-content 横向滚动，不撑破两栏 */
  .article-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    margin: 1rem 0;
    table-layout: auto;
  }
  .article-content table th,
  .article-content table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.65rem;
    word-break: break-word;
  }

  /* 非 Prettify 的代码块（兜底） */
  .article-content pre:not(.prettyprint) {
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 8px;
    background: #f4f4f5;
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 1rem 0;
  }
  .article-content code {
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
  }
  .article-content pre code {
    padding: 0;
    background: transparent !important;
    border-radius: 0;
    font-size: inherit;
    line-height: inherit;
  }
  /* 与后台 Editor.md 预览区一致：Prettify 代码块（editormd.preview.min.css + 容器类） */
  .article-content.markdown-body pre.prettyprint {
    max-width: 100%;
    overflow-x: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.55;
    background: #f7f7f9;
  }
  .article-content.markdown-body pre.prettyprint code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
  }
  .article-content.markdown-body ol.linenums {
    color: #999;
    padding-left: 2.5em;
    margin: 0;
  }
  .article-content.markdown-body ol.linenums li {
    list-style-type: decimal;
  }
  /* Prettify 行号行：浅色交替背景在深色主题下会成白块，全部去掉 */
  .article-content.markdown-body pre.prettyprint ol.linenums li,
  .article-content.markdown-body pre.prettyprint ol.linenums li[class^="L"] {
    background: transparent !important;
  }

  /* 非 Markdown 渲染的正文才用本站标题字号；Markdown 与后台 Editor.md 一致，交给 .markdown-body */
  .article-content:not(.markdown-body) h1,
  .article-content:not(.markdown-body) h2,
  .article-content:not(.markdown-body) h3,
  .article-content:not(.markdown-body) h4 {
    margin: 1.25rem 0 0.75rem;
    line-height: 1.35;
    font-weight: 700;
    word-break: break-word;
  }
  .article-content:not(.markdown-body) h1 { font-size: 1.5rem; }
  .article-content:not(.markdown-body) h2 { font-size: 1.35rem; }
  .article-content:not(.markdown-body) h3 { font-size: 1.2rem; }
  .article-content:not(.markdown-body) h4 { font-size: 1.1rem; }

  .article-content:not(.markdown-body) blockquote {
    margin: 1rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 4px solid var(--nav-link-active, #5b9bd5);
    color: #555;
    background: rgba(91, 155, 213, 0.06);
    border-radius: 0 8px 8px 0;
  }

  /* Markdown（editormd.preview）里 .markdown-body p 默认 margin-bottom:16px，块之间空行会变成空 <p>，与分区标题叠在一起显得间距巨大 */
  .article-content.markdown-body p:empty {
    margin: 0 !important;
    padding: 0;
    line-height: 0;
    min-height: 0;
  }

  /* marked breaks:true 会把块内换行变成 <br>，分区标题模板若含换行会被撑到一百多像素高 */
  .article-content .md-snippet-titleline br {
    display: none;
  }

  /* 快捷块「分区标题」：前半字下粉色粗横线（不用 ::after 负偏移，避免 .markdown-body{overflow:hidden} 裁切） */
  .article-content .md-snippet-titleline {
    margin: 0.2rem 0 0.35rem;
  }
  /* 两个分区标题紧挨着时不再重复上边距 */
  .article-content.markdown-body .md-snippet-titleline + .md-snippet-titleline {
    margin-top: 0;
  }
  .article-content .md-snippet-titleline__inner {
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.28;
    letter-spacing: 0.02em;
  }
  .article-content .md-snippet-titleline__underline {
    display: inline-block;
    color: #111827;
    padding-bottom: 7px;
    background-image: linear-gradient(#ec4899, #ec4899);
    background-size: 100% 7px;
    background-position: left bottom;
    background-repeat: no-repeat;
    border-radius: 0 0 4px 4px;
  }
  .article-content .md-snippet-titleline__rest {
    color: #111827;
  }

  .article-content ul,
  .article-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
  }
  .article-content li {
    margin-bottom: 0.35rem;
  }
  
  /* 文中图片：统一使用占位图（SVG data URL） */
  .article-figure {
    margin: 1.5rem 0;
  }
  /* 外层已有 .article-figure 间距，内部大图不再重复上下 margin */
  .article-figure .article-inline-img {
    margin: 0;
  }
  
  .article-inline-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0.875rem 0;
    border-radius: 8px;
    background: #f5f5f5;
    object-fit: cover;
  }
  
  .article-figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
  }
  
  /* 返回列表 */
  .article-footer {
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }
  
  .article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    color: var(--nav-link-active, #5b9bd5);
    text-decoration: none;
  }
  
  .article-back-link:hover {
    color: var(--nav-link-active, #5b9bd5);
    text-decoration: underline;
  }
  
  /* 侧栏/顶栏登录态：退出按钮 */
  .hero-user-logout-wrap {
    margin-bottom: 1rem;
  }
  .hero-user-logout-wrap.hidden {
    display: none !important;
  }
  .hero-user-btn--logout {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary, #6c757d);
    background: var(--main-bg-color);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: border-color 0.2s, color 0.2s;
  }
  .hero-user-btn--logout:hover {
    color: var(--nav-link-active, #5b9bd5);
    border-color: var(--nav-link-active, #5b9bd5);
  }
  
  /* 右侧边栏沿用通用样式，需与 page-auth-query 一致时在此覆盖 */
  .page-article .page-auth-query-sidebar-user {
    margin-bottom: 1.25rem;
  }
  
  /* 深色模式 */
  html[data-theme="dark"] .article-card {
    background: var(--main-bg-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  }
  
  html[data-theme="dark"] .article-title {
    color: var(--main-color);
  }
  
  html[data-theme="dark"] .article-meta,
  html[data-theme="dark"] .article-figcaption {
    color: var(--muted-color);
  }
  
  html[data-theme="dark"] .article-content {
    color: var(--main-color);
  }

  html[data-theme="dark"] .article-content .md-snippet-titleline__underline,
  html[data-theme="dark"] .article-content .md-snippet-titleline__rest {
    color: #ffffff;
  }
  html[data-theme="dark"] .article-content .md-snippet-titleline__underline {
    background-image: linear-gradient(#f472b6, #f472b6);
  }

  html[data-theme="dark"] .article-content img,
  html[data-theme="dark"] .article-content video {
    background: var(--body-bg-color);
  }

  html[data-theme="dark"] .article-content table th,
  html[data-theme="dark"] .article-content table td {
    border-color: var(--muted-4-color);
  }

  html[data-theme="dark"] .article-content pre:not(.prettyprint) {
    background: var(--body-bg-color);
    color: var(--main-color);
  }

  html[data-theme="dark"] .article-content code {
    background: rgba(255, 255, 255, 0.08);
  }
  html[data-theme="dark"] .article-content pre code {
    background: transparent !important;
  }

  html[data-theme="dark"] .article-content.markdown-body pre.prettyprint {
    background: #252526;
    border-color: var(--muted-4-color, #444);
    color: #d4d4d4;
  }
  html[data-theme="dark"] .article-content.markdown-body pre.prettyprint ol.linenums li,
  html[data-theme="dark"] .article-content.markdown-body pre.prettyprint ol.linenums li[class^="L"] {
    background: transparent !important;
    color: #ccc;
  }
  html[data-theme="dark"] .article-content.markdown-body pre.prettyprint ol.linenums li code:empty {
    min-height: 1.35em;
    display: inline-block;
    vertical-align: top;
  }

  html[data-theme="dark"] .article-content:not(.markdown-body) blockquote {
    color: var(--muted-color);
    background: rgba(91, 155, 213, 0.12);
    border-left-color: var(--nav-link-active);
  }
  
  html[data-theme="dark"] .article-featured-img-wrap,
  html[data-theme="dark"] .article-inline-img {
    background: var(--body-bg-color);
  }
  
  html[data-theme="dark"] .article-footer {
    border-top-color: var(--muted-4-color);
  }
  
  html[data-theme="dark"] .article-back-link {
    color: var(--nav-link-active);
  }
  
  html[data-theme="dark"] .article-back-link:hover {
    color: var(--nav-link-active);
  }
  
  html[data-theme="dark"] .hero-user-btn--logout {
    background: var(--main-bg-color);
    border-color: var(--muted-4-color);
    color: var(--muted-color);
  }
  html[data-theme="dark"] .hero-user-btn--logout:hover {
    color: var(--nav-link-active);
    border-color: var(--nav-link-active);
  }
  
  /* 移动端 */
  @media (max-width: 991px) {
    .page-article .content-two-col-left {
      gap: 1rem;
    }
  
    .page-article .mobile-float-sidebar .page-auth-query-sidebar-user {
      display: none;
    }
  
    .article-header,
    .article-content,
    .article-footer {
      padding-left: 1.25rem;
      padding-right: 1.25rem;
    }
  
    .article-featured-img-wrap {
      margin-left: 1.25rem;
      margin-right: 1.25rem;
    }
  
    .article-title {
      font-size: 1.25rem;
    }
  
    .article-featured-img {
      max-height: 260px;
    }
  
    .article-content {
      font-size: 0.9375rem;
    }
  }
  
  @media (max-width: 576px) {
    .article-header {
      padding-top: 1.25rem;
    }
  
    .article-title {
      font-size: 1.125rem;
    }
  
    .article-meta {
      font-size: 0.8125rem;
      gap: 0.75rem;
    }
  
    .article-featured-img-wrap {
      margin-top: 0.75rem;
      margin-left: 1rem;
      margin-right: 1rem;
    }
  
    .article-content {
      padding: 1.25rem 1rem 0.75rem;
    }
  
    .article-figure {
      margin: 1.25rem 0;
    }
  
    .article-footer {
      padding: 0.85rem 1rem 1.25rem;
    }
  }
  