/**
 * Shiguang 拾光集 - 文章详情页样式
 */

/* ========== 加载状态 ========== */
.article-loading {
  padding-top: calc(var(--nav-height) + 120px);
  min-height: 60vh;
}

/* ========== 文章头部 ========== */
.article-header {
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: 64px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,
    rgba(108, 159, 255, 0.05) 0%,
    rgba(255, 184, 122, 0.02) 60%,
    transparent 100%);
}

.article-header::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(108, 159, 255, 0.06);
  filter: blur(60px);
  pointer-events: none;
}

/* 封面图：作为文章头部背景层，铺满整个头部 */
.article-cover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
  max-width: none;
  margin: 0;
  padding: 0;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  display: block;
}

/* 半透明遮罩，保证叠加在封面上的文字可读 */
.article-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.52) 0%, rgba(15, 23, 42, 0.30) 55%, rgba(15, 23, 42, 0.58) 100%);
}

.article-header-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.article-back {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 24px;
  transition: color var(--transition);
}

.article-back:hover {
  color: var(--primary);
}

.article-category-badge {
  display: inline-block;
  margin-bottom: 16px;
}

.article-category-badge .badge {
  padding: 5px 16px;
  font-size: 13px;
  border-radius: var(--radius-full);
  color: var(--primary);
  background: rgba(108, 159, 255, 0.1);
  font-weight: 500;
}

.article-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== 文章元信息 ========== */
.article-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 作者可点击跳转用户主页 */
.article-author-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.article-author-link:hover {
  opacity: 0.8;
}

.article-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(108, 159, 255, 0.15);
  background: linear-gradient(135deg, #c8d6e5, #a5b8cc);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.article-author-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.article-info {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--text-light);
}

.article-info span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 有封面时，标题区文字转为白色叠加在背景上 */
.article-header.has-cover .article-back { color: rgba(255, 255, 255, 0.85); }
.article-header.has-cover .article-back:hover { color: #fff; }
.article-header.has-cover .article-category-badge .badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}
.article-header.has-cover .article-title {
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.article-header.has-cover .article-author-avatar { border-color: rgba(255, 255, 255, 0.35); }
.article-header.has-cover .article-author-name { color: #fff; }
.article-header.has-cover .article-info { color: rgba(255, 255, 255, 0.88); }
.article-header.has-cover .article-series a { color: rgba(255, 255, 255, 0.88); }
.article-header.has-cover .article-series a:hover { color: #fff; }

/* ========== 正文区域 ========== */
.article-content-wrap {
  padding: 0 0 48px;
}

.article-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ========== 富文本排版 ========== */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-top: 2em;
  margin-bottom: 0.8em;
}

.article-content h1 { font-size: 1.75rem; }
.article-content h2 {
  font-size: 1.45rem;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}
.article-content h3 { font-size: 1.25rem; }
.article-content h4 { font-size: 1.1rem; }
.article-content h5 { font-size: 1rem; }
.article-content h6 { font-size: 0.95rem; color: var(--text-secondary); }

.article-content p {
  margin-bottom: 1.4em;
  color: var(--text);
  line-height: 2;
  font-size: inherit;
}

.article-content img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.5em 0;
  box-shadow: var(--shadow-sm);
}

.article-content blockquote {
  margin: 1.5em 0;
  padding: 16px 24px;
  border-left: 4px solid var(--primary);
  background: rgba(108, 159, 255, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content blockquote p {
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

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

.article-content ul,
.article-content ol {
  margin: 1.2em 0;
  padding-left: 1.8em;
  color: var(--text);
}

.article-content li {
  margin-bottom: 0.5em;
  line-height: 1.8;
}

.article-content ul li::marker {
  color: var(--primary);
}

.article-content ol li::marker {
  color: var(--primary);
  font-weight: 600;
}

.article-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(108, 159, 255, 0.06);
  color: var(--primary-dark);
  border: 1px solid rgba(108, 159, 255, 0.1);
}

.article-content pre {
  margin: 1.5em 0;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  background: #1e1e2e;
  color: #cdd6f4;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.article-content pre code {
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  font-size: inherit;
}

.article-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(108, 159, 255, 0.3);
  text-underline-offset: 3px;
  transition: all var(--transition);
}

.article-content a:hover {
  text-decoration-color: var(--primary);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.article-content thead {
  background: rgba(108, 159, 255, 0.06);
}

.article-content th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border-strong);
}

.article-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.article-content tbody tr:hover {
  background: rgba(108, 159, 255, 0.02);
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.article-content strong {
  font-weight: 600;
  color: var(--text);
}

.article-content em {
  font-style: italic;
}

/* 首字下沉效果（可选） */
.article-content > p:first-of-type::first-letter {
  font-size: 2.2em;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin-right: 8px;
  margin-top: 4px;
  color: var(--primary);
}

/* ========== 标签区域 ========== */
.article-tags-section {
  padding: 24px 0 32px;
}

.article-tags {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px;
}

.article-tags .tag {
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
}

/* ========== 互动栏 ========== */
.article-actions {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
}

.actions-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 0 24px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-solid);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.action-btn:hover {
  border-color: rgba(108, 159, 255, 0.3);
  color: var(--primary);
  background: rgba(108, 159, 255, 0.04);
}

.action-btn.active {
  color: #fff;
  border-color: transparent;
}

.action-btn.active.like-active {
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  box-shadow: 0 2px 12px rgba(255, 107, 107, 0.3);
}

.action-btn.active.bookmark-active {
  background: linear-gradient(135deg, var(--accent), #FF9A5C);
  box-shadow: 0 2px 12px rgba(255, 184, 122, 0.3);
}

.action-icon {
  font-size: 16px;
}

/* 请求进行中：置灰禁点，防重复提交 */
.action-btn.processing {
  opacity: 0.65;
  pointer-events: none;
  transform: scale(0.98);
}

/* 点赞/收藏图标动效 */
.action-icon.pop {
  display: inline-block;
  animation: icon-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-icon.swing {
  display: inline-block;
  animation: icon-swing 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes icon-pop {
  0%   { transform: scale(0.6); }
  55%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@keyframes icon-swing {
  0%   { transform: rotate(-14deg) scale(0.7); }
  50%  { transform: rotate(10deg) scale(1.25); }
  100% { transform: rotate(0deg) scale(1); }
}

/* 轻提示 Toast（操作成功/失败反馈） */
.sg-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(28, 32, 46, 0.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.sg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sg-toast.error {
  background: rgba(190, 56, 56, 0.95);
}

.action-count {
  font-size: 13px;
  opacity: 0.8;
}

.action-views {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
}

/* ========== 上下篇导航 ========== */
.post-nav-section {
  padding: 40px 0;
}

.post-nav {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 24px;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.post-nav-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: rgba(108, 159, 255, 0.15);
  color: inherit;
}

.post-nav-item.next-item {
  text-align: right;
  align-items: flex-end;
}

.post-nav-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 500;
}

.post-nav-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav-item:hover .post-nav-title {
  color: var(--primary);
}

.post-nav-item.empty-nav {
  visibility: hidden;
}

/* ========== 相关推荐 ========== */
.related-section {
  padding: 48px 0 60px;
  background: linear-gradient(180deg, transparent 0%, rgba(108, 159, 255, 0.03) 100%);
}

.related-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 28px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ========== 错误状态 ========== */
.article-error {
  padding-top: calc(var(--nav-height) + 80px);
  min-height: 50vh;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .article-header {
    padding-top: calc(var(--nav-height) + 32px);
    padding-bottom: 24px;
  }

  .article-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .article-content {
    font-size: 15px;
    padding: 0 16px;
  }

  .article-content p {
    font-size: 15px;
  }

  .article-content h1 { font-size: 1.4rem; }
  .article-content h2 { font-size: 1.25rem; }
  .article-content h3 { font-size: 1.1rem; }

  .actions-inner {
    gap: 16px;
    flex-wrap: wrap;
  }

  .action-btn {
    padding: 8px 18px;
    font-size: 13px;
  }

  .post-nav {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .post-nav-item.next-item {
    text-align: left;
    align-items: flex-start;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-content > p:first-of-type::first-letter {
    font-size: 1.8em;
  }

  .article-content pre {
    padding: 16px;
    font-size: 13px;
    border-radius: 8px;
  }

  .article-tags {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .article-title {
    font-size: 1.3rem;
  }

  .article-info {
    gap: 12px;
    font-size: 12px;
  }

  .article-content {
    font-size: 14.5px;
    line-height: 1.85;
  }

  .action-btn {
    padding: 8px 14px;
    font-size: 12px;
    gap: 4px;
  }

  .actions-inner {
    gap: 10px;
  }
}

/* ========== 阅读进度条 ========== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 9999;
  transition: width 0.1s ease;
}

/* ========== 右侧浮动阅读工具栏 ========== */
.reading-float-toolbar {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.reading-float-toolbar.visible {
  opacity: 1;
  visibility: visible;
}

.float-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  color: var(--text-secondary);
}
.float-btn:hover {
  background: rgba(108,159,255,0.1);
  color: var(--primary);
}
.float-btn:active {
  transform: scale(0.92);
}
.float-btn-icon {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.float-divider {
  width: 20px;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* 分享弹出面板 */
.float-share-panel {
  position: absolute;
  right: 52px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 130px;
}
.float-share-panel button,
.float-share-panel a {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(108,159,255,0.06);
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}
.float-share-panel button:hover,
.float-share-panel a:hover {
  background: rgba(108,159,255,0.15);
  color: var(--primary);
}

/* 文内搜索浮层 */
.in-article-search-float {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  max-width: 460px;
  width: calc(100% - 48px);
}
.in-article-search-float input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  outline: none;
  background: transparent;
  min-width: 0;
}
.in-article-search-float input:focus {
  border-color: var(--primary);
}
.in-article-search-float .search-count {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}
.in-article-search-float button {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-light);
  flex-shrink: 0;
}

/* ========== 防爬虫保护 ========== */
/* 正文允许选中（划线高亮功能依赖选区）；复制仍由 JS 拦截：右键菜单、Ctrl+C 复制事件替换剪贴板为版权信息 */
.article-content img {
  pointer-events: none;
  -webkit-user-drag: none;
}
/* 允许选中搜索框和互动区域 */
.in-article-search-float input,
.article-actions,
.article-tags {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

/* ========== 文章布局（带目录侧栏）========== */
.article-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.article-content-wrap {
  flex: 1;
  min-width: 0;
  padding: 0 0 48px;
}

/* ========== 目录侧栏 ========== */
.article-toc {
  position: sticky;
  top: calc(var(--nav-height) + 60px);
  width: 240px;
  max-height: calc(100vh - var(--nav-height) - 80px);
  margin-left: 24px;
  margin-right: -264px;
  padding: 16px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  display: none;
}

.article-toc.show {
  display: block;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.toc-header button {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-light);
}

.toc-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-nav a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.toc-nav a:hover {
  color: var(--primary);
  border-left-color: var(--primary-light);
}

.toc-nav a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

.toc-nav .toc-h3 {
  padding-left: 24px;
  font-size: 12px;
}

/* ========== 系列导航 ========== */
.article-series {
  max-width: 700px;
  margin: 16px auto 0;
  padding: 12px 20px;
  background: rgba(108,159,255,0.06);
  border: 1px solid rgba(108,159,255,0.15);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.article-series strong {
  color: var(--primary);
  font-weight: 600;
}

/* ========== 划线高亮 ========== */
.article-content mark,
.article-content .highlight {
  background: linear-gradient(120deg, rgba(255,215,0,0.3) 0%, rgba(255,184,122,0.3) 100%);
  padding: 2px 4px;
  border-radius: 4px;
  color: inherit;
}

/* 已保存的笔记高亮（悬停提示可点击查看） */
.article-content mark.highlight.saved {
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(255, 180, 80, 0.45);
  transition: background 0.2s ease;
}

.article-content mark.highlight.saved:hover {
  background: linear-gradient(120deg, rgba(255,215,0,0.5) 0%, rgba(255,184,122,0.5) 100%);
}

/* ========== 划线笔记弹窗 ========== */
.note-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.note-popup-card {
  width: 480px;
  max-width: 100%;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.note-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.note-popup-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-popup-header h3 i {
  color: var(--primary);
}

.note-popup-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  line-height: 1;
}

.note-popup-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

.note-popup-body {
  padding: 16px 20px;
}

.note-popup-quote {
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  background: var(--card);
  border-radius: 0 10px 10px 0;
  margin-bottom: 14px;
  line-height: 1.8;
  font-style: italic;
  max-height: 120px;
  overflow-y: auto;
  word-break: break-word;
}

.note-popup-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.note-popup-body textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
  font-family: inherit;
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.note-popup-body textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.note-popup-colors {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.note-popup-color {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.note-popup-color.active {
  border-color: #333;
  transform: scale(1.15);
}

.note-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.note-popup-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.note-popup-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 159, 255, 0.05);
}

.note-popup-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7FA8FF);
  border-color: transparent;
}

.note-popup-btn.primary:hover {
  opacity: 0.9;
  color: #fff;
}

.note-popup-btn.danger {
  color: #ff4d4f;
  border-color: rgba(255, 77, 79, 0.25);
  margin-right: auto;
}

.note-popup-btn.danger:hover {
  background: rgba(255, 77, 79, 0.06);
  border-color: rgba(255, 77, 79, 0.4);
}

.note-popup-btn.ghost:hover {
  border-color: var(--border);
  color: var(--text);
  background: rgba(0, 0, 0, 0.03);
}

.highlight-popup {
  position: absolute;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  z-index: 1000;
  display: none;
}

.highlight-popup button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--primary);
}

/* ========== 投稿引导 ========== */
.contribute-banner {
  padding: 48px 0;
  background: linear-gradient(135deg, rgba(108,159,255,0.04), rgba(255,184,122,0.04));
}

.contribute-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
}

.contribute-inner h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.contribute-inner p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ========== 搜索高亮 ========== */
.search-highlight {
  background: rgba(255,215,0,0.4);
  padding: 1px 2px;
  border-radius: 2px;
}

.search-highlight.current {
  background: rgba(255,140,0,0.6);
}

/* ========== 响应式补充 ========== */
@media (max-width: 1024px) {
  .article-toc {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .reading-float-toolbar {
    right: 12px;
    padding: 8px 6px;
    gap: 2px;
    border-radius: 22px;
  }
  .float-btn {
    width: 34px;
    height: 34px;
  }
  .float-btn-icon { font-size: 13px; }
  .float-share-panel {
    right: 44px;
    min-width: 120px;
  }
  .in-article-search-float {
    max-width: calc(100% - 32px);
  }

  .contribute-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ========== 暗色模式 ========== */
[data-theme="dark"] .reading-float-toolbar {
  background: rgba(37,37,64,0.92);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
[data-theme="dark"] .float-btn { color: var(--text-secondary); }
[data-theme="dark"] .float-btn:hover { background: rgba(108,159,255,0.15); }
[data-theme="dark"] .float-divider { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .float-share-panel {
  background: rgba(37,37,64,0.95);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .float-share-panel button,
[data-theme="dark"] .float-share-panel a {
  background: rgba(108,159,255,0.1);
}
[data-theme="dark"] .in-article-search-float {
  background: rgba(37,37,64,0.95);
  border-color: rgba(255,255,255,0.1);
}

/* ========== 点赞用户头像 ========== */
.like-users-section {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.like-users-head {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.like-users {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.like-user {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c8d6e5, #a5b8cc);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.like-user:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.like-user img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.like-user-default {
  font-size: 13px;
}
/* ========== 分享海报弹窗 ========== */
.poster-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.poster-modal {
  width: 420px;
  max-width: 100%;
  max-height: 88vh;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.poster-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.poster-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.poster-modal-header h3 i {
  color: var(--primary);
}

.poster-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  line-height: 1;
}

.poster-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

.poster-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.poster-img-wrap {
  background: #191c30;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.poster-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.poster-tip {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.poster-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.poster-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.poster-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 159, 255, 0.05);
}

.poster-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7FA8FF);
  border-color: transparent;
}

.poster-btn.primary:hover {
  opacity: 0.9;
  color: #fff;
}

.poster-btn.ghost:hover {
  border-color: var(--border);
  color: var(--text);
  background: rgba(0, 0, 0, 0.03);
}
/* ========== 免责声明 ========== */
.article-disclaimer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-light);
}

.article-disclaimer a {
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.2s ease;
}

.article-disclaimer a:hover {
  color: var(--primary);
}

/* 免责声明弹窗 */
.disclaimer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.disclaimer-modal {
  width: 560px;
  max-width: 100%;
  max-height: 82vh;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.disclaimer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.disclaimer-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.disclaimer-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.disclaimer-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.disclaimer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.disclaimer-html {
  font-size: 14px;
  color: var(--text);
  line-height: 1.9;
}

.disclaimer-html h1, .disclaimer-html h2, .disclaimer-html h3 {
  margin: 14px 0 8px;
}

.disclaimer-html p {
  margin: 8px 0;
}

.disclaimer-html ul, .disclaimer-html ol {
  padding-left: 20px;
  margin: 8px 0;
}

.disclaimer-updated {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-light);
}

.disclaimer-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  text-align: right;
  flex-shrink: 0;
}